| | |
| | | <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 * from blade_attach where is_deleted = 0 |
| | | <if test="attach.nickName != null and attach.nickName != ''"> |
| | | AND (nick_name LIKE CONCAT('%', #{attach.nickName}, '%') OR name LIKE CONCAT('%', #{attach.nickName}, '%')) |
| | | <select id="selectAttachPage" resultMap="attachResultMap" > |
| | | select |
| | | ba.*, |
| | | bd.dept_name, |
| | | coalesce(ba.nick_name,ba.original_name) nickName |
| | | from |
| | | blade_attach ba |
| | | left join |
| | | /* 修改点1:双向转为 text 对齐 */ |
| | | blade_dept bd on ba.create_dept::text = bd.id::text |
| | | where |
| | | ba.is_deleted = 0 |
| | | <if test="attach.nickName!=null and attach.nickName!=''"> |
| | | and ba.nick_name like concat('%',#{attach.nickName},'%') |
| | | </if> |
| | | <if test="attach.originalName!=null and attach.originalName!=''"> |
| | | and original_name like concat('%',#{attach.originalName},'%') |
| | | <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.extension!=null and attach.extension!=''"> |
| | | and extension like concat('%',#{attach.extension},'%') |
| | | <if test="attach.deptList != null and attach.deptList.size > 0"> |
| | | and ba.create_dept::text in |
| | | <foreach collection="attach.deptList" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId}::text |
| | | </foreach> |
| | | </if> |
| | | <if test="attach.startTime!=null and attach.startTime!=''"> |
| | | and date_format(create_time,'%Y-%m-%d') >= #{attach.startTime} |
| | | </if> |
| | | <if test="attach.endTime!=null and attach.endTime!=''"> |
| | | and date_format(create_time,'%Y-%m-%d') <= #{attach.endTime} |
| | | </if> |
| | | <if test="attach.resultType!=null"> |
| | | and result_type = #{attach.resultType} |
| | | </if> |
| | | <if test="attach.wayLineJobId!=null and attach.wayLineJobId!=''"> |
| | | and wayline_job_id = #{attach.wayLineJobId} |
| | | </if> |
| | | <if test="attach.deviceSn!=null and attach.deviceSn!=''"> |
| | | and device_sn = #{attach.deviceSn} |
| | | </if> |
| | | |
| | | order by create_time desc,id desc |
| | | order by ba.create_time desc, ba.id desc |
| | | </select> |
| | | |
| | | <select id="findAiAttachImages" resultType="org.sxkj.resource.vo.AttachVO"> |
| | | select |
| | | DISTINCT attach.id, |
| | | attach.link, |
| | | attach.name, |
| | | ifNull( attach.nick_name,SUBSTRING_INDEX( SUBSTRING_INDEX( attach.NAME, '/', - 1 ), '.', 1 )) AS nick_name, |
| | | COALESCE( attach.nick_name,SUBSTRING_INDEX( SUBSTRING_INDEX( attach.NAME, '/', - 1 ), '.', 1 )) AS nick_name, |
| | | attach.original_name, |
| | | attach.extension, |
| | | attach.device_sn, |
| | |
| | | wj.name AS job_name, |
| | | rela.status |
| | | from blade_attach attach |
| | | left join drone_job_event_rela rela on attach.id = rela.attach_id |
| | | left join wayline_job wj ON attach.wayline_job_id = wj.job_id |
| | | left join wayline_job_info info on wj.job_info_id = info.id |
| | | left join drone_job_event_rela rela on attach.id::VARCHAR = rela.attach_id::VARCHAR |
| | | left join wayline_job wj ON attach.wayline_job_id::VARCHAR = wj.job_id::VARCHAR |
| | | left join wayline_job_info info on wj.job_info_id::VARCHAR = info.id::VARCHAR |
| | | where attach.is_deleted = 0 |
| | | and info.is_deleted = 0 |
| | | and attach.is_thumbnail = 0 |
| | | and (rela.is_deleted = 0 or rela.is_deleted is null) |
| | | and attach.is_generate_ai_img = 0 |
| | | and wj.`status` in (2, 3, 5, 6, 7) |
| | | <if test="attach.jobName!=null and attach.jobName!=''"> |
| | | and wj.name like concat('%',#{attach.jobName},'%') |
| | |
| | | <select id="findAllMd5ByAi" resultType="org.sxkj.resource.vo.EventImgMd5VO"> |
| | | select md5,original_md5 |
| | | from drone_job_event_rela rela |
| | | left join ai_event_record record on rela.ai_event_record_uuid=record.uuid |
| | | left join ai_event_record record on rela.ai_event_record_uuid::VARCHAR = record.uuid::VARCHAR |
| | | <where> |
| | | and record.id in |
| | | <foreach collection="aiRecordIds" item="eventRecordId" separator="," open="(" close=")"> |
| | |
| | | attach.create_time, |
| | | rela.status |
| | | from blade_attach attach |
| | | right join drone_job_event_rela rela on attach.id = rela.attach_id |
| | | right join drone_job_event_rela rela on attach.id::VARCHAR = rela.attach_id::VARCHAR |
| | | where attach.is_deleted = 0 and attach.is_thumbnail = 0 |
| | | <if test="attach.nickName != null and attach.nickName != ''"> |
| | | AND (nick_name LIKE CONCAT('%', #{attach.nickName}, '%') OR name LIKE CONCAT('%', #{attach.nickName}, '%')) |
| | |
| | | attach.link, |
| | | attach.name, |
| | | attach.attach_size, |
| | | ifNull( attach.nick_name,SUBSTRING_INDEX( SUBSTRING_INDEX( attach.NAME, '/', - 1 ), '.', 1 )) nick_name, |
| | | COALESCE( attach.nick_name,SUBSTRING_INDEX( SUBSTRING_INDEX( attach.NAME, '/', - 1 ), '.', 1 )) nick_name, |
| | | attach.original_name, |
| | | attach.extension, |
| | | attach.device_sn, |
| | |
| | | </if> |
| | | device.nickName nestName |
| | | from blade_attach attach |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id |
| | | left join wayline_job_info wji on wji.id = job.job_info_id |
| | | left join manage_device device on job.dock_sn = device.device_sn |
| | | left join manage_device_expansion mde on job.dock_sn = mde.device_sn |
| | | left join blade_region region on device.area_code = region.code |
| | | left join drone_job_event_rela rela on attach.id = rela.attach_id |
| | | left join wayline_job job on attach.wayline_job_id::VARCHAR = job.job_id::VARCHAR |
| | | left join wayline_job_info wji on wji.id = job.job_info_id::VARCHAR |
| | | left join manage_device device on job.dock_sn = device.device_sn::VARCHAR |
| | | left join manage_device_expansion mde on job.dock_sn = mde.device_sn::VARCHAR |
| | | left join blade_region region on device.area_code = region.code::VARCHAR |
| | | left join drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR |
| | | where |
| | | attach.is_deleted = 0 |
| | | and wji.is_deleted = 0 |
| | |
| | | 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 ifNull(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', -1), '.', 1)) |
| | | and COALESCE(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', -1), '.', 1)) |
| | | like concat('%',#{attach.name},'%') |
| | | </if> |
| | | <if test="attach.jobName!=null and attach.jobName!=''"> |
| | |
| | | and create_time > #{startTime} |
| | | and create_time < #{endTime} |
| | | GROUP BY create_dept) b |
| | | on (a.id = b.create_dept) |
| | | on (a.id = b.create_dept::VARCHAR) |
| | | </select> |
| | | |
| | | <!--判断附件是否已存在--> |
| | |
| | | device.area_code "dictKey", |
| | | count(*)"num" |
| | | from blade_attach attach |
| | | left join manage_device device on attach.device_sn=device.device_sn |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id |
| | | left join wayline_job_info wji on wji.id = job.job_info_id |
| | | left join manage_device device on attach.device_sn = device.device_sn::VARCHAR |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR |
| | | left join wayline_job_info wji on wji.id = job.job_info_id::VARCHAR |
| | | <where> |
| | | and attach.is_deleted = 0 |
| | | and wji.is_deleted = 0 |
| | |
| | | device.area_code "dictKey" |
| | | FROM |
| | | odm_task_info oti |
| | | LEFT JOIN wayline_job wj ON wj.job_id = oti.wayline_job_id |
| | | LEFT JOIN manage_device device ON wj.dock_sn = device.device_sn |
| | | LEFT JOIN tb_lot_info tli ON tli.dkbh = wj.dkbh |
| | | LEFT JOIN wayline_job wj ON wj.job_id = oti.wayline_job_id::VARCHAR |
| | | LEFT JOIN manage_device device ON wj.dock_sn = device.device_sn::VARCHAR |
| | | LEFT JOIN tb_lot_info tli ON tli.dkbh = wj.dkbh::VARCHAR |
| | | WHERE |
| | | ( wj.job_type = 4 OR wj.job_type = 2 ) |
| | | AND oti.running_progress = 1.00 |
| | | AND oti.running_progress = 1.00::VARCHAR |
| | | <if test="startDate!=null"> |
| | | and oti.create_time >=#{startDate} |
| | | </if> |
| | |
| | | '$.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 |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id |
| | | left join wayline_job_info wji on wji.id = job.job_info_id |
| | | left join manage_device device on attach.device_sn = device.device_sn::VARCHAR |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR |
| | | left join wayline_job_info wji on wji.id = job.job_info_id::VARCHAR |
| | | <if test="resultType!=null and resultType!='' and resultType==4"> |
| | | left join odm_task_info odm on attach.wayline_job_id=odm.wayline_job_id |
| | | left join odm_task_info odm on attach.wayline_job_id = odm.wayline_job_id::VARCHAR |
| | | </if> |
| | | <where> |
| | | and attach.is_deleted = 0 |
| | |
| | | </select> |
| | | |
| | | <select id="getAttachList" resultType="org.sxkj.resource.vo.AttachVO"> |
| | | select attach.name, attach.wayline_job_id, job.name jobName |
| | | from wayline_job job |
| | | left join blade_attach attach on attach.wayline_job_id = job.job_id |
| | | left join manage_device device on attach.device_sn = device.device_sn |
| | | <where> |
| | | select |
| | | attach.* |
| | | from |
| | | blade_attach attach |
| | | <where> |
| | | <if test="attachIds!=null and attachIds.size()>0"> |
| | | and attach.id in |
| | | <foreach item="item" index="index" collection="attachIds" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="wayLineJobIds!=null and wayLineJobIds.size()>0"> |
| | | and attach.wayline_job_id in |
| | | <foreach item="item" index="index" collection="wayLineJobIds" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime!=null and startTime !='' and endTime!=null and endTime !='' "> |
| | | and DATE_FORMAT(FROM_UNIXTIME(job.execute_time/1000,'%Y-%m-%d %H:%i:%s'),'%Y-%m-%d %H:%i:%s') between |
| | | #{startTime} and #{endTime} |
| | | </if> |
| | | <if test="dockSn!=null and dockSn!=''"> |
| | | and attach.device_sn = #{dockSn} |
| | | </if> |
| | | <if test="jobName!=null and jobName!=''"> |
| | | and job.name like concat('%',#{jobName},'%') |
| | | </if> |
| | | <if test="fileName!=null and fileName!=''"> |
| | | and attach.name like concat('%',#{fileName},'%') |
| | | </if> |
| | | <if test="fileType!=null and fileType!=''"> |
| | | <choose> |
| | | <when test="fileType=='visable'"> |
| | | and attach.media_category = 0 |
| | | </when> |
| | | <when test="fileType=='ir'"> |
| | | and attach.media_category = 1 |
| | | </when> |
| | | </choose> |
| | | </if> |
| | | <!-- <if test="resultType!=null and resultType!=''"> --> |
| | | <!-- and attach.result_type = #{resultType} --> |
| | | <!-- </if> --> |
| | | <if test="resultTypes!=null and resultTypes.size()>0"> |
| | | and attach.result_type in |
| | | <foreach collection="resultTypes" item="resultType" open="(" close=")" separator=","> |
| | | #{resultType} |
| | | </foreach> |
| | | </if> |
| | | AND attach.wayline_job_id IS NOT NULL |
| | | AND job.NAME IS NOT NULL |
| | | AND attach.is_deleted = 0 |
| | | </where> |
| | | </select> |
| | |
| | | attach.create_time, |
| | | attach.link, |
| | | rela.event_name, |
| | | ifnull(attach.result_type,2) "result_type" |
| | | COALESCE(attach.result_type,2) "result_type" |
| | | FROM blade_attach attach |
| | | LEFT JOIN drone_job_event_rela rela ON attach.id = rela.attach_id |
| | | LEFT JOIN drone_job_event_rela rela ON attach.id = rela.attach_id::VARCHAR |
| | | WHERE |
| | | attach.is_deleted = 0 |
| | | AND attach.is_thumbnail = 0 |
| | |
| | | select attach.create_time, |
| | | attach.id, |
| | | attach.name, |
| | | ifNull(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', - 1), '.', 1)) nick_name, |
| | | COALESCE(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', - 1), '.', 1)) nick_name, |
| | | attach.link, |
| | | attach.device_sn, |
| | | attach.metadata, |
| | |
| | | device.nickname nestName, |
| | | CONCAT_WS(',', region.province_name, region.city_name, region.district_name) region_name |
| | | from blade_attach attach |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id |
| | | left join manage_device device on attach.device_sn = device.device_sn |
| | | left join blade_region region on device.area_code = region.code |
| | | left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR |
| | | left join manage_device device on attach.device_sn = device.device_sn::VARCHAR |
| | | left join blade_region region on device.area_code = region.code::VARCHAR |
| | | where attach.id = #{id} |
| | | </select> |
| | | |
| | |
| | | select attach.create_time, |
| | | attach.id, |
| | | attach.name, |
| | | ifNull(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', - 1), '.', 1)) nick_name, |
| | | COALESCE(attach.nick_name, SUBSTRING_INDEX(SUBSTRING_INDEX(attach.NAME, '/', - 1), '.', 1)) nick_name, |
| | | attach.link, |
| | | attach.device_sn, |
| | | attach.metadata, |
| | |
| | | device.nickname, |
| | | CONCAT_WS(',', region.province_name, region.city_name, region.district_name) region_name |
| | | from wayline_job job |
| | | left join blade_attach attach on attach.wayline_job_id = job.job_id |
| | | left join manage_device device on attach.device_sn = device.device_sn |
| | | left join blade_region region on device.area_code = region.code |
| | | left join drone_job_event_rela rela on attach.id = rela.attach_id |
| | | left join blade_attach attach on attach.wayline_job_id = job.job_id::VARCHAR |
| | | left join manage_device device on attach.device_sn = device.device_sn::VARCHAR |
| | | left join blade_region region on device.area_code = region.code::VARCHAR |
| | | left join drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR |
| | | where job.job_id = #{jobId} |
| | | and attach.result_type in (0, 2, 5) |
| | | </select> |
| | |
| | | attach.result_type type, |
| | | count(attach.id) count |
| | | FROM blade_attach attach |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id |
| | | LEFT JOIN wayline_job_info wji on wji.id = wj.job_info_id |
| | | LEFT JOIN drone_job_event_rela rela on attach.id = rela.attach_id |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR |
| | | LEFT JOIN wayline_job_info wji on wji.id = wj.job_info_id::VARCHAR |
| | | LEFT JOIN drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR |
| | | <where> |
| | | <if test="param.deviceSn!=null and param.deviceSn!=''"> |
| | | and attach.device_sn = #{param.deviceSn} |
| | |
| | | ROUND( sum( wj3d.area ) / 1000000, 2 ) AS area |
| | | FROM |
| | | blade_attach attach |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id |
| | | LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id AND wji.is_deleted = 0 |
| | | LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR |
| | | LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id::VARCHAR AND wji.is_deleted = 0 |
| | | LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id::VARCHAR |
| | | <where> |
| | | <if test="param.deviceSn!=null and param.deviceSn!=''"> |
| | | AND attach.device_sn = #{param.deviceSn} |
| | |
| | | wj3d.area_code |
| | | FROM |
| | | blade_attach attach |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id |
| | | LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id AND wji.is_deleted = 0 |
| | | LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR |
| | | LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id::VARCHAR AND wji.is_deleted = 0 |
| | | LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id::VARCHAR |
| | | <where> |
| | | <if test="param.deviceSn!=null and param.deviceSn!=''"> |
| | | AND attach.device_sn = #{param.deviceSn} |
| | |
| | | count(attach.id) count, |
| | | DATE_FORMAT(attach.create_time, #{param1.formatTime}) timeStr |
| | | from blade_attach attach |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id |
| | | left JOIN wayline_job_info wji ON wji.id = wj.job_info_id and wji.is_deleted = 0 |
| | | LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR |
| | | left JOIN wayline_job_info wji ON wji.id = wj.job_info_id::VARCHAR and wji.is_deleted = 0 |
| | | <where> |
| | | <if test="param1.deviceSn!=null and param1.deviceSn!=''"> |
| | | and attach.device_sn = #{param1.deviceSn} |
| | |
| | | <delete id="deleteAttach"> |
| | | |
| | | UPDATE blade_attach ba |
| | | INNER JOIN wayline_job wj ON ba.wayline_job_id = wj.job_id |
| | | INNER JOIN wayline_job_info wji ON wj.job_info_id = wji.id |
| | | INNER JOIN wayline_job_record wjr ON wji.id = wjr.job_info_id |
| | | INNER JOIN wayline_job wj ON ba.wayline_job_id = wj.job_id::VARCHAR |
| | | INNER JOIN wayline_job_info wji ON wj.job_info_id = wji.id::VARCHAR |
| | | INNER JOIN wayline_job_record wjr ON wji.id = wjr.job_info_id::VARCHAR |
| | | SET ba.is_deleted = 1, |
| | | ba.update_user = #{operator} |
| | | WHERE ba.workspace_id = #{workspaceId} |
| | |
| | | a.is_thumbnail, |
| | | a.longitude, |
| | | a.latitude, |
| | | a.is_generate_ai_img, |
| | | a.media_category, |
| | | a.media_create_time, |
| | | a.is_deleted |
| | | FROM |
| | | blade_attach a |
| | | INNER JOIN |
| | | wayline_job j ON a.wayline_job_id = j.job_id |
| | | wayline_job j ON a.wayline_job_id = j.job_id::VARCHAR |
| | | WHERE |
| | | ( |
| | | FIND_IN_SET(#{lotInfoId}, j.lot_info_id) > 0 |
| | | #{lotInfoId} = ANY(string_to_array(j.lot_info_id, ',')::bigint[]) |
| | | OR j.lot_info_id = #{lotInfoId} |
| | | ) |
| | | AND a.result_type = 0 -- 根据您的需求,只查询成果类型为 0 (图片) 的数据 |