From 642d5108ac44faa9e70c8b1d167d9194e11cf1bf Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Fri, 5 Aug 2022 11:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E7=82=B9=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=20=E9=87=8D=E7=82=B9=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/KeyAreaController.java | 14 ++++++++++++++ .../com/hisense/monitormanage/entity/KeyArea.java | 2 +- .../monitormanage/mapper/KeyAreaMapper.java | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java index 40a1177..b845331 100644 --- a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java +++ b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java @@ -2,6 +2,7 @@ package com.hisense.monitormanage.controller; import com.hisense.monitormanage.dto.EventDto; import com.hisense.monitormanage.dto.KeyAreaDto; +import com.hisense.monitormanage.entity.KeyArea; import com.hisense.monitormanage.entity.KeyAreaLocation; import com.hisense.monitormanage.entity.PassengerFlow; import com.hisense.monitormanage.entity.Result; @@ -66,6 +67,19 @@ public class KeyAreaController { return success; } + /** + * 根据名称查询重点区域名称 + * @param areaName + * @return + */ + @GetMapping("selectByLikeName") + @ApiOperation("根据名称查询重点区域名称") + public Result selectByLikeName(String areaName){ + List keyAreaLocations = keyAreaMapper.selectByLikeName(areaName); + Result success = Result.success(keyAreaLocations); + return success; + } + /** * 重点区域场景查询所有事件 * @return diff --git a/src/main/java/com/hisense/monitormanage/entity/KeyArea.java b/src/main/java/com/hisense/monitormanage/entity/KeyArea.java index 580a709..9e943ff 100644 --- a/src/main/java/com/hisense/monitormanage/entity/KeyArea.java +++ b/src/main/java/com/hisense/monitormanage/entity/KeyArea.java @@ -13,7 +13,7 @@ public class KeyArea { private String type;//类型 - private String name;//名称 + private String areaName;//名称 private String location;//位置 diff --git a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java index 18c5194..cde7276 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java @@ -19,4 +19,9 @@ public interface KeyAreaMapper extends BaseMapper { @Select("SELECT * FROM t_key_area_location kal JOIN t_key_area ka ON kal.area_id = ka.area_id WHERE ka.area_name = #{areaName}") List selectByAreaName(String areaName); + @Select("select * from t_key_area where area_name like concat('%',#{areaName},'%')") + List selectByLikeName(String areaName); + + + }