wangfei
2025-09-04 721e56d2156cd820beaabd8b4e3e5c06fd87c809
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -36,7 +36,7 @@
                (#{item.glassId}, #{item.targetSlot})
            </foreach>
            )
            and state !=101
            and state not in (8, 9, 101)
        </where>
    </update>
    <update id="updateDeviceIdBySlot">
@@ -52,7 +52,8 @@
    <select id="hollowIsAll" resultMap="baseMap">
        WITH sum_flow_layer_count AS ( SELECT flow_card_id, layer, min( films_id ) AS films_id, min(thickness) as
        thickness,count(*) AS sum_count FROM hollow_glass_relation_info GROUP BY flow_card_id, layer ),
        real_flow_layer_count AS ( SELECT flow_card_id, layer, count(*) AS real_count FROM
        real_flow_layer_count AS ( SELECT flow_card_id, layer, count(*) AS real_count, count(distinct slot) as
        slot_count FROM
        hollow_big_storage_cage_details t WHERE state = 100 GROUP BY flow_card_id, layer ),
        damage_flow_layer_count AS ( SELECT process_id AS flow_card_id, technology_number AS layer, count(*) as
        damage_count FROM damage where type in(8,9) GROUP BY process_id, technology_number ),
@@ -99,7 +100,8 @@
        IFNULL( t3.pair_count, 0 ) AS pair_count,
        IFNULL( real_count, 0 ) AS real_count,
        IFNULL( damage_count, 0 ) AS damage_count,
        IFNULL( lack_count, 0 ) AS lack_count
        IFNULL( lack_count, 0 ) AS lack_count,
        IFNULL(slot_count,0) AS slot_count
        FROM
        sum_flow_layer_count t
        LEFT JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id
@@ -118,6 +120,7 @@
        <if test="flag == true">
            and sum_count = pair_count
        </if>
        order by layer
    </select>
    <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO">
@@ -207,11 +210,12 @@
        </if>
    </select>
    <select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO">
        SELECT SLOT, COUNT(1) AS COUNT
        FROM HOLLOW_BIG_STORAGE_CAGE_DETAILS
        where state in (100, 102, 103, 104)
        group by SLOT
        ORDER BY SLOT
        select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count
        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
        order by hbsc.device_id, hbsc.slot
    </select>
    <select id="querySlotMaxSequence" resultType="com.mes.hollow.entity.HollowBigStorageCageDetails">
        select max(sequence) as sequence, device_id, slot
@@ -247,4 +251,10 @@
        inner join hollow_sequence_temp t1 on t.hollow_sequence = t1.hollow_sequence
        ORDER BY t.hollow_sequence
    </select>
    <select id="queryFlowCardIdsAndLayer" resultType="com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO">
        select flow_card_id, layer
        from hollow_big_storage_cage_details
        where state in (100, 102, 103, 104)
        group by flow_card_id, layer
    </select>
</mapper>