| | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
| | | import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
|
| | | import com.ruoyi.common.constant.CameraConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.device.camera.domain.ArdCameras;
|
| | | import com.ruoyi.device.camera.domain.CameraCmd;
|
| | | import com.ruoyi.device.camera.domain.DeptAndCamerasDto;
|
| | |
| | | TreeMap nearCamerasBycoordinate = ardCamerasService.getNearCamerasBycoordinate(cmd);
|
| | | return AjaxResult.success(nearCamerasBycoordinate);
|
| | | }
|
| | |
|
| | | @GetMapping("/getCamerasByDeptId")
|
| | | @ApiOperation("获取权限及下属权限下的相机")
|
| | | public AjaxResult getCamerasByDeptId() {
|
| | | Long deptId = SecurityUtils.getDeptId();
|
| | | List<Map<String,Object>> camerasList = ardCamerasService.getCamerasByDeptId(deptId);
|
| | | return AjaxResult.success(camerasList);
|
| | | }
|
| | | }
|
| | |
| | | package com.ruoyi.device.camera.mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | |
| | | * @return 相机信息 |
| | | */ |
| | | public ArdCameras checkCameraIpAndPortUnique(@Param("ip") String ip, @Param("port")Integer port); |
| | | |
| | | public List<Map<String, Object>> getCamerasByDeptId(Long deptId); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | public String checkCameraIpAndPortUnique(ArdCameras camera); |
| | | |
| | | public List<Map<String,Object>> getCamerasByDeptId(Long deptId); |
| | | } |
| | |
| | | } |
| | | return CameraConstants.UNIQUE; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getCamerasByDeptId(Long deptId) { |
| | | List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptId); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | 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&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&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>
|
| | | </mapper>
|