| | |
| | | -- 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 bigint 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, |
| | |
| | | CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geo) = 'POLYGON'::text OR geo IS NULL), |
| | | CONSTRAINT enforce_srid_geom CHECK (st_srid(geo) = 4490) |
| | | ); |
| | | create index index_sys_meta_geo on lf.sys_meta using gist (geo); |
| | | -- drop index index_sys_meta_geo; |
| | | create index index_sys_meta_geo on lf.sys_meta using GIST (geo); |
| | | 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 '大小:单位为B'; |
| | | 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.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)); |
| | | |
| | | 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(geo) from lf.sys_meta; |
| | | ----------------------------------------------------------------------------------------------------- 17.元数据文件表 |
| | | -- DROP TABLE IF EXISTS lf.sys_meta_file; |
| | | create table lf.sys_meta_file( |
| | |
| | | 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.geo is '空间位置'; |
| | | -- insert into lf.sys_download (name,pwd,url,descr) values ('2022-09-27','123456','','测试下载'); |
| | | |
| | | select * from lf.sys_download; |
| | |
| | | * @author WWW |
| | | */ |
| | | public class MetaEntity implements Serializable { |
| | | private static final long serialVersionUID = -525590434915195392L; |
| | | private static final long serialVersionUID = -351865749970015936L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private String name; |
| | | private int verid; |
| | | |
| | | private String format; |
| | | private String type; |
| | | |
| | | private long fsize; |
| | | private long sizes; |
| | | |
| | | private String cs; |
| | | |
| | | private String fscale; |
| | | private String scale; |
| | | |
| | | private String resolution; |
| | | |
| | | private Timestamp gather; |
| | | |
| | | private String descr; |
| | | |
| | | private String guid; |
| | | |
| | | private int createUser; |
| | | |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getDirid() { |
| | | return dirid; |
| | | } |
| | |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public int getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public void setVerid(int verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public String getFormat() { |
| | | return format; |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setFormat(String format) { |
| | | this.format = format; |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public long getFsize() { |
| | | return fsize; |
| | | public long getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setFsize(long fsize) { |
| | | this.fsize = fsize; |
| | | public void setSizes(long sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public String getCs() { |
| | |
| | | this.cs = cs; |
| | | } |
| | | |
| | | public String getFscale() { |
| | | return fscale; |
| | | public String getScale() { |
| | | return scale; |
| | | } |
| | | |
| | | public void setFscale(String fscale) { |
| | | this.fscale = fscale; |
| | | public void setScale(String scale) { |
| | | this.scale = scale; |
| | | } |
| | | |
| | | public String getResolution() { |
| | |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.data.MetaEntity"> |
| | | insert into lf.sys_meta |
| | | (dirid,depid,name,format,fsize,cs,fscale,resolution,gather,descr,guid,create_user,create_time,geo) |
| | | (name,dirid,depid,verid,type,sizes,cs,scale,resolution,gather,descr,create_user,create_time,geo) |
| | | values |
| | | (#{dirid},#{depid},#{name},#{format},#{fsize},#{cs},#{fscale},#{resolution},now(),#{descr},#{guid},#{createUser},now(),#{geo}) |
| | | (#{name},#{dirid},#{depid},#{verid},#{type},#{sizes},#{cs},#{scale},#{resolution},now(),#{descr},#{createUser},now(),#{geo}) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_meta |
| | | (dirid,depid,name,format,fsize,cs,fscale,resolution,gather,descr,guid,create_user,create_time,geo) |
| | | (name,dirid,depid,verid,type,sizes,cs,scale,resolution,gather,descr,create_user,create_time,geo) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.dirid},#{item.depid},#{item.name},#{item.format},#{item.fsize},#{item.cs},#{item.fscale},#{item.resolution},now(),#{item.descr},#{item.guid},#{item.createUser},now(),#{item.geo}) |
| | | (#{item.name},#{item.dirid},#{item.depid},#{item.verid},#{item.type},#{item.sizes},#{item.cs},#{item.scale},#{item.resolution},now(),#{item.descr},#{item.createUser},now(),#{item.geo}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_meta |
| | | set dirid=#{dirid},depid=#{depid},name=#{name},format=#{format},fsize=#{fsize},cs=#{cs},fscale=#{fscale},resolution=#{resolution},gather=now(),descr=#{descr},guid=#{guid},update_user=#{updateUser},update_time=now(),geo=#{geo} |
| | | where id=#{id} |
| | | update lf.sys_meta |
| | | set name=#{name},dirid=#{dirid},depid=#{depid},verid=#{verid},type=#{type},sizes=#{sizes},cs=#{cs},scale=#{scale},resolution=#{resolution},gather=now(),descr=#{descr},update_user=#{updateUser},update_time=now(),geo=#{geo} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_meta |
| | | <set> |
| | | dirid=#{item.dirid},depid=#{item.depid},name=#{item.name},format=#{item.format},fsize=#{item.fsize},cs=#{item.cs},fscale=#{item.fscale},resolution=#{item.resolution},gather=now(),descr=#{item.descr},guid=#{item.guid},update_user=#{item.updateUser},update_time=now(),geo=#{item.geo} |
| | | name=#{item.name},dirid=#{item.dirid},depid=#{item.depid},verid=#{item.verid},type=#{item.type},sizes=#{item.sizes},cs=#{item.cs},scale=#{item.scale},resolution=#{item.resolution},gather=now(),descr=#{item.descr},update_user=#{item.updateUser},update_time=now(),geo=#{item.geo} |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |