| | |
| | | <select id="countProjectType" resultType="java.util.Map"> |
| | | SELECT a.type, |
| | | count(a.type) AS number, |
| | | sum(a.sizes) AS capacity |
| | | coalesce( cast(sum(a.sizes) as decimal(12, 2) ), 0) AS capacity |
| | | FROM lf.sys_meta a |
| | | INNER JOIN lf.sys_dir b ON a.dircode = b.code |
| | | WHERE a.dircode LIKE '${projectCode}%' |
| | |
| | | |
| | | <!-- 按大类统计 --> |
| | | <select id="countByMajor" resultType="com.lf.server.entity.ctrl.CountEntity"> |
| | | select '测绘(ESV)' "m1", '数字线划图' "m2", '平方千米' "m3", 0.0 "sizes" |
| | | select '测绘(ESV)' "m1", '数字线划图' "m2", '平方千米' "m3", coalesce(sum(area), 0) "sizes" from lf.sys_line_buffer |
| | | union all |
| | | select '测绘(ESV)' "m1", '数字正射影像图' "m2", '平方千米' "m3", ( |
| | | select coalesce(sum(b.area), 0) 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') ) "sizes" |
| | | union all |
| | | select '测绘(ESV)' "m1", '管线数据' "m2", '千米' "m3", cast( sum( st_length( st_geographyfromtext( st_astext(geom) ) ) ) / 1000 as decimal(12, 2) ) "sizes" from bs.m_pipeline |
| | | select '测绘(ESV)' "m1", '管线数据' "m2", '千米' "m3", |
| | | cast( coalesce(sum( ST_Length( ST_GeographyFromText( ST_AsText(geom) ) ) ) / 1000, 0) as decimal(12, 2) ) "sizes" from bs.m_pipeline |
| | | union all |
| | | select '勘察(EGE)' "m1", '勘探点' "m2", '个' "m3", count(*) "sizes" from bs.s_explorationpoint |
| | | union all |
| | | select '勘察(EGE)' "m1", '三维地质模型' "m2", '平方米' "m3", ( |
| | | select coalesce(sum(b.area), 0) from lf.sys_meta b |
| | | inner join lf.sys_dir c on b.dircode = c.code |
| | | where b.type in ('fbx', 'ifc', 'rvt') ) "sizes" |
| | | where b.type in ('fbx', 'ifc') ) "sizes" |
| | | union all |
| | | select '地灾(EGD)' "m1", '地灾点' "m2", '个' "m3", count(*) "sizes" from bd.b_geologic_hazard; |
| | | </select> |
| | | |
| | | <!-- 查询中线缓冲区 --> |
| | | <select id="selectLineBuffer" resultType="java.lang.Integer"> |
| | | select fn_line_buffer(); |
| | | </select> |
| | | |
| | | <!-- 根据类型查询元数据(用于计算面积) --> |
| | | <select id="selectMetaByType" resultType="java.util.Map"> |
| | | (select a.id, a.path, 'DOM' type from lf.sys_meta a |
| | | inner join lf.sys_dir b on a.dircode = b.code |
| | | where a.area is null and a.type in ('img', 'tif', 'tiff') and b.name = '数字正射影像图' limit 1) |
| | | union all |
| | | (select a.id, a.path, 'DEM' type from lf.sys_meta a |
| | | inner join lf.sys_dir b on a.dircode = b.code |
| | | where a.area is null and a.type in ('dem', 'tif', 'tiff') and b.name = '数字高程模型' limit 1) |
| | | union all |
| | | (select id, path, 'OSGB' type from lf.sys_meta where area is null and type = 'osgb' limit 1) |
| | | union all |
| | | (select id, path, 'LAS' type from lf.sys_meta where area is null and type = 'las' or type = 'laz' limit 1) |
| | | union all |
| | | (select id, path, 'IFC' type from lf.sys_meta where area is null and type = 'ifc' limit 1) |
| | | union all |
| | | (select id, path, 'FBX' type from lf.sys_meta where area is null and type = 'fbx' limit 1) |
| | | </select> |
| | | </mapper> |