添加重点区域模糊查询区域名称

重点区域实体类字段修改
This commit is contained in:
wuweida 2022-08-05 11:29:01 +08:00
parent 8251e38ec0
commit 642d5108ac
3 changed files with 20 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package com.hisense.monitormanage.controller;
import com.hisense.monitormanage.dto.EventDto; import com.hisense.monitormanage.dto.EventDto;
import com.hisense.monitormanage.dto.KeyAreaDto; import com.hisense.monitormanage.dto.KeyAreaDto;
import com.hisense.monitormanage.entity.KeyArea;
import com.hisense.monitormanage.entity.KeyAreaLocation; import com.hisense.monitormanage.entity.KeyAreaLocation;
import com.hisense.monitormanage.entity.PassengerFlow; import com.hisense.monitormanage.entity.PassengerFlow;
import com.hisense.monitormanage.entity.Result; import com.hisense.monitormanage.entity.Result;
@ -66,6 +67,19 @@ public class KeyAreaController {
return success; return success;
} }
/**
* 根据名称查询重点区域名称
* @param areaName
* @return
*/
@GetMapping("selectByLikeName")
@ApiOperation("根据名称查询重点区域名称")
public Result selectByLikeName(String areaName){
List<KeyArea> keyAreaLocations = keyAreaMapper.selectByLikeName(areaName);
Result success = Result.success(keyAreaLocations);
return success;
}
/** /**
* 重点区域场景查询所有事件 * 重点区域场景查询所有事件
* @return * @return

View File

@ -13,7 +13,7 @@ public class KeyArea {
private String type;//类型 private String type;//类型
private String name;//名称 private String areaName;//名称
private String location;//位置 private String location;//位置

View File

@ -19,4 +19,9 @@ public interface KeyAreaMapper extends BaseMapper<KeyArea> {
@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}") @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<KeyAreaLocation> selectByAreaName(String areaName); List<KeyAreaLocation> selectByAreaName(String areaName);
@Select("select * from t_key_area where area_name like concat('%',#{areaName},'%')")
List<KeyArea> selectByLikeName(String areaName);
} }