| | |
| | | (#{item.glassId}, #{item.targetSlot}) |
| | | </foreach> |
| | | ) |
| | | and state !=101 |
| | | </where> |
| | | </update> |
| | | |
| | |
| | | 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 |
| | | ), |
| | |
| | | |
| | | <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 |
| | | </select> |