管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-31 062a0efe4644edc4e2bbd85f7c12327e5af4dffe
1
已修改5个文件
65 ■■■■ 文件已修改
data/update.sql 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/ProjectController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/all/BaseQueryMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/BaseQueryService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/all/BaseQueryMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/update.sql
@@ -135,20 +135,13 @@
select * from lf.sys_user
select * from lf.sys_menu where cn_name='数据管理'
delete   from lf.sys_meta
select * from lf.sys_meta
select * from lf.sys_fme_log
select '国' "key", cname "value" from bs.th_globe_country where ST_Intersects(ST_PointFromText('POINT(114.178955 38.991743)', 4490), geom)
union all
select '省' "key", cname "value" from bs.th_province_area where ST_Intersects(ST_PointFromText('POINT(114.178955 38.991743)', 4490), geom)
union all
select '市' "key", cname "value" from bs.th_district_area where ST_Intersects(ST_PointFromText('POINT(114.178955 38.991743)', 4490), geom)
union all
select '县' "key", cname "value" from bs.th_county_area where ST_Intersects(ST_PointFromText('POINT(114.178955 38.991743)', 4490), geom);
src/main/java/com/lf/server/controller/data/ProjectController.java
@@ -7,6 +7,7 @@
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.bs.BsprojectEntity;
import com.lf.server.entity.ctrl.KeyValueEntity;
import com.lf.server.entity.data.DictEntity;
import com.lf.server.entity.data.DirEntity;
import com.lf.server.entity.sys.DepEntity;
@@ -123,6 +124,24 @@
    }
    @SysLog()
    @ApiOperation(value = "查询位置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "x", value = "X", dataType = "Double", paramType = "query", example = "114.178955"),
            @ApiImplicitParam(name = "y", value = "Y", dataType = "Double", paramType = "query", example = "38.991743")
    })
    @GetMapping(value = "/selectLocation")
    public ResponseMsg<Object> selectLocation(double x, double y) {
        try {
            String wkt = String.format("POINT(%f %f)", x, y);
            List<KeyValueEntity> list = baseQueryService.selectLocation(wkt);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "删除一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gid", value = "ID", dataType = "int", paramType = "query", example = "1")
src/main/java/com/lf/server/mapper/all/BaseQueryMapper.java
@@ -1,6 +1,7 @@
package com.lf.server.mapper.all;
import com.lf.server.entity.ctrl.IdNameEntity;
import com.lf.server.entity.ctrl.KeyValueEntity;
import com.lf.server.entity.ctrl.TabEntity;
import com.lf.server.entity.data.DictEntity;
import com.lf.server.entity.data.DomainEntity;
@@ -85,4 +86,12 @@
     * @return 多线
     */
    public String selectRoute(double x1, double y1, double x2, double y2);
    /**
     * 查询位置
     *
     * @param wkt WKT字符串
     * @return 位置
     */
    public List<KeyValueEntity> selectLocation(String wkt);
}
src/main/java/com/lf/server/service/all/BaseQueryService.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lf.server.entity.all.RedisCacheKey;
import com.lf.server.entity.ctrl.IdNameEntity;
import com.lf.server.entity.ctrl.KeyValueEntity;
import com.lf.server.entity.ctrl.TabEntity;
import com.lf.server.entity.data.DictEntity;
import com.lf.server.entity.data.DomainEntity;
@@ -255,4 +256,9 @@
    public String selectRoute(double x1, double y1, double x2, double y2) {
        return baseQueryMapper.selectRoute(x1, y1, x2, y2);
    }
    @Override
    public List<KeyValueEntity> selectLocation(String wkt) {
        return baseQueryMapper.selectLocation(wkt);
    }
}
src/main/resources/mapper/all/BaseQueryMapper.xml
@@ -57,4 +57,14 @@
    <select id="selectRoute" resultType="java.lang.String">
        select ST_astext(ST_Union(geom)) as route from pgr_fromAtoB('lrdl'::text, #{x1}, #{y1}, #{x2}, #{y2});
    </select>
    <select id="selectLocation" resultType="com.lf.server.entity.ctrl.KeyValueEntity">
        select '国' "key", cname "value" from bs.th_globe_country where ST_Intersects(ST_PointFromText(#{wkt}, 4490), geom)
        union all
        select '省' "key", cname "value" from bs.th_province_area where ST_Intersects(ST_PointFromText(#{wkt}, 4490), geom)
        union all
        select '市' "key", cname "value" from bs.th_district_area where ST_Intersects(ST_PointFromText(#{wkt}, 4490), geom)
        union all
        select '县' "key", cname "value" from bs.th_county_area where ST_Intersects(ST_PointFromText(#{wkt}, 4490), geom);
    </select>
</mapper>