From 2e2356dd4fec268f6be6ed923b14bfa667de0c0d Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期六, 21 六月 2025 16:02:54 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/Report.xml |   50 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index a264be9..ebcc5bf 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -126,6 +126,7 @@
         <result column="reviewed" property="reviewed"/>
         <result column="examine_time" property="examineTime"/>
         <result column="workProcessName" property="workProcessName"/>
+        <result column="device_name" property="deviceName"/>
     </resultMap>
 
     <resultMap id="scheduleProductionScheduleMap" type="com.example.erp.dto.pp.ScheduleProductionScheduleDTO">
@@ -1347,6 +1348,7 @@
         JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code,
         rw.reviewed,
         rw.examine_time,
+        rw.device_name,
 --         GROUP_CONCAT(ogd.glass_child SEPARATOR '+') as workProcessName
         CASE
         WHEN LOCATE('step',#{laminating})>0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+')
@@ -1377,6 +1379,9 @@
         <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''">
             and od.edging_type regexp #{teamOutputDTO.edgingType}
         </if>
+        <if test="teamOutputDTO.deviceName != null and teamOutputDTO.deviceName != ''">
+            and rw.device_name regexp #{teamOutputDTO.deviceName}
+        </if>
 
         <choose>
             <when test="laminating == ''">
@@ -1390,11 +1395,15 @@
             </when>
             <otherwise>
                 GROUP BY
+                <if test="laminating == 'stepA' || laminating == 'stepC'" >
+                    ogd.`group`,
+                </if>
                 rw.reporting_work_id,
                 rw.process_id,
                 rw.this_process,
                 rw.teams_groups_name,
                 rwd.order_number
+
             </otherwise>
         </choose>
         ORDER BY
@@ -1420,7 +1429,14 @@
         rwd.completed_quantity as completed_quantity,
         ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*rwd.completed_quantity/1000000,2) as area,
         od.product_name,
-        JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code
+        JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code,
+        rw.reviewed,
+        rw.examine_time,
+        rw.device_name,
+        CASE
+        WHEN LOCATE('step',#{laminating})>0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+')
+        ELSE MAX( ogd.glass_child )
+        END AS workProcessName
         FROM
         reporting_work as rw left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id
         left join flow_card as fc on fc.order_id=rw.order_id and fc.process_id=rw.process_id  and fc.order_number=rwd.order_number and fc.technology_number=rwd.technology_number
@@ -1428,15 +1444,31 @@
         left join sd.order_detail as od  on od.order_id=ogd.order_id and od.order_number=ogd.order_number
         left join sd.`order` as o on o.order_id=od.order_id
         where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0
-          and date(rw.reporting_work_time) >= #{date[0]}
-          and date(rw.reporting_work_time) &lt;= #{date[1]}
+        and date(rw.reporting_work_time) >= #{date[0]}
+        and date(rw.reporting_work_time) &lt;= #{date[1]}
         and position(#{process} in rw.this_process)
-        GROUP BY
-        rw.reporting_work_id,
-        rw.process_id,
-        rw.this_process,
-        rw.teams_groups_name,
-        rwd.order_number
+        <choose>
+            <when test="laminating == ''">
+                GROUP BY
+                rw.reporting_work_id,
+                rw.process_id,
+                rw.this_process,
+                rw.teams_groups_name,
+                rwd.order_number,
+                rwd.technology_number
+            </when>
+            <otherwise>
+                GROUP BY
+                <if test="laminating == 'stepA' || laminating == 'stepC'" >
+                    ogd.`group`,
+                </if>
+                rw.reporting_work_id,
+                rw.process_id,
+                rw.this_process,
+                rw.teams_groups_name,
+                rwd.order_number
+            </otherwise>
+        </choose>
         ORDER BY
         rw.this_process,
         rw.process_id,

--
Gitblit v1.8.0