From 606c6a34fe4bd3fad543a2f41eafe294a331685e Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期一, 18 三月 2024 15:46:03 +0800
Subject: [PATCH] 增加流媒体删除异常捕获

---
 ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml |   85 +++++++++++++++++++++++++-----------------
 1 files changed, 50 insertions(+), 35 deletions(-)

diff --git a/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml b/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
index b084616..0a4d585 100644
--- a/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
+++ b/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
@@ -288,41 +288,56 @@
         where ip = #{ip}
           and port = #{port} limit 1
     </select>
-    <select id="getCamerasByDeptId" resultType="java.util.Map" parameterType="java.lang.Long">
-        with recursive rsd as (
-            select ac.id,ac.name,ac.ip,ac.port,ac.username,ac.password,ac.longitude,ac.latitude,ac.altitude,ac.channel,ac.dept_id as "deptId",
-                   ac.gdtype,ac.state,sdd.dict_label as "dictLabel",sdd0.dict_label as factory,
-                   case sdd0.dict_label
-                       when '娴峰悍' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/h264/ch1/main/av_stream')
-                       when '澶у崕' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/cam/realmonitor?channel=1&amp;subtype=1')
-                       end as rtsp
-            from sys_dept sd
-                     inner join ard_cameras ac on sd.dept_id = ac.dept_id
-                     inner join sys_dict_data sdd on ac.gdtype = sdd.dict_value
-                     inner join sys_dict_type sdt on sdd.dict_type = sdt.dict_type
-                     inner join sys_dict_data sdd0 on ac.factory = sdd0.dict_value
-                     inner join sys_dict_type sdt0 on sdd0.dict_type = sdt0.dict_type
-            where sd.dept_id = #{deptId}
-              and sdt.dict_type = 'camera_type' and (sdd.dict_label = '灏忓厜鐢�' or sdd.dict_label = '澶у厜鐢�')
-              and sdt0.dict_type = 'factory'
-            union
-            select ac.id,ac.name,ac.ip,ac.port,ac.username,ac.password,ac.longitude,ac.latitude,ac.altitude,ac.channel,ac.dept_id as "deptId",
-                   ac.gdtype,ac.state,sdd.dict_label as "dictLabel",sdd0.dict_label as factory,
-                   case sdd0.dict_label
-                       when '娴峰悍' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/h264/ch1/main/av_stream')
-                       when '澶у崕' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/cam/realmonitor?channel=1&amp;subtype=1')
-                       end as rtsp
-            from sys_dept csd
-                     inner join rsd on rsd."deptId" = csd.parent_id
-                     inner join ard_cameras ac on csd.dept_id = ac.dept_id
-                     inner join sys_dict_data sdd on ac.gdtype = sdd.dict_value
-                     inner join sys_dict_type sdt on sdd.dict_type = sdt.dict_type
-                     inner join sys_dict_data sdd0 on ac.factory = sdd0.dict_value
-                     inner join sys_dict_type sdt0 on sdd0.dict_type = sdt0.dict_type
-                and sdt.dict_type = 'camera_type' and (sdd.dict_label = '灏忓厜鐢�' or sdd.dict_label = '澶у厜鐢�')
-                and sdt0.dict_type = 'factory'
-        )
-        select distinct * from rsd order by "dictLabel"
+    <select id="getCamerasByDeptId" resultType="java.util.Map" >
+        select distinct * from (
+           with recursive rsd as (
+               select ac.id,ac.name,ac.ip,ac.port,ac.username,ac.password,ac.longitude,ac.latitude,ac.altitude,ac.channel,ac.dept_id as "deptId",
+                      ac.gdtype,ac.state,sdd.dict_label as "dictLabel",sdd0.dict_label as factory,
+                      case sdd0.dict_label
+                          when '娴峰悍' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/h264/ch1/main/av_stream')
+                          when '澶у崕' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/cam/realmonitor?channel=1&amp;subtype=1')
+                          end as rtsp
+               from sys_dept sd
+                        inner join ard_cameras ac on sd.dept_id = ac.dept_id
+                        inner join sys_dict_data sdd on ac.gdtype = sdd.dict_value
+                        inner join sys_dict_type sdt on sdd.dict_type = sdt.dict_type
+                        inner join sys_dict_data sdd0 on ac.factory = sdd0.dict_value
+                        inner join sys_dict_type sdt0 on sdd0.dict_type = sdt0.dict_type
+               where sd.dept_id = #{deptId}
+                 and sdt.dict_type = 'camera_type' and (sdd.dict_label = '灏忓厜鐢�' or sdd.dict_label = '澶у厜鐢�')
+                 and sdt0.dict_type = 'factory'
+               union
+               select ac.id,ac.name,ac.ip,ac.port,ac.username,ac.password,ac.longitude,ac.latitude,ac.altitude,ac.channel,ac.dept_id as "deptId",
+                      ac.gdtype,ac.state,sdd.dict_label as "dictLabel",sdd0.dict_label as factory,
+                      case sdd0.dict_label
+                          when '娴峰悍' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/h264/ch1/main/av_stream')
+                          when '澶у崕' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/cam/realmonitor?channel=1&amp;subtype=1')
+                          end as rtsp
+               from sys_dept csd
+                        inner join rsd on rsd."deptId" = csd.parent_id
+                        inner join ard_cameras ac on csd.dept_id = ac.dept_id
+                        inner join sys_dict_data sdd on ac.gdtype = sdd.dict_value
+                        inner join sys_dict_type sdt on sdd.dict_type = sdt.dict_type
+                        inner join sys_dict_data sdd0 on ac.factory = sdd0.dict_value
+                        inner join sys_dict_type sdt0 on sdd0.dict_type = sdt0.dict_type
+                   and sdt.dict_type = 'camera_type' and (sdd.dict_label = '灏忓厜鐢�' or sdd.dict_label = '澶у厜鐢�')
+                   and sdt0.dict_type = 'factory')
+           select * from rsd
+           union
+           select ac.id,ac.name,ac.ip,ac.port,ac.username,ac.password,ac.longitude,ac.latitude,ac.altitude,ac.channel,ac.dept_id as "deptId",
+                  ac.gdtype,ac.state,sdd.dict_label as "dictLabel",sdd0.dict_label as factory,
+                  case sdd0.dict_label
+                      when '娴峰悍' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/h264/ch1/main/av_stream')
+                      when '澶у崕' then concat('rtsp://',ac.username,':',ac.password,'@',ac.ip,':',ac.rtsp_port,'/cam/realmonitor?channel=1&amp;subtype=1')
+                      end as rtsp from sys_user_role sur
+                                           inner join sys_role_dept srd on sur.role_id = srd.role_id
+                                           inner join ard_cameras ac on srd.dept_id = ac.dept_id
+                                           inner join sys_dict_data sdd on ac.gdtype = sdd.dict_value
+                                           inner join sys_dict_type sdt on sdd.dict_type = sdt.dict_type
+                                           inner join sys_dict_data sdd0 on ac.factory = sdd0.dict_value
+                                           inner join sys_dict_type sdt0 on sdd0.dict_type = sdt0.dict_type
+           where sur.user_id = #{userId} and sdt.dict_type = 'camera_type' and (sdd.dict_label = '灏忓厜鐢�' or sdd.dict_label = '澶у厜鐢�') and sdt0.dict_type = 'factory'
+       )t order by "dictLabel"
     </select>
     <select id="getCameraOperationByCameraId" resultType="java.lang.Boolean" parameterType="java.lang.String">
         select

--
Gitblit v1.9.3