From 547294b0c7a7de8cc84a8a8df297548c7b2f9846 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 06 八月 2025 10:07:48 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
index 3fbe9ba..ee659ad 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -24,6 +24,7 @@
         od.product_name,
         r.technology_number,
         ogd.glass_address,
+        ogd.glass_child,
         r.patch_num,
         od.width,
         od.height,
@@ -42,8 +43,8 @@
         JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS glassNumber
         from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number
         left join sd.`order` o on r.order_id = o.order_id
-        left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
-        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
+        left join (select * from sd.order_glass_detail group by order_id,order_number,technology_number) as ogd
+        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number and r.technology_number=ogd.technology_number
         <where>
             date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
             and o.create_order>0
@@ -95,6 +96,9 @@
             <if test="patchLog.glassAddress != null and patchLog.glassAddress != ''">
                 and ogd.glass_address regexp #{patchLog.glassAddress}
             </if>
+            <if test="patchLog.glassChild != null and patchLog.glassChild != ''">
+                and ogd.glass_child regexp #{patchLog.glassChild}
+            </if>
             <if test="patchLog.responsibleTeam != null and patchLog.responsibleTeam != ''">
                 and r.responsible_team regexp #{patchLog.responsibleTeam}
             </if>
@@ -133,8 +137,8 @@
         from (select r.id as id
         from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number
         left join sd.`order` o on r.order_id = o.order_id
-        left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
-        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
+        left join (select * from sd.order_glass_detail group by order_id,order_number,technology_number) as ogd
+        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number and r.technology_number=ogd.technology_number
         <where>
             date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
             <if test="patchLog.patchId != null and patchLog.patchId != ''">
@@ -184,6 +188,9 @@
             </if>
             <if test="patchLog.glassAddress != null and patchLog.glassAddress != ''">
                 and ogd.glass_address regexp #{patchLog.glassAddress}
+            </if>
+            <if test="patchLog.glassChild != null and patchLog.glassChild != ''">
+                and ogd.glass_child regexp #{patchLog.glassChild}
             </if>
             <if test="patchLog.responsibleTeam != null and patchLog.responsibleTeam != ''">
                 and r.responsible_team regexp #{patchLog.responsibleTeam}
@@ -299,18 +306,19 @@
                dd.responsible_equipment as responsibleEquipment,
                dd.responsible_team as responsibleTeam,
                ROUND((dd.breakage_quantity-dd.quantity) * od.width * od.height / 1000000, 2) as patchArea,
-               rw.quality_inspector as qualityInspector
+               rw.quality_inspector as qualityInspector,
+               ogd.glass_child as glassChild
         from pp.damage_details dd
                  left join	pp.reporting_work_detail rwd on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number=rwd.order_number  and dd.technology_number=rwd.technology_number
                  left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id
 
                  left join sd.`order` o on rw.order_id = o.order_id
                  left join sd.order_detail od on rw.order_id = od.order_id and dd.order_number = od.order_number
-                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
-                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
+                 left join (select * from sd.order_glass_detail group by order_id,order_number,technology_number) as ogd
+                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number and rwd.technology_number=ogd.technology_number
 
         <where>  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1)) and rw.reviewed_state!=-1
-                and o.create_order>0
+                and o.create_order>0 and dd.patch_status=0
             <if test="patchLogAddDTO.orderId != null and patchLogAddDTO.orderId != ''">
                 and o.order_id regexp #{patchLogAddDTO.orderId}
             </if>
@@ -352,6 +360,9 @@
             </if>
             <if test="patchLogAddDTO.glassAddress != null and patchLogAddDTO.glassAddress != ''">
                 and ogd.glass_address regexp #{patchLogAddDTO.glassAddress}
+            </if>
+            <if test="patchLogAddDTO.glassChild != null and patchLogAddDTO.glassChild != ''">
+                and ogd.glass_child regexp #{patchLogAddDTO.glassChild}
             </if>
             <if test="patchLogAddDTO.responsibleTeam != null and patchLogAddDTO.responsibleTeam != ''">
                 and dd.responsible_team regexp #{patchLogAddDTO.responsibleTeam}
@@ -413,8 +424,9 @@
 
     <select id="selectProjectCount">
         SELECT COUNT(*)
-        FROM flow_card
-        WHERE process_id= #{processId} and project_no IS not NULL;
+        FROM patch_log
+        WHERE process_id= #{processId} and patch_id=#{patchId} and technology_number = #{technologyNumber}
+          and project_no IS not NULL;
     </select>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0