zhoushihao
2025-05-26 4d00b5a1923103b25ae4beaf26ba0a04b8d3ca4a
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -129,20 +129,33 @@
        from hollow_glass_relation_info
        where flow_card_id = #{flowCardId}
    </select>
    <select id="queryProductNameByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDetailsDTO">
        select t.product_name, t1.customer_name
        from sd.order_detail t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where (t.order_id, t.order_number) = (
            select min(order_id) as order_id, min(order_number) as order_number
            from pp.flow_card
            where process_id = #{flowCardId}
        )
        limit 1
    </select>
    <update id="clearDirtyFlowCardData">
        update hollow_glass_relation_info
        set glass_id = null,
            tempering_layout_id = null,
        set glass_id                = null,
            tempering_layout_id     = null,
            tempering_feed_sequence = null,
            engineer_id = null,
            state = 0
            engineer_id             = null,
            state                   = 0
        where flow_card_id = #{flowCardId}
          and layer = #{layer}
          and glass_id not in (
            select glass_id
            from hollow_big_storage_cage_details
            where flow_card_id = #{flowCardId} and layer = #{layer} and state = 100
            where flow_card_id = #{flowCardId}
              and layer = #{layer}
              and state in (100, 102, 103, 104)
        )
    </update>
</mapper>