zouyu
2 天以前 8035f6ea81274e01d64e16e91d40f1603931f0b6
inspect-server/src/main/resources/mapper/InsProductDeviationWarningMapper.xml
@@ -31,21 +31,27 @@
        LEFT JOIN ins_product ip ON ip.id = ipdw.ins_product_id
        LEFT JOIN structure_item_parameter sip ON sip.id = ip.structure_item_parameter_id
        LEFT JOIN ins_order io ON io.id = isa.ins_order_id
        LEFT JOIN structure_test_object sto ON sip.sample LIKE CONCAT('%"', sto.specimen_name, '"%')
        LEFT JOIN structure_test_object sto
        ON sip.sample LIKE CONCAT('%"', sto.specimen_name, '"%')
        LEFT JOIN ifs_inventory_quantity ifs ON ifs.id = io.ifs_inventory_id
        LEFT JOIN sys_dict_data dict
        ON dict.dict_type = 'material_prop_type'
        AND dict.dict_value = ifs.material_prop
        AND dict.dict_value NOT IN ('04Dlan', '03Package')
        WHERE
        sto.object_type != 3 -- 过滤条件:排除 object_type 为 3 的记录
        WHERE sto.object_type != 3
        <if test="dictValues != null and dictValues.size() > 0">
            AND ifs.material_prop IN
            <foreach collection="dictValues" item="value" open="(" separator="," close=")">
                #{value}
            </foreach>
        </if>
        <if test="dictValues == null or dictValues.size() == 0">
            AND 1 = 0
        </if>
        <if test="ew.sqlFirst != null">
            ${ew.sqlFirst}
        </if>
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            AND ${ew.customSqlSegment}
        </if>
        AND (ifs.material_prop IS NULL OR dict.dict_value IS NOT NULL)
        ) t
        ORDER BY t.detection_time DESC
    </select>
</mapper>