From 3bcf550b8323fb0060264b5d160a917d495cf376 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Wed, 15 Jun 2022 11:30:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E4=BF=9D=E5=8C=BA=E5=9F=9F=E4=BA=BA?= =?UTF-8?q?=E6=B5=81=E8=AF=86=E5=88=AB=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PeopleRecognizeController.java | 14 +++++++++--- .../monitormanage/dto/PeopleRecognizeDto.java | 22 +++++++++++++++++++ .../mapper/PeopleRecognizeMapper.java | 7 ++++++ 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/hisense/monitormanage/dto/PeopleRecognizeDto.java 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(); + }