zhoushihao
2025-10-23 261698358e2b756a61e992bc1651e01b3f45290b
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -43,7 +43,7 @@
        t.filmsId,
        t.thickness,
        case
        when type in (7, 8) and status = 1 then ''
        when type in (8, 9) and status = 1 then ''
        else t1.working_procedure end as working_procedure,
        ROW_NUMBER() OVER (PARTITION BY t1.glass_id ORDER BY t1.id DESC) as rn
        FROM detail_temp t
@@ -105,7 +105,7 @@
                     t.width,
                     t.height,
                     COUNT(DISTINCT t.glass_id) as lack_count,
                     COUNT(DISTINCT CASE WHEN t1.type IN (7,8) AND t1.status = 1 THEN t.glass_id END) as damage_count
                     COUNT(DISTINCT CASE WHEN t1.type IN (8,9) AND t1.status = 1 THEN t.glass_id END) as damage_count
                 FROM detail_temp t
                          LEFT JOIN damage_latest t1 ON t.glass_id = t1.glass_id
                 GROUP BY
@@ -150,7 +150,7 @@
                   t.filmsId,
                   t.thickness,
                   case
                       when type in (7, 8) and status = 1 then ''
                       when type in (8, 9) and status = 1 then ''
                       else t1.working_procedure end as working_procedure,
                   ROW_NUMBER()                         OVER (PARTITION BY t1.glass_id ORDER BY t1.id DESC) as rn
            FROM detail_temp t
@@ -167,14 +167,17 @@
    <update id="clearDirtyFlowCardData">
        update tempering_glass_relation_info
        set shelf_order = null
          , state       = 0
        update hollow_glass_relation_info
        set glass_id                = null,
            tempering_layout_id     = null,
            tempering_feed_sequence = null,
            engineer_id             = null,
            state                   = 0
        where flow_card_id = #{flowCardId}
          and layer = #{layer}
          and shelf_order not in (
            select shelf_order
            from vertical_sheet_cage_details
          and glass_id not in (
            select glass_id
            from hollow_big_storage_cage_details
            where flow_card_id = #{flowCardId}
              and layer = #{layer}
              and state in (100, 102, 103, 104)