From 8a57b3a0ee3fa70e8d43eb12865f1c27d0d385d8 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期三, 01 四月 2020 14:55:58 +0800
Subject: [PATCH] Merge branch 'div-1' into div

---
 fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml |   25 +++++++++++++++++++++++++
 1 files changed, 25 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 0bf29f8..ad529de 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
@@ -383,4 +383,29 @@
 		</if>
 	ORDER BY v2.`hb_get_time`
   </select>
+  
+  
+  <select id="countFreeMoneyByTypeAndDay" resultType="BigDecimal">
+  	 SELECT SUM(v2.`hb_money`) FROM yeshi_ec_user_system_coupon c 
+  	 LEFT JOIN yeshi_ec_system_coupon sp ON sp.`sc_id` = c.`usc_coupon_id` 
+	 LEFT JOIN `yeshi_ec_user_system_coupon_record` pr ON c.`usc_id` = pr.`ucr_user_coupon_id`
+	 LEFT JOIN `yeshi_ec_common_order` co ON pr.`ucr_order_no` = co.`co_order_no`
+	 LEFT JOIN `yeshi_ec_hongbao_order` ho ON ho.`ho_order_id` = co.`co_id`
+	 LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON ho.`ho_hongbao_id` = v2.`hb_id`
+	 WHERE pr.`ucr_state` = 3 AND sp.`sc_type` = #{type} 
+	 	  AND TO_DAYS(v2.`hb_get_time`) = TO_DAYS(#{preDay})
+  </select>
+  
+  <select id="countRebateMoneyByDay" resultType="BigDecimal">
+  	SELECT SUM(v2.`hb_money`)  FROM yeshi_ec_hongbao_v2 v2 
+	WHERE  v2.`hb_type`= 10 AND TO_DAYS(v2.`hb_get_time`) = TO_DAYS(#{preDay})	 
+  </select>
+  
+  <select id="countCouponNumByDay" resultType="BigDecimal">
+    SELECT COUNT(c.`usc_id`) FROM yeshi_ec_user_system_coupon c 
+  	LEFT JOIN yeshi_ec_system_coupon p ON  p.`sc_id`= c.`usc_coupon_id`
+	WHERE p.`sc_type` = #{type} AND TO_DAYS(c.`usc_create_time`) = TO_DAYS(#{preDay})
+  </select>
+  
+ 
 </mapper>

--
Gitblit v1.8.0