管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-12 c200212b2741e9ef4f5edb9c5ca75969db9c2187
1
已修改3个文件
84 ■■■■ 文件已修改
data/db_cx.sql 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_tab.sql 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/update.sql 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_cx.sql
@@ -15,10 +15,8 @@
insert into lf.sys_layer (pid,cn_name,en_name,url,type,level,order_num,is_show,create_user,serve_type,data_type,elev) values
  (423, '地面层', 'fushun_site', 'tileset/o/39HBFG/tileset.json', 2, 3, 5, 0, 1, 'Tileset', '工程测量模型', 1200);
update lf.sys_layer set elev=118,cn_name='地面层' where id=427;
delete from lf.sys_layer where id=427;
-- delete from lf.sys_layer where id=427;
select * from bs.th_strategic_channel
select * from lf.sys_dict where tab='th_strategic_channel'
select * from lf.sys_model -- delete from lf.sys_model
data/db_tab.sql
@@ -1246,11 +1246,69 @@
comment on column lf.sys_model.bak is '备注';
select * from lf.sys_model order by id desc;
----------------------------------------------------------------------------------------------------- 37.数据发布表
-- drop table if exists lf.sys_publish;
create table lf.sys_publish(
  id serial primary key,
  name varchar(50),
  url varchar(512),
  path varchar(200),
  type varchar(10),
  status integer default 0,
  dirid varchar(24),
  depid varchar(24),
  min integer default 0,
  max integer default 20,
  json varchar(2048),
  create_user integer default 1,
  create_time timestamp(6) without time zone default now(),
  update_user integer,
  update_time timestamp(6) without time zone,
  geom geometry(PointZ,4490),
  bak varchar(1024)
);
-- drop index if exists lf.idx_sys_publish_geom;
create index idx_sys_publish_geom on lf.sys_publish using gist (geom);
comment on table lf.sys_publish is '数据发布表';
comment on column lf.sys_publish.id is '主键ID';
comment on column lf.sys_publish.name is '名称';
comment on column lf.sys_publish.url is '地址';
comment on column lf.sys_publish.path is '路径';
comment on column lf.sys_publish.type is '类型:obj,fbx,rvt,ifc,3dml,mpt,DOM';
comment on column lf.sys_publish.status is '状态:-1-停用,0-待发布,1-发布中,2-更新发布,3-已发布';
comment on column lf.sys_publish.dirid is '目录ID';
comment on column lf.sys_publish.depid is '单位ID';
comment on column lf.sys_publish.min is '最小级别';
comment on column lf.sys_publish.max is '最大级别';
comment on column lf.sys_publish.json is 'JSON数据';
comment on column lf.sys_publish.create_user is '创建人ID';
comment on column lf.sys_publish.create_time is '创建时间';
comment on column lf.sys_publish.update_user is '更新人ID';
comment on column lf.sys_publish.update_time is '更新时间';
comment on column lf.sys_publish.bak is '备注'; --POINT Z (0 0 0)
-- insert into lf.sys_publish (name,geom) values ('Test',ST_GeomFromText('POINT Z (101.9281 36.58675 2199.5)'));
select st_astext(geom) "wkt",a.* from lf.sys_publish a;
----------------------------------------------------------------------------------------------------- 38.元数据-数据发布表
-- drop table if exists lf.sys_meta_pub;
create table lf.sys_meta_pub(
  id serial primary key,
  metaid integer,
  pubid integer,
  create_user integer default 1,
  create_time timestamp(6) without time zone default now(),
  update_user integer,
  update_time timestamp(6) without time zone
);
comment on table lf.sys_meta_pub is '元数据-数据发布表';
comment on column lf.sys_meta_pub.id is '主键ID';
comment on column lf.sys_meta_pub.metaid is '元数据ID';
comment on column lf.sys_meta_pub.pubid is '数据发布ID';
comment on column lf.sys_meta_pub.create_user is '创建人ID';
comment on column lf.sys_meta_pub.create_time is '创建时间';
comment on column lf.sys_meta_pub.update_user is '更新人ID';
comment on column lf.sys_meta_pub.update_time is '更新时间';
-- insert into lf.sys_meta_pub (metaid,pubid) values (1399,1);
select * from lf.sys_meta_pub;
----------------------------------------------------------------------------------------------------- 
select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName,
    (select coalesce(sum(dcount), 0) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "downCount",
    (select fn_uname(download_user) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id order by download_time desc limit 1) "lastUser",
    (select max(download_time) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "lastTime"
from lf.sys_meta a
order by id desc
limit 10 offset 0;
data/update.sql
@@ -458,6 +458,14 @@
select a.* from lf.sys_domain a where exists (select * from lf.sys_dict b where b.ns = 'bd' and b.tab = 'dlg_25w_hyda') and a.dom_code like '210%' order by a.id
select * from lf.sys_download a where create_user = 1 and type = 2;
select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName,
    (select coalesce(sum(dcount), 0) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "downCount",
    (select fn_uname(download_user) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id order by download_time desc limit 1) "lastUser",
    (select max(download_time) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "lastTime"
from lf.sys_meta a
order by id desc
limit 10 offset 0;
--------------------------------------------------------- 08.查询空间数据
select to_char(create_time, 'yyyy-mm-dd hh24:mi:ss') from lf.sys_meta;
select to_timestamp('2018-08-15 12:10:10', 'yyyy-MM-dd hh24:mi:ss');