From ffc0309ac8e6f72e6429f91fad93456030e05e5e Mon Sep 17 00:00:00 2001
From: gongzuming <gongzuming>
Date: 星期二, 10 九月 2024 15:45:28 +0800
Subject: [PATCH] 优化
---
src/main/resources/mapper/payment/DeliveryOrderMapper.xml | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/payment/DeliveryOrderMapper.xml b/src/main/resources/mapper/payment/DeliveryOrderMapper.xml
index dbfd143..93e2eaf 100644
--- a/src/main/resources/mapper/payment/DeliveryOrderMapper.xml
+++ b/src/main/resources/mapper/payment/DeliveryOrderMapper.xml
@@ -79,13 +79,16 @@
</select>
<select id="selectSupplierDoList4Check" resultType="com.mzl.flower.dto.response.payment.DeliveryOrderList4CheckDTO">
- SELECT tt.id, tt.supplierName, tt.supplierTel, tt.stationName, sum(tt.num) totalNum, sum(tt.amount) totalAmount
+ SELECT tt.id, tt.supplierName, tt.supplierTel, tt.stationName, sum(tt.num) totalNum
+ , sum(tt.amount) totalAmount, sum(tt.uncheckedCount) uncheckedCount
from (
select s.id, s.name supplierName, s.contact_tel supplierTel, st.name stationName
, (select sum(num) from t_order_item oi
where oi.supplier_id = q.supplier_id and oi.order_id = q.order_id) num
- , (select sum(oi.supplier_price * oi.num) from t_order_item oi
+ , (select sum(oi.supplier_price * oi.num) from t_order_item oi
where oi.supplier_id = q.supplier_id and oi.order_id = q.order_id) amount
+ , (select count(1) from t_delivery_order dor
+ where dor.id = q.id and dor.status != 'CHECKED') uncheckedCount
from t_supplier_info s
join t_station st on st.id = s.station_id
join t_delivery_order q on s.id = q.supplier_id
--
Gitblit v1.9.3