From 5a5e59f8aaa2a030511ef245886bf6d1db9bf774 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 15 三月 2024 14:40:14 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml b/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
index 9983811..2307263 100644
--- a/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
+++ b/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
@@ -26,5 +26,47 @@
 
 
     </insert>
+    <update id="updateQuantity">
+        update sd.order_process_detail as a
+        inner join
+        (select
+             rwd.completed_quantity,
+             rwd.breakage_quantity,
+             rw.process_id,
+             rwd.order_number,
+             rwd.technology_number
+              from pp.reporting_work_detail as rwd
+            left join pp.reporting_work as rw
+                on rwd.reporting_work_id =  rw.reporting_work_id
+            where rwd.reporting_work_id =#{reportingWorkId} )  as b
+        on a.process_id = b.process_id
+        and a.order_number = b.order_number
+        and a.technology_number = b.technology_number
+
+        <if test="type == 'delete'">
+            set a.reporting_work_num_count
+                = a.reporting_work_num_count-b.completed_quantity,
+
+            a.reporting_work_num
+                = a.reporting_work_num-b.completed_quantity,
+
+            a.broken_num
+                = a.broken_num-b.breakage_quantity
+        </if>
+
+        <if test="type == 'add'">
+            set a.reporting_work_num_count
+            = a.reporting_work_num_count+b.completed_quantity,
+
+            a.reporting_work_num
+            = a.reporting_work_num+b.completed_quantity,
+
+            a.broken_num
+            = a.broken_num+b.breakage_quantity
+        </if>
+
+        where a.process = #{process}
+
+    </update>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0