From 05d6de25d55bdf1e2f3cde9d310c2cd14d59837a Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 17 七月 2024 12:51:33 +0800
Subject: [PATCH] 提交

---
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
index 1acb864..0a17142 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -129,8 +129,8 @@
             ogd.child_width,
             ogd.child_height,
             if(od.shape=1,'鏅舰',if(od.shape=2,'寮傚舰','')) as shape,
-            fc.quantity -odpd.reporting_work_num -odpd.broken_num  as quantity,
-            fc.quantity -odpd.reporting_work_num -odpd.broken_num  as completedQuantity,
+            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(patch.patch_num,0)  as quantity,
+            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(patch.patch_num,0)   as completedQuantity,
             odpd.reporting_work_num as completed,
             odpd.broken_num as onceBroken,
             if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
@@ -150,6 +150,19 @@
             AND odpd.order_number = fc.order_number
             AND odpd.technology_number = fc.technology_number
             and  odpd.process_id = fc.process_id
+        left join (
+                select ifnull(sum(a.patch_num),0) as patch_num,a.process_id,a.technology_number,a.order_sort
+                from patch_log as a
+                where a.process_id=#{processIdStr}
+                and a.technology_number =  #{technologyStr}
+                and a.patch_processes = #{process}
+                and a.review_status = 1
+                group by a.process_id,a.order_sort,a.technology_number
+            ) as patch
+        on patch.process_id = fc.process_id
+        and patch.order_sort = fc.order_number
+        and patch.technology_number = fc.technology_number
+
         WHERE
             fc.process_id = #{processIdStr}
           AND fc.technology_number = #{technologyStr}

--
Gitblit v1.8.0