From c1c7cae9ebaa7f743e51660265c8dfa6ac52f10d Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期四, 09 十月 2025 16:07:42 +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 |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 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 522421e..d69806f 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -24,9 +24,10 @@
         od.product_name,
         r.technology_number,
         ogd.glass_address,
+        ogd.glass_child,
         r.patch_num,
-        od.width,
-        od.height,
+        ogd.child_width as width,
+        ogd.child_height as height,
         od.shape,
         r.patch_type,
         r.patch_reason,
@@ -81,10 +82,10 @@
                 and r.quality_inspector regexp #{patchLog.qualityInspector}
             </if>
             <if test="patchLog.width != null and patchLog.width != ''">
-                and od.width regexp #{patchLog.width}
+                and ogd.child_width regexp REGEXP_REPLACE(#{patchLog.width},'\\.0+$','')
             </if>
             <if test="patchLog.height != null and patchLog.height != ''">
-                and od.height regexp #{patchLog.height}
+                and ogd.child_height regexp REGEXP_REPLACE(#{patchLog.height},'\\.0+$','')
             </if>
             <if test="patchLog.shape != null and patchLog.shape != ''">
                 and od.shape regexp #{patchLog.shape}
@@ -94,6 +95,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}
@@ -171,10 +175,10 @@
                 and r.quality_inspector regexp #{patchLog.qualityInspector}
             </if>
             <if test="patchLog.width != null and patchLog.width != ''">
-                and od.width regexp #{patchLog.width}
+                and ogd.child_width regexp REGEXP_REPLACE(#{patchLog.width},'\\.0+$','')
             </if>
             <if test="patchLog.height != null and patchLog.height != ''">
-                and od.height regexp #{patchLog.height}
+                and ogd.child_height regexp REGEXP_REPLACE(#{patchLog.height},'\\.0+$','')
             </if>
             <if test="patchLog.shape != null and patchLog.shape != ''">
                 and od.shape regexp #{patchLog.shape}
@@ -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}
@@ -286,8 +293,8 @@
                dd.technology_number as technologyNumber,
                ogd.glass_address as glassAddress,
                dd.breakage_quantity-dd.quantity as patchNum,
-               od.width,
-               od.height,
+                ogd.child_width as width,
+                ogd.child_height as height,
                od.shape,
                dd.responsible_process as responsibleProcess,
                rw.this_process as patchProcesses,
@@ -299,7 +306,10 @@
                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,
+               if(dd.responsible_process=rw.this_process,2,dd.quality_ins_status) as qualityInsStatus,
+               if(dd.quality_ins_status=1,1,2) as orderBy
         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
@@ -309,7 +319,7 @@
                  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
+        <where>  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and rw.reviewed_state!=-1 /*(dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1)) and */
                 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}
@@ -342,16 +352,19 @@
                 and rw.quality_inspector regexp #{patchLogAddDTO.qualityInspector}
             </if>
             <if test="patchLogAddDTO.width != null and patchLogAddDTO.width != ''">
-                and od.width regexp #{patchLogAddDTO.width}
+                and ogd.child_width regexp REGEXP_REPLACE(#{patchLogAddDTO.width},'\\.0+$','')
             </if>
             <if test="patchLogAddDTO.height != null and patchLogAddDTO.height != ''">
-                and od.height regexp #{patchLogAddDTO.height}
+                and ogd.child_height regexp REGEXP_REPLACE(#{patchLogAddDTO.height},'\\.0+$','')
             </if>
             <if test="patchLogAddDTO.shape != null and patchLogAddDTO.shape != ''">
                 and od.shape regexp #{patchLogAddDTO.shape}
             </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}
@@ -372,7 +385,7 @@
                 and dd.breakage_reason regexp #{patchLogAddDTO.patchReason}
             </if>
         </where>
-        order by dd.id desc
+        order by orderBy desc,dd.id desc
     </select>
 
     <delete id="deleteReplenishMp">

--
Gitblit v1.8.0