package com.hai.service.impl; import com.hai.dao.HighCouponCodeMapper; import com.hai.dao.HighCouponCodeMapperExt; import com.hai.entity.HighCouponCode; import com.hai.entity.HighCouponCodeExample; import com.hai.service.HighCouponCodeService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.List; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/14 17:45 */ @Service("highCouponCodeService") public class HighCouponCodeServiceImpl implements HighCouponCodeService { @Resource private HighCouponCodeMapper highCouponCodeMapper; @Resource private HighCouponCodeMapperExt highCouponCodeMapperExt; @Override public void insertCouponCode(HighCouponCode highCouponCode) { highCouponCodeMapper.insert(highCouponCode); } @Override public void insertList(List list) { highCouponCodeMapperExt.insertList(list); } @Override public Integer getStockCountByCoupon(Long couponId) { HighCouponCodeExample example = new HighCouponCodeExample(); example.createCriteria().andStatusEqualTo(1).andSalesEndTimeLessThan(new Date()); return highCouponCodeMapper.selectByExample(example).size(); } }