From d6d8e246fa97bca67c990f0b3db2d96383be9255 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期三, 16 四月 2025 17:52:32 +0800
Subject: [PATCH] 焊缝统计表-确认数据问题
---
aps-modules/aps-core/src/main/resources/mapper/core/ApsWeldSeamMapper.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsWeldSeamMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsWeldSeamMapper.xml
index 5cf207c..5b9b3fa 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsWeldSeamMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsWeldSeamMapper.xml
@@ -155,21 +155,51 @@
</delete>
<select id="weldSeamStat" parameterType="java.util.List" resultType="com.aps.core.domain.ApsWeldSeamStatistics">
SELECT produce_year as year,
- produce_month as month,
- production_base as productionBase,
- SUM ( CASE WHEN work_order_type = '0' AND classification = '1' THEN production_quantity ELSE 0 END ) AS pipingOrderRequirement,
- SUM ( CASE WHEN work_order_type = '0' AND classification = '0' THEN production_quantity ELSE 0 END ) AS gasOrderRequirement,
- SUM ( CASE WHEN work_order_type = '1' AND classification = '1' THEN production_quantity ELSE 0 END ) AS pipingPredictionRequirement,
- SUM ( CASE WHEN work_order_type = '1' AND classification = '0' THEN production_quantity ELSE 0 END ) AS gasPredictionRequirement
+ produce_month as month,
+ production_base as productionBase,
+ work_order_type as workOrderType,
+ classification,
+ sum(total_weld_seam) as total
+ FROM aps_weld_seam where del_flag='0'
+ GROUP BY produce_year, produce_month, production_base, work_order_type, classification
+ </select>
+ <update id="removeLastBatch" parameterType="String">
+ update aps_weld_seam set del_flag='1' where del_flag='0'
+ </update>
+
+ <select id="weldSeamEcharts" parameterType="java.util.List" resultType="map">
+
+ SELECT
+ seam.produce_year,
+ seam.produce_month,
+ seam.production_base,
+ workOrderType.dict_label AS work_order_name,
+ classification.dict_label AS classification_name,
+ SUM ( seam.total_weld_seam ) AS total_weld_seam
FROM
- "aps_weld_seam"
- where 1=1
- <foreach item="item" index="index" collection="list" separator=",">
- or ( produce_year=#{item.produceYear} and produce_month=#{item.produceMonth} and production_base=#{item.productionBase})
- </foreach>
+ aps_weld_seam seam
+ LEFT JOIN sys_dict_data workOrderType ON seam.work_order_type = workOrderType.dict_value
+ AND workOrderType.dict_type = 'aps_weld_work_order_type'
+ LEFT JOIN sys_dict_data classification ON seam.classification = classification.dict_value
+ AND classification.dict_type = 'aps_weld_classification'
+ <where>
+ <if test="produceYears != null "> and produce_year in
+ <foreach item="produceYear" collection="produceYears" open="(" separator="," close=")">
+ #{produceYear}
+ </foreach>
+ </if>
+ <if test="produceMonths != null "> and produce_month in
+ <foreach item="produceMonth" collection="produceMonths" open="(" separator="," close=")">
+ #{produceMonth}
+ </foreach>
+ </if>
+ </where>
GROUP BY
- produce_year,
- produce_month,
- production_base
+ seam.produce_year,
+ seam.produce_month,
+ seam.production_base,
+ workOrderType.dict_label,
+ classification.dict_label
+
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3