From 62d15798697cc6afdb02a0e0a893baadb9e66044 Mon Sep 17 00:00:00 2001 From: Cui Zhi Feng <cuizf@fengyuntec.com> Date: 星期四, 29 八月 2024 21:24:25 +0800 Subject: [PATCH] Merge branch 'master' into master-v2 --- src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml | 45 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml index 62f1f26..bc8691b 100644 --- a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml +++ b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml @@ -57,11 +57,39 @@ </update> <select id="getCouponTemplatePage" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> - <include refid="QuerySql2"></include> + <include refid="QuerySql2"/> </select> <select id="getList" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> - <include refid="QuerySql2"></include> + <include refid="QuerySql2"/> </select> + <select id="getCouponPointList" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> + <include refid="QueryPointSql" /> + </select> + <select id="getPointPage" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> + <include refid="QueryPointSql" /> + </select> + + <sql id="QueryPointSql"> + select * + from t_coupon_template + where deleted=0 + <if test="param.category != null and param.category != ''"> + AND category = #{param.category} + </if> + <if test="param.status != null and param.status != ''"> + AND status = #{param.status} + </if> + <if test="param.minPoint != null "> + AND point >= #{param.minPoint} + </if> + <if test="param.maxPoint != null "> + AND point <= #{param.maxPoint} + </if> + <if test="param.orderStr != null and param.orderStr != '' "> + order by ${param.orderStr} + </if> + + </sql> <sql id="QuerySql2"> select * @@ -70,11 +98,11 @@ create_by_user.nick_name as createByName, IFNULL(get_num.cnt, 0) as getNum, IFNULL(t.coupon_amount, 0) - IFNULL(get_num.cnt, 0) as unGetNum - from t_coupon_template t - left join t_user create_by_user - on t.create_by =create_by_user.id - left join (select coupon_template_id,count(1) as cnt from t_coupon_usage where deleted=0 group by coupon_template_id) get_num - on t.id=get_num.coupon_template_id + from t_coupon_template t + left join t_user create_by_user + on t.create_by =create_by_user.id + left join (select coupon_id,count(1) as cnt from t_coupon_record where deleted=0 group by coupon_id) get_num + on t.id=get_num.coupon_id ) t where t.deleted=0 <if test="param.name != null and param.name != ''"> @@ -95,6 +123,9 @@ <if test="param.category != null and param.category != ''"> AND t.category = #{param.category} </if> + <if test="param.status != null and param.status != ''"> + AND t.status = #{param.status} + </if> order by t.create_time desc </sql> -- Gitblit v1.9.3