From 4d6a6a364947150962e58aa16d474f3bdcbfb3b9 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 10 May 2022 13:54:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=91=84=E5=83=8F=E5=A4=B4?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 26 ++++++++++++++----- .../monitormanage/dto/CameraChannelDto.java | 14 ++++++++++ .../mapper/CameraChannelMapper.java | 13 ++++++---- .../resources/mapper/CameraChannelMapper.xml | 8 ++++++ 4 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/hisense/monitormanage/dto/CameraChannelDto.java diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 41ed5bf..71f6350 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -1,5 +1,6 @@ package com.hisense.monitormanage.controller; +import com.hisense.monitormanage.dto.CameraChannelDto; import com.hisense.monitormanage.dto.ChannelLabelDto; import com.hisense.monitormanage.dto.ChengguanDto; import com.hisense.monitormanage.dto.ScenicCameraDto; @@ -9,13 +10,9 @@ import com.hisense.monitormanage.service.MonitorService; import com.hisense.monitormanage.service.SedimentTrailService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.lang.reflect.Method; -import java.time.Clock; -import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -101,9 +98,26 @@ public class Controller { * @return */ @RequestMapping("selectAll") - public Result selectAll(CameraChannel cameraChannel){ + public Result selectAll(CameraChannel cameraChannel,Integer page,Integer pageSize){ - List list = cameraChannelMapper.selectAll(cameraChannel); + List list = cameraChannelMapper.selectAll(cameraChannel,page,pageSize); + + Result success = Result.success(list); + + return success; + + + } + + /** + * 根据channelId查询摄像头详细信息 + * @param channelId + * @return + */ + @RequestMapping("selectByChannelId") + public Result selectByChannelId(String channelId){ + + List list = cameraChannelMapper.selectByChannelId(channelId); Result success = Result.success(list); diff --git a/src/main/java/com/hisense/monitormanage/dto/CameraChannelDto.java b/src/main/java/com/hisense/monitormanage/dto/CameraChannelDto.java new file mode 100644 index 0000000..bc8fe82 --- /dev/null +++ b/src/main/java/com/hisense/monitormanage/dto/CameraChannelDto.java @@ -0,0 +1,14 @@ +package com.hisense.monitormanage.dto; + +import lombok.Data; + +@Data +public class CameraChannelDto { + + private String channelCode; + + private String gpsX; + + private String gpsY; + +} diff --git a/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java b/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java index 20209ab..b2ab11b 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java @@ -1,6 +1,7 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hisense.monitormanage.dto.CameraChannelDto; import com.hisense.monitormanage.dto.ChannelLabelDto; import com.hisense.monitormanage.dto.ChengguanDto; import com.hisense.monitormanage.entity.CameraChannel; @@ -12,9 +13,11 @@ import org.apache.ibatis.annotations.Update; import java.util.List; public interface CameraChannelMapper extends BaseMapper { - @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 selectAll(CameraChannel cameraChannel); + + List selectAll(CameraChannel cameraChannel,@Param("page") Integer page,@Param("pageSize") Integer pageSize); + + @Select("select * from t_camera_channel where channel_id = #{channelId}") + List selectByChannelId(@Param("channelId") String channelId); @Select("select * from t_camera_channel where parent_id = #{parentId}") List selectByParentId(@Param("parentId") String parentId); @@ -28,10 +31,10 @@ public interface CameraChannelMapper extends BaseMapper { @Select("select * from t_label") List