积水点场景添加根据经纬度查询积水点周边监控

在建工地场景接口优化
This commit is contained in:
wuweida 2022-08-12 15:49:45 +08:00
parent 28486c637e
commit 5e3db658b0
4 changed files with 38 additions and 5 deletions

View File

@ -3,11 +3,14 @@ package com.hisense.monitormanage.controller;
import com.hisense.monitormanage.dto.WaterCameraDto;
import com.hisense.monitormanage.dto.WaterPointDto;
import com.hisense.monitormanage.dto.WaterPointDtos;
import com.hisense.monitormanage.entity.CameraChannel;
import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.entity.WaterPoint;
import com.hisense.monitormanage.mapper.WaterPointMapper;
import com.hisense.monitormanage.utils.LongLatUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -98,4 +101,26 @@ public class WaterPointController {
Result success = Result.success(waterCameras);
return success;
}
/**
* 根据经纬度查询积水点周边监控
* @param longitude
* @param latitude
* @param radius
* @return
*/
@GetMapping ("selectByLongAndLiti")
@ApiOperation("根据经纬度查询积水点周边监控")
@ApiImplicitParams({
@ApiImplicitParam(name = "longitude", value = "经度",required = true,dataType ="Double"),
@ApiImplicitParam(name = "latitude", value = "纬度",required = true,dataType ="Double"),
@ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),}
)
public Result selectByLongAndLiti(Double longitude,Double latitude,Integer radius){
double[] around = LongLatUtil.getAround(longitude, latitude, radius);
List<WaterPoint> c = waterPointMapper.selectByLongAndLiti(around[0], around[2], around[1], around[3]);
Result success = Result.success(c);
return success;
}
}

View File

@ -42,7 +42,7 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
List<EventDto> selectByAllEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
@Select("select COUNT(*) from t_event WHERE camera_name IN ('博海建设南昌路127号现场','青城建设蚌埠路以北宁乡路以西门') AND track_event = 'START'")
@Select("select COUNT(*) from t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name where te.track_event = 'START'")
Integer selectCountEvent();
@Select("select COUNT(*) from (select br.pm10 from t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc where br.pm10 > 80) a ")
@ -71,7 +71,7 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
@Select("select * from t_road_data where pm10 > 150 AND dt = #{dt}")
List<RoadData> selectByDayRoadData(String dt);
@Select("select * from t_event WHERE camera_name IN ('博海建设南昌路127号现场','青城建设蚌埠路以北宁乡路以西门') AND track_event = 'START' AND TO_DAYS(capture_time) = TO_DAYS(NOW())")
@Select("select * from t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name where te.track_event = 'START' AND TO_DAYS(te.capture_time) = TO_DAYS(NOW())")
List<EventDto> selectByEvent();
}

View File

@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.monitormanage.dto.WaterCameraDto;
import com.hisense.monitormanage.dto.WaterPointDto;
import com.hisense.monitormanage.dto.WaterPointDtos;
import com.hisense.monitormanage.entity.CameraChannel;
import com.hisense.monitormanage.entity.WaterPoint;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@ -31,5 +33,11 @@ public interface WaterPointMapper extends BaseMapper<WaterPoint> {
@Select("select wpr.point_level,COUNT(*) as count from water_point wp LEFT JOIN water_point_report wpr ON wp.water_point_id = wpr.water_point_id WHERE wp.audit_flag = '2' and wp.disp_flag in (0,1) GROUP BY wpr.point_level")
List<WaterPointDtos> selectCountLevel();
@Select("select * from water_point where (longitude between #{longitude1} and #{longitude2}) and (latitude between #{latitude1} and #{latitude2} ) and audit_flag = '2' and disp_flag in (0,1)")
List<WaterPoint> selectByLongAndLiti(@Param("longitude1") Double longitude1,
@Param("longitude2") Double longitude2,
@Param("latitude1") Double latitude1,
@Param("latitude2") Double latitude2);
}

View File

@ -51,9 +51,9 @@
</select>
<select id="selectByAllEvent" resultType="com.hisense.monitormanage.dto.EventDto">
select * from t_event
WHERE camera_name IN ('博海建设南昌路127号现场','青城建设蚌埠路以北宁乡路以西门')
AND track_event = 'START'
select * from t_event te
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
WHERE te.track_event = 'START'
<bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize}
</select>