From 083ac7646ef2ab4a2614678b158a3dce1482e75c Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 05 十二月 2024 02:32:13 +0800
Subject: [PATCH] 省厅标签拆分
---
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml | 126 +++++++++++++++++++++++++++++------------
1 files changed, 88 insertions(+), 38 deletions(-)
diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
index 5a297d8..607fb80 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -38,7 +38,7 @@
<result property="lxbm" column="lxbm"/>
<result property="deviceType" column="device_type"/>
</resultMap>
-
+ <!-- TODO -->
<resultMap id="monitorMap" type="com.ycl.platform.domain.result.SYS.TMonitorResult">
<result column="m.id" property="id"/>
<result column="no" property="no"/>
@@ -117,10 +117,10 @@
#{number}
</foreach>
</select>
-
+ <!-- TODO -->
<select id="selectTMonitorList" resultType="com.ycl.platform.domain.vo.TMonitorVO">
select m.id, m.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude,
- camera_capture_area, p.online as onState, civil_code, d.dept_id, d.dept_name, d.area, p.province_tag,p.dept_tag,
+ camera_capture_area, p.online as onState, civil_code, d.dept_id, d.dept_name, d.area, p.province_tag_video,p.province_tag_car,p.province_tag_face,p.dept_tag,
IF(COUNT(w.id) OVER() > 0, '鏄�', '鍚�') AS error, u.unit_name,p.recovery_time,p.reason,p.start_time,p.end_time, w.work_order_no
from t_monitor m
left join t_yw_point p on m.serial_number = p.serial_number and p.deleted = 0
@@ -141,7 +141,10 @@
or m.serial_number like concat('%', #{name}, '%')
or u.unit_name like concat('%', #{name}, '%'))
</if>
- <if test="provinceTag != null ">and p.province_tag = #{provinceTag}</if>
+ <if test="provinceTag != null and cameraFunType == 1">and p.province_tag_video = #{provinceTag}</if>
+ <if test="provinceTag != null and cameraFunType == 2">and p.province_tag_car = #{provinceTag}</if>
+ <if test="provinceTag != null and cameraFunType == 3">and p.province_tag_face = #{provinceTag}</if>
+ <if test="provinceTag != null and recovery == 1">and (p.province_tag_face = #{provinceTag} or p.province_tag_video = #{provinceTag} or p.province_tag_car = #{provinceTag})</if>
<if test="deptTag != null ">and p.dept_tag = #{deptTag}</if>
<if test="siteType != null ">and site_type = #{siteType}</if>
<if test="macAddr != null and macAddr != ''">and mac_addr = #{macAddr}</if>
@@ -180,7 +183,33 @@
${params.dataScope}
</where>
</select>
-
+ <!-- TODO -->
+ <select id="exportTMonitorList" resultType="com.ycl.platform.domain.excel.TMonitorExp">
+ select m.id, m.serial_number, name, ip, camera_fun_type,p.online as onState,
+ d.dept_name, p.id as pointId,p.province_tag,p.dept_tag,p.important_tag,p.important_command_image_tag,u.unit_name as managementUnit
+ from t_monitor m
+ left join t_yw_point p on m.serial_number = p.serial_number and p.deleted = 0
+ left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0
+ left join t_yw_unit u on p.unit_id = u.id and u.deleted = 0
+ <where>
+ p.examine_status = 1
+ <if test="serialNumber != null and serialNumber != ''">and m.serial_number = #{serialNumber}</if>
+ <if test="name != null and name != ''">
+ and (name like concat('%', #{name}, '%')
+ or m.ip like concat('%', #{name}, '%')
+ or m.serial_number like concat('%', #{name}, '%')
+ or u.unit_name like concat('%', #{name}, '%'))
+ </if>
+ <if test="provinceTag != null ">and p.province_tag = #{provinceTag}</if>
+ <if test="deptTag != null ">and p.dept_tag = #{deptTag}</if>
+ <if test="cameraFunType != null and cameraFunType != ''">and camera_fun_type like concat('%',
+ #{cameraFunType}, '%')
+ </if>
+ <if test="onState != null ">and p.online = #{onState}</if>
+ <if test="civilCode != null and civilCode != ''">and civil_code = #{civilCode}</if>
+ </where>
+ </select>
+ <!-- TODO -->
<select id="selectMonitorVOList" resultType="com.ycl.platform.domain.vo.TMonitorVO">
select m.id, m.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude,
camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working,
@@ -190,7 +219,7 @@
left join t_yw_point p on m.serial_number = p.serial_number
left join sys_dept d on p.dept_id = d.dept_id
</select>
-
+ <!-- TODO -->
<select id="selectMonitorResult" resultType = "com.ycl.platform.domain.result.SYS.TMonitorResult">
select m.id, m.serial_number as no,m.name,m.camera_fun_type as monitorType,
d.dept_id,p.province_tag,p.important_tag,p.important_command_image_tag,p.dept_tag,p.online,p.id as pointId
@@ -363,7 +392,6 @@
#{id}
</foreach>
</delete>
-
<select id="getVideoCount" resultType="java.util.Map">
SELECT count(*) AS totalPosts,
IFNULL(SUM(IF(p.online = 1, 1, 0)), 0) AS totalMembers,
@@ -375,8 +403,14 @@
left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0
<where>
camera_fun_type like concat('%', #{cameraFunType}, '%') and p.examine_status = 1
- <if test="provinceTag!=null">
- and p.province_tag = #{provinceTag}
+ <if test="provinceTag!=null and cameraFunType==1">
+ and p.province_tag_video = #{provinceTag}
+ </if>
+ <if test="provinceTag!=null and cameraFunType==2">
+ and p.province_tag_car = #{provinceTag}
+ </if>
+ <if test="provinceTag!=null and cameraFunType==3">
+ and p.province_tag_face = #{provinceTag}
</if>
<if test="deptTag!=null">
and p.dept_tag = #{deptTag}
@@ -398,7 +432,7 @@
p.examine_status = 1
<!-- (p.recovery = 1 OR TIMESTAMPDIFF(DAY, p.recovery_time, NOW()) <![CDATA[<=]]> #{time}) -->
<if test="provinceTag!=null">
- and p.province_tag = #{provinceTag}
+ and (p.province_tag_video = #{provinceTag} or p.province_tag_car = #{provinceTag} or p.province_tag_face = #{provinceTag})
</if>
<if test="deptTag!=null">
and p.dept_tag = #{deptTag}
@@ -472,9 +506,9 @@
COUNT(p2.id) AS errorNum,
COUNT(p3.id) AS normalNum
FROM t_monitor
- LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1<if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
- LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = -1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
- LEFT JOIN t_yw_point p3 ON t_monitor.serial_number = p3.serial_number AND p3.examine_status = 1 AND p3.online = 1 AND p1.id = p3.id<if test="dataScope == 1"> AND p3.province_tag = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if><if test="deptId != null"> AND p3.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1<if test="dataScope == 1"> AND p1.province_tag_video = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = -1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag_video = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p3 ON t_monitor.serial_number = p3.serial_number AND p3.examine_status = 1 AND p3.online = 1 AND p1.id = p3.id<if test="dataScope == 1"> AND p3.province_tag_video = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if><if test="deptId != null"> AND p3.dept_id = #{deptId} </if>
WHERE INSTR(camera_fun_type, 1)
UNION ALL
SELECT
@@ -483,9 +517,9 @@
COUNT(p2.id) AS errorNum,
COUNT(p3.id) AS normalNum
FROM t_monitor
- LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1 <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
- LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = -1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
- LEFT JOIN t_yw_point p3 ON t_monitor.serial_number = p3.serial_number AND p3.examine_status = 1 AND p3.online = 1 AND p1.id = p3.id <if test="dataScope == 1"> AND p3.province_tag = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if><if test="deptId != null"> AND p3.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1 <if test="dataScope == 1"> AND p1.province_tag_car = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = -1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag_car = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p3 ON t_monitor.serial_number = p3.serial_number AND p3.examine_status = 1 AND p3.online = 1 AND p1.id = p3.id <if test="dataScope == 1"> AND p3.province_tag_car = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if><if test="deptId != null"> AND p3.dept_id = #{deptId} </if>
WHERE INSTR(camera_fun_type, 2)
UNION ALL
SELECT
@@ -494,11 +528,12 @@
COUNT(p2.id) AS errorNum,
COUNT(p3.id) AS normalNum
FROM t_monitor
- LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1 <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
- LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = -1 AND p1.id = p2.id<if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
- LEFT JOIN t_yw_point p3 ON t_monitor.serial_number = p3.serial_number AND p3.examine_status = 1 AND p3.online = 1 AND p1.id = p3.id<if test="dataScope == 1"> AND p3.province_tag = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if><if test="deptId != null"> AND p3.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1 <if test="dataScope == 1"> AND p1.province_tag_face = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = -1 AND p1.id = p2.id<if test="dataScope == 1"> AND p2.province_tag_face = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+ LEFT JOIN t_yw_point p3 ON t_monitor.serial_number = p3.serial_number AND p3.examine_status = 1 AND p3.online = 1 AND p1.id = p3.id<if test="dataScope == 1"> AND p3.province_tag_face = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if><if test="deptId != null"> AND p3.dept_id = #{deptId} </if>
WHERE INSTR(camera_fun_type, 3)
</select>
+ <!-- TODO -->
<select id="monitorRate" resultType="com.ycl.platform.domain.vo.screen.MonitorRateVO">
SELECT
*
@@ -512,9 +547,9 @@
COUNT(m2.id) AS faceErrorNum
FROM
sys_dept d
- LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
- LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.online = -1 AND p2.examine_status = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
- LEFT JOIN t_yw_point p3 ON p3.dept_id = d.dept_id AND p3.deleted = 0 AND p3.online = 1 AND p3.examine_status = 1 AND p.id = p3.id <if test="dataScope == 1"> AND p3.province_tag = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag_face = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.online = -1 AND p2.examine_status = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag_face = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p3 ON p3.dept_id = d.dept_id AND p3.deleted = 0 AND p3.online = 1 AND p3.examine_status = 1 AND p.id = p3.id <if test="dataScope == 1"> AND p3.province_tag_face = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if>
LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 3)
LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 3)
LEFT JOIN t_monitor m3 ON m3.serial_number = p3.serial_number AND INSTR(m3.camera_fun_type, 3)
@@ -532,9 +567,9 @@
COUNT(m2.id) AS carErrorNum
FROM
sys_dept d
- LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
- LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.examine_status = 1 AND p2.online = -1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
- LEFT JOIN t_yw_point p3 ON p3.dept_id = d.dept_id AND p3.deleted = 0 AND p3.examine_status = 1 AND p3.online = 1 AND p.id = p3.id <if test="dataScope == 1"> AND p3.province_tag = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag_car = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.examine_status = 1 AND p2.online = -1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag_car = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p3 ON p3.dept_id = d.dept_id AND p3.deleted = 0 AND p3.examine_status = 1 AND p3.online = 1 AND p.id = p3.id <if test="dataScope == 1"> AND p3.province_tag_car = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if>
LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 2)
LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 2)
LEFT JOIN t_monitor m3 ON m3.serial_number = p3.serial_number AND INSTR(m3.camera_fun_type, 2)
@@ -552,9 +587,9 @@
COUNT(m2.id) AS videoErrorNum
FROM
sys_dept d
- LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
- LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.examine_status = 1 AND p2.online = -1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
- LEFT JOIN t_yw_point p3 ON p3.dept_id = d.dept_id AND p3.deleted = 0 AND p3.examine_status = 1 AND p3.online = 1 AND p.id = p3.id <if test="dataScope == 1"> AND p3.province_tag = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag_video = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.examine_status = 1 AND p2.online = -1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag_video = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
+ LEFT JOIN t_yw_point p3 ON p3.dept_id = d.dept_id AND p3.deleted = 0 AND p3.examine_status = 1 AND p3.online = 1 AND p.id = p3.id <if test="dataScope == 1"> AND p3.province_tag_video = 1 </if><if test="dataScope == 3"> AND p3.dept_tag = 1 </if>
LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 1)
LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 1)
LEFT JOIN t_monitor m3 ON m3.serial_number = p3.serial_number AND INSTR(m3.camera_fun_type, 1)
@@ -677,9 +712,11 @@
WHERE
serial_number in <foreach collection="gbList" open="(" separator="," close=")" item="no">#{no}</foreach>
</select>
-
+ <!-- TODO -->
<select id="getDistinctIP" resultType="com.ycl.platform.domain.result.SYS.TMonitorResult">
- select DISTINCT m.id, m.ip,m.serial_number as no,m.name,m.camera_fun_type as monitorType,d.dept_id,p.province_tag,p.important_tag,p.important_command_image_tag,p.dept_tag,p.online
+ select DISTINCT m.id, m.ip,m.serial_number as no,m.name,m.camera_fun_type as monitorType,d.dept_id,
+ p.province_tag,
+ p.important_tag,p.important_command_image_tag,p.dept_tag,p.online
from t_monitor m
left join t_yw_point p on m.serial_number = p.serial_number
left join sys_dept d on p.dept_id = d.dept_id
@@ -695,14 +732,27 @@
update_time = #{online.updateTime}
WHERE
EXISTS (SELECT 1 FROM t_monitor
- <where>
- ip = #{online.ip} AND t_monitor.serial_number = t_yw_point.serial_number
- <if test="online.online!=null and online.online">
- and t_monitor.camera_fun_type = '2' or t_monitor.camera_fun_type = '3'
- </if>
- </where>
- )
+ WHERE ip = #{online.ip}
+ AND t_monitor.serial_number = t_yw_point.serial_number )
</foreach>
</update>
-
+ <update id="batchUpdateOnline">
+ UPDATE
+ t_yw_point p
+ LEFT JOIN t_monitor m on p.serial_number = m.serial_number
+ SET
+ p.online = #{online},
+ p.update_time = #{date}
+ WHERE m.ip in
+ <foreach collection="ipList" open="(" close=")" separator="," item="ip">
+ #{ip}
+ </foreach>
+ </update>
+ <select id="selectCarOrFace" resultType="com.ycl.platform.domain.entity.TMonitor">
+ select m.*
+ from t_monitor m
+ left join t_yw_point p
+ on m.serial_number = p.serial_number
+ where (m.camera_fun_type = '2' or m.camera_fun_type = '3') and p.examine_status = 1
+ </select>
</mapper>
--
Gitblit v1.8.0