| | |
| | | */ |
| | | public ArdCameras checkCameraIpAndPortUnique(@Param("ip") String ip, @Param("port")Integer port); |
| | | |
| | | public List<Map<String, Object>> getCamerasByDeptId(@Param("deptId")Long deptId,@Param("userId")String userId); |
| | | //public List<Map<String, Object>> getCamerasByDeptId(@Param("deptId")Long deptId,@Param("userId")String userId); |
| | | public List<Map<String, Object>> getCamerasByDeptId(@Param("deptIdList")List<Long> deptIdList,@Param("userId")String userId); |
| | | |
| | | public Boolean getCameraOperationByCameraId(@Param("id") String id, @Param("userId") String userId); |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getCamerasByDeptId(Long deptId,String userId) { |
| | | List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptId,userId); |
| | | List<Long> deptIdList = new ArrayList(); |
| | | deptIdList.add(deptId); |
| | | deptIdList = getOwnAndChildrenDeptIdList(deptIdList,new ArrayList());//递归查询下属部门主键 |
| | | //List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptId,userId); |
| | | List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptIdList,userId); |
| | | return result; |
| | | } |
| | | |
| | | public List<Long> getOwnAndChildrenDeptIdList(List<Long> deptIdList,List<Long> deptIdListr){ |
| | | deptIdListr.addAll(deptIdList); |
| | | List<Long> result = sysDeptMapper.getChildrenDeptIdList(deptIdList); |
| | | if(result.size() != 0){ |
| | | deptIdListr.addAll(result); |
| | | result = getOwnAndChildrenDeptIdList(result,deptIdListr); |
| | | } |
| | | deptIdListr = deptIdListr.stream().distinct().collect(Collectors.toList()); |
| | | return deptIdListr; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean getCameraOperationByCameraId(String id, String userId) { |
| | | Boolean result = ardCamerasMapper.getCameraOperationByCameraId(id,userId); |
| | |
| | | where ip = #{ip}
|
| | | and port = #{port} limit 1
|
| | | </select>
|
| | | <select id="getCamerasByDeptId" resultType="java.util.Map" >
|
| | | <!--<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",
|
| | |
| | | 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="getCamerasByDeptId" resultType="java.util.Map" >
|
| | | select distinct * from (
|
| | | 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 ard_cameras ac
|
| | | 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 ac.dept_id in
|
| | | <foreach collection="deptIdList" open="(" close=")" separator="," item="deptId">
|
| | | #{deptId}
|
| | | </foreach>
|
| | | 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_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
|