| | |
| | | comment on column lf.sys_menu.update_time is '更新时间'; |
| | | comment on column lf.sys_menu.bak is '备注'; |
| | | --alter table lf.sys_menu alter column bak type varchar(1024); |
| | | --alter sequence lf.sys_menu_id_seq restart with 45; |
| | | --alter sequence lf.sys_menu_id_seq restart with 44; |
| | | |
| | | select * from lf.sys_menu order by order_num; |
| | | ----------------------------------------------------------------------------------------------------- 2.单位表 |
| | |
| | | comment on column lf.sys_login.descr is '描述'; |
| | | comment on column lf.sys_login.userid is '登记人ID'; |
| | | comment on column lf.sys_login.optime is '登记时间'; |
| | | /*insert into lf.sys_login (appid,ip,userid) values (1,'192.168.20.106',1); |
| | | insert into lf.sys_login (appid,ip,userid,optime) values (1,'192.168.20.106',1,'2024-01-02');*/ |
| | | /* insert into lf.sys_login (appid,ip,userid) values (1,'192.168.20.106',1); |
| | | insert into lf.sys_login (appid,ip,userid,optime) values (1,'192.168.20.106',1,'2024-01-02'); |
| | | delete from lf.sys_login_2024; */ |
| | | |
| | | 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; |
| | |
| | | comment on column lf.sys_operate.userid is '操作人ID'; |
| | | comment on column lf.sys_operate.optime is '操作时间'; |
| | | comment on column lf.sys_operate.bak is '备注'; |
| | | /*insert into lf.sys_operate (modular,url,ip,type) values ('数据管理\目录管理','data/manage/update','192.168.20.106',5); |
| | | insert into lf.sys_operate (modular,url,ip,type,optime) values ('数据管理\目录管理','data/manage/delete','192.168.20.107',4,'2024-01-02');*/ |
| | | /* insert into lf.sys_operate (modular,url,ip,type) values ('数据管理\目录管理','data/manage/update','192.168.20.106',5); |
| | | insert into lf.sys_operate (modular,url,ip,type,optime) values ('数据管理\目录管理','data/manage/delete','192.168.20.107',4,'2024-01-02'); |
| | | delete from lf.sys_operate_2024; */ |
| | | |
| | | alter table lf.sys_operate add column modular1 varchar(50); alter table lf.sys_operate drop column modular; |
| | | select split_part(modular,'\',1),split_part(modular,'\',2) from lf.sys_operate; |
| | |
| | | comment on column lf.sys_token.create_time is '创建时间'; |
| | | comment on column lf.sys_token.update_user is '更新人ID'; |
| | | comment on column lf.sys_token.update_time is '更新时间'; |
| | | /*insert into lf.sys_token (token,ip) values (new_guid(),'192.168.20.106'); |
| | | insert into lf.sys_token (token,ip,expire,create_time) values (new_guid(),'192.168.20.107',now()::timestamp + '1 year 4 hour',now()::timestamp + '1 year');*/ |
| | | /* insert into lf.sys_token (token,ip) values (new_guid(),'192.168.20.106'); |
| | | insert into lf.sys_token (token,ip,expire,create_time) values (new_guid(),'192.168.20.107',now()::timestamp + '1 year 4 hour',now()::timestamp + '1 year'); |
| | | delete from lf.sys_token_2023; */ |
| | | |
| | | select * from lf.sys_token where token='91cf74dc-1d03-4937-983f-88810589b112' and expire > now() limit 1; |
| | | 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); |
| | |
| | | comment on table lf.sys_res_op is '资源操作表'; |
| | | comment on column lf.sys_res_op.id is '主键ID'; |
| | | comment on column lf.sys_res_op.resid is '资源ID'; |
| | | comment on column lf.sys_res_op.type is '操作类型:1-查看,2-新增,3-修改,4-删除,5-上传,6-下载'; |
| | | comment on column lf.sys_res_op.type is '操作类型:1-查看,2-新增,3-修改,4-删除,5-上传,6-下载,7-统计'; |
| | | comment on column lf.sys_res_op.ip is 'IP地址'; |
| | | comment on column lf.sys_res_op.userid is '操作人ID'; |
| | | comment on column lf.sys_res_op.optime is '创建时间'; |
| | | /*insert into lf.sys_res_op (resid,ip,type) values (1,'192.168.20.106',5); |
| | | /* insert into lf.sys_res_op (resid,ip,type) values (1,'192.168.20.106',5); |
| | | insert into lf.sys_res_op (resid,ip,type) values (1,'192.168.20.106',1); |
| | | insert into lf.sys_res_op (resid,ip,type,optime) values (1,'192.168.20.107',4,'2024-01-02');*/ |
| | | insert into lf.sys_res_op (resid,ip,type,optime) values (1,'192.168.20.107',4,'2024-01-02'); |
| | | delete from lf.sys_res_op_2024; */ |
| | | |
| | | select a.*,b.uname,c.name from lf.sys_res_op a inner join lf.sys_user b on a.userid = b.id inner join lf.sys_res c on a.resid=c.id; |
| | | |
| | |
| | | comment on column lf.sys_auth.update_user is '更新人ID'; |
| | | comment on column lf.sys_auth.update_time is '更新时间'; |
| | | comment on column lf.sys_auth.bak is '备注'; |
| | | /*insert into lf.sys_auth (name,tag) values ('查看','select'); |
| | | insert into lf.sys_auth (name,tag) values ('新增','insert'); |
| | | insert into lf.sys_auth (name,tag) values ('修改','update'); |
| | | insert into lf.sys_auth (name,tag) values ('删除','delete'); |
| | | insert into lf.sys_auth (name,tag) values ('上传','upload'); |
| | | insert into lf.sys_auth (name,tag) values ('下载','download');*/ |
| | | /* insert into lf.sys_auth (name,tag) values ('查看','/select'); |
| | | insert into lf.sys_auth (name,tag) values ('新增','/insert'); |
| | | insert into lf.sys_auth (name,tag) values ('修改','/update'); |
| | | insert into lf.sys_auth (name,tag) values ('删除','/delete'); |
| | | insert into lf.sys_auth (name,tag) values ('上传','/upload'); |
| | | insert into lf.sys_auth (name,tag) values ('下载','/download'); |
| | | insert into lf.sys_auth (name,tag) values ('统计','/count'); |
| | | alter sequence lf.sys_auth_id_seq restart with 8; */ |
| | | |
| | | select * from lf.sys_auth; |
| | | ----------------------------------------------------------------------------------------------------- 11.角色表 |
| | |
| | | --insert into lf.sys_menu_auth (menuid,authid) values (1,1),(1,2),(1,3),(1,4),(1,5); |
| | | |
| | | select * from lf.sys_menu_auth; |
| | | ----------------------------------------------------------------------------------------------------- 14.角色-菜单-权限表 |
| | | ----------------------------------------------------------------------------------------------------- 15.角色-菜单-权限表 |
| | | -- DROP TABLE IF EXISTS lf.sys_role_menu_auth; |
| | | create table lf.sys_role_menu_auth( |
| | | id serial primary key, |
| | |
| | | -- DROP TABLE IF EXISTS lf.sys_meta; |
| | | create table lf.sys_meta( |
| | | id serial primary key, |
| | | dirid integer, |
| | | depid integer, |
| | | name varchar(256), |
| | | format varchar(100), |
| | | fsize bigint default 0, |
| | | dirid integer default 0, |
| | | depid integer default 0, |
| | | verid integer default 0, |
| | | type varchar(100), |
| | | sizes float8 default 0, |
| | | cs varchar(50), |
| | | fscale varchar(50), |
| | | scale varchar(50), |
| | | resolution varchar(50), |
| | | gather timestamp(6) without time zone, |
| | | descr varchar(256), |
| | | guid varchar(40) default null, |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | | update_time timestamp(6) without time zone, |
| | | geo geometry default null, |
| | | CONSTRAINT enforce_dims_geom CHECK (st_ndims(geo) = 2), |
| | | CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geo) = 'POLYGON'::text OR geo IS NULL), |
| | | CONSTRAINT enforce_srid_geom CHECK (st_srid(geo) = 4490) |
| | | geom geometry default null, |
| | | CONSTRAINT enforce_dims_geom CHECK (st_ndims(geom) = 2), |
| | | CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POLYGON'::text OR geom IS NULL), |
| | | CONSTRAINT enforce_srid_geom CHECK (st_srid(geom) = 4490) |
| | | ); |
| | | create index index_sys_meta_geo on lf.sys_meta using gist (geo); |
| | | -- drop index index_sys_meta_geom; |
| | | create index index_sys_meta_geom on lf.sys_meta using GIST (geom); |
| | | comment on table lf.sys_meta is '元数据表'; |
| | | comment on column lf.sys_meta.id is '主键ID'; |
| | | comment on column lf.sys_meta.name is '名称'; |
| | | comment on column lf.sys_meta.dirid is '目录ID'; |
| | | comment on column lf.sys_meta.depid is '单位ID'; |
| | | comment on column lf.sys_meta.name is '名称'; |
| | | comment on column lf.sys_meta.format is '格式'; |
| | | comment on column lf.sys_meta.fsize is '大小:单位为kb'; |
| | | comment on column lf.sys_meta.verid is '版本ID'; |
| | | comment on column lf.sys_meta.type is '格式'; |
| | | comment on column lf.sys_meta.sizes is '大小:单位MB'; |
| | | comment on column lf.sys_meta.cs is '坐标系'; |
| | | comment on column lf.sys_meta.fscale is '比例尺'; |
| | | comment on column lf.sys_meta.scale is '比例尺'; |
| | | comment on column lf.sys_meta.resolution is '分辨率'; |
| | | comment on column lf.sys_meta.gather is '采集日期'; |
| | | comment on column lf.sys_meta.descr is '描述'; |
| | | comment on column lf.sys_meta.guid is '文件ID'; |
| | | comment on column lf.sys_meta.create_user is '创建人ID'; |
| | | comment on column lf.sys_meta.create_time is '创建时间'; |
| | | comment on column lf.sys_meta.update_user is '更新人ID'; |
| | | comment on column lf.sys_meta.update_time is '更新时间'; |
| | | comment on column lf.sys_meta.geo is '空间'; |
| | | --insert into lf.sys_meta(dirid,depid,name,geo) values (1,1,'Test',ST_PolygonFromText('POLYGON ((100 0,120 0,120 20,100 20,100 0))',4490)); |
| | | comment on column lf.sys_meta.geom is '空间位置'; |
| | | -- insert into lf.sys_meta(dirid,depid,name,geom,sizes) values (1,1,'Test',ST_PolygonFromText('POLYGON ((100 0,120 0,120 20,100 20,100 0))',4490),0.001); |
| | | |
| | | select id,dirid,depid,name,descr,guid,create_user,create_time,update_user,update_time,st_astext(geo) from lf.sys_meta; |
| | | select * from lf.sys_meta; select id,name,dirid,depid,verid,type,sizes,descr,create_user,create_time,update_user,update_time,st_astext(geom) from lf.sys_meta; |
| | | ----------------------------------------------------------------------------------------------------- 17.元数据文件表 |
| | | -- DROP TABLE IF EXISTS lf.sys_meta_file; |
| | | create table lf.sys_meta_file( |
| | | id serial primary key, |
| | | metaid integer, |
| | | name varchar(256), |
| | | metaid integer, |
| | | fileid integer default 0, |
| | | guid varchar(40) default new_guid(), |
| | | path varchar(512), |
| | | fileid integer default 0, |
| | | sizes float default 0, |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | |
| | | ); |
| | | comment on table lf.sys_meta_file is '元数据文件表'; |
| | | comment on column lf.sys_meta_file.id is '主键ID'; |
| | | comment on column lf.sys_meta_file.metaid is '元数据ID'; |
| | | comment on column lf.sys_meta_file.name is '文件名'; |
| | | comment on column lf.sys_meta_file.metaid is '元数据ID'; |
| | | comment on column lf.sys_meta_file.fileid is '父文件ID:0-没有'; |
| | | comment on column lf.sys_meta_file.guid is '文件ID'; |
| | | comment on column lf.sys_meta_file.path is '存储路径'; |
| | | comment on column lf.sys_meta_file.fileid is '父文件ID:0-没有'; |
| | | comment on column lf.sys_meta_file.sizes is '文件大小:单位MB'; |
| | | comment on column lf.sys_meta_file.create_user is '创建人ID'; |
| | | comment on column lf.sys_meta_file.create_time is '创建时间'; |
| | | comment on column lf.sys_meta_file.update_user is '更新人ID'; |
| | | comment on column lf.sys_meta_file.update_time is '更新时间'; |
| | | --insert into lf.sys_meta_file (metaid,name,path) values (1,'a.jpg','c:\a.jpg'); |
| | | -- insert into lf.sys_meta_file (metaid,name,path) values (1,'a.jpg','c:\a.jpg'); |
| | | |
| | | select * from lf.sys_meta_file; |
| | | ----------------------------------------------------------------------------------------------------- 18.附件表 |
| | |
| | | id serial primary key, |
| | | name varchar(256), |
| | | tab varchar(100), |
| | | tab_guid varchar(40), |
| | | guid varchar(40) default new_guid(), |
| | | path varchar(512), |
| | | sizes float8 default 0; |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | |
| | | comment on column lf.sys_attach.id is '主键ID'; |
| | | comment on column lf.sys_attach.name is '文件名'; |
| | | comment on column lf.sys_attach.tab is '表名:如 public.data_dir'; |
| | | comment on column lf.sys_attach.tab_guid is '表ID'; |
| | | comment on column lf.sys_attach.guid is '文件ID'; |
| | | comment on column lf.sys_attach.path is '存储路径'; |
| | | comment on column lf.sys_attach.sizes is '文件大小:单位MB'; |
| | | comment on column lf.sys_attach.create_user is '创建人ID'; |
| | | comment on column lf.sys_attach.create_time is '创建时间'; |
| | | comment on column lf.sys_attach.update_user is '更新人ID'; |
| | | comment on column lf.sys_attach.update_time is '更新时间'; |
| | | --insert into lf.sys_attach (name,tab,path) values ('a.jpg','public.data_dir','c:\a.jpg'); |
| | | --alter table lf.sys_attach add tab_guid varchar(40); |
| | | --alter table lf.sys_attach add sizes bigint default 0; |
| | | --alter table lf.sys_attach alter column sizes type float8; |
| | | |
| | | select length(guid) from lf.sys_attach limit 1; select * from lf.sys_attach; |
| | | select * from lf.sys_attach; select length(guid) from lf.sys_attach limit 1; select * from lf.sys_attach; |
| | | ----------------------------------------------------------------------------------------------------- 19.版本表 |
| | | -- DROP TABLE IF EXISTS lf.sys_ver; |
| | | create table lf.sys_ver( |
| | |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | | update_time timestamp(6) without time zone, |
| | | tabletype varchar(20), |
| | | unit varchar(50), |
| | | domain_na varchar(100), |
| | | showtype smallint, |
| | | editable smallint, |
| | | bak varchar(1024) |
| | | ); |
| | | comment on table lf.sys_dict is '附件表'; |
| | |
| | | comment on column lf.sys_dict.create_time is '创建时间'; |
| | | comment on column lf.sys_dict.update_user is '更新人ID'; |
| | | comment on column lf.sys_dict.update_time is '更新时间'; |
| | | comment on column lf.sys_dict.tabletype is '表类型'; |
| | | comment on column lf.sys_dict.unit is '单位'; |
| | | comment on column lf.sys_dict.domain_na is '值域名称'; |
| | | comment on column lf.sys_dict.showtype is '显示类型'; |
| | | comment on column lf.sys_dict.editable is '是否可编辑'; |
| | | comment on column lf.sys_dict.bak is '备注'; |
| | | /* alter sequence lf.sys_dict_id_seq restart with 300; |
| | | update lf.sys_dict set create_user=1,create_time=now() where 1=1; |
| | |
| | | |
| | | select count(*) from lf.sys_dict where tab='sys_user'; |
| | | select * from lf.sys_dict order by ns,tab,order_num limit 10 offset 0; |
| | | select distinct ns,fn_get_entity(tab) tab,tab_desc,tabletype from lf.sys_dict order by tab; |
| | | ----------------------------------------------------------------------------------------------------- 21.样式表 |
| | | -- DROP TABLE IF EXISTS lf.sys_style; |
| | | create table lf.sys_style( |
| | |
| | | create_time timestamp(6) without time zone default now(), |
| | | download_user integer, |
| | | download_time timestamp(6) without time zone, |
| | | geo geometry default null, |
| | | geom geometry default null, |
| | | bak varchar(1024) |
| | | CONSTRAINT enforce_dims_geom CHECK (st_ndims(geo) = 2), |
| | | CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geo) = 'POLYGON'::text OR geo IS NULL), |
| | | CONSTRAINT enforce_srid_geom CHECK (st_srid(geo) = 4490) |
| | | CONSTRAINT enforce_dims_geom CHECK (st_ndims(geom) = 2), |
| | | CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POLYGON'::text OR geom IS NULL), |
| | | CONSTRAINT enforce_srid_geom CHECK (st_srid(geom) = 4490) |
| | | ); |
| | | create index index_sys_download_geo on lf.sys_download using gist (geo); |
| | | create index index_sys_download_geom on lf.sys_download using gist (geom); |
| | | comment on table lf.sys_download is '下载记录表'; |
| | | comment on column lf.sys_download.id is '主键ID'; |
| | | comment on column lf.sys_download.name is '名称'; |
| | |
| | | comment on column lf.sys_download.create_time is '创建时间'; |
| | | comment on column lf.sys_download.download_user is '下载人ID'; |
| | | comment on column lf.sys_download.download_time is '下载时间'; |
| | | comment on column lf.sys_download.geo is '空间'; |
| | | comment on column lf.sys_download.bak is '备注'; |
| | | comment on column lf.sys_download.geom is '空间位置'; |
| | | -- insert into lf.sys_download (name,pwd,url,descr) values ('2022-09-27','123456','','测试下载'); |
| | | |
| | | select * from lf.sys_download; |
| | |
| | | -- DROP TABLE IF EXISTS lf.sys_blacklist; |
| | | create table lf.sys_blacklist( |
| | | id serial primary key, |
| | | ip varchar(50), |
| | | ip varchar(50) unique, |
| | | type smallint default 1, |
| | | visit integer default 0, |
| | | descr varchar(50), |
| | |
| | | insert into lf.sys_blacklist (ip,type) values ('127.0.0.1',2); */ |
| | | |
| | | select * from lf.sys_blacklist; |
| | | ----------------------------------------------------------------------------------------------------- 26.标绘表 |
| | | -- DROP TABLE IF EXISTS lf.sys_mark; |
| | | create table lf.sys_mark( |
| | | id serial primary key, |
| | | name varchar(50), |
| | | wkt text, |
| | | 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_mark is '标绘表'; |
| | | comment on column lf.sys_mark.id is '主键ID'; |
| | | comment on column lf.sys_mark.name is '名称'; |
| | | comment on column lf.sys_mark.wkt is 'WKT'; |
| | | comment on column lf.sys_mark.create_user is '创建人ID'; |
| | | comment on column lf.sys_mark.create_time is '创建时间'; |
| | | comment on column lf.sys_mark.update_user is '更新人ID'; |
| | | comment on column lf.sys_mark.update_time is '更新时间'; |
| | | |
| | | select * from lf.sys_mark; |
| | | ----------------------------------------------------------------------------------------------------- |