Commit 5d12023b authored by zhengyi's avatar zhengyi

优惠列表状态查询bug修复

parent 945403d9
...@@ -306,23 +306,41 @@ public interface CouponMapper extends BaseMapperX<CouponDO> { ...@@ -306,23 +306,41 @@ 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 isIncludeExpiredStatus == false' >",
"<when test=\"reqVO.statusList != null and reqVO.statusList.size()>0\">" + "<when test='reqVO.statusList.size()==1'>",
" <when test=\"reqVO.statusList != null and reqVO.statusList.size()==1 \">" + " AND c.`status` = ",
" AND c.`status` =\n" + " <foreach item='statusId' index='index' collection='reqVO.statusList' >",
" <foreach item='statusId' index='index' collection='reqVO.statusList' >\n" + " #{statusId}",
" #{statusId}" + " </foreach>" ,
" </foreach>" + " </when>",
" </when>" + " <when test='reqVO.statusList != null and reqVO.statusList.size()>1'>",
" <when test=\"reqVO.statusList != null and reqVO.statusList.size()>1 \">" + " AND c.`status` in ",
" AND c.`status` in " + " <foreach item='statusId' index='index' collection='reqVO.statusList' open='(' separator=',' close=')'>",
" <foreach item='statusId' index='index' collection='reqVO.statusList' open='(' separator=',' close=')'>" + " #{statusId}",
" #{statusId}" + " </foreach>",
" </foreach>" + " </when>",
" </when>" +
"</when>", "</when>",
"<when test='reqVO.statusList != null and reqVO.statusList.size()>0 and isIncludeExpiredStatus == true' >",
"AND ( 1 = 1",
"<when test = 'reqVO.overdueStatus != null'>", "<when test = 'reqVO.overdueStatus != null'>",
"or c.overdue_status = #{reqVO.overdueStatus}",
"</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>",
"<when test = 'reqVO.overdueStatus != null and isIncludeExpiredStatus == false'>",
"AND c.overdue_status = #{reqVO.overdueStatus}", "AND c.overdue_status = #{reqVO.overdueStatus}",
"</when>", "</when>",
"<when test = 'reqVO.putonStatus != null'>", "<when test = 'reqVO.putonStatus != null'>",
......
...@@ -1265,6 +1265,21 @@ public class CouponServiceImpl extends AbstractService<CouponMapper, CouponDO> i ...@@ -1265,6 +1265,21 @@ public class CouponServiceImpl extends AbstractService<CouponMapper, CouponDO> i
@Override @Override
public PageResult<CouponDO> getCouponPage(CouponPageReqVO pageReqVO) { public PageResult<CouponDO> getCouponPage(CouponPageReqVO pageReqVO) {
if (CollectionUtil.isNotEmpty(pageReqVO.getStatusList())){
if (pageReqVO.getStatusList().contains(2)){
// 包含已过期状态
pageReqVO.setOverdueStatus(true);
if (pageReqVO.getStatusList().size() == 1){
pageReqVO.setStatusList(null);
pageReqVO.setIncludeExpiredStatus(false);
}else {
pageReqVO.getStatusList().remove(2);
pageReqVO.setIncludeExpiredStatus(true);
}
}
}else {
pageReqVO.setIncludeExpiredStatus(false);
}
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());
......
...@@ -135,4 +135,7 @@ public class CouponPageReqVO extends PageParam { ...@@ -135,4 +135,7 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String searchKey; private String searchKey;
@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