zhangnaisong
2024-05-31 9091740e4964c6065c6549cd1599624d0fb24cbd
巡检需要的大光电查询修改提交
已修改3个文件
20 ■■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCamerasMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>