From debf2b9164ab65ff3ff72845d057e73f5a7e13af Mon Sep 17 00:00:00 2001
From: Cui Zhi Feng <7426394+wuxixiaocui@user.noreply.gitee.com>
Date: 星期三, 25 九月 2024 16:17:47 +0800
Subject: [PATCH] 供应商结算明细优化

---
 src/main/resources/mapper/payment/DeliveryOrderMapper.xml |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/payment/DeliveryOrderMapper.xml b/src/main/resources/mapper/payment/DeliveryOrderMapper.xml
index 7d64fcf..243e5d8 100644
--- a/src/main/resources/mapper/payment/DeliveryOrderMapper.xml
+++ b/src/main/resources/mapper/payment/DeliveryOrderMapper.xml
@@ -188,6 +188,22 @@
     </select>
 
     <select id="statisticStationList" resultType="com.mzl.flower.dto.response.flower.StationStatisticDTO">
+        select tt.*
+            , (select count(distinct s.id)
+                from t_supplier_info s
+                join t_delivery_order q on s.id = q.supplier_id
+                WHERE q.deleted = 0
+                and q.status in ('CHECKED')
+                AND s.station_id = tt.stationId
+            ) checkedSupplierCount
+            , (select count(distinct s.id)
+                from t_supplier_info s
+                join t_delivery_order q on s.id = q.supplier_id
+                WHERE q.deleted = 0
+                and q.status in ('PENDING', 'ARRIVED')
+                AND s.station_id = tt.stationId
+            ) uncheckedSupplierCount
+        from (
             SELECT
                 s.station_id AS stationId,
                 st.`name`,
@@ -226,6 +242,7 @@
                 </foreach>
             </if>
             GROUP BY s.station_id, st.`name`
+        ) tt
     </select>
 
     <update id="setDeliveryOrderPending">

--
Gitblit v1.9.3