lanan-system/dl-module-inspection/src/main/resources/mapper/inspection/InspectionFileMapper.xml

33 lines
1.4 KiB
XML
Raw Normal View History

2024-08-28 20:54:03 +08:00
<?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="cn.iocoder.yudao.module.inspection.mapper.InspectionFileMapper">
<select id="selectInspectionFileList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionFile">
select * from inspection_file
<where>
2024-10-11 18:53:33 +08:00
and partner_id = #{vo.partnerId}
2024-08-28 20:54:03 +08:00
<choose>
2024-10-11 18:53:33 +08:00
<when test="vo.fatherId != null and vo.fatherId != ''">
and father_id = #{vo.fatherId}
2024-08-28 20:54:03 +08:00
</when>
<otherwise>
and father_id is null
</otherwise>
</choose>
2024-10-11 18:53:33 +08:00
<if test="vo.type != null and vo.type != ''"> and type = #{vo.type}</if>
<if test="vo.fileName != null and vo.fileName != ''"> and file_name like concat('%', #{vo.fileName}, '%')</if>
2024-08-28 20:54:03 +08:00
<if test="params.beginWarnTime != null and params.beginWarnTime != '' and params.endWarnTime != null and params.endWarnTime != ''"> and warn_time between #{params.beginWarnTime} and #{params.endWarnTime}</if>
</where>
order by `type` ASC,create_time desc
</select>
<select id="selectInspectionFileById" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionFile">
select * from inspection_file
where id = #{id}
</select>
</mapper>