wuww
2025-04-15 3f9ac67b7fe272fcf48b2d7ef549e4ac7872a3a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---------------------------------------------- 0.初始化
create extension if not exists postgis cascade;
 
create extension if not exists "uuid-ossp";
 
create schema if not exists nsl;
---------------------------------------------- 1.推演模拟
-- drop table if exists nsl.simu;
create table nsl.simu (
      id serial primary key,
      name varchar(200),
      service_name varchar(200),
    type smallint default 1,
    area_type smallint default 0,
    data varchar(8000),
    status smallint default 0,
    result varchar(8000),
    create_time timestamp(6) without time zone default now(),
    create_user varchar(50),
    update_time timestamp(6) without time zone,
      update_user varchar(50),
    bak varchar(2000),
    geom geometry(MultiPolygon, 4490)
);
-- drop index nsl.idx_nsl_simu_geom;
create index idx_nsl_simu_geom on nsl.simu using GIST (geom);
 
comment on table nsl.simu is '推演模拟表';
comment on column nsl.simu.id is '主键ID';
comment on column nsl.simu.name is '名称';
comment on column nsl.simu.service_name is '服务名称';
comment on column nsl.simu.type is '类别:1-预测模拟,2-实时模拟,3-历史模拟';
comment on column nsl.simu.area_type is '区域类别:0-自定义,1-行政区划,2-重点区域,3-重点沟';
comment on column nsl.simu.data is '数据(JSON)';
comment on column nsl.simu.status is '状态:0-创建仿真,1-预处理,2-分析中,10-完成,20-出错';
comment on column nsl.simu.result is '结果(JSON)';
comment on column nsl.simu.create_time is '创建时间';
comment on column nsl.simu.create_user is '创建人';
comment on column nsl.simu.update_time is '更新时间';
comment on column nsl.simu.update_user is '更新人';
comment on column nsl.simu.bak is '备注';
comment on column nsl.simu.geom is '空间位置';
 
select * from nsl.simu;
---------------------------------------------- 2.推演区域
-- drop table if exists nsl.region;
create table nsl.region (
      id serial primary key,
      name varchar(200),
    type smallint default 1,
    geom geometry(MultiPolygon, 4490)
);
-- drop index nsl.idx_nsl_region_geom;
create index idx_nsl_region_geom on nsl.region using GIST (geom);
 
comment on table nsl.region is '推演区域表';
comment on column nsl.region.id is '主键ID';
comment on column nsl.region.name is '名称';
comment on column nsl.region.type is '类别:1-行政区划,2-重点区域,3-重点沟';
comment on column nsl.region.geom is '空间位置';
 
select * from nsl.region;
---------------------------------------------- 3.雨量计 *
-- drop table if exists nsl.udometer;
create table nsl.udometer (
      id serial primary key,
      name varchar(200),
    rainfall numeric(15, 3) default 0.0, -- 总位数/小数位数
    geom geometry(Point, 4490)
);
-- drop index nsl.idx_nsl_udometer_geom;
create index idx_nsl_udometer_geom on nsl.udometer using GIST (geom);
 
comment on table nsl.udometer is '雨量计表';
comment on column nsl.udometer.id is '主键ID';
comment on column nsl.udometer.name is '名称';
comment on column nsl.udometer.rainfall is '降雨量(米)';
comment on column nsl.udometer.geom is '空间位置';
 
select * from nsl.udometer;
----------------------------------------------