| | |
| | | ----------------------------------------------------------------------------------------------------- 1.菜单表 |
| | | ----------------------------------------------------------------------------------------------------- 01.菜单表 |
| | | -- DROP TABLE IF EXISTS lf.sys_menu; |
| | | create table lf.sys_menu( |
| | | id serial primary key, |
| | |
| | | --alter sequence lf.sys_menu_id_seq restart with 44; |
| | | |
| | | select * from lf.sys_menu order by order_num; |
| | | ----------------------------------------------------------------------------------------------------- 2.单位表 |
| | | ----------------------------------------------------------------------------------------------------- 02.单位表 |
| | | -- DROP TABLE IF EXISTS lf.sys_dep; |
| | | create table lf.sys_dep( |
| | | id serial primary key, |
| | |
| | | -- update lf.sys_dep set name='中国xxx工程有限公司' where name='中国石油天然气管道工程有限公司'; |
| | | |
| | | select * from lf.sys_dep order by id; |
| | | ----------------------------------------------------------------------------------------------------- 3.目录表 |
| | | ----------------------------------------------------------------------------------------------------- 03.目录表 |
| | | -- DROP TABLE IF EXISTS lf.sys_dir; |
| | | create table lf.sys_dir( |
| | | id serial primary key, |
| | |
| | | --alter sequence lf.sys_dir_id_seq restart with 124; |
| | | |
| | | select * from lf.sys_dir order by id; |
| | | ----------------------------------------------------------------------------------------------------- 4.用户表 |
| | | ----------------------------------------------------------------------------------------------------- 04.用户表 |
| | | -- DROP TABLE IF EXISTS lf.sys_user; |
| | | create table lf.sys_user( |
| | | id serial primary key, |
| | |
| | | update lf.sys_user set pwd='b37f70636f1164e86cc8796201737933f65af63918d8442b'; */ |
| | | |
| | | select * from lf.sys_user order by id; |
| | | ----------------------------------------------------------------------------------------------------- 5.登录日志表 |
| | | ----------------------------------------------------------------------------------------------------- 05.登录日志表 |
| | | -- DROP TABLE IF EXISTS lf.sys_login; |
| | | create table lf.sys_login( |
| | | id serial8, |
| | |
| | | |
| | | select * from lf.sys_login; select * from lf.sys_login_2022; select * from lf.sys_login_2024; |
| | | select a.*,b.uname from lf.sys_login a inner join lf.sys_user b on a.userid = b.id; |
| | | ----------------------------------------------------------------------------------------------------- 6.操作日志表 |
| | | ----------------------------------------------------------------------------------------------------- 06.操作日志表 |
| | | -- DROP TABLE IF EXISTS lf.sys_operate; |
| | | create table lf.sys_operate( |
| | | id serial8, |
| | |
| | | |
| | | select a.*,b.uname from lf.sys_operate a inner join lf.sys_user b on a.userid = b.id; |
| | | select * from lf.sys_operate; select * from lf.sys_operate_2022; select * from lf.sys_operate_2024; |
| | | ----------------------------------------------------------------------------------------------------- 7.令牌表 |
| | | ----------------------------------------------------------------------------------------------------- 07.令牌表 |
| | | -- DROP TABLE IF EXISTS lf.sys_token; |
| | | create table lf.sys_token( |
| | | id serial8, |
| | |
| | | select * from lf.sys_user where id=(select create_user from lf.sys_token where token='91cf74dc-1d03-4937-983f-88810589b112' and expire > now() limit 1); |
| | | |
| | | select * from lf.sys_token; select * from lf.sys_token_2022; select * from lf.sys_token_2023; select now()::timestamp + '1 year 4 hour'; |
| | | ----------------------------------------------------------------------------------------------------- 8.资源表 |
| | | ----------------------------------------------------------------------------------------------------- 08.资源表 |
| | | -- DROP TABLE IF EXISTS lf.sys_res; |
| | | create table lf.sys_res( |
| | | id serial primary key, |
| | |
| | | insert into lf.sys_res (name) values ('天地图矢量'); */ |
| | | |
| | | select * from lf.sys_res; |
| | | ----------------------------------------------------------------------------------------------------- 9.资源操作表 |
| | | ----------------------------------------------------------------------------------------------------- 09.资源操作表 |
| | | -- DROP TABLE IF EXISTS lf.sys_res_op; |
| | | create table lf.sys_res_op( |
| | | id serial8, |
| | |
| | | -- insert into lf.sys_meta(dirid,depid,geom,sizes,name,path) values (1,1,ST_PolygonFromText('MultiPolygon (((100 0,120 0,120 20,100 20,100 0)))', 4490),0.001,'a.jpg','c:\a.jpg'); |
| | | |
| | | select a.*,st_astext(geom) from lf.sys_meta a; select id,name,dirid,depid,verid,type,sizes,create_user,create_time,update_user,update_time,st_astext(geom) from lf.sys_meta; |
| | | ----------------------------------------------------------------------------------------------------- 18.附件表 |
| | | ----------------------------------------------------------------------------------------------------- 17.附件表 |
| | | -- DROP TABLE IF EXISTS lf.sys_attach; |
| | | create table lf.sys_attach( |
| | | id serial primary key, |
| | |
| | | --alter table lf.sys_attach alter column sizes type float8; |
| | | |
| | | select * from lf.sys_attach; select length(guid) from lf.sys_attach limit 1; select * from lf.sys_attach; |
| | | ----------------------------------------------------------------------------------------------------- 19.版本表 |
| | | ----------------------------------------------------------------------------------------------------- 18.版本表 |
| | | -- DROP TABLE IF EXISTS lf.sys_ver; |
| | | create table lf.sys_ver( |
| | | id serial primary key, |
| | |
| | | --insert into lf.sys_ver (dirid,name) values (1003,'2020-02-01'); |
| | | |
| | | select * from lf.sys_ver order by id; |
| | | ----------------------------------------------------------------------------------------------------- 20.数据字典表 |
| | | ----------------------------------------------------------------------------------------------------- 19.数据字典表 |
| | | -- DROP TABLE IF EXISTS lf.sys_dict; |
| | | create table lf.sys_dict( |
| | | id serial primary key, |
| | |
| | | select count(*) from lf.sys_dict where status=0 and tab='sys_user'; |
| | | select * from lf.sys_dict order by ns,tab,order_num limit 10 offset 0; |
| | | select distinct ns,tab,fn_get_entity(tab) entity,tab_desc,tabletype from lf.sys_dict order by tab; |
| | | ----------------------------------------------------------------------------------------------------- 21.样式表 |
| | | ----------------------------------------------------------------------------------------------------- 20.样式表 |
| | | -- DROP TABLE IF EXISTS lf.sys_style; |
| | | create table lf.sys_style( |
| | | id serial primary key, |
| | |
| | | |
| | | select count(*) from lf.sys_style where name like '%.edp'; |
| | | select * from lf.sys_style order by ns,tab,order_num limit 10 offset 0; |
| | | ----------------------------------------------------------------------------------------------------- 22.下载记录表 |
| | | ----------------------------------------------------------------------------------------------------- 21.下载记录表 |
| | | -- DROP TABLE IF EXISTS lf.sys_download; |
| | | create table lf.sys_download( |
| | | id serial primary key, |
| | |
| | | -- insert into lf.sys_download (name,pwd,url,descr) values ('2022-09-27','123456','','测试下载'); |
| | | |
| | | select * from lf.sys_download order by id; |
| | | ----------------------------------------------------------------------------------------------------- 23.消息通知表 |
| | | ----------------------------------------------------------------------------------------------------- 22.消息通知表 |
| | | -- DROP TABLE IF EXISTS lf.sys_msg; |
| | | create table lf.sys_msg( |
| | | id serial primary key, |
| | |
| | | --insert into lf.sys_msg (title,msg,guid,update_user) values ('2022-09-26','数据下载',new_guid(),2); |
| | | |
| | | select * from lf.sys_msg; |
| | | ----------------------------------------------------------------------------------------------------- 24.参数设置表 |
| | | ----------------------------------------------------------------------------------------------------- 23.参数设置表 |
| | | -- DROP TABLE IF EXISTS lf.sys_args; |
| | | create table lf.sys_args( |
| | | id serial primary key, |
| | |
| | | insert into lf.sys_args (name,cvalue,dvalue,min_value,max_value,times,descr,mark) values ('服务上限',5000,5000,5,1000000,1,'当超出服务上限时,就拒绝访问。','MAX_SERVERS'); */ |
| | | |
| | | select * from lf.sys_args order by id; |
| | | ----------------------------------------------------------------------------------------------------- 25.黑名单表 |
| | | ----------------------------------------------------------------------------------------------------- 24.黑名单表 |
| | | -- DROP TABLE IF EXISTS lf.sys_blacklist; |
| | | create table lf.sys_blacklist( |
| | | id serial primary key, |
| | |
| | | insert into lf.sys_blacklist (ip,type) values ('0:0:0:0:0:0:0:1',2);*/ |
| | | |
| | | select * from lf.sys_blacklist; |
| | | ----------------------------------------------------------------------------------------------------- 26.标绘表 |
| | | ----------------------------------------------------------------------------------------------------- 25.标绘表 |
| | | -- DROP TABLE IF EXISTS lf.sys_mark; |
| | | create table lf.sys_mark( |
| | | id serial primary key, |
| | |
| | | comment on column lf.sys_mark.update_time is '更新时间'; |
| | | |
| | | select * from lf.sys_mark; |
| | | ----------------------------------------------------------------------------------------------------- 27.值域表 |
| | | ----------------------------------------------------------------------------------------------------- 26.值域表 |
| | | -- drop table if exists lf.sys_domain; |
| | | create table if not exists lf.sys_domain( |
| | | id serial primary key, |
| | |
| | | comment on column lf.sys_domain.bak is '备注'; |
| | | |
| | | select * from lf.sys_domain order by dom_name,orderid; |
| | | ----------------------------------------------------------------------------------------------------- 28.项目表 |
| | | -- drop table if exists lf.sys_project; |
| | | create table if not exists lf.sys_project ( |
| | | ----------------------------------------------------------------------------------------------------- 27.报告模板表 |
| | | -- drop table if exists lf.sys_report; |
| | | create table if not exists lf.sys_report ( |
| | | id serial primary key, |
| | | dirid integer default 0, |
| | | depid integer default 0, |
| | | projname varchar(200), |
| | | projtype varchar(50), |
| | | location varchar(200), |
| | | province varchar(50), |
| | | country varchar(50), |
| | | corpname varchar(200), |
| | | department varchar(200), |
| | | conperiod varchar(20), |
| | | contents varchar(500), |
| | | projstate varchar(50), |
| | | remarks varchar(250), |
| | | belongsid varchar(100), |
| | | datastatus varchar(10), |
| | | name varchar(100), |
| | | type varchar(50), |
| | | path varchar(512), |
| | | code varchar(50), |
| | | 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(Point, 4490) |
| | | ); -- drop index index_sys_project_geom; |
| | | create index index_sys_project_geom on lf.sys_project using gist (geom); |
| | | comment on table lf.sys_project is '项目表'; |
| | | comment on column lf.sys_project.id is '主键id'; |
| | | comment on column lf.sys_project.dirid is '目录id'; |
| | | comment on column lf.sys_project.depid is '单位id'; |
| | | comment on column lf.sys_project.projname is '项目名称'; |
| | | comment on column lf.sys_project.projtype is '项目类型'; |
| | | comment on column lf.sys_project.location is '地理位置'; |
| | | comment on column lf.sys_project.province is '所属省份'; |
| | | comment on column lf.sys_project.country is '所属国家'; |
| | | comment on column lf.sys_project.corpname is '建设单位名称'; |
| | | comment on column lf.sys_project.department is '主管部门'; |
| | | comment on column lf.sys_project.conperiod is '建设工期'; |
| | | comment on column lf.sys_project.contents is '工程内容'; |
| | | comment on column lf.sys_project.projstate is '项目状态'; |
| | | comment on column lf.sys_project.remarks is '备注'; |
| | | comment on column lf.sys_project.belongsid is '权限代码'; |
| | | comment on column lf.sys_project.datastatus is '数据状态'; |
| | | comment on column lf.sys_project.create_user is '创建人id'; |
| | | comment on column lf.sys_project.create_time is '创建时间'; |
| | | comment on column lf.sys_project.update_user is '更新人id'; |
| | | comment on column lf.sys_project.update_time is '更新时间'; |
| | | comment on column lf.sys_project.geom is '空间位置'; |
| | | bak varchar(1024) |
| | | ); |
| | | comment on table lf.sys_report is '报告模板表'; |
| | | comment on column lf.sys_report.id is '主键ID'; |
| | | comment on column lf.sys_report.name is '名称'; |
| | | comment on column lf.sys_report.type is '类型'; |
| | | comment on column lf.sys_report.path is '路径'; |
| | | comment on column lf.sys_report.code is '编码'; |
| | | comment on column lf.sys_report.create_user is '创建人id'; |
| | | comment on column lf.sys_report.create_time is '创建时间'; |
| | | comment on column lf.sys_report.update_user is '更新人id'; |
| | | comment on column lf.sys_report.update_time is '更新时间'; |
| | | comment on column lf.sys_report.bak is '备注'; |
| | | |
| | | select * from lf.sys_project; |
| | | ----------------------------------------------------------------------------------------------------- 29.下载日志表 |
| | | select * from lf.sys_report; |
| | | ----------------------------------------------------------------------------------------------------- 28.下载日志表 |
| | | -- drop table if exists lf.sys_downlog; |
| | | create table lf.sys_downlog ( |
| | | id serial primary key, |
| | |
| | | -- insert into lf.sys_downlog(downid,ip,create_user) values (100,'192.168.20.39',1); |
| | | |
| | | select * from lf.sys_downlog; |
| | | ----------------------------------------------------------------------------------------------------- 30.数据申请表 |
| | | ----------------------------------------------------------------------------------------------------- 29.数据申请表 |
| | | -- drop table if exists lf.sys_apply; |
| | | create table lf.sys_apply ( |
| | | id serial primary key, |
| | |
| | | comment on column lf.sys_apply.update_time is '更新时间'; |
| | | |
| | | select * from lf.sys_apply; |
| | | ----------------------------------------------------------------------------------------------------- 31.申请流程表 |
| | | ----------------------------------------------------------------------------------------------------- 30.申请流程表 |
| | | -- drop table if exists lf.sys_flow; |
| | | create table lf.sys_flow ( |
| | | id serial primary key, |
| | |
| | | comment on column lf.sys_flow.update_time is '更新时间'; |
| | | |
| | | select * from lf.sys_flow; |
| | | ----------------------------------------------------------------------------------------------------- 32.FME日志表 |
| | | ----------------------------------------------------------------------------------------------------- 31.FME日志表 |
| | | create table lf.sys_fme_log ( |
| | | id serial primary key, |
| | | parentid varchar(38), |
| | |
| | | comment on column lf.sys_fme_log.create_time is '创建时间'; |
| | | |
| | | select * from lf.sys_fme_log; -- delete from lf.sys_fme_log; |
| | | ----------------------------------------------------------------------------------------------------- 33.图层表 |
| | | ----------------------------------------------------------------------------------------------------- 32.图层表 |
| | | -- DROP TABLE IF EXISTS lf.sys_layer; |
| | | create table lf.sys_layer( |
| | | id serial primary key, |
| | |
| | | comment on column lf.sys_layer.bak is '备注'; |
| | | |
| | | select * from lf.sys_layer; |
| | | ----------------------------------------------------------------------------------------------------- 34.服务日志表 |
| | | ----------------------------------------------------------------------------------------------------- 33.服务日志表 |
| | | -- DROP TABLE IF EXISTS lf.sys_serve_log; |
| | | create table lf.sys_serve_log( |
| | | id serial8, |