|
|
@ -5,6 +5,8 @@ import com.hai.entity.HighDiscount; |
|
|
|
import com.hai.entity.HighDiscountCouponRel; |
|
|
|
import com.hai.entity.HighDiscountCouponRel; |
|
|
|
import com.hai.entity.HighDiscountExample; |
|
|
|
import com.hai.entity.HighDiscountExample; |
|
|
|
import com.hai.service.HighDiscountService; |
|
|
|
import com.hai.service.HighDiscountService; |
|
|
|
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
@ -22,9 +24,6 @@ public class HighDiscountServiceImpl implements HighDiscountService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighDiscountMapper highDiscountMapper; |
|
|
|
private HighDiscountMapper highDiscountMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountCouponRel highDiscountCouponRel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void insertDiscount(HighDiscount highDiscount) { |
|
|
|
public void insertDiscount(HighDiscount highDiscount) { |
|
|
|
highDiscountMapper.insert(highDiscount); |
|
|
|
highDiscountMapper.insert(highDiscount); |
|
|
@ -45,6 +44,16 @@ public class HighDiscountServiceImpl implements HighDiscountService { |
|
|
|
HighDiscountExample example = new HighDiscountExample(); |
|
|
|
HighDiscountExample example = new HighDiscountExample(); |
|
|
|
HighDiscountExample.Criteria criteria = example.createCriteria(); |
|
|
|
HighDiscountExample.Criteria criteria = example.createCriteria(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(MapUtils.getString(map, "discountKey"))) { |
|
|
|
|
|
|
|
criteria.andDiscountKeyEqualTo(MapUtils.getString(map, "discountKey")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(MapUtils.getString(map, "discountName"))) { |
|
|
|
|
|
|
|
criteria.andDiscountNameLike("%" + MapUtils.getString(map, "discountName") + "%"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (MapUtils.getInteger(map, "discountType") != null) { |
|
|
|
|
|
|
|
criteria.andDiscountTypeEqualTo(MapUtils.getInteger(map, "discountType")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
example.setOrderByClause("update_time desc"); |
|
|
|
example.setOrderByClause("update_time desc"); |
|
|
|
return highDiscountMapper.selectByExample(example); |
|
|
|
return highDiscountMapper.selectByExample(example); |
|
|
|
} |
|
|
|
} |
|
|
|