Commit 49768f65 authored by zhengyi's avatar zhengyi

优惠活动状态查询补充修改

parent 235c4fd9
......@@ -306,41 +306,30 @@ public interface CouponMapper extends BaseMapperX<CouponDO> {
"<when test = 'reqVO.status != null'>",
"AND c.status = #{reqVO.status}",
"</when>",
"<when test='reqVO.statusList != null and reqVO.statusList.size()>0 and reqVO.isIncludeExpiredStatus == false' >",
"<when test='reqVO.statusList.size()==1'>",
" AND c.`status` = ",
" <foreach item='statusId' index='index' collection='reqVO.statusList' >",
" #{statusId}",
" </foreach>" ,
" </when>",
" <when test='reqVO.statusList != null and reqVO.statusList.size()>1'>",
" AND c.`status` in ",
" <foreach item='statusId' index='index' collection='reqVO.statusList' open='(' separator=',' close=')'>",
" #{statusId}",
" </foreach>",
" </when>",
"</when>",
"<when test='reqVO.statusList != null and reqVO.statusList.size()>0 and reqVO.isIncludeExpiredStatus == true' >",
"AND ( 1 != 1",
"<when test = 'reqVO.overdueStatus != null'>",
"or (c.overdue_status = #{reqVO.overdueStatus} and c.`puton_status` = 1)",
"</when>",
"<when test='reqVO.statusList.size()==1'>",
" or c.`status` = ",
" <foreach item='statusId' index='index' collection='reqVO.statusList' >",
" #{statusId}",
" </foreach>" ,
" </when>",
" <when test='reqVO.statusList != null and reqVO.statusList.size()>1'>",
" AND c.`status` in ",
" <foreach item='statusId' index='index' collection='reqVO.statusList' open='(' separator=',' close=')'>",
" #{statusId}",
" </foreach>",
" </when>",
"<when test='reqVO.statusList != null and reqVO.statusList.size()>0 ' >",
"AND ( 1 != 1",
"<foreach item='status' index='index' collection='reqVO.statusList'>",
"<choose>",
"<when test=' status == 0'>",
" or c.`status` = #{statusId}",
"</when>",
"<when test=' status == 1'>",
" or c.`status` = #{statusId}",
"</when>",
"<when test=' status == 2'>",
" or c.`puton_status` = 0",
"</when>",
"<when test=' status == 3'>",
" or c.`puton_status` = 1",
"</when>",
"<when test=' status == 4'>",
" or c.`overdue_status` = 0",
"</when>",
"</choose>",
"</foreach>",
" )",
"</when>",
"<when test = 'reqVO.overdueStatus != null and reqVO.isIncludeExpiredStatus == false'>",
"<when test = 'reqVO.overdueStatus != null '>",
"AND c.overdue_status = #{reqVO.overdueStatus} and c.`puton_status` = 1",
"</when>",
"<when test = 'reqVO.putonStatus != null'>",
......
......@@ -1265,21 +1265,6 @@ public class CouponServiceImpl extends AbstractService<CouponMapper, CouponDO> i
@Override
public PageResult<CouponDO> getCouponPage(CouponPageReqVO pageReqVO) {
pageReqVO.setIncludeExpiredStatus(false);
if (CollectionUtil.isNotEmpty(pageReqVO.getStatusList())){
if (pageReqVO.getStatusList().contains(2)){
// 包含已过期状态
pageReqVO.setOverdueStatus(false);
if (pageReqVO.getStatusList().size() == 1){
pageReqVO.setStatusList(null);
}else {
// 这里调用的方法需要传包装类型,传常量2是另一种执行逻辑,所以需要将状态2重新定义为包装类型
Integer status = 2;
pageReqVO.getStatusList().remove(status);
pageReqVO.setIncludeExpiredStatus(true);
}
}
}
PageVO page = new PageVO();
page.setField("c.coupon_id DESC");
page.setRows(pageReqVO.getPageSize());
......
......@@ -134,8 +134,8 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "关键字")
private String searchKey;
@ApiModelProperty(value = "是否组合状态")
private boolean isIncludeExpiredStatus = false;
//
// @ApiModelProperty(value = "是否组合状态")
// private boolean isIncludeExpiredStatus = false;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment