ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java
@@ -96,4 +96,6 @@ public Boolean getCameraOperationByCameraId(@Param("id") String id, @Param("userId") String userId); public List<Map<String, Object>> getChannelByCameraId(String id); public List<ArdCameras> findTowerCamerasBySubAndOwnDeptIds(@Param("deptIdList")List<Long> deptIdList); } ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
@@ -292,7 +292,15 @@ } public List findOptions(ArdCameras ardCameras) { List<ArdCameras> options = ardCamerasMapper.findOptions(ardCameras); //List<ArdCameras> options = ardCamerasMapper.findOptions(ardCameras); List<Long> subDeptIdList = sysDeptMapper.selectDeptIdBySub(SecurityUtils.getDeptId());//下属及本权限 List<Long> ownDeptIdList= sysDeptMapper.selectRoleDeptIdByUsersId(SecurityUtils.getUserId());//自定义权限 HashSet<Long> deptIdSet = new HashSet();//去重 deptIdSet.addAll(subDeptIdList); deptIdSet.addAll(ownDeptIdList); List<Long> deptIdList = new ArrayList(); deptIdList.addAll(deptIdSet);//符合条件的全部权限 List<ArdCameras> options = ardCamerasMapper.findTowerCamerasBySubAndOwnDeptIds(deptIdList); for (ArdCameras camera : options) { ArdChannel ardChannel = new ArdChannel(); ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
@@ -398,4 +398,12 @@ inner join sys_config sc on sc.config_key = 'dayNightTime' where ac.device_id = #{id} </select> <select id="findTowerCamerasBySubAndOwnDeptIds" parameterType="java.lang.String" resultMap = "ArdCamerasResult"> select * from ard_cameras where dept_id in <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")"> #{deptId} </foreach> and tower_id is not null order by create_time desc </select> </mapper>