From c440713b6816be769a6aaea9a5c1bc7afa4e8603 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Mon, 23 May 2022 15:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=BB=99=E5=9F=8E=E7=AE=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 16 +++++++++---- .../monitormanage/dto/ChannelPictureDto.java | 24 +++++++++++++++++++ .../mapper/ChannelPictureMapper.java | 7 ++++++ 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/hisense/monitormanage/dto/ChannelPictureDto.java diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index f791fc9..945ac74 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -59,6 +59,9 @@ public class Controller { @Autowired private BuildingSiteService buildingSitrService; + @Autowired + private ChannelPictureMapper channelPictureMapper; + @GetMapping("all") public Object all(){ @@ -77,9 +80,9 @@ public class Controller { */ @GetMapping("cameras") public Result cameras(){ - List chengguanDtos = cameraMapper.selectCamera(); - Result success = Result.success(chengguanDtos); - success.setCount(chengguanDtos.size()); + List channelPictureDtos = channelPictureMapper.selectByProject(); + Result success = Result.success(channelPictureDtos); + success.setCount(channelPictureDtos.size()); return success; } @@ -280,12 +283,17 @@ public class Controller { } /** - * + * 提供给其他项目分页查询摄像头接口 * @param page * @param pageSize * @return */ @GetMapping("selectCamera") + @ApiOperation("提供给其他项目分页查询摄像头接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page",value = "页码",required = true,dataType = "Integer"), + @ApiImplicitParam(name = "pageSize",value = "页码大小",required = true,dataType = "Integer") + }) public Result selectNLAll(Integer page,Integer pageSize){ List selectNLAll = cameraChannelMapper.selectNLAll(page,pageSize); Result success = Result.success(selectNLAll); diff --git a/src/main/java/com/hisense/monitormanage/dto/ChannelPictureDto.java b/src/main/java/com/hisense/monitormanage/dto/ChannelPictureDto.java new file mode 100644 index 0000000..cb85624 --- /dev/null +++ b/src/main/java/com/hisense/monitormanage/dto/ChannelPictureDto.java @@ -0,0 +1,24 @@ +package com.hisense.monitormanage.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class ChannelPictureDto { + + private String ssqh; + private String xmmc; + private String xmdz; + private String channelCode; + + private String PicUrl; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date insertTime; + + + + +} diff --git a/src/main/java/com/hisense/monitormanage/mapper/ChannelPictureMapper.java b/src/main/java/com/hisense/monitormanage/mapper/ChannelPictureMapper.java index 58eeac4..cba266a 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/ChannelPictureMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/ChannelPictureMapper.java @@ -1,8 +1,15 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hisense.monitormanage.dto.ChannelPictureDto; import com.hisense.monitormanage.entity.ChannelPicture; +import org.apache.ibatis.annotations.Select; + +import java.util.List; public interface ChannelPictureMapper extends BaseMapper { + @Select("select * from t_project p JOIN t_channel_picture cp JOIN t_project_mtm_camera pmc on p.id = pmc.project_id AND cp.channel_code = pmc.channel_code") + List selectByProject(); + }