From 1bfbc52da47b22f00a1c1f5f670c30f70d999873 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Mon, 02 Feb 2026 18:18:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml | 238 ++++++++++++++++++++---------------------------------------
1 files changed, 80 insertions(+), 158 deletions(-)
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
index f73938e..6493925 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
@@ -6,11 +6,6 @@
<resultMap id="fwAreaDivideResultMap" type="org.sxkj.fw.area.vo.FwAreaDivideVO">
<result column="id" property="id"/>
<result column="area_name" property="areaName"/>
- <result column="longitude" property="longitude"/>
- <result column="latitude" property="latitude"/>
- <result column="area_size" property="areaSize"/>
- <result column="geom" property="geom"/>
- <result column="area_type" property="areaType"/>
<result column="trigger_condition" property="triggerCondition"/>
<result column="response_mechanism" property="responseMechanism"/>
<result column="control_level" property="controlLevel"/>
@@ -19,21 +14,16 @@
<result column="fly_date_start" property="flyDateStart"/>
<result column="fly_date_end" property="flyDateEnd"/>
<result column="area_code" property="areaCode"/>
+ <result column="area_type_keys" property="areaTypeKeys"/>
<result column="police_station_name" property="policeStationName"/>
<result column="police_station_contact_person" property="policeStationContactPerson"/>
<result column="police_station_contact_phone" property="policeStationContactPhone"/>
- <result column="create_user" property="createUser"/>
- <result column="create_dept" property="createDept"/>
- <result column="create_time" property="createTime"/>
- <result column="update_user" property="updateUser"/>
- <result column="update_time" property="updateTime"/>
- <result column="status" property="status"/>
</resultMap>
<resultMap id="fwAreaDivideStatisticsResultMap" type="org.sxkj.fw.area.vo.FwAreaDivideStatisticsVO">
<result column="id" property="id"/>
<result column="area_name" property="areaName"/>
- <result column="area_type" property="areaType"/>
+ <result column="area_type_keys" property="areaTypeKeys"/>
<result column="scene_name" property="sceneName"/>
<result column="scene_type" property="sceneType"/>
<result column="device_count" property="deviceCount"/>
@@ -46,33 +36,10 @@
<select id="selectFwAreaDividePage" resultMap="fwAreaDivideResultMap">
select
- ad.id,
- ad.area_name,
- ad.longitude,
- ad.latitude,
- ad.area_size,
- case
- when ad.geom is null then null
- when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then ST_AsText(ad.geom)
- else concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
- end as geom,
- ad.area_type,
- ad.trigger_condition,
- ad.response_mechanism,
- ad.control_level,
- ad.police_station_id,
- ad.device_ids,
- ad.fly_date_start,
- ad.fly_date_end,
- ad.area_code,
+ ad.*,
ps.station_name as police_station_name,
- ad.create_user,
- ad.create_dept,
- ad.create_time,
- ad.update_user,
- ad.update_time,
- ad.status,
- ad.is_deleted
+ ps.contact_person as police_station_contact_person,
+ ps.contact_phone as police_station_contact_phone
from
ja_fw_area_divide ad
left join
@@ -84,18 +51,6 @@
</if>
<if test="param2.areaName != null and param2.areaName != ''">
and ad.area_name like concat('%', #{param2.areaName}, '%')
- </if>
- <if test="param2.longitude != null and param2.longitude != ''">
- and ad.longitude = #{param2.longitude}
- </if>
- <if test="param2.latitude != null and param2.latitude != ''">
- and ad.latitude = #{param2.latitude}
- </if>
- <if test="param2.areaSize != null and param2.areaSize != ''">
- and ad.area_size = #{param2.areaSize}
- </if>
- <if test="param2.areaType != null and param2.areaType != ''">
- and ad.area_type = #{param2.areaType}
</if>
<if test="param2.triggerCondition != null and param2.triggerCondition != ''">
and ad.trigger_condition = #{param2.triggerCondition}
@@ -121,6 +76,13 @@
<if test="param2.areaCode != null and param2.areaCode != ''">
and ad.area_code = #{param2.areaCode}
</if>
+ <if test="param2.areaTypeKeyList != null and param2.areaTypeKeyList.size > 0">
+ and (
+ <foreach collection="param2.areaTypeKeyList" item="key" separator=" or ">
+ find_in_set(#{key}, ad.area_type_keys)
+ </foreach>
+ )
+ </if>
<if test="param2.deptList != null and param2.deptList.size > 0">
and ad.create_dept in
<foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")">
@@ -132,37 +94,38 @@
<select id="selectFwAreaDivideList" resultMap="fwAreaDivideResultMap">
select
- ad.id,
- ad.area_name,
- ad.longitude,
- ad.latitude,
- ad.area_size,
- case
- when ad.geom is null then null
- when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then ST_AsText(ad.geom)
- else concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
- end as geom,
- ad.area_type,
- ad.trigger_condition,
- ad.response_mechanism,
- ad.control_level,
- ad.police_station_id,
- ad.device_ids,
- ad.fly_date_start,
- ad.fly_date_end,
- ad.area_code,
- ps.station_name as police_station_name,
- ad.create_user,
- ad.create_dept,
- ad.create_time,
- ad.update_user,
- ad.update_time,
- ad.status,
- ad.is_deleted
+ ad.*,
+ ps.station_name as police_station_name,
+ ps.contact_person as police_station_contact_person,
+ ps.contact_phone as police_station_contact_phone
from ja_fw_area_divide ad
left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0
<where>
ad.is_deleted = 0
+ <if test="isSetSceneManage != null and isSetSceneManage == 1">
+ and exists (
+ select 1
+ from ja_fw_defense_scene ds
+ join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id and dsm.is_deleted = 0
+ where ds.is_deleted = 0
+ and ds.area_divide_ids is not null
+ and ds.area_divide_ids != ''
+ and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
+ )
+ </if>
+ <if test="isSetSceneManage != null and isSetSceneManage == 1 and flyTime != null">
+ and exists (
+ select 1
+ from ja_fw_defense_scene ds
+ join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id and dsm.is_deleted = 0
+ where ds.is_deleted = 0
+ and ds.area_divide_ids is not null
+ and ds.area_divide_ids != ''
+ and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
+ and (dsm.effective_date_start is null or dsm.effective_date_start <= #{flyTime})
+ and (dsm.effective_date_end is null or dsm.effective_date_end >= #{flyTime})
+ )
+ </if>
<if test="filterSelected != null and filterSelected == 1">
and (
not exists (
@@ -195,6 +158,13 @@
and ds.area_divide_ids is not null
and ds.area_divide_ids != ''
and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
+ )
+ </if>
+ <if test="areaTypeKeyList != null and areaTypeKeyList.size > 0">
+ and (
+ <foreach collection="areaTypeKeyList" item="key" separator=" or ">
+ find_in_set(#{key}, ad.area_type_keys)
+ </foreach>
)
</if>
</where>
@@ -253,35 +223,10 @@
<select id="selectFwAreaDivideDetail" resultMap="fwAreaDivideResultMap">
select
- ad.id,
- ad.area_name,
- ad.longitude,
- ad.latitude,
- ad.area_size,
- case
- when ad.geom is null then null
- when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then ST_AsText(ad.geom)
- else concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
- end as geom,
- ad.area_type,
- ad.trigger_condition,
- ad.response_mechanism,
- ad.control_level,
- ad.police_station_id,
- ad.device_ids,
- ad.fly_date_start,
- ad.fly_date_end,
- ad.area_code,
- ps.station_name as police_station_name,
- ps.contact_person as police_station_contact_person,
- ps.contact_phone as police_station_contact_phone,
- ad.create_user,
- ad.create_dept,
- ad.create_time,
- ad.update_user,
- ad.update_time,
- ad.status,
- ad.is_deleted
+ ad.*,
+ ps.station_name as police_station_name,
+ ps.contact_person as police_station_contact_person,
+ ps.contact_phone as police_station_contact_phone
from ja_fw_area_divide ad
left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0
where ad.is_deleted = 0
@@ -292,7 +237,7 @@
select
stats.id,
stats.area_name,
- stats.area_type,
+ stats.area_type_keys,
stats.scene_name,
stats.scene_type,
stats.device_count,
@@ -309,16 +254,18 @@
select
ad.id,
ad.area_name,
- ad.area_type,
+ ad.area_type_keys,
(
select group_concat(distinct ds.scene_name)
from ja_fw_defense_scene ds
+ join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id and dsm.is_deleted = 0
where ds.is_deleted = 0
and find_in_set(ad.id, ds.area_divide_ids)
) as scene_name,
(
select group_concat(distinct ds.scene_type)
from ja_fw_defense_scene ds
+ join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id and dsm.is_deleted = 0
where ds.is_deleted = 0
and find_in_set(ad.id, ds.area_divide_ids)
) as scene_type,
@@ -360,14 +307,18 @@
from ja_fw_area_divide ad
<where>
ad.is_deleted = 0
+ and exists (
+ select 1
+ from ja_fw_defense_scene ds
+ join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id and dsm.is_deleted = 0
+ where ds.is_deleted = 0
+ and find_in_set(ad.id, ds.area_divide_ids)
+ )
<if test="param2.id != null and param2.id != ''">
and ad.id = #{param2.id}
</if>
<if test="param2.areaName != null and param2.areaName != ''">
and ad.area_name like concat('%', #{param2.areaName}, '%')
- </if>
- <if test="param2.areaType != null and param2.areaType != ''">
- and ad.area_type = #{param2.areaType}
</if>
<if test="param2.sceneType != null and param2.sceneType != ''">
and exists (
@@ -380,6 +331,13 @@
</if>
<if test="param2.areaCode != null and param2.areaCode != ''">
and ad.area_code = #{param2.areaCode}
+ </if>
+ <if test="param2.areaTypeKeyList != null and param2.areaTypeKeyList.size > 0">
+ and (
+ <foreach collection="param2.areaTypeKeyList" item="key" separator=" or ">
+ find_in_set(#{key}, ad.area_type_keys)
+ </foreach>
+ )
</if>
<if test="param2.deptList != null and param2.deptList.size > 0">
and ad.create_dept in
@@ -395,7 +353,7 @@
select
stats.id,
stats.area_name,
- stats.area_type,
+ stats.area_type_keys,
stats.scene_name,
stats.scene_type,
stats.device_count,
@@ -409,13 +367,13 @@
else '差'
end as control_effect
from (
- select
- ad.id,
- ad.area_name,
- ad.area_type,
- (
- select group_concat(distinct ds.scene_name)
- from ja_fw_defense_scene ds
+ select
+ ad.id,
+ ad.area_name,
+ ad.area_type_keys,
+ (
+ select group_concat(distinct ds.scene_name)
+ from ja_fw_defense_scene ds
where ds.is_deleted = 0
and find_in_set(ad.id, ds.area_divide_ids)
) as scene_name,
@@ -478,11 +436,6 @@
SELECT
id,
area_name,
- longitude,
- latitude,
- area_size,
- concat(ST_AsText(geom), ' | ', ST_SRID(geom)) as geom,
- area_type,
trigger_condition,
response_mechanism,
control_level,
@@ -505,11 +458,6 @@
insert into ja_fw_area_divide (
id,
area_name,
- longitude,
- latitude,
- area_size,
- geom,
- area_type,
trigger_condition,
response_mechanism,
control_level,
@@ -518,6 +466,7 @@
fly_date_start,
fly_date_end,
area_code,
+ area_type_keys,
create_user,
create_dept,
create_time,
@@ -528,22 +477,6 @@
) values (
#{id},
#{areaName},
- #{longitude},
- #{latitude},
- #{areaSize},
- <choose>
- <when test="geom != null and geom != ''">
- case
- when instr(#{geom}, '|') > 0 then ST_GeomFromText(
- trim(substring_index(#{geom}, '|', 1)),
- cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
- )
- else ST_GeomFromText(trim(#{geom}))
- end
- </when>
- <otherwise>null</otherwise>
- </choose>,
- #{areaType},
#{triggerCondition},
#{responseMechanism},
#{controlLevel},
@@ -552,6 +485,7 @@
#{flyDateStart},
#{flyDateEnd},
#{areaCode},
+ #{areaTypeKeys},
#{createUser},
#{createDept},
#{createTime},
@@ -566,19 +500,6 @@
update ja_fw_area_divide
<set>
<if test="areaName != null">area_name = #{areaName},</if>
- <if test="longitude != null">longitude = #{longitude},</if>
- <if test="latitude != null">latitude = #{latitude},</if>
- <if test="areaSize != null">area_size = #{areaSize},</if>
- <if test="geom != null and geom != ''">
- geom = case
- when instr(#{geom}, '|') > 0 then ST_GeomFromText(
- trim(substring_index(#{geom}, '|', 1)),
- cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
- )
- else ST_GeomFromText(trim(#{geom}))
- end,
- </if>
- <if test="areaType != null">area_type = #{areaType},</if>
<if test="triggerCondition != null">trigger_condition = #{triggerCondition},</if>
<if test="responseMechanism != null">response_mechanism = #{responseMechanism},</if>
<if test="controlLevel != null">control_level = #{controlLevel},</if>
@@ -587,6 +508,7 @@
<if test="flyDateStart != null">fly_date_start = #{flyDateStart},</if>
<if test="flyDateEnd != null">fly_date_end = #{flyDateEnd},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
+ <if test="areaTypeKeys != null">area_type_keys = #{areaTypeKeys},</if>
<if test="createUser != null">create_user = #{createUser},</if>
<if test="createDept != null">create_dept = #{createDept},</if>
<if test="createTime != null">create_time = #{createTime},</if>
--
Gitblit v1.9.3