From 96a415a0de73542ddb5da7eaa61e4d7e55065ae3 Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期六, 12 一月 2019 15:30:55 +0800
Subject: [PATCH] Merge branch 'div1'

---
 fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml |   50 ++++++++++++++++++++++++--------------------------
 1 files changed, 24 insertions(+), 26 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 bc4583a..0fcc883 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
@@ -255,24 +255,24 @@
 
 	<sql id="SELECT_PARAM_ORDER_CREATE_TIME">
 		<if test="startTime != null and startTime != '' ">
-			AND <![CDATA[co.co_create_time >= #{startTime}]]>
+			AND <![CDATA[co.co_third_create_time >= #{startTime}]]>
 		</if>
 		<if test="endTime != null and endTime != '' ">
-			AND <![CDATA[co.co_create_time <= #{endTime}]]>
+			AND <![CDATA[co.co_third_create_time <= #{endTime}]]>
 		</if>
 		<if test="day != null and day == 1"> <!-- 浠婂ぉ -->
-			AND TO_DAYS(co.`co_create_time`) = TO_DAYS(NOW())
+			AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
 		</if>
 		<if test="day != null and day == 2">  <!-- 鏄ㄥぉ -->
-			AND TO_DAYS(NOW()) - TO_DAYS(co.`co_create_time`) = 1
+			AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1
 		</if>
 		<if test="day != null and day == 3">  <!-- 鏈湀 -->
-			AND DATE_FORMAT(co.`co_create_time`,'%Y%m') =
+			AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') =
 			DATE_FORMAT(CURDATE(),'%Y%m')
 		</if>
 		<if test="day != null and day == 4">  <!-- 涓婃湀 -->
 			AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
-			DATE_FORMAT(co.`co_create_time`, '%Y%m')) = 1
+			DATE_FORMAT(co.`co_third_create_time`, '%Y%m')) = 1
 		</if>
 	</sql>
 	
@@ -331,7 +331,7 @@
 				AND co.co_order_no = #{orderNo}
 			  </if>
 		GROUP BY co.`co_order_no`, co.`co_source_type`
-		ORDER BY co.co_create_time DESC
+		ORDER BY co.co_third_create_time DESC
 		LIMIT ${start},${count}
 	</select>
 
@@ -396,18 +396,18 @@
 			LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
 			WHERE (hb.hb_id IS NOT NULL OR hbp.hb_id IS NOT NULL)
 				<if test="day != null and day == 1"> <!-- 浠婂ぉ -->
-					AND TO_DAYS(co.`co_create_time`) = TO_DAYS(NOW())
+					AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
 				</if>
 				<if test="day != null and day == 2">  <!-- 鏄ㄥぉ -->
-					AND TO_DAYS(NOW()) - TO_DAYS(co.`co_create_time`) = 1
+					AND TO_DAYS(NOW()) - TO_DAYS(co.co_third_create_time) = 1
 				</if>
 				<if test="day != null and day == 3">  <!-- 鏈湀 -->
-					AND DATE_FORMAT(co.`co_create_time`,'%Y%m') =
+					AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') =
 					DATE_FORMAT(CURDATE(),'%Y%m')
 				</if>
 				<if test="day != null and day == 4">  <!-- 涓婃湀 -->
 					AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
-					DATE_FORMAT(co.`co_create_time`, '%Y%m')) = 1
+					DATE_FORMAT(co.`co_third_create_time`, '%Y%m')) = 1
 				</if>
 			GROUP BY co.`co_order_no`, co.`co_source_type`)YX
 			
@@ -426,18 +426,18 @@
 				LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
 				WHERE (hb.hb_id IS NOT NULL OR hbp.hb_id IS NOT NULL)
 					<if test="day != null and day == 1"> <!-- 浠婂ぉ -->
-						AND TO_DAYS(co.`co_create_time`) = TO_DAYS(NOW())
+						AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
 					</if>
 					<if test="day != null and day == 2">  <!-- 鏄ㄥぉ -->
-						AND TO_DAYS(NOW()) - TO_DAYS(co.`co_create_time`) = 1
+						AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1
 					</if>
 					<if test="day != null and day == 3">  <!-- 鏈湀 -->
-						AND DATE_FORMAT(co.`co_create_time`,'%Y%m') =
+						AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') =
 						DATE_FORMAT(CURDATE(),'%Y%m')
 					</if>
 					<if test="day != null and day == 4">  <!-- 涓婃湀 -->
 						AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
-						DATE_FORMAT(co.`co_create_time`, '%Y%m')) = 1
+						DATE_FORMAT(co.`co_third_create_time`, '%Y%m')) = 1
 					</if>
 				GROUP BY co.`co_order_no`, co.`co_source_type`)WQ
 				
