| | |
| | | AND customer_id = #{param.customerId} |
| | | </if> |
| | | </update> |
| | | <update id="expireCouponRecordAll"> |
| | | update t_coupon_record set `status`='expired' where `status`='unused' and effective_end < NOW() |
| | | </update> |
| | | |
| | | <select id="statisCouponTemplateCount" resultType="java.lang.Integer"> |
| | | select IFNULL(count(1),0) as cnt from t_coupon_record where deleted=false and category=#{param.category} |
| | |
| | | <if test="param.couponId != null and param.couponId != ''"> |
| | | and t.coupon_id = #{param.couponId} |
| | | </if> |
| | | <if test="param.category != null and param.category != ''"> |
| | | and t.category = #{param.category} |
| | | </if> |
| | | |
| | | |
| | | |
| | | order by t.create_time desc |
| | | </sql> |