From 8edf0004e4bd8b758b0fc5940a8a83f0f7948f74 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 29 Jul 2026 16:31:26 +0800
Subject: [PATCH] feat(workorder): 添加事件处置记录和状态流转功能
---
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml | 41 ++++++++++++++++++++++++++++++++++-------
1 files changed, 34 insertions(+), 7 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 35431da..632cdaf 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
@@ -65,6 +65,9 @@
<resultMap id="gdClueEventCountVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventCountVO">
<result column="total_count" property="totalCount"/>
<result column="my_count" property="myCount"/>
+ <result column="returned_count" property="returnedCount"/>
+ <result column="disposed_count" property="disposedCount"/>
+ <result column="completed_count" property="completedCount"/>
</resultMap>
<sql id="gdClueEventDeptWhere">
@@ -116,10 +119,29 @@
<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,
@@ -127,10 +149,12 @@
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,
- tr.geojson as geojson,
- tr.attachment_type
+ 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::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
@@ -143,10 +167,13 @@
<select id="selectGdClueEventCount" resultMap="gdClueEventCountVoResultMap">
select count(1) as total_count,
- COALESCE(sum(case when ce.dispose_user = #{userId} then 1 else 0 end), 0) as my_count
+ COALESCE(sum(case when ce.dispose_user = #{userId} then 1 else 0 end), 0) as my_count,
+ COALESCE(sum(case when ce.event_status = 2 then 1 else 0 end), 0) as returned_count,
+ 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 (1, 3)
+ and ce.event_status in (0, 1, 2, 3, 4)
<if test="keyword != null and keyword != ''">
and ce.event_num like concat('%', #{keyword}, '%')
</if>
--
Gitblit v1.9.3