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/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml | 189 +++++++++++++++++++++++++++++++++--------------
1 files changed, 133 insertions(+), 56 deletions(-)
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
index ba5ade2..f84700f 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -196,6 +196,13 @@
on t.flow_card_id = t1.flow_card_id and t.hollow_sequence = t1.hollow_sequence
where t.state = 100
and t.flow_card_id = #{flowCardId}
+ <if test="list != null and list.size() > 0">
+ and t.layer in (
+ <foreach collection="list" item="item" separator=",">
+ #{item}
+ </foreach>
+ )
+ </if>
)
select *
from result_detail
@@ -205,11 +212,14 @@
</if>
</select>
<select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO">
- select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count
+ select hbsc.device_id,
+ hbsc.slot,
+ hbscd.glass_id,
+ if(hbscd.width > hbscd.height, hbscd.width, hbscd.height) as length
from hollow_big_storage_cage hbsc
left join hollow_big_storage_cage_details hbscd
on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104)
- group by hbsc.device_id, hbsc.slot
+ group by hbsc.device_id, hbsc.slot, hbscd.glass_id
order by hbsc.device_id, hbsc.slot
</select>
<select id="querySlotMaxSequence" resultType="com.mes.hollow.entity.HollowBigStorageCageDetails">
@@ -255,14 +265,18 @@
<select id="queryHollowAllFlowCard" resultType="com.mes.hollow.entity.dto.FlowCardGlassInfoDTO">
WITH hollow_flow_temp AS (
- SELECT DISTINCT flow_card_id
- FROM hollow_big_storage_cage_details
- WHERE state = 100
+ SELECT DISTINCT
+ flow_card_id
+ FROM
+ hollow_big_storage_cage_details
+ WHERE
+ state = 100
<if test="flowCardId != null and flowCardId != ''">
- AND flow_card_id LIKE CONCAT('%', #{flowCardId}, '%')
+ AND flow_card_id LIKE CONCAT(
+ '%',#{flowCardId}, '%')
</if>
<if test="filmsId != null and filmsId != ''">
- AND films_id LIKE CONCAT('%', #{filmsId}, '%')
+ AND films_id LIKE CONCAT( '%', #{filmsId}, '%')
</if>
<if test="thickness != 0">
AND thickness = #{thickness}
@@ -277,50 +291,50 @@
layer,
total_layer,
hollow_sequence
- FROM hollow_big_storage_cage_details
- WHERE state = 100
+ FROM
+ hollow_big_storage_cage_details
+ WHERE
+ state = 100
<if test="flowCardId != null and flowCardId != ''">
- AND flow_card_id LIKE CONCAT('%', #{flowCardId}, '%')
+ AND flow_card_id LIKE CONCAT(
+ '%',#{flowCardId}, '%')
</if>
<if test="filmsId != null and filmsId != ''">
- AND films_id LIKE CONCAT('%', #{filmsId}, '%')
+ AND films_id LIKE CONCAT( '%', #{filmsId}, '%')
</if>
<if test="thickness != 0">
AND thickness = #{thickness}
</if>
),
- hollow_through_temp AS (
- SELECT
- flow_card_id,
- MIN(hollow_sequence) as hollow_sequence,
- MAX(total_layer) as total_layer
- FROM hollow_details_temp
- GROUP BY flow_card_id
- ),
+ hollow_through_temp AS ( SELECT flow_card_id, MIN( hollow_sequence ) AS hollow_sequence, MAX( total_layer ) AS
+ total_layer FROM hollow_details_temp GROUP BY flow_card_id ),
hollow_pair_temp AS (
SELECT
t1.flow_card_id,
COUNT(*) AS pair_count
- FROM hollow_details_temp t1
- INNER JOIN hollow_details_temp t2
- ON t1.flow_card_id = t2.flow_card_id
+ FROM
+ hollow_details_temp t1
+ INNER JOIN hollow_details_temp t2 ON t1.flow_card_id = t2.flow_card_id
AND t1.virtual_slot = t2.virtual_slot
AND t1.sequence = t2.sequence
- AND t1.layer = 1 AND t2.layer = 2
- WHERE NOT EXISTS (
- SELECT 1
- FROM hollow_through_temp ht
- WHERE ht.flow_card_id = t1.flow_card_id
- AND ht.total_layer = 3
- ) OR EXISTS (
- SELECT 1
- FROM hollow_details_temp t3
- WHERE t3.flow_card_id = t1.flow_card_id
+ AND t1.layer = 1
+ AND t2.layer = 2
+ WHERE
+ NOT EXISTS ( SELECT 1 FROM hollow_through_temp ht WHERE ht.flow_card_id = t1.flow_card_id AND ht.total_layer = 3
+ )
+ OR EXISTS (
+ SELECT
+ 1
+ FROM
+ hollow_details_temp t3
+ WHERE
+ t3.flow_card_id = t1.flow_card_id
AND t3.virtual_slot = t1.virtual_slot
AND t3.sequence = t1.sequence
AND t3.layer = 3
)
- GROUP BY t1.flow_card_id
+ GROUP BY
+ t1.flow_card_id
),
glass_info_temp AS (
SELECT
@@ -330,50 +344,113 @@
gi.layer,
gi.thickness,
gi.filmsId
- FROM hollow_flow_temp hft
+ FROM
+ hollow_flow_temp hft
INNER JOIN glass_info gi ON hft.flow_card_id = gi.flow_card_id
+ ),
+ glass_engineer_temp AS (
+ SELECT
+ distinct flow_card_id,
+ engineer_id
+ FROM
+ (
+ SELECT
+ gi.flow_card_id,
+ gi.engineer_id,
+ ROW_NUMBER() OVER ( PARTITION BY gi.flow_card_id, gi.layer ORDER BY COUNT( gi.glass_id ) DESC ) AS rn
+ FROM
+ hollow_flow_temp hft
+ INNER JOIN glass_info gi ON hft.flow_card_id = gi.flow_card_id
+ GROUP BY
+ gi.flow_card_id,
+ gi.layer,
+ gi.engineer_id
+ ) t
+ WHERE
+ rn = 1
+ ),
+ glass_result AS (
+ SELECT
+ count( t1.id ) AS sum_count,
+ t1.flow_card_id,
+ t1.layer
+ FROM
+ glass_engineer_temp t
+ INNER JOIN glass_info t1 ON t.engineer_id = t1.engineer_id
+ AND t.flow_card_id = t1.flow_card_id
+ GROUP BY
+ t1.flow_card_id,
+ t1.layer
),
damage_ranked AS (
SELECT
d.glass_id,
d.type,
- d.status,
- ROW_NUMBER() OVER(PARTITION BY d.glass_id ORDER BY d.id DESC) as rn
- FROM hollow_flow_temp hft
+ d.STATUS,
+ ROW_NUMBER() OVER ( PARTITION BY d.glass_id ORDER BY d.id DESC ) AS rn
+ FROM
+ hollow_flow_temp hft
INNER JOIN damage d ON hft.flow_card_id = d.process_id
),
- damage_latest AS (
- SELECT
- glass_id,
- type,
- status
- FROM damage_ranked
- WHERE rn = 1
- ),
+ damage_latest AS ( SELECT glass_id, type, STATUS FROM damage_ranked WHERE rn = 1 ),
result_temp AS (
SELECT
t.flow_card_id,
t.layer,
t.thickness,
t.filmsId,
- COUNT(DISTINCT t.id) as sum_count,
- COUNT(DISTINCT t1.glass_id) as real_count,
- COUNT(DISTINCT t.id) - COUNT(DISTINCT t1.glass_id) as lack_count,
- COUNT(DISTINCT CASE WHEN t2.type IN (7,8) AND t2.status = 1 THEN t.glass_id END) as damage_count
- FROM glass_info_temp t
+ COUNT( DISTINCT t1.glass_id ) AS real_count,
+ COUNT( DISTINCT CASE WHEN t2.type IN ( 7, 8 ) AND t2.STATUS = 1 THEN t.glass_id END ) AS damage_count
+ FROM
+ glass_info_temp t
LEFT JOIN hollow_details_temp t1 ON t.glass_id = t1.glass_id
LEFT JOIN damage_latest t2 ON t.glass_id = t2.glass_id
- GROUP BY t.flow_card_id, t.layer, t.thickness, t.filmsId
- )
- SELECT
+ GROUP BY
+ t.flow_card_id,
+ t.layer,
+ t.thickness,
+ t.filmsId
+ ) SELECT
t.*,
- COALESCE(t1.pair_count, 0) as pair_count,
+ t3.sum_count,
+ t3.sum_count - t.real_count AS lack_count,
+ COALESCE ( t1.pair_count, 0 ) AS pair_count,
t2.hollow_sequence,
t2.total_layer
- FROM result_temp t
+ FROM
+ result_temp t
LEFT JOIN hollow_pair_temp t1 ON t.flow_card_id = t1.flow_card_id
LEFT JOIN hollow_through_temp t2 ON t.flow_card_id = t2.flow_card_id
- ORDER BY t.flow_card_id
+ LEFT JOIN glass_result t3 ON t.flow_card_id = t3.flow_card_id
+ AND t.layer = t3.layer
+ ORDER BY
+ t.flow_card_id
+ </select>
+ <select id="queryVerticalSheetCageDetailsList"
+ resultType="com.mes.hollow.entity.vo.HollowBigCageDetailsVO">
+ SELECT t.id,t.device_id,t.slot,t.remain_width ,t.enable_state,t1.virtual_slot,total_layer,t1.engineer_id,
+ t1.id as detail_id,t1.device_id as detail_device_id ,t1.slot as
+ detail_slot,t1.engineer_id,t1.glass_id,t1.tempering_layout_id,t1.tempering_feed_sequence,
+ t1.flow_card_id,t1.layer,t1.width,t1.height,t1.thickness,t1.films_id
+ FROM hollow_big_storage_cage t
+ left join hollow_big_storage_cage_details t1 on t.slot = t1.slot
+ and t1.state in (100, 102, 103, 104)
+ <if test="filmsId != null and filmsId != ''">
+ and t1.films_id like CONCAT('%', #{filmsId}, '%')
+ </if>
+ <if test="flowCardId != null and flowCardId != ''">
+ and t1.flow_card_id like CONCAT('%', #{flowCardId}, '%')
+ </if>
+ <if test="engineerId != null and engineerId != ''">
+ and t1.engineer_id like CONCAT('%', #{engineerId}, '%')
+ </if>
+ <if test="glassId != null and glassId != ''">
+ and t1.glass_id like CONCAT('%', #{glassId}, '%')
+ </if>
+ <if test="thickness != -1">
+ and t1.thickness = #{thickness}
+ </if>
+ order by t.slot
</select>
--
Gitblit v1.8.0