--参数--
CREATE TABLE public.__parameter__
(
    id serial primary key,
    "参数名" character varying(64),
    "参数值" character varying(128),
    "参数类型" character varying(20),
    "管网名" character varying(64)
);

--模式表--
CREATE TABLE public.__pattern__
(
    id serial primary key,
    "模式名" character varying(64),
    "时段" integer,
    "系数" double precision,
	"类型" integer
)

CREATE TABLE public.__pattern__
(
    id serial primary key,
    model_name character varying(64),
    model_type integer,
    model_data character varying
)

--曲线表--
CREATE TABLE public.__curve__
(
     id serial primary key,
    "曲线名" character varying(64),
    "类型" character varying(64),
    x double precision,
    y double precision
)

--结果点表--
CREATE TABLE public.__node_result__
(
    id serial primary key,
    "本点号" character varying(20),
    "类型" integer,
    "压力" double precision,
    "水头" double precision,
    "标高" double precision,
    "实际需水量" double precision,
    "水池容量" double precision,
    "水池最大容量" double precision,
    "液位高度" double precision,
    "水质" double precision,
    "时间" timestamp without time zone
)

--结果线表--
CREATE TABLE public.__pipe_result__
(
    id serial primary key,
    "编号" character varying(20),
    "流量" double precision,
    "流向" integer,
    "流速" double precision,
    "水头损失" double precision,
    "单位水头损" double precision,
    "上点水头" double precision,
    "本点水头" double precision,
    "局部水头损" double precision,
    "摩擦水头损" double precision,
    "状态" character varying(20),
    "水质" double precision,
    "时间" timestamp without time zone
)
