查询摄像头标签接口优化

This commit is contained in:
wuweida 2022-05-26 10:13:12 +08:00
parent f61093b6d7
commit 85157456b8
4 changed files with 15 additions and 8 deletions

View File

@ -114,7 +114,7 @@ public class Controller {
@GetMapping("capture1") @GetMapping("capture1")
public Object capture1(){ public Object capture1(){
monitorService.screenShot1(); monitorService.listChannelPlayStates();
return "finish capture"; return "finish capture";
} }
@ -292,10 +292,12 @@ public class Controller {
@ApiOperation("提供给其他项目分页查询摄像头接口") @ApiOperation("提供给其他项目分页查询摄像头接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "page",value = "页码",required = true,dataType = "Integer"), @ApiImplicitParam(name = "page",value = "页码",required = true,dataType = "Integer"),
@ApiImplicitParam(name = "pageSize",value = "页码大小",required = true,dataType = "Integer") @ApiImplicitParam(name = "pageSize",value = "页码大小",required = true,dataType = "Integer"),
@ApiImplicitParam(name = "labelCode",value = "标签号",required = false,dataType = "String")
}) })
public Result selectNLAll(Integer page,Integer pageSize){ public Result selectNLAll(Integer page,Integer pageSize,String labelCode){
List<CameraChannelNLDto> selectNLAll = cameraChannelMapper.selectNLAll(page,pageSize); List<CameraChannelNLDto> selectNLAll = cameraChannelMapper.selectNLAll(page,pageSize,labelCode);
Result success = Result.success(selectNLAll); Result success = Result.success(selectNLAll);
return success; return success;
} }

View File

@ -52,6 +52,6 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
@Param("gpsY1") Double gpsY1); @Param("gpsY1") Double gpsY1);
List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize); List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize,@Param("labelCode") String labelCode);
} }

View File

@ -791,7 +791,7 @@ public class MonitorService {
//获取当前时间和前一天的UTC时间 //获取当前时间和前一天的UTC时间
Map<String,Object> condition = new HashMap<>(); Map<String,Object> condition = new HashMap<>();
ZonedDateTime endUTC = ZonedDateTime.now(ZoneOffset.UTC); ZonedDateTime endUTC = ZonedDateTime.now(ZoneOffset.UTC);
ZonedDateTime startUTC = endUTC.minusDays(30); ZonedDateTime startUTC = endUTC.minusDays(60);
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'"); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'");
condition.put("checkStatus",0); condition.put("checkStatus",0);
condition.put("startTime",dateTimeFormatter.format(startUTC)); condition.put("startTime",dateTimeFormatter.format(startUTC));

View File

@ -25,9 +25,14 @@
</update> </update>
<select id="selectNLAll" resultType="com.hisense.monitormanage.dto.CameraChannelNLDto"> <select id="selectNLAll" resultType="com.hisense.monitormanage.dto.CameraChannelNLDto">
SELECT a.label_name,d.* from t_label a JOIN (select b.label_code,c.* from t_camera_channel c SELECT a.label_name,d.* from t_label a RIGHT JOIN (select b.label_code,c.* from t_camera_channel c
JOIN t_channel_mtm_label b on c.channel_code = b.channel_code where label_code != '') d LEFT JOIN t_channel_mtm_label b on c.channel_code = b.channel_code) d
on d.label_code = a.label_code on d.label_code = a.label_code
<where>
<if test="labelCode != null and labelCode != ''">
d.label_code = #{labelCode}
</if>
</where>
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize} limit #{page},#{pageSize}
</select> </select>