From 8a54915d3c39d9d8d7e90c0971d1e19d0eb76622 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期五, 12 六月 2020 14:37:04 +0800 Subject: [PATCH] 券统计 --- fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml index d23ff63..e008820 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml @@ -291,5 +291,28 @@ WHERE p.`sc_type` = #{type} AND TO_DAYS(c.`usc_create_time`) = TO_DAYS(#{preDay}) </select> + + <select id="countCouponNum" resultType="java.lang.Long"> + SELECT IFNULL(count(uc.`usc_id`),0) FROM `yeshi_ec_user_system_coupon` uc + LEFT JOIN yeshi_ec_system_coupon p ON p.`sc_id`= uc.`usc_coupon_id` + WHERE 1=1 + <if test="uid != null"> + AND uc.`usc_uid` = #{uid} + </if> + <if test="state != null"> + AND uc.usc_state = #{state} + </if> + <if test="activated != null"> + AND uc.`usc_state_activate` = #{activated} + </if> + <if test="list != null"> + AND p.`sc_type` in + <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach> + </if> + <if test="listSource != null"> + AND uc.`usc_source` in + <foreach collection="listSource" item="item" open="(" close=")" separator=",">#{item}</foreach> + </if> + </select> </mapper> -- Gitblit v1.8.0