From 133098a6f81de1de99cb0a5c829b7d1b39105e84 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: Thu, 29 Feb 2024 17:03:11 +0800
Subject: [PATCH] 获取附近相机增加数据权限

---
 ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java |   16 +++++++++-------
 ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml              |    9 ++++++---
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java b/ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java
index 81e6a6d..719ede0 100644
--- a/ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java
@@ -2,13 +2,14 @@
 
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.device.camera.domain.ArdCameras;
 import org.apache.ibatis.annotations.Param;
 
 
 /**
  * 相机设备Mapper接口
- * 
+ *
  * @author 刘苏义
  * @date 2023-02-11
  */
@@ -16,7 +17,7 @@
 {
     /**
      * 查询相机设备
-     * 
+     *
      * @param id 相机设备主键
      * @return 相机设备
      */
@@ -24,10 +25,11 @@
 
     /**
      * 查询相机设备列表
-     * 
+     *
      * @param ardCameras 相机设备
      * @return 相机设备集合
      */
+    @DataScope(deptAlias = "d")
     public List<ArdCameras> selectArdCamerasList(ArdCameras ardCameras);
     /**
      * 查询相机设备列表(不过滤)
@@ -38,7 +40,7 @@
     public List<ArdCameras>selectArdCamerasListNoDataScope(ArdCameras ardCameras);
     /**
      * 新增相机设备
-     * 
+     *
      * @param ardCameras 相机设备
      * @return 结果
      */
@@ -46,7 +48,7 @@
 
     /**
      * 修改相机设备
-     * 
+     *
      * @param ardCameras 相机设备
      * @return 结果
      */
@@ -54,7 +56,7 @@
 
     /**
      * 删除相机设备
-     * 
+     *
      * @param id 相机设备主键
      * @return 结果
      */
@@ -62,7 +64,7 @@
 
     /**
      * 批量删除相机设备
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
diff --git a/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml b/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
index 64e4e3a..897dcd2 100644
--- a/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
+++ b/ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
@@ -281,7 +281,10 @@
         from ard_cameras
         where dept_id = #{deptId}
     </select>
-    <select id="checkCameraIpAndPortUnique"  resultMap="ArdCamerasResult">
-        select * from ard_cameras where ip=#{ip} and port=#{port} limit 1
+    <select id="checkCameraIpAndPortUnique" resultMap="ArdCamerasResult">
+        select *
+        from ard_cameras
+        where ip = #{ip}
+          and port = #{port} limit 1
     </select>
-</mapper>
\ No newline at end of file
+</mapper>

--
Gitblit v1.9.3