| | |
| | | <result column="original_name" property="originalName"/> |
| | | <result column="extension" property="extension"/> |
| | | <result column="attach_size" property="attachSize"/> |
| | | <result column="result_type" property="resultType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/> |
| | | </resultMap> |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectAttachPage" resultType="org.sxkj.resource.vo.AttachVO"> |
| | | <select id="selectAttachPage" resultMap="attachResultMap" > |
| | | select |
| | | ba.*, |
| | | bd.dept_name, |
| | |
| | | blade_dept bd on ba.create_dept::text = bd.id::text |
| | | where |
| | | ba.is_deleted = 0 |
| | | <if test="attach.originalName!=null and attach.originalName!=''"> |
| | | and ba.original_name like concat('%',#{attach.originalName},'%') |
| | | <if test="attach.nickName!=null and attach.nickName!=''"> |
| | | and ba.nick_name like concat('%',#{attach.nickName},'%') |
| | | </if> |
| | | <if test="attach.resultType!=null"> |
| | | /* 修改点2:如果 resultType 是字符串传入,也需加权转 */ |
| | | and ba.result_type::text = #{attach.resultType}::text |
| | | <if test="attach.resultType!=null and attach.resultType!='' "> |
| | | /* 将逗号分隔的字符串转换为带引号的格式,如 "road,road1" 转为 "\"road\",\"road1\"" */ |
| | | and ba.result_type like concat('%', |
| | | ( |
| | | select string_agg(concat('"', trim(arr_val), '"'), ',') |
| | | from unnest(string_to_array(#{attach.resultType}, ',')) as arr_val |
| | | ), |
| | | '%') |
| | | </if> |
| | | <if test="attach.deptList != null and attach.deptList.size > 0"> |
| | | and ba.create_dept::text in |
| | |
| | | #{deptId}::text |
| | | </foreach> |
| | | </if> |
| | | /* 修改点3:result_type 如果是字符型字段,数字必须加单引号 */ |
| | | and ba.result_type::text in ('1','2','3','4','5') |
| | | order by ba.create_time desc, ba.id desc |
| | | order by ba.create_time desc, ba.id desc |
| | | </select> |
| | | |
| | | <select id="findAiAttachImages" resultType="org.sxkj.resource.vo.AttachVO"> |
| | |
| | | and job.job_info_id is not null |
| | | <if test="attach.startTime!=null and attach.startTime!='' and attach.endTime!=null and attach.endTime!=''"> |
| | | and (DATE_FORMAT(FROM_UNIXTIME(job.execute_time/1000,'%Y-%m-%d %H:%i:%s'),'%Y-%m-%d %H:%i:%s') between |
| | | #{attach.startTime} and #{attach.endTime} or rela.create_time between #{attach.startTime} and #{attach.endTime} ) |
| | | #{attach.startTime} and #{attach.endTime} or rela.create_time between #{attach.startTime}::timestamp and #{attach.endTime}::timestamp ) |
| | | </if> |
| | | <if test="attach.name!=null and attach.name!=''"> |
| | | and COALESCE(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', -1), '.', 1)) |
| | |
| | | '$.shootPosition.lat') ) AS latitude |
| | | <if test="resultType!=null and resultType!='' and resultType==4"> |
| | | ,odm.orthoimage_api 'url', |
| | | ST_AsText ( odm.geom ) "geom" |
| | | public.st_astext ( odm.geom ) "geom" |
| | | </if> |
| | | from blade_attach attach |
| | | left join manage_device device on attach.device_sn = device.device_sn::VARCHAR |