按标签查询相应的摄像头

This commit is contained in:
wuweida 2022-05-07 10:30:13 +08:00
parent 675e353d46
commit 81773d9216
5 changed files with 73 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.hisense.monitormanage.controller;
import com.hisense.monitormanage.dto.ChannelLabelDto;
import com.hisense.monitormanage.dto.ChengguanDto;
import com.hisense.monitormanage.dto.ScenicCameraDto;
import com.hisense.monitormanage.entity.CameraChannel;
@ -133,6 +134,11 @@ public class Controller {
return monitorService.reverseGeocode(map);
}
/**
* 查询摄像头
* @param cameraChannel
* @return
*/
@RequestMapping("selectAll")
public Result selectAll(CameraChannel cameraChannel){
@ -154,6 +160,19 @@ public class Controller {
return success;
}
/**
* 根据标签查询对应摄像头
* @return
*/
@RequestMapping("selectLabel")
public Result selectLabel(String labelCode){
List<ChannelLabelDto> channelLabelDtos = cameraChannelMapper.selectLabel(labelCode);
Result success = Result.success(channelLabelDtos);
return success;
}
}

View File

@ -0,0 +1,27 @@
package com.hisense.monitormanage.dto;
import lombok.Data;
@Data
public class ChannelLabelDto {
private String labelCode;
private String labelName;
private String channelCode;
private String channelId;
private String channelName;
private String gpsX;
private String gpsY;
private Integer status;//1在线0离线
private String nodeName;
private Integer checkStatus;//1正常0异常
}

View File

@ -0,0 +1,15 @@
package com.hisense.monitormanage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("t_label")
public class Label {
@TableId
private Long id;
private String labelCode;
private String labelName;
}

View File

@ -1,6 +1,8 @@
package com.hisense.monitormanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.monitormanage.dto.ChannelLabelDto;
import com.hisense.monitormanage.dto.ChengguanDto;
import com.hisense.monitormanage.entity.CameraChannel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -8,12 +10,16 @@ import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
@Select("select c.* from t_camera_channel c where (c.gps_x NOT IN('0.0','0','') OR c.gps_y NOT IN('0.0','0','')) AND c.status != 0")
@Select("select c.* from t_camera_channel c where (c.gps_x NOT IN('0.0','0','') " +
"OR c.gps_y NOT IN('0.0','0','')) AND c.status != 0")
List<CameraChannel> selectAll(CameraChannel cameraChannel);
@Select("select * from t_camera_channel where idt_camera_channel = #{idtCameraChannel}")
List<String> selectById(@Param("idtCameraChannel") String idtCameraChannel);
@Select("select * from (select a.*,c.* from t_channel_mtm_label b JOIN t_label a JOIN t_camera_channel c " +
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code ) m where m.label_code = #{labelCode} ")
List<ChannelLabelDto> selectLabel(@Param("labelCode") String labelCode);

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hisense.monitormanage.mapper.CameraChannelMapper">
</mapper>