From d032522d3b4fcd78d5fe5cb32f50858d86fd81d1 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Thu, 30 Jul 2026 16:03:52 +0800
Subject: [PATCH] fix(gd): 移除操作时间参数验证并使用当前时间
---
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml | 70 +++++++++++++++++++++++++++++-----
1 files changed, 59 insertions(+), 11 deletions(-)
diff --git a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
index 632cdaf..1536433 100644
--- a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
+++ b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
@@ -60,6 +60,19 @@
<result column="geojson" property="geojson"/>
<result column="attachment_type" property="attachmentType"/>
<result column="event_name" property="eventName"/>
+ <result column="shoot_time" property="shootTime"/>
+ <result column="dispose_user_name" property="disposeUserName"/>
+ <result column="dispose_dept_name" property="disposeDeptName"/>
+ <result column="result_id" property="resultId"/>
+ <result column="work_order_id" property="workOrderId"/>
+ <result column="dispose_user" property="disposeUser"/>
+ <result column="dispose_dept" property="disposeDept"/>
+ <result column="longitude" property="longitude"/>
+ <result column="latitude" property="latitude"/>
+ <result column="event_status" property="eventStatus"/>
+ <result column="area_code" property="areaCode"/>
+ <result column="event_num" property="eventNum"/>
+ <result column="attach_url" property="attachUrl"/>
</resultMap>
<resultMap id="gdClueEventCountVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventCountVO">
@@ -69,11 +82,6 @@
<result column="disposed_count" property="disposedCount"/>
<result column="completed_count" property="completedCount"/>
</resultMap>
-
- <sql id="gdClueEventDeptWhere">
- where ce.is_deleted = 0
- and ce.dispose_dept = #{deptId}
- </sql>
<resultMap id="gdClueEventExcelResultMap" type="org.sxkj.gd.workorder.excel.GdClueEventExcel">
<result column="result_id" property="resultId"/>
@@ -108,16 +116,45 @@
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
+ ce.create_time as create_time,
+ tr.shoot_time as shoot_time,
+ COALESCE(bu.real_name, bu.name) as dispose_user_name,
+ bd.dept_name as dispose_dept_name,
+ 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.attach_url
from ja_gd_clue_event ce
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)
+ 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
+ where ce.is_deleted = 0
+ <if test="deptId != null">
+ and ce.dispose_dept = #{deptId}
+ </if>
+ <if test="statusList != null and statusList.size() > 0">
+ and ce.event_status in
+ <foreach collection="statusList" item="status" open="(" separator="," close=")">
+ #{status}
+ </foreach>
+ </if>
<if test="keyword != null and keyword != ''">
and ce.event_num::VARCHAR like concat('%', #{keyword}, '%')
</if>
<if test="onlyMine != null and onlyMine == 1">
and ce.dispose_user = #{userId}
+ </if>
+ <if test="startTime != null and startTime != ''">
+ and tr.shoot_time >= #{startTime}::timestamp
+ </if>
+ <if test="endTime != null and endTime != ''">
+ and tr.shoot_time <= #{endTime}::timestamp
</if>
order by ce.create_time desc
</select>
@@ -161,7 +198,10 @@
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"/>
+ where ce.is_deleted = 0
+ <if test="deptId != null">
+ and ce.dispose_dept = #{deptId}
+ </if>
and ce.id = #{id}
</select>
@@ -172,8 +212,16 @@
COALESCE(sum(case when ce.event_status = 3 then 1 else 0 end), 0) as disposed_count,
COALESCE(sum(case when ce.event_status = 4 then 1 else 0 end), 0) as completed_count
from ja_gd_clue_event ce
- <include refid="gdClueEventDeptWhere"/>
- and ce.event_status in (0, 1, 2, 3, 4)
+ where ce.is_deleted = 0
+ <if test="deptId != null">
+ and ce.dispose_dept = #{deptId}
+ </if>
+ <if test="statusList != null and statusList.size() > 0">
+ and ce.event_status in
+ <foreach collection="statusList" item="status" open="(" separator="," close=")">
+ #{status}
+ </foreach>
+ </if>
<if test="keyword != null and keyword != ''">
and ce.event_num like concat('%', #{keyword}, '%')
</if>
--
Gitblit v1.9.3