From 4ee53f8b43e850d2b35d5b1eb979d7b0bc2fbcd4 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 30 五月 2024 10:52:26 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
index 770d133..93a2ab0 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -17,13 +17,28 @@
     <update id="updateOrderParameter">
         update `order` o
         left join
-            (select a.order_id,round(sum(a.perimeter),2) as aa,sum(a.quantity) as b,sum(a.compute_gross_area)  as c
-             from sd.order_detail as a group by a.order_id)  od
+            (select a.order_id,
+                    round(sum(a.perimeter),2) as aa,
+                    sum(a.quantity) as b,
+                    sum(a.compute_gross_area)  as c,
+                   sum(a.gross_amount) as 'detailAmount'
+             from sd.order_detail as a group by a.order_id
+            ) as od
             on o.order_id = od.order_id
+        left join (select oom.order_id,
+                          sum(oom.money) as 'money'
+                   from order_other_money as oom
+                   where
+                       oom.order_id = #{orderId}
+                   group by oom.order_id
+                   ) as c
+        on c.order_id = o.order_id
         set
+            o.money = ifnull(od.detailAmount,0)+ifnull(c.money,0),
             o.quantity = od.b,
             o.area = od.c,
-            o.perimeter= od.aa
+            o.perimeter= od.aa,
+            o.other_money = ifnull(c.money,0)
         where
             o.order_id = #{orderId}
 
@@ -32,7 +47,7 @@
     <select id="getOrderList">
         select
             *,
-        sum(fgi.quantity_available) as goodsQuantity
+        ifnull(sum(fgi.quantity_available),0) as goodsQuantity
         from
             `order` as o
         left join mm.finished_goods_inventory as  fgi

--
Gitblit v1.8.0