| | |
| | | <!--自定义分页查询--> |
| | | <select id="selectAttachPage" resultType="org.sxkj.resource.vo.AttachVO"> |
| | | select |
| | | ba.*, |
| | | bd.dept_name, |
| | | coalesce(ba.nick_name,ba.original_name) nickName |
| | | ba.*, |
| | | bd.dept_name, |
| | | coalesce(ba.nick_name,ba.original_name) nickName |
| | | from |
| | | blade_attach ba |
| | | blade_attach ba |
| | | left join |
| | | blade_dept bd on ba.create_dept = bd.id::VARCHAR |
| | | /* 修改点1:双向转为 text 对齐 */ |
| | | blade_dept bd on ba.create_dept::text = bd.id::text |
| | | where |
| | | ba.is_deleted = 0 |
| | | ba.is_deleted = 0 |
| | | <if test="attach.originalName!=null and attach.originalName!=''"> |
| | | and original_name like concat('%',#{attach.originalName},'%') |
| | | and ba.original_name like concat('%',#{attach.originalName},'%') |
| | | </if> |
| | | <if test="attach.resultType!=null"> |
| | | and result_type = #{attach.resultType} |
| | | /* 修改点2:如果 resultType 是字符串传入,也需加权转 */ |
| | | and ba.result_type::text = #{attach.resultType}::text |
| | | </if> |
| | | <if test="attach.deptList != null and attach.deptList.size > 0"> |
| | | and ba.create_dept in |
| | | and ba.create_dept::text in |
| | | <foreach collection="attach.deptList" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | #{deptId}::text |
| | | </foreach> |
| | | </if> |
| | | and result_type in (1,2,3,4,5) |
| | | order by create_time desc,id desc |
| | | /* 修改点3:result_type 如果是字符型字段,数字必须加单引号 */ |
| | | and ba.result_type::text in ('1','2','3','4','5') |
| | | order by ba.create_time desc, ba.id desc |
| | | </select> |
| | | |
| | | <select id="findAiAttachImages" resultType="org.sxkj.resource.vo.AttachVO"> |
| | | select |
| | | DISTINCT attach.id, |