select count(*) from lf.sys_report
upper(name) like #{name}
code = #{code}
select a.*,fn_uname(a.create_user) createName,fn_uname(a.update_user) updateName from lf.sys_report a
upper(name) like #{name}
code = #{code}
order by a.id desc
limit #{limit} offset #{offset}
select * from lf.sys_report order by id desc;
select * from lf.sys_report where id = #{id}
insert into lf.sys_report
(name,type,fname,guid,code,create_user,create_time,bak)
values
(#{name},#{type},#{fname},#{guid},#{code},#{createUser},now(),#{bak})
insert into lf.sys_report
(name,type,fname,guid,code,create_user,create_time,bak)
values
(#{item.name},#{item.type},#{item.fname},#{item.guid},#{item.code},#{item.createUser},now(),#{item.bak})
delete from lf.sys_report where id = #{id}
delete from lf.sys_report where id in
#{id}
update lf.sys_report
set name=#{name},type=#{type},fname=#{fname},guid=#{guid},code=#{code},update_user=#{updateUser},update_time=now(),bak=#{bak}
where id=#{id}
update lf.sys_report
name=#{item.name},type=#{item.type},fname=#{item.fname},guid=#{item.guid},code=#{item.code},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak}
where id = #{item.id}
select fn_get_fullname(depcode, 1) "m1", cast(sum(sizes) as decimal(18, 3)) "sizes", count(*) "count"
from lf.sys_meta
group by depcode
order by depcode;
select type "m1", cast(sum(sizes) as decimal(18, 3)) "sizes", count(*) "count"
from lf.sys_meta
group by type
order by type;
select name "m1", count(*) "count"
from lf.sys_serve_log
group by name
order by name;
select modular1 "m1", modular2 "m2", count(*) "count"
from lf.sys_operate
group by modular1,modular2
order by modular1 desc,modular2;
select name "m1",
(select cast( coalesce(sum(sizes), 0) as decimal(18, 3) ) from lf.sys_meta b where b.dircode like a.code || '%') as "sizes",
(select count(*) from lf.sys_meta b where b.dircode like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by a.code;
select
name "m1", a.code "m3", 0.0 "area",
(select count(*) from bs.s_explorationpoint b where dirid like a.code || '%') "count",
(select coalesce(round(sum(sizes)::numeric, 3), 0)
from bs.s_explorationpoint b
inner join lf.sys_meta c
on b.parentid = c.eventid
where b.dirid like a.code || '%') "sizes"
from lf.sys_dir a
where pid = 0
order by code;
select ST_X(geom) "x", ST_Y(geom) "y"
from bs.s_explorationpoint b
dirid like #{code} and geom is not null
select name "m1",
(select cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) 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 a.code || '%') "area"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1", 0.0 "area"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select cast( coalesce(sum(area), 0) as decimal(20, 2) ) from lf.sys_meta b
where b.type = 'osgb' and b.dircode like a.code || '%') "area"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select cast( coalesce(sum(area), 0) as decimal(20, 2) ) from lf.sys_meta b
where b.type in ('las', 'laz') and b.dircode like a.code || '%') "area"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.s_surveyworksite b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.s_explorationpoint b
inner join lf.sys_attach c on b.eventid = c.tab_guid
where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_collapse b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_debrisflow b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_ground_collapse b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_highandsteep_slope b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_landslide b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_unstable_slope b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bs.g_water_damage b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select dir "m1", cast( coalesce(sum(area), 0) as decimal(20, 2) ) "area"
from lf.sys_line_buffer
group by code, dir
order by code;
select name "m1",
(select cast( coalesce(sum(b.area), 0) as decimal(20, 2) ) 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 a.code || '%') "area"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select cast( coalesce(sum( ST_Length( ST_GeographyFromText( ST_AsText(geom) ) ) ) / 1000, 0) as decimal(20, 2) )
from bs.m_pipeline b where b.dirid like a.code || '%') as "len"
from lf.sys_dir a
where pid = 0
order by a.code;
select name "m1",
(select count(*) from bs.s_explorationpoint b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select cast( coalesce(sum(b.area), 0) as decimal(20, 2) )
from lf.sys_meta b where b.type in ('fbx', 'ifc') and b.dircode like a.code || '%') "area"
from lf.sys_dir a
where pid = 0
order by code;
select name "m1",
(select count(*) from bd.b_geologic_hazard b where b.dirid like a.code || '%') "count"
from lf.sys_dir a
where pid = 0
order by code;
(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});