From e7b7ffed9be4ce118d52e20a6f26a4ac9718eaef Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 05 三月 2025 16:46:17 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 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 cf7f56e..c122755 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -1012,4 +1012,60 @@
     <select id="selectOrderid">
         select order_id from  pp.flow_card where process_id=#{processIdStr} group by order_id
     </select>
+
+    <select id="getFootSum">
+        SELECT
+            ifnull(SUM(this_completed_quantity),0) AS thisCompletedQuantity,
+            ifnull(SUM(ROUND(child_width * child_height * this_completed_quantity / 1000000, 2)),0) AS completedArea,
+            ifnull(SUM(this_worn_quantity),0) AS thisWornQuantity,
+            ifnull(SUM(ROUND(child_width * child_height * this_worn_quantity / 1000000, 2)),0) AS wornArea
+        FROM (
+                 -- 鍏堝 reporting_work_id 杩涜鍘婚噸
+                 SELECT
+                     rw.reporting_work_id,
+                     MAX(rw.this_completed_quantity) AS this_completed_quantity,
+                     MAX(rw.this_worn_quantity) AS this_worn_quantity,
+                     MAX(ogd.child_width) AS child_width,
+                     MAX(ogd.child_height) AS child_height
+                 FROM sd.order AS o
+                          LEFT JOIN sd.order_glass_detail AS ogd
+                                    ON ogd.order_id = o.order_id
+                          LEFT JOIN reporting_work AS rw
+                                    ON rw.order_id = ogd.order_id
+                                        AND rw.production_id = ogd.production_id
+                 WHERE rw.reviewed_state != 2
+      and rw.reporting_work_time >= #{selectTime1}
+                   AND rw.reporting_work_time &lt;  #{selectTime2}
+                   and position(#{orderId} in rw.order_id)
+                   AND rw.reviewed_state != -1
+                   AND o.create_order > 0
+        <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
+            and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
+        </if>
+        <if test="reportingWork.orderId != null and reportingWork.orderId != ''">
+            and o.order_id regexp #{reportingWork.orderId}
+        </if>
+        <if test="reportingWork.processId != null and reportingWork.processId != ''">
+            and rw.process_id regexp #{reportingWork.processId}
+        </if>
+        <if test="reportingWork.order.project != null and reportingWork.order.project != ''">
+            and o.project regexp #{reportingWork.order.project}
+        </if>
+        <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''">
+            and o.batch regexp #{reportingWork.order.batch}
+        </if>
+        <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''">
+            and rw.this_process regexp #{reportingWork.thisProcess}
+        </if>
+        <if test="reportingWork.deviceName != null and reportingWork.deviceName != ''">
+            and rw.device_name regexp #{reportingWork.deviceName}
+        </if>
+        <if test="reportingWork.teamsGroupsName != null and reportingWork.teamsGroupsName != ''">
+            and rw.teams_groups_name regexp #{reportingWork.teamsGroupsName}
+        </if>
+                 GROUP BY rw.reporting_work_id  -- 鎸� reporting_work_id 杩涜鍒嗙粍锛岀‘淇濆敮涓�
+
+             ) AS subquery;
+
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0