管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-25 b6b0cb226fcf184525ee7b36af3a09471e9c0057
修改数据统计的查询条件
已修改7个文件
164 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/show/OneMapController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/BaseEntity.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/WordHelper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/ReportMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/TestService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/ReportService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/ReportMapper.xml 150 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/OneMapController.java
@@ -389,7 +389,8 @@
        return success(resList);
    }
    // ============[ 数据统计 - 2024-03-06]============
    //============[数据统计 - 2024-03-06]==================
    @SysLog()
    @ApiOperation(value = "数据统计(按大类统计)")
    @GetMapping("/countByMajor")
src/main/java/com/lf/server/entity/all/BaseEntity.java
@@ -46,7 +46,9 @@
    @TableField(value = "fn_uname(createuser)", insertStrategy = FieldStrategy.NEVER)
    private String createName;
    // updateStrategy = FieldStrategy.NEVER
    /**
     * updateStrategy = FieldStrategy.NEVER
     */
    @TableField(value = "fn_uname(updateuser)", insertStrategy = FieldStrategy.NEVER)
    private String updateName;
src/main/java/com/lf/server/helper/WordHelper.java
@@ -16,6 +16,7 @@
 * @author WWW
 * @date 2024-03-21
 */
@SuppressWarnings("ALL")
public class WordHelper {
    private final static Log log = LogFactory.getLog(WordHelper.class);
src/main/java/com/lf/server/mapper/sys/ReportMapper.java
@@ -143,8 +143,8 @@
    /**
     * 根据项目编码查询钻孔数据坐标点
     *
     * @param code
     * @return
     * @date
     */
    public List<CoordinateEntity> selectExplorationPoints(String code);
src/main/java/com/lf/server/service/all/TestService.java
@@ -271,7 +271,7 @@
        String inputFile = "C:\\Users\\Administrator\\Desktop\\ts\\项目数据分类统计.docx";
        String outPutFile = "C:\\Users\\Administrator\\Desktop\\ts\\NewWord.docx";
        Map<String, String> textMap = new HashMap<>();
        Map<String, String> textMap = new HashMap<>(1);
        textMap.put("title", "深圳液化天然气应急调峰站外输管道工程(XQ03T04)");
        List<String[]> tableList = new ArrayList<>();
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -251,7 +251,7 @@
    @Override
    public List<CountEntity> countVariousDataByPrj(String code) {
        code = StringHelper.getRightLike(code);
        code = StringUtils.isEmpty(code) || "ALL".equals(code) ? null : StringHelper.getRightLike(code);
        return reportMapper.countVariousDataByPrj(code);
    }
src/main/resources/mapper/sys/ReportMapper.xml
@@ -326,49 +326,159 @@
    <!-- 项目数据分类统计 -->
    <select id="countVariousDataByPrj" resultType="com.lf.server.entity.ctrl.CountEntity">
        (select '数字线划图' "m1", 'area' "m2", 0 "count", cast( coalesce(sum(area), 0) as decimal(20, 2) ) "area", 0 "len"
            from lf.sys_line_buffer where code like #{code})
            from lf.sys_line_buffer
            <where>
                <if test="null != code">
                    code like #{code})
                </if>
            </where>
        union all
        (select '数字高程模型' "m1", 'area' "m2", 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})
            <where>
                c.name = '数字高程模型' and b.type in ('dem', 'tif', 'tiff')
                <if test="null != code">
                    and b.dircode like #{code}
                </if>
            </where>
        )
        union all
        (select '数字正射影像图' "m1", 'area' "m2", 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})
            <where>
                c.name = '数字正射影像图' and b.type in ('img', 'tif', 'tiff')
                <if test="null != code">
                    and b.dircode like #{code}
                </if>
            </where>
        )
        union all
        (select '倾斜摄影模型' "m1", 'area' "m2", 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})
            from lf.sys_meta b
            <where>
                b.type = 'osgb'
                <if test="null != code">
                    and b.dircode like #{code}
                </if>
            </where>
        )
        union all
        (select '激光点云模型' "m1", 'area' "m2", 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})
            from lf.sys_meta b
            <where>
                b.type in ('las', 'laz')
                <if test="null != code">
                    and b.dircode like #{code}
                </if>
            </where>
        )
        union all
        (select '管线长度' "m1", 'len' "m2", 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})
        (select '管线长度' "m1", 'len' "m2", 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>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '勘探点' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.s_explorationpoint b where b.dirid like #{code})
        (select '勘探点' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.s_explorationpoint b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '勘察工点' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.s_surveyworksite b where b.dirid like #{code})
        (select '勘察工点' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.s_surveyworksite b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '勘察报告' "m1", 'count' "m2", 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})
            inner join lf.sys_attach c on b.eventid = c.tab_guid
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '三维地质模型' "m1", 'area' "m2", 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})
        (select '三维地质模型' "m1", 'area' "m2", 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')
                <if test="null != code">
                    and b.dircode like #{code}
                </if>
            </where>
        )
        union all
        (select '地灾点' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bd.b_geologic_hazard b where b.dirid like #{code})
        (select '地灾点' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bd.b_geologic_hazard b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '崩塌' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_collapse b where b.dirid like #{code})
        (select '崩塌' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_collapse b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '泥石流' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_debrisflow b where b.dirid like #{code})
        (select '泥石流' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_debrisflow b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '地面塌陷' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_ground_collapse b where b.dirid like #{code})
        (select '地面塌陷' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_ground_collapse b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '高陡边坡' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_highandsteep_slope b where b.dirid like #{code})
        (select '高陡边坡' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_highandsteep_slope b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '滑坡' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_landslide b where b.dirid like #{code})
        (select '滑坡' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_landslide b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '不稳定斜坡' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_unstable_slope b where b.dirid like #{code})
        (select '不稳定斜坡' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_unstable_slope b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        )
        union all
        (select '水毁' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_water_damage b where b.dirid like #{code});
        (select '水毁' "m1", 'count' "m2", count(*), 0 "area", 0 "len" from bs.g_water_damage b
            <where>
                <if test="null != code">
                    b.dirid like #{code}
                </if>
            </where>
        );
    </select>
</mapper>