添加重点区域场景接口

This commit is contained in:
wuweida 2022-07-15 09:14:15 +08:00
parent f39d0f7165
commit 0572c41a41
5 changed files with 60 additions and 4 deletions

View File

@ -0,0 +1,38 @@
package com.hisense.monitormanage.controller;
import com.hisense.monitormanage.dto.KeyAreaDto;
import com.hisense.monitormanage.entity.PassengerFlow;
import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.mapper.KeyAreaMapper;
import com.hisense.monitormanage.mapper.PassengerFlowMapper;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("api/project/keyArea")
@Api(tags = "重点区域")
public class KeyAreaController {
@Autowired
private KeyAreaMapper keyAreaMapper;
@Autowired
private PassengerFlowMapper passengerFlowMapper;
@GetMapping("seelctKeyAreaList")
public Result seelctKeyAreaList(String type){
PassengerFlow maxId = passengerFlowMapper.getByMaxId();
String timeId = maxId.getTimeId();
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.seelctKeyAreaList(type,timeId);
keyAreaDtos.forEach(keyAreaDto -> {
keyAreaDto.setTimeId(timeId);
});
Result success = Result.success(keyAreaDtos);
return success;
}
}

View File

@ -0,0 +1,12 @@
package com.hisense.monitormanage.dto;
import lombok.Data;
@Data
public class KeyAreaDto {
private String type;
private String areaName;
private String location;
private String allNums;
private String timeId;
}

View File

@ -58,6 +58,6 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
@Select("SELECT * FROM t_camera_channel WHERE channel_code < '404_37020323541317325139' AND channel_code > '404_37020300001310016729' ORDER BY channel_code DESC" )
@Select("SELECT * FROM t_camera_channel WHERE channel_code < '404_37020310541317325240' AND channel_code > '404_37020300001310016729' ORDER BY channel_code DESC" )
List<CameraChannel> selectCameraChannel();
}

View File

@ -1,8 +1,10 @@
package com.hisense.monitormanage.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.monitormanage.dto.KeyAreaDto;
import com.hisense.monitormanage.entity.KeyArea;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -10,5 +12,9 @@ import java.util.List;
@Repository
public interface KeyAreaMapper extends BaseMapper<KeyArea> {
List<KeyArea> seelctKeyAreaList(String timeId);
@Select("select ka.type,ka.area_name,ka.location,ss.allNums from t_key_area ka LEFT JOIN (select pt.area_name,SUM(pf.all_nums) as allNums from t_passenger_flow pf JOIN t_passenger_test pt ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude WHERE pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name) ss ON ka.area_name = ss.area_name WHERE ka.type = #{type}")
List<KeyAreaDto> seelctKeyAreaList(@Param("type") String type,@Param("timeId") String timeId);
}

View File

@ -298,7 +298,7 @@ public class MonitorService {
}
}
@Scheduled(cron = "0 0 7 * * ?")
@Scheduled(cron = "0 30 8 * * ?")
public void CameraScreenshot () {
try {
log.info("[monitor-capture]: start capture");