zhoushihao
2025-01-16 56599835685c0deb29601d9eb287b9436324b824
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -222,4 +222,29 @@
        group by device_id, slot
        order by sequence
    </select>
    <select id="queryPairGlassList" resultType="com.mes.hollow.entity.HollowBigStorageCageDetails">
        with hollow_sequence_temp as (
        SELECT hollow_sequence, count(distinct layer) as count
        FROM hollow_big_storage_cage_details
        WHERE flow_card_id = #{flowCardId}
        <if test="isOut == 0">
            AND STATE = 100
        </if>
        GROUP BY hollow_sequence
        having count = #{totalLayer}
        limit #{totalPairQuantity}
        ),
        hollow_details as (select *
        from hollow_big_storage_cage_details
        WHERE flow_card_id = #{flowCardId}
        <if test="isOut == 0">
            AND STATE = 100
        </if>
        )
        select *
        from hollow_details t
        inner join hollow_sequence_temp t1 on t.hollow_sequence = t1.hollow_sequence
        ORDER BY t.hollow_sequence
    </select>
</mapper>