From 85bcee0ebf26d17b033744dbce9789ef2471f0f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com>
Date: Wed, 3 Jul 2024 23:47:29 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E5=B8=88=E8=AE=A2=E5=8D=95=20?=
=?UTF-8?q?=E6=AD=A3=E8=B4=9F8=E5=B0=8F=E6=97=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../resources/mapper/artificer/OrdersDao.xml | 57 +++----------------
1 file changed, 8 insertions(+), 49 deletions(-)
diff --git a/src/main/resources/mapper/artificer/OrdersDao.xml b/src/main/resources/mapper/artificer/OrdersDao.xml
index 3a50cbc..932dbae 100644
--- a/src/main/resources/mapper/artificer/OrdersDao.xml
+++ b/src/main/resources/mapper/artificer/OrdersDao.xml
@@ -377,17 +377,18 @@
select o1.*,
(case when o1.status = 4
then o1.pay_money + ifnull(o1.add_money,0)
- else o1.pay_money + ifnull(o1.add_money,0) + ifnull(o2.pay_money,0) + ifnull(o2.add_money,0)
+ else o1.pay_money + ifnull(o1.add_money,0) + ifnull(o2.pay_money,0) + ifnull(o2.add_money,0) + ifnull(o3.pay_money,0) + ifnull(o3.add_money,0)
end) as pay_money_total,
(case when o1.status = 4
then o1.artificer_money + ifnull(o1.add_artificer_money,0)
- else o1.artificer_money + ifnull(o1.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0)
+ else o1.artificer_money + ifnull(o1.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0)
end) as artificer_money_total,
a.artificer_name as artificerName,a.artificer_img as artificerImg,
a.user_id as artificerUserId,c.consortia_name as shopName,c.address as shopAddress,
c.phone as shopPhone
from orders o1
left join orders o2 on o1.old_orders_id = o2.orders_id and o2.status != 4
+ left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
left join artificer a on a.artificer_id=o1.artificer_id
left join tb_user u on u.user_id=o1.user_id
left join consortia c on c.consortia_id=o1.consortia_id
@@ -421,18 +422,6 @@
and o1.orders_id not in (
select orders_id from orders
where old_orders_id is not null
-
- and o1.user_package_id = #{userPackageId}
-
-
- and o1.user_id=#{userId}
-
-
- and o1.status=#{status}
-
-
- and o1.status in (2,9)
-
)
and o1.user_package_id = #{userPackageId}
@@ -662,10 +651,11 @@
now() > DATE_ADD(STR_TO_DATE(o.serve_time, '%Y-%m-%d %H:%i'), INTERVAL #{minutes} MINUTE) as is_can_supplement,
(case when o.status = 4
then o.artificer_money + ifnull(o.add_artificer_money,0)
- else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0)
+ else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0)
end) as artificer_money_total
from orders o
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
+ left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
left join orders_massage om on om.orders_id=o.orders_id
left join massage_type m on m.massage_type_id=om.massage_id
LEFT JOIN bl_user_package_detail bl ON bl.id = om.massage_id
@@ -673,7 +663,9 @@
and o.old_orders_id is not null
and o.status != 11
- and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status in (2,3,5,6,7,8,9)
+ and date_format(o.serve_time,'%Y-%m-%d %H:%i') >= date_format(DATE_ADD(now(), INTERVAL -8 HOUR),'%Y-%m-%d %H:%i')
+ and date_format(o.serve_time,'%Y-%m-%d %H:%i') <= date_format(DATE_ADD(now(), INTERVAL 8 HOUR),'%Y-%m-%d %H:%i')
+ and o.status in (2,3,5,6,7,8,9)
and o.status=2
@@ -721,39 +713,6 @@
and o.orders_id not in (
select orders_id from orders
where old_orders_id is not null
-
- and date_format(serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and status in (2,3,5,6,7,8,9)
-
-
- and status=2
-
- and date_format(serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
-
-
- and date_format(serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
-
-
-
- and status in (3,5)
-
- and date_format(serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
-
-
- and date_format(serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
-
-
-
- and status in (2,3,4,5,6,7,8)
-
- and date_format(serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
-
-
- and date_format(serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
-
-
-
- and date_format(serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and status=2
-
)
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status in (2,3,5,6,7,8,9)