@@ -460,18 +460,18 @@
 				LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
 				WHERE (hb.hb_id IS NOT NULL OR hbp.hb_id IS NOT NULL)
 					<if test="day != null and day == 1"> <!-- 浠婂ぉ -->
-						AND TO_DAYS(co.`co_create_time`) = TO_DAYS(NOW())
+						AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
 					</if>
 					<if test="day != null and day == 2">  <!-- 鏄ㄥぉ -->
-						AND TO_DAYS(NOW()) - TO_DAYS(co.`co_create_time`) = 1
+						AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1
 					</if>
 					<if test="day != null and day == 3">  <!-- 鏈湀 -->
-						AND DATE_FORMAT(co.`co_create_time`,'%Y%m') =
+						AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') =
 						DATE_FORMAT(CURDATE(),'%Y%m')
 					</if>
 					<if test="day != null and day == 4">  <!-- 涓婃湀 -->
 						AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
-						DATE_FORMAT(co.`co_create_time`, '%Y%m')) = 1
+						DATE_FORMAT(co.`co_third_create_time`, '%Y%m')) = 1
 					</if>
 				GROUP BY co.`co_order_no`, co.`co_source_type`)SX
 		)A
@@ -557,9 +557,6 @@
 				LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
 				WHERE (hb.hb_id IS NOT NULL OR hbp.hb_id IS NOT NULL)
 					<include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
-					<if test="day != null and day == 4"> 
-						AND co.`co_state` = 2 <!-- 涓婃湀 :缁熻宸叉敹璐� -->
-					</if>
 				GROUP BY co.`co_order_no`, co.`co_source_type`
 		)A
 	</select>
@@ -582,12 +579,12 @@
 		WHERE (hb.hb_id IS NOT NULL OR hbp.hb_id IS NOT NULL)
 			<include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
 			<if test="day != null and day == 4"> 
-				AND co.`co_state` = 2 <!-- 涓婃湀 :缁熻宸叉敹璐� -->
+				AND co.`co_state` = 2  <!-- 涓婃湀 :缁熻宸叉敹璐� -->
 			</if>
 	</select>
 	
 	<select id="countBonusOrderMoneyAndNumber" resultType="java.util.HashMap">
-		<!-- 濂栭噾缁熻锛氳鍗曟�昏繑鍒╅噾棰� 鍘绘帀宸插け鏁� -->
+		<!-- 濂栭噾缁熻鏈夋晥璁㈠崟锛氳鍗曟�婚噾棰� / 鎬昏鍗曟暟      -->
 		SELECT COUNT(ho.`ho_id`) AS totalNum,
 			CAST(SUM(IF(hb.hb_id IS NULL,hbp.`hb_money`,hb.`hb_money`))AS DECIMAL(19,2)) AS totalmoney
 		FROM yeshi_ec_hongbao_order ho 	
@@ -605,8 +602,9 @@
 		WHERE (hb.hb_id IS NOT NULL OR hbp.hb_id IS NOT NULL)
 			<include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
 			<if test="day != null and day == 4"> 
-				AND co.`co_state` = 2 <!-- 涓婃湀 :缁熻宸叉敹璐� -->
+				AND co.`co_state` = 2  <!-- 涓婃湀 :缁熻宸叉敹璐� -->
 			</if>
+		GROUP BY co.`co_order_no`, co.`co_source_type`
 	</select>
 	
 	<select id="listQueryByUid" resultMap="ResultMap">   
@@ -639,7 +637,7 @@
 			  <if test="orderNo != null and orderNo !='' ">
 				AND co.co_order_no = #{orderNo}
 			  </if>
-		ORDER BY co.co_create_time DESC
+		ORDER BY co.co_third_create_time DESC
 		LIMIT ${start},${count}
 	</select>
 

--
Gitblit v1.8.0