From 7c30e26f3cc97ebcbb2cf86e2026b10f2e23994d Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 08 十二月 2025 16:40:26 +0800
Subject: [PATCH] 流程卡添加订单类型、补片流程卡调整样式,工序待完成报表添加厚度

---
 north-glass-erp/src/main/resources/mapper/pp/DamageDetails.xml |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/DamageDetails.xml b/north-glass-erp/src/main/resources/mapper/pp/DamageDetails.xml
index c29e5ef..ac4583a 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/DamageDetails.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/DamageDetails.xml
@@ -8,13 +8,18 @@
     FROM pp.damage_details as a
     left join pp.reporting_work as b
     on a.reporting_work_id = b.reporting_work_id
+    left join patch_log as c
+    on a.reporting_work_id = c.reporting_work_id
+           and a.process_id = c.process_id
+           and a.order_number = c.order_sort
+           and a.technology_number = c.technology_number
     WHERE a.process_id = #{processId}
     <if test="needOrderNumber!=null">
     and a.order_number = #{orderNumber}
     </if>
+    and a.available=0
     and a.technology_number =#{technologyNumber}
     and a.breakage_quantity>0
-    and a.patch_status=0
     and b.reviewed_state>=0
     and b.this_process in (WITH RECURSIVE cte AS (
                             SELECT 1 AS n
@@ -24,21 +29,26 @@
                            SELECT REGEXP_SUBSTR(#{behindProcess}, '[^,]+', 1, n) AS process
                            FROM cte
                            WHERE REGEXP_SUBSTR(#{behindProcess}, '[^,]+', 1, n) IS NOT NULL)
+    and ifnull(c.review_status,0) = 0
 
 </select>
     <select id="getNotReview">
-    select a.*
+    select a.*,ifnull(c.review_status,0) as reviewed_state
     from damage_details as a
     left join reporting_work as b
     on a.reporting_work_id = b.reporting_work_id
+    left join patch_log as c
+    on a.reporting_work_id = c.reporting_work_id and a.process_id = c.process_id and a.order_number = c.order_sort
+    and a.technology_number = c.technology_number
     where a.process_id=#{processId}
      and b.reviewed_state>=0
-  <if test="orderNumber!= null">
+  <if test="orderNumber!= null || orderNumber!=''">
       and a.order_number = #{orderNumber}
   </if>
+    and a.available=0
     and a.technology_number = #{technologyNumber}
-     and     a.patch_status=0
     and a.breakage_quantity>0
+    and ifnull(c.review_status,0) = 0
 
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0