From c8ea01fdd9fc8ebf5e1fcbbd56fee7071e4d5809 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期二, 10 十二月 2024 14:45:05 +0800
Subject: [PATCH] 583-订单管理-订单列表统计页面增加一个,筛选地区的下拉列表,例如昆明-呈贡区等等

---
 src/main/resources/mapper/payment/OrderMapper.xml |   41 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/main/resources/mapper/payment/OrderMapper.xml b/src/main/resources/mapper/payment/OrderMapper.xml
index 6142cf6..c806ff9 100644
--- a/src/main/resources/mapper/payment/OrderMapper.xml
+++ b/src/main/resources/mapper/payment/OrderMapper.xml
@@ -7,6 +7,7 @@
         where status_backend = 'SEND' and partner_id is not null
     </update>
 
+
     <select id="getPartnerOrderReceive" resultType="com.mzl.flower.entity.payment.Order">
         select * from t_order t where status_backend = 'SEND' and partner_id is not null
     </select>
@@ -51,7 +52,7 @@
             AND q.payment_time &gt;= #{condition.createStartDate}
         </if>
         <if test="condition.createEndDate != null">
-            AND q.payment_time &lt;= #{condition.createEndDate}
+            AND q.payment_time &lt; #{condition.createEndDate}
         </if>
         <if test="condition.partnerId != null">
             AND q.partner_id = #{condition.partnerId}
@@ -93,6 +94,15 @@
         <if test="condition.orderNo != null and condition.orderNo != ''">
             AND q.order_no LIKE concat('%', #{condition.orderNo},'%')
         </if>
+        <if test="condition.province != null and condition.province != ''">
+            AND q.customer_province LIKE concat('%', #{condition.province},'%')
+        </if>
+        <if test="condition.city != null and condition.city != ''">
+            AND q.customer_city LIKE concat('%', #{condition.city},'%')
+        </if>
+        <if test="condition.region != null and condition.region != ''">
+            AND q.customer_region LIKE concat('%', #{condition.region},'%')
+        </if>
         <if test="condition.customerAddress != null and condition.customerAddress != ''">
             AND q.customer_address LIKE concat('%', #{condition.customerAddress},'%')
         </if>
@@ -131,7 +141,7 @@
             AND q.payment_time  &gt;= #{condition.createStartDate}
         </if>
         <if test="condition.createEndDate != null">
-            AND q.payment_time &lt;= #{condition.createEndDate}
+            AND q.payment_time &lt; #{condition.createEndDate}
         </if>
         <if test="condition.partnerId != null">
             AND q.partner_id = #{condition.partnerId}
@@ -160,6 +170,9 @@
         </if>
         <if test="condition.warehouseLocationCode != null and condition.warehouseLocationCode != ''">
             AND q.warehouse_location_code LIKE concat('%', #{condition.warehouseLocationCode},'%')
+        </if>
+        <if test="condition.createName != null and condition.createName != ''">
+            AND u.nick_name LIKE concat('%', #{condition.createName},'%')
         </if>
 
         ORDER BY q.create_time desc, q.payment_time desc
@@ -193,7 +206,7 @@
             AND q.payment_time &gt;= #{condition.createStartDate}
         </if>
         <if test="condition.createEndDate != null">
-            AND q.payment_time &lt;= #{condition.createEndDate}
+            AND q.payment_time &lt; #{condition.createEndDate}
         </if>
 <!--        <if test="condition.createStartDate != null">-->
 <!--            AND q.create_time &gt;= #{condition.createStartDate}-->
@@ -331,7 +344,7 @@
             AND q.payment_time &gt;= #{condition.startDate}
         </if>
         <if test="condition.endDate != null">
-            AND q.payment_time &lt;= #{condition.endDate}
+            AND q.payment_time &lt; #{condition.endDate}
         </if>
         <if test="condition.createStartDate != null">
             AND q.create_time &gt;= #{condition.createStartDate}
@@ -382,4 +395,24 @@
             and o.create_time &lt;= #{endTime}
         </if>
     </select>
+
+<!--    获取所有的订单数据,以及时间数据-->
+    <select id="selectAllDateList" resultType="com.mzl.flower.entity.payment.Order">
+        SELECT t.id,t.payment_time,
+               CASE
+                   WHEN t.payment_time > DATE(t.payment_time) + INTERVAL 17 HOUR THEN DATE(t.payment_time) + INTERVAL 1 DAY
+                   ELSE DATE(t.payment_time)
+                   END AS payment_date,
+               t.create_time,
+               CASE
+                   WHEN t.create_time > DATE(t.create_time) + INTERVAL 17 HOUR THEN DATE(t.create_time) + INTERVAL 1 DAY
+                   ELSE DATE(t.create_time)
+                   END AS create_date
+        FROM t_order t
+        order by t.create_time desc
+    </select>
+
+    <update id="updatePaymentCreateDate">
+        update t_order  set payment_date_sta=#{order.paymentDate}, create_date_sta=#{order.createDate} where id=#{order.id}
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3