管道基础大数据平台系统开发-【后端】-Server
xing
2023-02-21 e1e254787f8b9327a4ed47a7559d6b56db13c80b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lf.server.mapper.show.OneMapMapper">
 
 
    <!--  项目类别 select * from bs.bs_project;  -->
    <select id="projectCategoryCount" resultType="java.util.Map">
        select projtype,count(*) from bs.bs_project group by projtype;
    </select>
 
 
    <!--  项目位置分布 select a.*,st_astext(geom) from bs.bs_project a  -->
    <select id="projectLocationCount" resultType="java.util.Map">
        select a.*,st_astext(geom) from bs.bs_project a;
    </select>
 
    <!--  项目类别 国家维度-数量  -->
    <select id="countryDimensionCount" resultType="java.util.Map">
        select country,count(*) from bs.bs_project group by country;
    </select>
 
    <!--  项目类别 省维度-数量  -->
    <select id="provinceDimensionCount" resultType="java.util.Map">
        select province,count(*) from bs.bs_project where country like '%中国%' group by province ;
    </select>
 
    <!--  数据统计 数据存储  -->
    <select id="dataStorageCount" resultType="java.util.Map">
        select name "名称", (select count(*) from lf.sys_meta b where b.dircode like a.code || '%') "文件数",
               (select count(sizes) from lf.sys_meta b where b.dircode like a.code || '%') "数量(MB)"
        from lf.sys_dir a where id > 1 and pid = 0;
    </select>
 
    <!--  数据统计 文件格式维度-文件个数  -->
    <select id="fileFormatCount" resultType="java.util.Map">
        select type,count(*),count(sizes) from lf.sys_meta group by type;
    </select>
 
    <!--  数据统计 数据申请  -->
    <select id="dataApplyCount" resultType="java.util.Map">
        select * from lf.sys_apply a inner join lf.sys_user b on a.userid = b.id;
    </select>
 
    <!--  数据统计 访问统计  -->
    <select id="dataVisitCount" resultType="java.util.Map">
        select modular1,count(*) from lf.sys_operate group by modular1 order by modular1;
    </select>
 
    <!--  统计项目显示  -->
    <select id="countProjectDisplay" resultType="java.util.Map">
        select PROJNAME,* from bs.bs_project WHERE PROJNAME IS NOT NULL;
    </select>
 
 
    <!--  统计项目类型 1  -->
    <select id="countProjectType1" resultType="java.util.Map">
        select (select string_agg(code, ',') from lf.sys_dir where name = a.name) "key", name "value" from lf.sys_dir a
        where name in ('测量(ESV)', '勘察(EGE)', '地灾(EGD)', '洞库(EGD)') group by name order by name;
    </select>
 
    <!--  统计项目类型 2  -->
    <select id="countProjectType2" resultType="java.util.Map">
        select modular1,count(*) from lf.sys_operate group by modular1 order by modular1;
    </select>
 
 
    <!--  查询表信息  -->
    <select id="queryTableInfo" resultType="java.util.Map">
        SELECT a.attnum,
               a.attname,
               concat_ws('',t.typname,SUBSTRING(format_type(a.atttypid,a.atttypmod)
                                                FROM '\(.*\)')) AS type,d.description,typnotnull
        FROM pg_class c,pg_attribute a,pg_type t,pg_description d
        WHERE c.relname= '${tableName}'
          AND a.attnum>0
          AND a.attrelid=c.oid
          AND a.atttypid=t.oid
          AND d.objoid=a.attrelid
          AND d.objsubid=a.attnum;
    </select>
 
 
 
 
 
 
</mapper>