diff --git a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java index f9b6982..268226b 100644 --- a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java +++ b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java @@ -74,6 +74,7 @@ public class KeyAreaController { */ @GetMapping("selectByLikeName") @ApiOperation("根据名称查询重点区域名称") + @ApiImplicitParam(name = "areaName",value = "重点区域名称",required = true,dataType = "String") public Result selectByLikeName(String areaName){ List keyAreaLocations = keyAreaMapper.selectByLikeName(areaName); Result success = Result.success(keyAreaLocations); @@ -84,14 +85,14 @@ public class KeyAreaController { * 重点区域场景查询所有事件 * @return */ - @GetMapping("selectAreaEvent") + @GetMapping("selectByAreaEvent") @ApiOperation("重点区域场景查询所有事件") @ApiImplicitParams({ - @ApiImplicitParam(name = "page", value = "页码", required = false, dataType = "Integer"), - @ApiImplicitParam(name = "pageSize", value = "页码大小", required = false, dataType = "Integer") + @ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer") }) - public Result selectAreaEvent(Integer page,Integer pageSize){ - List events = eventMapper.selectEvent(page,pageSize); + public Result selectByAreaEvent(Integer page,Integer pageSize){ + List events = keyAreaMapper.selectByAreaEvent(page,pageSize); events.forEach(event -> { if (event.getEventCnName().equals("街头伞篷") || event.getEventCnName().equals("水果和食品摊") || event.getEventCnName().equals("地摊")|| event.getEventCnName().equals("户外桌椅")){ @@ -107,10 +108,9 @@ public class KeyAreaController { event.setEventNewName(event.getEventCnName()); } }); - Integer integer = eventMapper.selectCountEvent(); - page = integer/pageSize + 1; + Integer integer = keyAreaMapper.selectCountAreaEvent(); Map map = new HashMap<>(); - map.put("page",page); + map.put("sum",integer); map.put("events",events); Result success = Result.success(map); diff --git a/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java b/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java index ca3e280..1204c81 100644 --- a/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java +++ b/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java @@ -13,6 +13,22 @@ public class KeyAreaDto { private String allNums; + private String localNums; + + private String nonlocalNums; + private String timeId; + private String serviceTime;//投用时间 + + private String management;//管理单位 + + private String scenicLevel;//景区级别 + + private String about;//简介 + + private Double longitude; + + private Double latitude; + } diff --git a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java index cde7276..df2a947 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java @@ -1,6 +1,7 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hisense.monitormanage.dto.EventDto; import com.hisense.monitormanage.dto.KeyAreaDto; import com.hisense.monitormanage.entity.KeyArea; import com.hisense.monitormanage.entity.KeyAreaLocation; @@ -13,7 +14,6 @@ import java.util.List; @Repository public interface KeyAreaMapper extends BaseMapper { - @Select("select ka.type,ka.area_name,ka.location,ss.allNums from t_key_area ka LEFT JOIN (select pt.area_name,SUM(pf.all_nums) as allNums from t_passenger_flow pf JOIN t_passenger_test pt ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude WHERE pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name) ss ON ka.area_name = ss.area_name WHERE ka.type = #{type}") List selectKeyAreaList(@Param("type") String type,@Param("timeId") String timeId); @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}") @@ -22,6 +22,11 @@ public interface KeyAreaMapper extends BaseMapper { @Select("select * from t_key_area where area_name like concat('%',#{areaName},'%')") List selectByLikeName(String areaName); + List selectByAreaEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + + @Select("SELECT COUNT(*) FROM t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name WHERE te.track_event = 'START' AND tse.scene_id = 2") + Integer selectCountAreaEvent(); + } diff --git a/src/main/resources/mapper/KeyAreaMapper.xml b/src/main/resources/mapper/KeyAreaMapper.xml index cb20770..8f36b35 100644 --- a/src/main/resources/mapper/KeyAreaMapper.xml +++ b/src/main/resources/mapper/KeyAreaMapper.xml @@ -1,5 +1,26 @@ - + + \ No newline at end of file