安保区域人流识别接口优化

This commit is contained in:
wuweida 2022-06-15 11:30:23 +08:00
parent cdb2bc5f87
commit 3bcf550b83
3 changed files with 40 additions and 3 deletions

View File

@ -1,6 +1,8 @@
package com.hisense.monitormanage.controller; package com.hisense.monitormanage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hisense.monitormanage.dto.ChannelLabelDto;
import com.hisense.monitormanage.dto.PeopleRecognizeDto;
import com.hisense.monitormanage.entity.PeopleRecognize; import com.hisense.monitormanage.entity.PeopleRecognize;
import com.hisense.monitormanage.entity.Result; import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.mapper.PeopleRecognizeMapper; import com.hisense.monitormanage.mapper.PeopleRecognizeMapper;
@ -28,9 +30,15 @@ public class PeopleRecognizeController {
@GetMapping("selectPeopleRecognize") @GetMapping("selectPeopleRecognize")
@ApiOperation("查询全部安保区域人流") @ApiOperation("查询全部安保区域人流")
public Result selectPeopleRecognize(){ public Result selectPeopleRecognize(){
QueryWrapper<PeopleRecognize> queryWrapper = new QueryWrapper<>(); List<PeopleRecognizeDto> lists = peopleRecognizeMapper.selectPeopleRecognize();
List<PeopleRecognize> list = peopleRecognizeMapper.selectList(queryWrapper); for (PeopleRecognizeDto list :lists) {
Result success = Result.success(list); String nodeName = list.getNodeName();
list.setNewNodeName(nodeName);
String[] splits = nodeName.split("->");
String split = splits[1];
list.setNodeName(split);
}
Result success = Result.success(lists);
return success; return success;
} }
} }

View File

@ -0,0 +1,22 @@
package com.hisense.monitormanage.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class PeopleRecognizeDto {
private String channelCode;
private String channelName;
private String picUrl;
private Integer personNum;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date insertTime;
private String gpsX;
private String gpsY;
private Integer status;//1在线0离线
private String nodeName;
private String newNodeName;
private Integer checkStatus;//1正常0异常
}

View File

@ -1,7 +1,14 @@
package com.hisense.monitormanage.mapper; package com.hisense.monitormanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.monitormanage.dto.PeopleRecognizeDto;
import com.hisense.monitormanage.entity.PeopleRecognize; import com.hisense.monitormanage.entity.PeopleRecognize;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface PeopleRecognizeMapper extends BaseMapper<PeopleRecognize> { public interface PeopleRecognizeMapper extends BaseMapper<PeopleRecognize> {
@Select("select pr.*,cc.* from t_camera_channel cc JOIN t_people_recognize pr ON cc.channel_code = pr.channel_code")
List<PeopleRecognizeDto> selectPeopleRecognize();
} }