管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-18 896b293b081a30d5642006f0935a61e83074fd14
1
已修改3个文件
112 ■■■■ 文件已修改
data/db_cx.sql 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/PublishController.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/show/PublishMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_cx.sql
@@ -1,8 +1,5 @@
st_length( st_geographyfromtext( st_astext( st_intersection( ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) AS acrossLength;
---------------------------------------------------------------------------------------------- -1.SQL测试
select * from lf.sys_attach where tab='lf.sys_style';
select * from lf.sys_attach order by tab,tab_guid;
select * from bs.s_explorationpoint where upper(exppointid) like '%XK0%';
select * from bs.s_survey_information; --勘察信息表,汉江穿越
alter table bs.s_survey_information add column workname varchar(50);
@@ -18,28 +15,18 @@
select concat(gb, '_', name) from bd.dlg_agnp limit 10;
select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName from lf.sys_dict a limit 10
select * from lf.sys_meta where 1=1 and type in ('ifc', 'fbx', 'rvt') order by id desc;
select * from lf.sys_meta where id in (1521) and type in ('ifc', 'fbx', 'rvt') order by id;
select * from bd.dlg_100w_hyda where eventid='f60b9ef6-9a00-4825-a3a4-130f5118cf2c' --dlg_100w_hyda.877
select * from lf.sys_meta where id in (1526,1527) and type in ('tif', 'tiff', 'img') order by id;
select b.ns, a.* from lf.sys_layer a left join lf.sys_dict b on a.en_name = b.tab where b.field = 'gid' order by id;
select * from lf.sys_download where position('管道基础大数据平台' in descr)>0 order by id desc;
select * from lf.sys_meta where 1=1 and type in ('mpt', '3dml')
select * from bs.u_sectionline;
select * from lf.sys_meta_pub; -- delete from lf.sys_meta_pub where id = 3;
select ST_AsText(geom),a.* from lf.sys_publish a; -- delete from lf.sys_publish where id = 1;
insert into lf.sys_meta_pub (metaid, pubid) select 1, 1 from (select 1) temp where not exists (select 1 from lf.sys_meta_pub where metaid = 1 and pubid = 1);
select count(gid) from bd.b_rg20w_anna where 1=1;
select ST_AsText(geom) "geom", a.*, fn_get_fullname(a.depid, 1) depName, fn_get_fullname(a.dirid, 2) dirName, fn_uname(create_user) createName, fn_uname(update_user) updateName
from lf.sys_publish a
where id = 7
insert into lf.sys_meta_pub (id,metaid,pubid) values (1,1,1);
insert into lf.sys_publish (id,name) values (1,'Test');
@@ -54,7 +41,8 @@
---------------------------------------------------------------------------------------------- 00.SQL查询
-- 缓冲区查询
insert into lf.sys_meta_pub (metaid, pubid) select 1, 1 from (select 1) temp where not exists (select 1 from lf.sys_meta_pub where metaid = 1 and pubid = 1);
select * from bd.dlg_agnp where ST_Intersects(geom, ST_Buffer(ST_PointFromText('POINT (100.746244878 35.588071316)', 4326), 10.0 / 1852 / 60)) limit 20;
select * from bd.dlg_agnp where ST_Intersects(geom, ST_Buffer(ST_PointFromText('POINT (100.746244878 35.588071316)', 4326), 10.0 * 0.00000899928)) limit 20;
src/main/java/com/lf/server/controller/data/PublishController.java
@@ -114,19 +114,6 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有")
    @GetMapping(value = "/selectAll")
    public ResponseMsg<List<PublishEntity>> selectAll() {
        try {
            List<PublishEntity> list = publishService.selectAll();
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "根据ID查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1")
@@ -156,45 +143,6 @@
            }
            int count = publishService.insert(entity);
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "插入多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "PublishEntity", paramType = "body")
    })
    @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> inserts(@RequestBody List<PublishEntity> list, HttpServletRequest req) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                for (PublishEntity entity : list) {
                    entity.setCreateUser(ue.getId());
                }
            }
            int count = publishService.inserts(list);
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "删除一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/delete")
    public ResponseMsg<Integer> delete(int id) {
        try {
            int count = publishService.delete(id);
            return success(count);
        } catch (Exception ex) {
@@ -237,30 +185,6 @@
            }
            int count = publishService.update(entity);
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "更新多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "PublishEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> updates(@RequestBody List<PublishEntity> list, HttpServletRequest req) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                for (PublishEntity entity : list) {
                    entity.setUpdateUser(ue.getId());
                }
            }
            int count = publishService.updates(list);
            return success(count);
        } catch (Exception ex) {
src/main/resources/mapper/show/PublishMapper.xml
@@ -71,7 +71,9 @@
    </select>
    <select id="selectById" resultType="com.lf.server.entity.data.PublishEntity">
        select * from lf.sys_publish where id = #{id}
        select ST_AsText(geom) "geom", a.*, fn_get_fullname(a.depid, 1) depName, fn_get_fullname(a.dirid, 2) dirName, fn_uname(create_user) createName, fn_uname(update_user) updateName
        from lf.sys_publish a
        where id = #{id}
    </select>
    <insert id="insert" parameterType="com.lf.server.entity.data.PublishEntity">
@@ -95,10 +97,16 @@
    </delete>
    <delete id="deletes">
        delete from lf.sys_publish where id in
        <foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>
        delete from lf.sys_meta_pub where pubid in (${ids});
        delete from lf.sys_publish where id in (${ids});
    </delete>
    <update id="update">