package com.hai.service.impl;

import com.hai.dao.HighDiscountPackageDiscountActualMapper;
import com.hai.entity.HighDiscountPackageDiscountActual;
import com.hai.entity.HighDiscountPackageDiscountActualExample;
import com.hai.service.HighDiscountPackageDiscountActualService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @serviceName HighDiscountPackageDiscountActualServiceImpl.java
 * @author Sum1Dream
 * @version 1.0.0
 * @Description // 优惠券包实际库存优惠券实际接口
 * @createTime 3:15 下午 2021/12/8
 **/
@Service("highDiscountPackageDiscountActualService")
public class HighDiscountPackageDiscountActualServiceImpl implements HighDiscountPackageDiscountActualService {

    @Resource
    private HighDiscountPackageDiscountActualMapper discountPackageDiscountActualMapper;

    @Override
    public void insertHighDiscountPackageDiscountActual(HighDiscountPackageDiscountActual highDiscountPackageDiscountActual) {
        discountPackageDiscountActualMapper.insert(highDiscountPackageDiscountActual);
    }

    @Override
    public void updateHighDiscountPackageDiscountActual(HighDiscountPackageDiscountActual highDiscountPackageDiscountActual) {
        discountPackageDiscountActualMapper.updateByPrimaryKey(highDiscountPackageDiscountActual);
    }

    @Override
    public List<HighDiscountPackageDiscountActual> getHighDiscountPackageDiscountActualList(Integer discountPackageActualId) {

        HighDiscountPackageDiscountActualExample example = new HighDiscountPackageDiscountActualExample();
        HighDiscountPackageDiscountActualExample.Criteria criteria = example.createCriteria();

        criteria.andDiscountPackageActualIdEqualTo(discountPackageActualId).andStatusEqualTo(1);

        return discountPackageDiscountActualMapper.selectByExample(example);
    }
}
