Commit 1cfbe91a authored by xiamw's avatar xiamw

优惠活动列表查询条件优化

parent 739b2ffa
...@@ -306,6 +306,22 @@ public interface CouponMapper extends BaseMapperX<CouponDO> { ...@@ -306,6 +306,22 @@ 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\">" +
" <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.types != 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'>", "<when test = 'reqVO.overdueStatus != null'>",
"AND c.overdue_status = #{reqVO.overdueStatus}", "AND c.overdue_status = #{reqVO.overdueStatus}",
"</when>", "</when>",
...@@ -315,6 +331,26 @@ public interface CouponMapper extends BaseMapperX<CouponDO> { ...@@ -315,6 +331,26 @@ public interface CouponMapper extends BaseMapperX<CouponDO> {
"<when test = 'reqVO.type != null'>", "<when test = 'reqVO.type != null'>",
"AND c.type = #{reqVO.type}", "AND c.type = #{reqVO.type}",
"</when>", "</when>",
"<when test = 'reqVO.validDays != null'>",
"AND c.valid_days = #{reqVO.validDays}",
"</when>",
"<when test=\"reqVO.types != null and reqVO.types.size()>0\">" +
" <when test=\"reqVO.types != null and reqVO.types.size()==1 \">" +
" AND c.`type` =\n" +
" <foreach item='typeId' index='index' collection='reqVO.types' >\n" +
" #{typeId}" +
" </foreach>" +
" </when>" +
" <when test=\"reqVO.types != null and reqVO.types.size()>1 \">" +
" AND c.`type` in " +
" <foreach item='typeId' index='index' collection='reqVO.types' open='(' separator=',' close=')'>" +
" #{typeId}" +
" </foreach>" +
" </when>" +
"</when>",
"<when test = 'reqVO.costType != null'>", "<when test = 'reqVO.costType != null'>",
"AND c.cost_type = #{reqVO.costType}", "AND c.cost_type = #{reqVO.costType}",
"</when>", "</when>",
...@@ -333,6 +369,18 @@ public interface CouponMapper extends BaseMapperX<CouponDO> { ...@@ -333,6 +369,18 @@ public interface CouponMapper extends BaseMapperX<CouponDO> {
"<when test = 'reqVO.beginEndTime != null and reqVO.endEndTime != null'>", "<when test = 'reqVO.beginEndTime != null and reqVO.endEndTime != null'>",
"AND DATE_FORMAT(c.end_time,'%Y-%m-%d 23:59:59') between #{reqVO.beginEndTime} and #{reqVO.endEndTime} ", "AND DATE_FORMAT(c.end_time,'%Y-%m-%d 23:59:59') between #{reqVO.beginEndTime} and #{reqVO.endEndTime} ",
"</when>", "</when>",
" <when test='reqVO.beginCreateTime != null' >",
"AND <![CDATA[ c.create_time >= #{reqVO.beginCreateTime} ]]> ",
"</when>",
" <when test='reqVO.endCreateTime != null' >",
"AND <![CDATA[ c.create_time <= #{reqVO.endCreateTime} ]]> ",
"</when>",
"<when test=\"reqVO.creator != null and reqVO.creator != '' \">" +
"AND cr.`nickname` like concat('%',concat(#{reqVO.creator},'%'))",
"</when>",
" order by c.coupon_id desc", " order by c.coupon_id desc",
"</script>" "</script>"
}) })
......
...@@ -196,19 +196,19 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -196,19 +196,19 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"</when>", "</when>",
"<when test=\"query.titleZhKey != null and query.titleZhKey != '' \">" + "<when test=\"query.titleZhKey != null and query.titleZhKey != '' \">" +
"AND c.`title_zh` like concat('%',concat(#{query.titleZhKey},'%'))", "AND t.`title_zh` like concat('%',concat(#{query.titleZhKey},'%'))",
"</when>", "</when>",
"<when test=\"query.notTitleZhKey != null and query.notTitleZhKey != '' \">" + "<when test=\"query.notTitleZhKey != null and query.notTitleZhKey != '' \">" +
"AND c.`title_zh` not like concat('%',concat(#{query.notTitleZhKey},'%'))", "AND t.`title_zh` not like concat('%',concat(#{query.notTitleZhKey},'%'))",
"</when>", "</when>",
"<when test=\"query.eqTitleZhKey != null and query.eqTitleZhKey != '' \">" + "<when test=\"query.eqTitleZhKey != null and query.eqTitleZhKey != '' \">" +
"AND c.`title_zh` = #{query.eqTitleZhKey} ", "AND t.`title_zh` = #{query.eqTitleZhKey} ",
"</when>", "</when>",
"<when test=\"query.notEqTitleZhKey != null and query.notEqTitleZhKey != '' \">" + "<when test=\"query.notEqTitleZhKey != null and query.notEqTitleZhKey != '' \">" +
"AND c.`title_zh` != #{query.notEqTitleZhKey} ", "AND t.`title_zh` != #{query.notEqTitleZhKey} ",
"</when>", "</when>",
"order by t.id desc", "order by t.id desc",
......
...@@ -26,6 +26,9 @@ public class CouponPageReqVO extends PageParam { ...@@ -26,6 +26,9 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "类型 1:优惠卷 2:金额-满减 3:方数-满减 4 折扣 5优惠 6 特价 7区间价") @ApiModelProperty(value = "类型 1:优惠卷 2:金额-满减 3:方数-满减 4 折扣 5优惠 6 特价 7区间价")
private Integer type; private Integer type;
@ApiModelProperty(value = "类型ids")
private List<Integer> types;
@ApiModelProperty(value = "使用条件(优惠卷专用)") @ApiModelProperty(value = "使用条件(优惠卷专用)")
private BigDecimal cashCondition; private BigDecimal cashCondition;
...@@ -115,6 +118,9 @@ public class CouponPageReqVO extends PageParam { ...@@ -115,6 +118,9 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "优惠券状态(0:草稿 1:发布)") @ApiModelProperty(value = "优惠券状态(0:草稿 1:发布)")
private Integer status; private Integer status;
@ApiModelProperty(value = "优惠券状态ids")
private List<Integer> statusList;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间") @ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime; private Date beginCreateTime;
...@@ -123,6 +129,9 @@ public class CouponPageReqVO extends PageParam { ...@@ -123,6 +129,9 @@ public class CouponPageReqVO extends PageParam {
@ApiModelProperty(value = "结束创建时间") @ApiModelProperty(value = "结束创建时间")
private Date endCreateTime; private Date endCreateTime;
@ApiModelProperty(value = "创建人")
private String creator;
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String searchKey; private String searchKey;
......
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