添加分页查询全部道路污染数据接口
This commit is contained in:
parent
f91c9e3205
commit
cfc3023d04
|
@ -1,5 +1,6 @@
|
|||
package com.hisense.monitormanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.hisense.monitormanage.dto.*;
|
||||
import com.hisense.monitormanage.entity.*;
|
||||
import com.hisense.monitormanage.mapper.*;
|
||||
|
@ -71,6 +72,9 @@ public class Controller {
|
|||
@Autowired
|
||||
private TrailSanitationMapper trailSanitationMapper;
|
||||
|
||||
@Autowired
|
||||
private RoadDataMapper roadDataMapper;
|
||||
|
||||
|
||||
@GetMapping("all")
|
||||
public Object all(){
|
||||
|
@ -566,6 +570,24 @@ public class Controller {
|
|||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询全部道路污染数据
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectRoadData")
|
||||
@ApiOperation("分页查询全部道路污染数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Integer", required = true),
|
||||
@ApiImplicitParam(name = "pageSize", value = "大小", paramType = "query", dataType = "Integer", required = true)
|
||||
})
|
||||
public Result selectRoadData(Integer page,Integer pageSize){
|
||||
List<RoadData> roadData = roadDataMapper.selectRoadData(page,pageSize);
|
||||
Result success = Result.success(roadData);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
//查询工地信息,根据经纬度和半径查询
|
||||
@GetMapping(value = "listBuildingSiteByPoints")
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.hisense.monitormanage.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hisense.monitormanage.entity.RoadData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -15,4 +16,6 @@ import java.util.Map;
|
|||
*/
|
||||
public interface RoadDataMapper extends BaseMapper<RoadData> {
|
||||
public void batchSave(List<Map> list);
|
||||
|
||||
List<RoadData> selectRoadData(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
}
|
||||
|
|
|
@ -36,16 +36,16 @@ public class LongLatUtil {
|
|||
/**
|
||||
* 根据经纬度和半径计算经纬度范围
|
||||
*
|
||||
* @param raidus 单位米
|
||||
* @param radius 单位米
|
||||
* @return minLat, minLng, maxLat, maxLng
|
||||
*/
|
||||
public static double[] getAround(double lon,double lat, int raidus) {
|
||||
public static double[] getAround(double lon,double lat, int radius) {
|
||||
|
||||
Double latitude = lat;
|
||||
Double longitude = lon;
|
||||
|
||||
Double degree = (24901 * 1609) / 360.0;
|
||||
double raidusMile = raidus;
|
||||
double raidusMile = radius;
|
||||
|
||||
Double dpmLat = 1 / degree;
|
||||
Double radiusLat = dpmLat * raidusMile;
|
||||
|
|
|
@ -16,4 +16,10 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectRoadData" resultType="com.hisense.monitormanage.entity.RoadData">
|
||||
select * from t_road_data
|
||||
<bind name="page" value="(page-1)*pageSize"/>
|
||||
limit #{page},#{pageSize}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue