From e068c9acf06cff7673fadfca686128f6d6d66e20 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期一, 12 八月 2019 11:12:57 +0800
Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

---
 fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml |   68 ++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
index bc363c5..40a5550 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -484,7 +484,7 @@
 		hb.hb_id=ho.`ho_hongbao_id`
 		<!-- 鑷喘璁㈠崟 -->
 		LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
-		WHERE hb.hb_id IS NOT NULL
+		WHERE hb.hb_id IS NOT NULL and hb.hb_state!=4
 		<if test="day != null and day == 1">
 			<!-- 浠婂ぉ -->
 			AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
@@ -517,7 +517,7 @@
 		= 20 ) hb ON hb.hb_id=ho.`ho_hongbao_id`
 		<!-- 鍒嗕韩璁㈠崟 -->
 		LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
-		WHERE hb.hb_id IS NOT NULL
+		WHERE hb.hb_id IS NOT NULL  and hb.hb_state!=4
 		<if test="day != null and day == 1">
 			<!-- 浠婂ぉ -->
 			AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
@@ -550,7 +550,7 @@
 		(v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR
 		v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) ) hbp ON
 		hbp.hb_pid=ho.`ho_hongbao_id` LEFT JOIN yeshi_ec_common_order co ON
-		co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL
+		co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL  and hbp.hb_state!=4
 		<if test="day != null and day == 1">
 			<!-- 浠婂ぉ -->
 			AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
@@ -764,6 +764,39 @@
 		ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT
 		JOIN yeshi_ec_user u ON u.id = A.hb_uid
 	</select>
+	
+	
+	<select id="listQueryWithNoChild" resultMap="ThreeResultMap">
+		SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS
+		userPortrait FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS
+		totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType,
+		hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS
+		preAccountTime, co.*  FROM yeshi_ec_hongbao_order ho LEFT JOIN
+		(SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
+		<include refid="SELECT_PARAM_HONGBAO_TYPE" />
+		<!-- 绾㈠寘绫诲瀷 -->
+		<include refid="SELECT_HONGBAO_STATE" />
+		<!-- 绾㈠寘鐘舵�� -->
+		)hb ON hb.hb_id=ho.`ho_hongbao_id`
+		LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` 
+		WHERE hb.hb_id IS NOT NULL
+		<include refid="SELECT_PARAM_ORDER_STATE" />
+		<!-- 璁㈠崟鐘舵�� -->
+		<if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]>
+		</if>
+		<if test="endTime != null and endTime != '' ">AND <![CDATA[co.co_third_create_time <= #{endTime}]]>
+		</if>
+		<if test="key != null and key != '' ">
+			<if test="keyType == 1 ">AND co.co_order_no = ${key}</if>
+			<if test="keyType == 2 ">AND hb.hb_uid = ${key}</if>
+		</if>
+		<!-- 璁㈠崟鏉ユ簮 -->
+		<if test="source != null">AND co.co_source_type = #{source}</if>
+		ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT
+		JOIN yeshi_ec_user u ON u.id = A.hb_uid
+	</select>
+	
+	
 	<select id="countQuery" resultType="java.lang.Long">
 		SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN
 		(SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
@@ -787,6 +820,35 @@
 		<!-- 璁㈠崟鏉ユ簮 -->
 		<if test="source != null">AND co.co_source_type = #{source}</if>
 	</select>
+	
+	
+	<select id="countQueryWithNoChild" resultType="java.lang.Long">
+		SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN
+		(SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
+		<include refid="SELECT_PARAM_HONGBAO_TYPE" />
+		<!-- 绾㈠寘绫诲瀷 -->
+		<include refid="SELECT_HONGBAO_STATE" />
+		<!-- 绾㈠寘鐘舵�� -->
+		)hb ON hb.hb_id=ho.`ho_hongbao_id`
+		LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` 
+		 WHERE hb.hb_id IS NOT NULL
+		<include refid="SELECT_PARAM_ORDER_STATE" />
+		<!-- 璁㈠崟鐘舵�� -->
+		<if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]>
+		</if>
+		<if test="endTime != null and endTime != '' ">AND <![CDATA[co.co_third_create_time <= #{endTime}]]>
+		</if>
+		<if test="key != null and key != '' ">
+			<if test="keyType == 1 ">AND co.co_order_no = ${key}</if>
+			<if test="keyType == 2 ">AND hb.hb_uid = ${key}</if>
+		</if>
+		<!-- 璁㈠崟鏉ユ簮 -->
+		<if test="source != null">AND co.co_source_type = #{source}</if>
+	</select>
+	
+	
+	
+	
 	<select id="getCouponHongbaoByOrderNo" resultMap="ResultMap">
 		SELECT COALESCE(SUM(IF(hb.hb_type=1,hb.`hb_money`,0)),0)AS totalMoney,
 		COALESCE(SUM(IF(hb.hb_type=10,hb.`hb_money`,0)),0)AS couponMoney,

--
Gitblit v1.8.0