Commit 49768f65 authored by zhengyi's avatar zhengyi

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

parent 235c4fd9
...@@ -306,41 +306,30 @@ public interface CouponMapper extends BaseMapperX<CouponDO> { ...@@ -306,41 +306,30 @@ public interface CouponMapper extends BaseMapperX<CouponDO> {
"<when test = 'reqVO.status != null'>", "<when test = 'reqVO.status != null'>",
"AND c.status = #{reqVO.status}", "AND c.status = #{reqVO.status}",
"</when>", "</when>",
"<when test='reqVO.statusList != null and reqVO.statusList.size()>0 and reqVO.isIncludeExpiredStatus == false' >", "<when test='reqVO.statusList != null and reqVO.statusList.size()>0 ' >",
"<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", "AND ( 1 != 1",
"<when test = 'reqVO.overdueStatus != null'>", "<foreach item='status' index='index' collection='reqVO.statusList'>",
"or (c.overdue_status = #{reqVO.overdueStatus} and c.`puton_status` = 1)", "<choose>",
"</when>", "<when test=' status == 0'>",
"<when test='reqVO.statusList.size()==1'>", " or c.`status` = #{statusId}",
" or c.`status` = ", "</when>",
" <foreach item='statusId' index='index' collection='reqVO.statusList' >", "<when test=' status == 1'>",
" #{statusId}", " or c.`status` = #{statusId}",
" </foreach>" , "</when>",
" </when>", "<when test=' status == 2'>",
" <when test='reqVO.statusList != null and reqVO.statusList.size()>1'>", " or c.`puton_status` = 0",
" AND c.`status` in ", "</when>",
" <foreach item='statusId' index='index' collection='reqVO.statusList' open='(' separator=',' close=')'>", "<when test=' status == 3'>",
" #{statusId}", " or c.`puton_status` = 1",
" </foreach>", "</when>",
" </when>", "<when test=' status == 4'>",
" or c.`overdue_status` = 0",
"</when>",
"</choose>",
"</foreach>",
" )", " )",
"</when>", "</when>",
"<when test = 'reqVO.overdueStatus != null '>",
"<when test = 'reqVO.overdueStatus != null and reqVO.isIncludeExpiredStatus == false'>",
"AND c.overdue_status = #{reqVO.overdueStatus} and c.`puton_status` = 1", "AND c.overdue_status = #{reqVO.overdueStatus} and c.`puton_status` = 1",
"</when>", "</when>",
"<when test = 'reqVO.putonStatus != null'>", "<when test = 'reqVO.putonStatus != null'>",
......
...@@ -1265,21 +1265,6 @@ public class CouponServiceImpl extends AbstractService<CouponMapper, CouponDO> i ...@@ -1265,21 +1265,6 @@ public class CouponServiceImpl extends AbstractService<CouponMapper, CouponDO> i
@Override @Override
public PageResult<CouponDO> getCouponPage(CouponPageReqVO pageReqVO) { 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(); PageVO page = new PageVO();
page.setField("c.coupon_id DESC"); page.setField("c.coupon_id DESC");
page.setRows(pageReqVO.getPageSize()); page.setRows(pageReqVO.getPageSize());
......
...@@ -134,8 +134,8 @@ public class CouponPageReqVO extends PageParam { ...@@ -134,8 +134,8 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String searchKey; private String searchKey;
//
@ApiModelProperty(value = "是否组合状态") // @ApiModelProperty(value = "是否组合状态")
private boolean isIncludeExpiredStatus = false; // 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