package com.hai.service.impl; import com.hai.service.HighCouponPackageDetailsService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; /** * @serviceName HighCouponPackageDetailsServiceImpl.java * @author Sum1Dream * @version 1.0.0 * @Description // 优惠券详情服务 * @createTime 3:38 下午 2021/11/25 **/ @Service("highCouponPackageDetailsService") public class HighCouponPackageDetailsServiceImpl implements HighCouponPackageDetailsService { @Resource private HighCouponPackageDetailsMapper highCouponPackageDetailsMapper; @Override public List getCouponPackageDetailsList(Map map) { HighCouponPackageDetailsExample example = new HighCouponPackageDetailsExample(); HighCouponPackageDetailsExample.Criteria criteria = example.createCriteria(); if (MapUtils.getInteger(map, "couponPackageId") != null) { criteria.andCouponPackageIdEqualTo(MapUtils.getInteger(map, "couponPackageId")); } criteria.andStatusEqualTo(1); return highCouponPackageDetailsMapper.selectByExample(example); } @Override public HighCouponPackageDetails findDetailsById(Integer id) { return highCouponPackageDetailsMapper.selectByPrimaryKey(id); } @Override public void insertCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails) { highCouponPackageDetailsMapper.insert(highCouponPackageDetails); } @Override public void updateCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails) { highCouponPackageDetailsMapper.updateByPrimaryKey(highCouponPackageDetails); } }