From 65232e8416d83a977936aa8754c6c662132a1be5 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期五, 16 五月 2025 15:12:53 +0800
Subject: [PATCH] 提交查询基础数据缓慢问题
---
north-glass-erp/src/main/resources/mapper/pp/Report.xml | 77 +++++++++++++++++++++++++++++---------
1 files changed, 58 insertions(+), 19 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 a1ed2a8..18c902f 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -1339,7 +1339,7 @@
rw.examine_time,
-- GROUP_CONCAT(ogd.glass_child SEPARATOR '+') as workProcessName
CASE
- WHEN #{laminating} = 'laminating' THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+')
+ WHEN LOCATE('step',#{laminating})>0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+')
ELSE MAX( ogd.glass_child )
END AS workProcessName
FROM
@@ -1368,12 +1368,25 @@
and od.edging_type regexp #{teamOutputDTO.edgingType}
</if>
- 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
+ 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,
@@ -1468,12 +1481,25 @@
and od.edging_type regexp #{teamOutputDTO.edgingType}
</if>
- 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
+ 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,
@@ -2070,12 +2096,25 @@
<if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''">
and od.edging_type regexp #{teamOutputDTO.edgingType}
</if>
- 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
+ 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