From a41ca5df78d3655e6dc1ff38824f0df9b36f45e3 Mon Sep 17 00:00:00 2001 From: gongzuming <gongzuming> Date: 星期三, 09 十月 2024 09:29:09 +0800 Subject: [PATCH] 支付 --- src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml | 35 +++++++++++++++++++++++++++++++++-- 1 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml index 66f2f6f..cf3918e 100644 --- a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml +++ b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml @@ -56,6 +56,12 @@ #{item} </foreach> </update> + <update id="expireHomeActivityCouponTemplate"> + update t_coupon_template set status='expired' where category='activity' and get_type='home' and status='active' + </update> + <update id="expireActivityCouponTemplateAll"> + update t_coupon_template set status='expired' where category='activity' and get_end_date < NOW() + </update> <select id="getCouponTemplatePage" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> <include refid="QuerySql2"/> @@ -76,8 +82,11 @@ SELECT * FROM t_coupon_template t WHERE t.deleted = FALSE - AND t.get_start_date <= NOW() - AND NOW() <= t.get_end_date + <if test="param.category != null and param.category != '' and param.category == 'activity' "> + AND t.get_start_date <= NOW() + AND NOW() <= t.get_end_date + </if> + <if test="param.category != null and param.category != ''"> AND category = #{param.category} </if> @@ -110,6 +119,28 @@ <select id="getCouponTemplateVipPage" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> <include refid="QuerySqlVip" /> </select> + <select id="getHomeActivityEffectAlert" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO"> + SELECT * + FROM t_coupon_template t + WHERE t.deleted = FALSE + + <if test="param.category != null and param.category != '' and param.category == 'activity' "> + AND t.get_start_date <= NOW() + AND NOW() <= t.get_end_date + </if> + + <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> + <if test="param.getType != null and param.getType != ''"> + AND t.get_type = #{param.getType} + </if> + ORDER BY t.create_time DESC + limit 1 + </select> <sql id="QueryPointSql"> select * -- Gitblit v1.9.3