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); + + + }