liding
2026-11-05 d28a5401ac1e2995ec6de12a81395aa5d05b040a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
<mapper namespace="com.ruoyi.process.mapper.InspectionOrderAttachmentMapper">
    <select id="selectVisibleAttachments" resultType="com.ruoyi.process.pojo.InspectionOrderAttachment">
        select a.*
        from cnas_inspection_order_attachment a
        left join ins_report r on r.id = a.ins_report_id
        where a.inspection_order_id = #{inspectionOrderId}
          and (a.source_type != 'REPORT' or r.is_ratify = 1)
        <if test="bindingId != null">
            and a.binding_id = #{bindingId}
        </if>
        order by a.create_time desc, a.id desc
    </select>
</mapper>