Commit 5d12023b authored by zhengyi's avatar zhengyi

优惠列表状态查询bug修复

parent 945403d9
......@@ -306,23 +306,41 @@ 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\">" +
" <when test=\"reqVO.statusList != null and reqVO.statusList.size()==1 \">" +
" AND c.`status` =\n" +
" <foreach item='statusId' index='index' collection='reqVO.statusList' >\n" +
" #{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 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 isIncludeExpiredStatus == true' >",
"AND ( 1 = 1",
"<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}",
"</when>",
"<when test = 'reqVO.putonStatus != null'>",
......
......@@ -1265,6 +1265,21 @@ public class CouponServiceImpl extends AbstractService<CouponMapper, CouponDO> i
@Override
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();
page.setField("c.coupon_id DESC");
page.setRows(pageReqVO.getPageSize());
......
......@@ -135,4 +135,7 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "关键字")
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