hangzhoumesParent/common/servicebase/src/main/resources/mapper/DamageMapper.xml
@@ -58,28 +58,42 @@
        t.height,
        t.thickness,
        t.filmsid,
        t1.working_procedure,
        t2.process AS working_procedure,
        t1.device_name,
        t1.type
        FROM glass_info t
        LEFT JOIN damage t1 ON t.glass_id = t1.glass_id
        WHERE
        ifnull(t1.type,0) as type,
        ifnull(t1.status,0) as status,
        t1.line,
        t1.remark
        FROM (
        SELECT '切割' AS process FROM DUAL
        UNION ALL
        SELECT '磨边' AS process FROM DUAL
        UNION ALL
        SELECT '钢化' AS process FROM DUAL
        ) t2
        LEFT JOIN glass_info t ON
        <!-- 抽离多字段IN条件:使用参数替换固定值 -->
        (t.flow_card_id, t.layer, t.glass_type) IN
        (t.engineer_id, t.flow_card_id, t.layer, t.glass_type) IN
        <foreach collection="conditionList" item="item" open="(" separator="," close=")">
            (#{item.flowCardId}, #{item.layer}, #{item.glassType})
            (#{item.engineerId},#{item.flowCardId}, #{item.layer}, #{item.glassType})
        </foreach>
        <!-- 抽离t1.type条件 -->
        AND t1.type IN
        <foreach collection="typeList" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        AND t1.working_procedure IN
        <foreach collection="workingProcedureList" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="workingProcedureList != null and workingProcedureList.size() > 0">
            AND t2.process IN
            <foreach collection="workingProcedureList" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="glassId != null and glassId != ''">
            AND t1.glass_id = #{glassId}
            AND t.glass_id = #{glassId}
        </if>
        LEFT JOIN damage t1 ON t.glass_id = t1.glass_id AND t1.working_procedure = t2.process
        where 1=1
        <!-- 抽离t1.type条件 -->
        <if test="typeList != null and typeList.size() > 0">
            AND t1.type IN
            <foreach collection="typeList" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
    <select id="queryFlowCardIdProgress" resultType="com.mes.damage.entity.vo.FlowCardDamageVO">
@@ -176,6 +190,11 @@
        t.width,
        t.height,
        t.total_quantity
        order by
        t.engineer_id,
        t.flow_card_id,
        t.glass_type,
        t.layer
        )
        select * from final_result;
    </select>