管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-20 8d8e33f84d124ca16287451d65114c7e21857d76
按项目统计各类数据
已修改4个文件
90 ■■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/DataCountController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/ReportMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/ReportService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/ReportMapper.xml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/DataCountController.java
@@ -391,7 +391,7 @@
    }
    @SysLog()
    @ApiOperation(value = "按项目统计地质模型面积")
    @ApiOperation(value = "按项目统计三维地质模型面积")
    @GetMapping(value = "/countGeoModelAreaByPrj")
    public ResponseMsg<Object> countGeoModelAreaByPrj() {
        try {
@@ -415,4 +415,24 @@
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "按项目统计各类数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code", value = "项目编码", dataType = "String", paramType = "query", example = "0B")
    })
    @GetMapping(value = "/countVariousDataByPrj")
    public ResponseMsg<Object> countVariousDataByPrj(String code) {
        try {
            if (StringHelper.isEmpty(code)) {
                return fail("项目编码不能为空");
            }
            List<CountEntity> list = reportService.countVariousDataByPrj(code);
            return success(list);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
}
src/main/java/com/lf/server/mapper/sys/ReportMapper.java
@@ -271,7 +271,7 @@
    /**
     * 按项目统计地质模型面积
     * 按项目统计三维地质模型面积
     *
     * @return
     */
@@ -283,4 +283,12 @@
     * @return
     */
    public List<CountEntity> countGeologicHazardByPrj();
    /**
     * 按项目统计各类数据
     *
     * @param code
     * @return
     */
    public List<CountEntity> countVariousDataByPrj(String code);
}
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -245,6 +245,13 @@
        return reportMapper.countGeologicHazardByPrj();
    }
    @Override
    public List<CountEntity> countVariousDataByPrj(String code) {
        code = StringHelper.getRightLike(code);
        return reportMapper.countVariousDataByPrj(code);
    }
    /**
     * 统计钻孔点面积
     */
src/main/resources/mapper/sys/ReportMapper.xml
@@ -304,7 +304,7 @@
        order by code;
    </select>
    <!-- 按项目统计地质模型面积 -->
    <!-- 按项目统计三维地质模型面积 -->
    <select id="countGeoModelAreaByPrj" resultType="com.lf.server.entity.ctrl.CountEntity">
        select name "m1",
          (select cast( coalesce(sum(b.area), 0) as decimal(20, 2) )
@@ -322,4 +322,53 @@
        where pid = 0
        order by code;
    </select>
    <!-- 按项目统计各类数据 -->
    <select id="countVariousDataByPrj" resultType="com.lf.server.entity.ctrl.CountEntity">
        (select '数字线划图' "m1", 0 "count", cast( coalesce(sum(area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_line_buffer where code like #{code})
        union all
        (select '数字高程模型' "m1", 0 "count", cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_meta b inner join lf.sys_dir c on b.dircode = c.code
            where c.name = '数字高程模型' and b.type in ('dem', 'tif', 'tiff') and b.dircode like #{code})
        union all
        (select '数字正射影像图' "m1", 0 "count", cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_meta b inner join lf.sys_dir c on b.dircode = c.code
            where c.name = '数字正射影像图' and b.type in ('img', 'tif', 'tiff') and b.dircode like #{code})
        union all
        (select '倾斜摄影模型' "m1", 0 "count", cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_meta b where b.type = 'osgb' and b.dircode like #{code})
        union all
        (select '激光点云模型' "m1", 0 "count", cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_meta b where b.type in ('las', 'laz') and b.dircode like #{code})
        union all
        (select '管线长度' "m1", 0 "count", 0 "area", cast( coalesce(sum( ST_Length( ST_GeographyFromText( ST_AsText(geom) ) ) ) / 1000, 0) as decimal(20, 2) ) "len"
            from bs.m_pipeline b where b.dirid like #{code})
        union all
        (select '勘探点' "m1", count(*), 0 "area", 0 "len" from bs.s_explorationpoint b where b.dirid like #{code})
        union all
        (select '勘察工点' "m1", count(*), 0 "area", 0 "len" from bs.s_surveyworksite b where b.dirid like #{code})
        union all
        (select '勘察报告' "m1", count(*), 0 "area", 0 "len" from bs.s_explorationpoint b
            inner join lf.sys_attach c on b.eventid = c.tab_guid where b.dirid like #{code})
        union all
        (select '三维地质模型' "m1", 0 "count", cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_meta b where b.type in ('fbx', 'ifc') and b.dircode like #{code})
        union all
        (select '地灾点' "m1", count(*), 0 "area", 0 "len" from bd.b_geologic_hazard b where b.dirid like #{code})
        union all
        (select '崩塌' "m1", count(*), 0 "area", 0 "len" from bs.g_collapse b where b.dirid like #{code})
        union all
        (select '泥石流' "m1", count(*), 0 "area", 0 "len" from bs.g_debrisflow b where b.dirid like #{code})
        union all
        (select '地面塌陷' "m1", count(*), 0 "area", 0 "len" from bs.g_ground_collapse b where b.dirid like #{code})
        union all
        (select '高陡边坡' "m1", count(*), 0 "area", 0 "len" from bs.g_highandsteep_slope b where b.dirid like #{code})
        union all
        (select '滑坡' "m1", count(*), 0 "area", 0 "len" from bs.g_landslide b where b.dirid like #{code})
        union all
        (select '不稳定斜坡' "m1", count(*), 0 "area", 0 "len" from bs.g_unstable_slope b where b.dirid like #{code})
        union all
        (select '水毁' "m1", count(*), 0 "area", 0 "len" from bs.g_water_damage b where b.dirid like #{code});
    </select>
</mapper>