From fd35c0ee025e8f5471acd4075af33b9f59f4d817 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期四, 05 十二月 2024 13:39:11 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject

---
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
index 0c164f2..9611a10 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
@@ -99,6 +99,7 @@
                 (#{item.glassId}, #{item.targetSlot})
             </foreach>
             )
+            and state !=101
         </where>
     </update>
 
@@ -134,7 +135,9 @@
              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.glass_id = t1.glass_id
+                          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
              ),
@@ -153,16 +156,20 @@
 
     <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO">
         with glass_id_temp as (
-            select glass_id
+            select engineer_id, tempering_layout_id, tempering_feed_sequence
             from big_storage_glass_relation_info
             where (engineer_id, tempering_layout_id, virtual_slot) =
                   (#{engineerId}, #{temperingLayoutId}, #{virtualSlot})
         )
-        select t.slot, max(t1.slot_sequence) as max_sequence, min(t1.slot_sequence) as min_sequence
+        select t.slot, max(t1.tempering_feed_sequence) as max_sequence, min(t1.tempering_feed_sequence) as min_sequence
         from big_storage_cage_details t
-                 inner join big_storage_glass_relation_info t1 on t.glass_id = t1.glass_id
-        where t.glass_id in (select * from glass_id_temp)
+                 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.engineer_id, t.tempering_layout_id, t.tempering_feed_sequence) in
+              (select engineer_id, tempering_layout_id, tempering_feed_sequence from glass_id_temp)
+          and t.state = 100
         group by t.slot
-        order by max_sequence
+        order by max_sequence desc
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0