吉安感知网项目-后端
linwei
2026-07-08 f5ea859946f70d9d3a50c52fa2bf0c3e9939ba09
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
@@ -49,12 +49,17 @@
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="geojson" property="geojson"/>
        <result column="attachment_type" property="attachmentType"/>
    </resultMap>
    <resultMap id="gdClueEventListVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventListVO">
        <result column="id" property="id"/>
        <result column="event_image_url" property="eventImageUrl"/>
        <result column="create_time" property="createTime"/>
        <result column="geojson" property="geojson"/>
        <result column="attachment_type" property="attachmentType"/>
        <result column="event_name" property="eventName"/>
    </resultMap>
    <resultMap id="gdClueEventCountVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventCountVO">
@@ -89,28 +94,51 @@
               COALESCE(bu.real_name, bu.name) as dispose_user_name,
        bd.dept_name as dispose_dept_name
        from (select * from ja_gd_clue_event ${ew.customSqlSegment}) ce
        left join blade_user bu on bu.id = ce.dispose_user::VARCHAR and bu.is_deleted = 0
        left join blade_dept bd on bd.id = ce.dispose_dept::VARCHAR and bd.is_deleted = 0
        left join blade_user bu on bu.id::VARCHAR = ce.dispose_user::VARCHAR and bu.is_deleted = 0
        left join blade_dept bd on bd.id::VARCHAR = ce.dispose_dept::VARCHAR and bd.is_deleted = 0
    </select>
    <select id="selectGdClueEventSimpleList" resultMap="gdClueEventListVoResultMap">
        select ce.id as id,
        tr.result_url as event_image_url,
        ce.create_time as create_time
        select
            ce.id as id,
            ce.event_name,
            COALESCE(tr.result_url, ce.attach_url) as event_image_url,
            COALESCE(tr.geojson, ce.geojson)  as geojson,
            COALESCE(tr.attachment_type, ce.attachment_type) as attachment_type,
            ce.create_time as create_time
        from ja_gd_clue_event ce
        left join ja_gd_task_result tr on tr.id = ce.result_id::VARCHAR and tr.is_deleted = 0
        left join ja_gd_task_result tr on tr.id::VARCHAR = ce.result_id::VARCHAR and tr.is_deleted = 0
        <include refid="gdClueEventDeptWhere"/>
        and ce.event_status in (1, 3)
        <if test="keyword != null and keyword != ''">
            and ce.event_num like concat('%', #{keyword}, '%')
            and ce.event_num::VARCHAR like concat('%', #{keyword}, '%')
        </if>
        <if test="onlyMine != null and onlyMine == 1">
            and ce.dispose_user = #{userId}
        </if>
        order by ce.create_time desc
    </select>
    <select id="selectGdClueEventDetailById" resultMap="gdClueEventVoResultMap">
        select ce.*,
        select
        ce.id,
        ce.result_id,
        ce.work_order_id,
        ce.dispose_user,
        ce.dispose_dept,
        ce.longitude,
        ce.latitude,
        ce.event_status,
        ce.area_code,
        ce.event_num,
        ce.event_name,
        ce.create_user,
        ce.create_dept,
        ce.create_time,
        ce.update_user,
        ce.update_time,
        ce.status,
        ce.is_deleted,
        COALESCE(bu.real_name, bu.name) as dispose_user_name,
        bd.dept_name as dispose_dept_name,
        COALESCE(cu.real_name, cu.name) as distribute_user_name,
@@ -118,14 +146,18 @@
        ce.create_time as distribute_time,
        concat(ce.longitude, ',', ce.latitude) as event_location,
        ce.event_num as event_num,
        tr.shoot_time as shoot_time,
        tr.result_url as event_image_url
        COALESCE(tr.shoot_time, ce.shoot_time) as shoot_time,
        COALESCE(tr.result_url, ce.attach_url) as event_image_url,
        COALESCE(tr.geojson, ce.geojson)  as geojson,
        COALESCE(tr.attachment_type, ce.attachment_type) as attachment_type,
               tr.id as tr_id,
               tr.attachment_type as tr_attachment_type_raw
        from ja_gd_clue_event ce
        left join blade_user bu on bu.id = ce.dispose_user::VARCHAR and bu.is_deleted = 0
        left join blade_dept bd on bd.id = ce.dispose_dept::VARCHAR and bd.is_deleted = 0
        left join blade_user cu on cu.id = ce.create_user::VARCHAR and cu.is_deleted = 0
        left join blade_dept cd on cd.id = ce.create_dept::VARCHAR and cd.is_deleted = 0
        left join ja_gd_task_result tr on tr.id = ce.result_id::VARCHAR and tr.is_deleted = 0
        left join blade_user bu on bu.id::VARCHAR = ce.dispose_user::VARCHAR and bu.is_deleted = 0
        left join blade_dept bd on bd.id::VARCHAR = ce.dispose_dept::VARCHAR and bd.is_deleted = 0
        left join blade_user cu on cu.id::VARCHAR = ce.create_user::VARCHAR and cu.is_deleted = 0
        left join blade_dept cd on cd.id::VARCHAR = ce.create_dept::VARCHAR and cd.is_deleted = 0
        left join ja_gd_task_result tr on tr.id::VARCHAR = ce.result_id::VARCHAR and tr.is_deleted = 0
        <include refid="gdClueEventDeptWhere"/>
        and ce.id = #{id}
    </select>