From 1195e51e67436cf2b9513678b5e9d3f27a043de4 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 22 十二月 2025 08:29:40 +0800
Subject: [PATCH] 1、中空选中除膜改为多选 2、流程卡报工情况查询添加工程号条件,添加线路,备注显示

---
 hangzhoumesParent/common/servicebase/src/main/resources/mapper/DamageMapper.xml |  155 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 154 insertions(+), 1 deletions(-)

diff --git a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/DamageMapper.xml b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/DamageMapper.xml
index 223b6c4..8ba3c39 100644
--- a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/DamageMapper.xml
+++ b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/DamageMapper.xml
@@ -6,12 +6,14 @@
         SELECT glass_id,
                order_number,
                technology_number,
-               working_procedure
+               working_procedure,
+               type
         FROM (
                  SELECT glass_id,
                         order_number,
                         technology_number,
                         working_procedure,
+                        type,
                         ROW_NUMBER() OVER (
       PARTITION BY glass_id
       ORDER BY damage_time DESC
@@ -45,4 +47,155 @@
             </if>
         </where>
     </select>
+    <select id="queryProgress" resultType="com.mes.damage.entity.vo.GlassDamageVO">
+        SELECT
+        t.glass_id,
+        t.glass_type,
+        t.flow_card_id,
+        t.layer,
+        t1.damage_time,
+        t.width,
+        t.height,
+        t.thickness,
+        t.filmsid,
+        t2.process AS working_procedure,
+        t1.device_name,
+        ifnull(t1.type,0) as type,
+        ifnull(t1.status,0) as status,
+        t1.line,
+        t1.remark
+        FROM (
+        SELECT '鍒囧壊' AS process FROM DUAL
+        UNION ALL
+        SELECT '纾ㄨ竟' AS process FROM DUAL
+        UNION ALL
+        SELECT '閽㈠寲' AS process FROM DUAL
+        ) t2
+        LEFT JOIN glass_info t ON
+        <!-- 鎶界澶氬瓧娈礗N鏉′欢锛氫娇鐢ㄥ弬鏁版浛鎹㈠浐瀹氬�� -->
+        (t.engineer_id, t.flow_card_id, t.layer, t.glass_type) IN
+        <foreach collection="conditionList" item="item" open="(" separator="," close=")">
+            (#{item.engineerId},#{item.flowCardId}, #{item.layer}, #{item.glassType})
+        </foreach>
+        <if test="workingProcedureList != null and workingProcedureList.size() > 0">
+            AND t2.process IN
+            <foreach collection="workingProcedureList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="glassId != null and glassId != ''">
+            AND t.glass_id = #{glassId}
+        </if>
+        LEFT JOIN damage t1 ON t.glass_id = t1.glass_id AND t1.working_procedure = t2.process
+        where 1=1
+        <!-- 鎶界t1.type鏉′欢 -->
+        <if test="typeList != null and typeList.size() > 0">
+            AND t1.type IN
+            <foreach collection="typeList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+    <select id="queryFlowCardIdProgress" resultType="com.mes.damage.entity.vo.FlowCardDamageVO">
+        WITH glass_info_result AS (
+        SELECT
+        engineer_id,
+        flow_card_id,
+        layer,
+        glass_type,
+        thickness,
+        filmsid,
+        width,
+        height,
+        count(*) AS total_quantity
+        FROM
+        glass_info
+        WHERE
+        1=1
+        <if test="flowCardId != null and flowCardId != ''">
+            AND flow_card_id = #{flowCardId}
+        </if>
+        <if test="engineerId != null and engineerId != ''">
+            AND engineer_id = #{engineerId}
+        </if>
+        <if test="glassId != null and glassId != ''">
+            and (flow_card_id, layer, glass_type) IN (select flow_card_id, layer, glass_type from glass_info where
+            glass_id=#{glassId} )
+        </if>
+        GROUP BY
+        engineer_id,
+        flow_card_id,
+        layer,
+        glass_type,
+        thickness,
+        filmsid,
+        width,
+        height
+        ),
+        damage_result AS (
+        SELECT
+        engineer_id,
+        process_id,
+        technology_number,
+        order_number,
+        working_procedure,
+        type,
+        count(*) AS report_quantity
+        FROM
+        damage
+        WHERE
+        1=1
+        <if test="flowCardId != null and flowCardId != ''">
+            AND process_id = #{flowCardId}
+        </if>
+        <if test="engineerId != null and engineerId != ''">
+            AND engineer_id = #{engineerId}
+        </if>
+        <if test="glassId != null and glassId != ''">
+            AND (process_id, technology_number, order_number) IN (select flow_card_id, layer, glass_type from glass_info
+            where glass_id=#{glassId} )
+        </if>
+        GROUP BY
+        engineer_id,
+        process_id,
+        technology_number,
+        order_number,
+        working_procedure,
+        type
+        ),
+        final_result AS (
+        SELECT
+        t.*,
+        sum( CASE WHEN t1.working_procedure = "鍒囧壊" AND t1.type = 1 THEN report_quantity ELSE 0 END ) -
+        sum( CASE WHEN (t1.working_procedure = "纾ㄨ竟" or t1.working_procedure="閽㈠寲" or t1.working_procedure="涓┖") AND
+        t1.type = 8 THEN report_quantity ELSE 0 END ) AS cutting,
+        sum( CASE WHEN t1.working_procedure = "纾ㄨ竟" AND t1.type = 1 THEN report_quantity ELSE 0 END ) -
+        sum( CASE WHEN (t1.working_procedure="閽㈠寲" or t1.working_procedure="涓┖") AND t1.type = 8 THEN report_quantity
+        ELSE 0 END ) AS edging,
+        sum( CASE WHEN t1.working_procedure = "閽㈠寲" AND t1.type = 1 THEN report_quantity ELSE 0 END ) -
+        sum( CASE WHEN (t1.working_procedure="涓┖") AND t1.type = 8 THEN report_quantity ELSE 0 END ) AS temping
+        FROM
+        glass_info_result t
+        LEFT JOIN damage_result t1 ON t.engineer_id = t1.engineer_id
+        AND t.flow_card_id = t1.process_id
+        AND t.layer = t1.technology_number
+        AND t.glass_type = t1.order_number
+        GROUP BY
+        t.engineer_id,
+        t.flow_card_id,
+        t.layer,
+        t.glass_type,
+        t.thickness,
+        t.filmsid,
+        t.width,
+        t.height,
+        t.total_quantity
+        order by
+        t.engineer_id,
+        t.flow_card_id,
+        t.glass_type,
+        t.layer
+        )
+        select * from final_result;
+    </select>
 </mapper>

--
Gitblit v1.8.0