按标签查询摄像头接口优化

This commit is contained in:
wuweida 2022-05-12 11:46:25 +08:00
parent b0e4365e04
commit bd038a0c22
2 changed files with 3 additions and 12 deletions

View File

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

View File

@ -21,8 +21,8 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
@Select("select * from t_camera_channel where parent_id = #{parentId}") @Select("select * from t_camera_channel where parent_id = #{parentId}")
List<CameraChannel> selectByParentId(@Param("parentId") String parentId); List<CameraChannel> selectByParentId(@Param("parentId") String parentId);
@Select("select * from (select a.*,c.* from t_channel_mtm_label b JOIN t_label a JOIN t_camera_channel c " + @Select("select c.channel_code,c.gps_x,c.gps_y,c.node_name from t_camera_channel c where channel_code in " +
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code where c.`status`!= 0) m where m.label_code = #{labelCode} ") "(select b.channel_code from t_channel_mtm_label b where b.label_code = #{labelCode}) ")
List<ChannelLabelDto> selectLabel(@Param("labelCode") String labelCode); List<ChannelLabelDto> selectLabel(@Param("labelCode") String labelCode);
//@Update("update t_camera_channel set state = list") //@Update("update t_camera_channel set state = list")
void updateState(@Param("list") List list); void updateState(@Param("list") List list);
@ -41,4 +41,5 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
List<ChannelLabelDto> selectLabelAndChannel(@Param("labelCode") String labelCode,@Param("labelCode1") String labelCode1); List<ChannelLabelDto> selectLabelAndChannel(@Param("labelCode") String labelCode,@Param("labelCode1") String labelCode1);
} }