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(); + }