<?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>
|