From aa5d2f68e1d97f7a1b20fa15e1bde9195544bb3e Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 11 十一月 2025 15:15:06 +0800
Subject: [PATCH] 1、钢化查询添加显示工程名称 2、中空任务界面缺片详情修改
---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml | 199 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 166 insertions(+), 33 deletions(-)
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
index 996634b..4c2d064 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
@@ -32,6 +32,7 @@
<resultMap id="temperingGlassCount" type="com.mes.bigstorage.entity.dto.TemperingGlassCountDTO">
<result column="engineer_id" property="engineerId"/>
+ <result column="engineer_name" property="engineerName"/>
<result column="tempering_layout_id" property="temperingLayoutId"/>
<result column="films_id" property="filmsId"/>
<result column="thickness" property="thickness"/>
@@ -76,7 +77,7 @@
WHERE ENGINEER_ID = #{engineerId}
AND TEMPERING_LAYOUT_ID = #{temperingLayoutId}
GROUP BY ENGINEER_ID,
- TEMPERING_LAYOUT_ID) T1
+ TEMPERING_LAYOUT_ID) T1
ON T.ENGINEER_ID = T1.ENGINEER_ID
AND T.TEMPERING_LAYOUT_ID = T1.TEMPERING_LAYOUT_ID
AND T.COUNT = T1.COUNT
@@ -89,14 +90,14 @@
T.TEMPERING_LAYOUT_ID,
COUNT(T.TEMPERING_FEED_SEQUENCE) AS COUNT
FROM GLASS_INFO T
- LEFT JOIN DAMAGE T1
- ON T.ENGINEER_ID = T1.ENGINEER_ID
- AND T.GLASS_ID = T1.GLASS_ID
- AND (T1.TYPE = 8
- OR T1.TYPE = 9)
+ LEFT JOIN DAMAGE T1
+ ON T.ENGINEER_ID = T1.ENGINEER_ID
+ AND T.GLASS_ID = T1.GLASS_ID
+ AND (T1.TYPE = 8
+ OR T1.TYPE = 9)
WHERE T1.GLASS_ID IS NULL
GROUP BY T.ENGINEER_ID,
- T.TEMPERING_LAYOUT_ID
+ T.TEMPERING_LAYOUT_ID
) T2
INNER JOIN (SELECT ENGINEER_ID, TEMPERING_LAYOUT_ID, COUNT(TEMPERING_FEED_SEQUENCE) AS COUNT
FROM BIG_STORAGE_CAGE_DETAILS
@@ -166,9 +167,9 @@
<select id="selectTemperingGlassCount" resultMap="temperingGlassCount">
with glass_info_temp as (
- select engineer_id, tempering_layout_id, count(*) as total_count
- from glass_info
- group by engineer_id, tempering_layout_id
+ select t.engineer_id,t1.engineer_name, t.tempering_layout_id, count(*) as total_count
+ from glass_info t inner join engineering t1 on t.engineer_id=t1.engineer_id
+ group by t.engineer_id, t.tempering_layout_id
),
big_details_temp as (
select engineer_id, tempering_layout_id, count(*) as real_count, films_id, thickness
@@ -186,11 +187,12 @@
damage_temp as (
select engineer_id, tempering_layout_id, count(*) as damage_count
from damage
- where type in(8,9)
+ where type in(8,9) and STATUS = 1
group by engineer_id, tempering_layout_id
),
result as (
select t.engineer_id,
+ t1.engineer_name,
t.tempering_layout_id,
t.films_id,
t.thickness,
@@ -212,27 +214,31 @@
<select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO">
with relation_temp as (
- select engineer_id, tempering_layout_id, virtual_slot, count(1) as slot_count
- from big_storage_glass_relation_info
- group by engineer_id, tempering_layout_id, virtual_slot
+ select engineer_id, tempering_layout_id, virtual_slot, count(1) as slot_count
+ from big_storage_glass_relation_info
+ group by engineer_id, tempering_layout_id, virtual_slot
),
- details_temp as (
- select t.engineer_id, t.tempering_layout_id, t.virtual_slot, count(1) as slot_count
- from big_storage_glass_relation_info t
- left join big_storage_cage_details t1 on
- t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
- t.tempering_feed_sequence = t1.tempering_feed_sequence
- where t1.state = 100
- group by t.engineer_id, t.tempering_layout_id, t.virtual_slot
- ),
- result_one as (
- select t.*, t1.slot_count as tslot_count
- from relation_temp t
- INNER JOIN details_temp t1 on t.engineer_id = t1.engineer_id and
- t.tempering_layout_id = t1.tempering_layout_id and
- t.virtual_slot = t1.virtual_slot
- where t.slot_count = t1.slot_count
- )
+ details_temp as (
+ select t.engineer_id, t.tempering_layout_id, t.virtual_slot, count(1) as slot_count
+ from big_storage_glass_relation_info t
+ left join big_storage_cage_details t1 on
+ t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+ t.tempering_feed_sequence = t1.tempering_feed_sequence
+ where t1.state = 100
+ AND T1.DEVICE_ID IN
+ <foreach collection="deviceIdList" item="item" open='(' close=')' separator=','>
+ #{item}
+ </foreach>
+ group by t.engineer_id, t.tempering_layout_id, t.virtual_slot
+ ),
+ result_one as (
+ select t.*, t1.slot_count as tslot_count
+ from relation_temp t
+ INNER JOIN details_temp t1 on t.engineer_id = t1.engineer_id and
+ t.tempering_layout_id = t1.tempering_layout_id and
+ t.virtual_slot = t1.virtual_slot
+ where t.slot_count = t1.slot_count
+ )
select engineer_id, tempering_layout_id, virtual_slot
from result_one
order by engineer_id, tempering_layout_id
@@ -292,9 +298,136 @@
<select id="querybigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO">
select bsc.device_id, bsc.slot, count(bscd.glass_id) as count
from big_storage_cage bsc
- left join big_storage_cage_details bscd
- on bsc.slot = bscd.slot and bscd.state in (100, 102, 103, 104)
+ left join big_storage_cage_details bscd
+ on bsc.slot = bscd.slot and bscd.state in (100, 102, 103, 104)
group by bsc.device_id, bsc.slot
order by bsc.device_id, bsc.slot
</select>
+ <select id="queryNeedDispatch" resultType="com.mes.bigstorage.entity.BigStorageCageDetails">
+ SELECT *
+ FROM big_storage_cage_details
+ WHERE STATE = 100
+ AND SLOT =
+ (SELECT SLOT FROM big_storage_cage_details WHERE STATE = 100 AND sequence = 1 order by slot desc LIMIT 1)
+ ORDER BY tempering_feed_sequence
+ </select>
+
+ <select id="queryNeedDispatchSlotBySequence" resultType="com.mes.bigstorage.entity.dto.BigStorageSlotDTO">
+ with glass_temp as (
+ select t.*, t1.virtual_slot, t1.slot_sequence
+ from big_storage_cage_details t
+ inner join
+ big_storage_glass_relation_info t1 on t.engineer_id = t1.engineer_id
+ and t.tempering_layout_id = t1.tempering_layout_id
+ and t.tempering_feed_sequence = t1.tempering_feed_sequence
+ where t.state = 100
+ )
+ , slot_max_temp as (
+ select ROW_NUMBER() over(PARTITION by engineer_id, tempering_layout_id, virtual_slot order by slot_sequence desc)
+ as rn,t.*
+ from glass_temp t
+ where t.device_id in (5, 6)
+ )
+ , slot_max_message as (select * from slot_max_temp where rn = 1)
+ , slot_min_temp as (
+ select ROW_NUMBER() over(PARTITION by engineer_id, tempering_layout_id, virtual_slot order by slot_sequence) as
+ rn,t.*
+ from glass_temp t
+ where t.device_id in (5, 6)
+ )
+ , slot_min_message as (select * from slot_min_temp where rn = 1)
+ , result as (
+ select t.slot as target_slot, t1.slot as start_slot
+ from slot_max_message t
+ inner join slot_min_message t1 on
+ t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+ t.virtual_slot =
+ t1.virtual_slot and t.tempering_layout_id = t1.tempering_layout_id and t.tempering_feed_sequence =
+ t1.tempering_feed_sequence - 1
+ )
+ select *
+ from result limit 1
+ </select>
+ <select id="queryTemperingGlassCountSummary" resultMap="temperingGlassCount">
+ with glass_info_temp as (
+ select engineer_id, tempering_layout_id, count(*) as total_count
+ from glass_info
+ group by engineer_id, tempering_layout_id
+ ),
+ big_details_temp as (
+ select engineer_id, tempering_layout_id, count(*) as real_count, films_id, thickness
+ from big_storage_cage_details
+ where state = 100
+ <if test="isTempering == 0">
+ and tempering_layout_id = 0
+ </if>
+ <if test="isTempering == 1">
+ and tempering_layout_id != 0
+ </if>
+
+ group by engineer_id, tempering_layout_id, films_id, thickness
+ ),
+ damage_temp as (
+ select engineer_id, tempering_layout_id, count(*) as damage_count
+ from damage
+ where type in(8,9) and STATUS = 1
+ group by engineer_id, tempering_layout_id
+ ),
+ result as (
+ select t.engineer_id,
+ t.tempering_layout_id,
+ t.films_id,
+ t.thickness,
+ total_count,
+ real_count,
+ ifnull(damage_count, 0) as damage_count,
+ case when total_count - real_count - ifnull(damage_count, 0) < 0 then 0 else
+ total_count - real_count - ifnull(damage_count, 0) end as lack_count
+ from big_details_temp t
+ inner join glass_info_temp t1 on t.engineer_id = t1.engineer_id and
+ t.tempering_layout_id = t1.tempering_layout_id
+ left join damage_temp t2
+ on t.engineer_id = t2.engineer_id and t.tempering_layout_id = t2.tempering_layout_id
+ ),
+ -- 浜屾姹囨�诲眰
+ secondary_summary as (
+ select
+ engineer_id,
+ films_id,
+ thickness,
+ count(distinct tempering_layout_id) as total_count, -- 璁$畻totalCount鐨勭疮璁℃暟锛堝幓閲嶈鏁帮級
+ sum(total_count) as real_count -- 璁$畻realCount鐨勬�诲拰
+ from result
+ group by engineer_id, films_id, thickness
+ )
+ select *
+ from secondary_summary
+ order by engineer_id, films_id, thickness
+ </select>
+ <select id="queryVerticalSheetCageDetailsList"
+ resultType="com.mes.bigstorage.entity.vo.BigCageDetailsVO">
+ SELECT t.id,t.device_id,t.slot,t.remain_width ,t.enable_state,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 big_storage_cage t
+ left join 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>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0