diff --git a/src/main/java/com/hisense/monitormanage/controller/PeopleRecognizeController.java b/src/main/java/com/hisense/monitormanage/controller/PeopleRecognizeController.java index ec534fa..057c0f0 100644 --- a/src/main/java/com/hisense/monitormanage/controller/PeopleRecognizeController.java +++ b/src/main/java/com/hisense/monitormanage/controller/PeopleRecognizeController.java @@ -1,6 +1,8 @@ package com.hisense.monitormanage.controller; 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.Result; import com.hisense.monitormanage.mapper.PeopleRecognizeMapper; @@ -28,9 +30,15 @@ public class PeopleRecognizeController { @GetMapping("selectPeopleRecognize") @ApiOperation("查询全部安保区域人流") public Result selectPeopleRecognize(){ - QueryWrapper queryWrapper = new QueryWrapper<>(); - List list = peopleRecognizeMapper.selectList(queryWrapper); - Result success = Result.success(list); + List lists = peopleRecognizeMapper.selectPeopleRecognize(); + for (PeopleRecognizeDto list :lists) { + 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; } } diff --git a/src/main/java/com/hisense/monitormanage/dto/PeopleRecognizeDto.java b/src/main/java/com/hisense/monitormanage/dto/PeopleRecognizeDto.java new file mode 100644 index 0000000..fa641c0 --- /dev/null +++ b/src/main/java/com/hisense/monitormanage/dto/PeopleRecognizeDto.java @@ -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异常 +} diff --git a/src/main/java/com/hisense/monitormanage/mapper/PeopleRecognizeMapper.java b/src/main/java/com/hisense/monitormanage/mapper/PeopleRecognizeMapper.java index d93b737..8edab4e 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/PeopleRecognizeMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/PeopleRecognizeMapper.java @@ -1,7 +1,14 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hisense.monitormanage.dto.PeopleRecognizeDto; import com.hisense.monitormanage.entity.PeopleRecognize; +import org.apache.ibatis.annotations.Select; + +import java.util.List; public interface PeopleRecognizeMapper extends BaseMapper { + @Select("select pr.*,cc.* from t_camera_channel cc JOIN t_people_recognize pr ON cc.channel_code = pr.channel_code") + List selectPeopleRecognize(); + }