CREATE TABLE "FXKH_TXL"."AB_INFO"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"JSON" VARCHAR(2000),
"AB_ID" INTEGER,
"VERSION" INTEGER DEFAULT 0 NOT NULL,
"CREATE_ID" VARCHAR(50),
"CREATE_TIME" DATETIME(0),
"TYPE" CHAR(1) DEFAULT 0,
"ADCD" VARCHAR(50),
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."AB_INFO" IS '通讯录操作日志';
COMMENT ON COLUMN "FXKH_TXL"."AB_INFO"."AB_ID" IS '通讯录编号';
COMMENT ON COLUMN "FXKH_TXL"."AB_INFO"."CREATE_ID" IS '新增人id';
COMMENT ON COLUMN "FXKH_TXL"."AB_INFO"."CREATE_TIME" IS '新增时间';
COMMENT ON COLUMN "FXKH_TXL"."AB_INFO"."JSON" IS '数据';
COMMENT ON COLUMN "FXKH_TXL"."AB_INFO"."TYPE" IS '0:添加用户,1:修改用户,2:修改权限,3:删除用户';
COMMENT ON COLUMN "FXKH_TXL"."AB_INFO"."VERSION" IS '版本号';


CREATE TABLE "FXKH_TXL"."AB_UD_R"
(
"AD_ID" INTEGER,
"DICT_ID" VARCHAR(50),
"TYPE" CHAR(1),
"SORT" INTEGER) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."AB_UD_R" IS '用户单位字典关联表';
COMMENT ON COLUMN "FXKH_TXL"."AB_UD_R"."AD_ID" IS '联系人id';
COMMENT ON COLUMN "FXKH_TXL"."AB_UD_R"."DICT_ID" IS '字典id';
COMMENT ON COLUMN "FXKH_TXL"."AB_UD_R"."SORT" IS '序号';
COMMENT ON COLUMN "FXKH_TXL"."AB_UD_R"."TYPE" IS '0:组织,1:单位';


CREATE TABLE "FXKH_TXL"."ADDRESS_BOOK"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"NAME" VARCHAR(80) NOT NULL,
"PHONE" VARCHAR(15),
"TEL" VARCHAR(50),
"FAXES" VARCHAR(50),
"ORGANIZATION" VARCHAR(50),
"POSITION" VARCHAR(200),
"COMMENTS" VARCHAR(200),
"URL" VARCHAR(200),
"ADCD" VARCHAR(50),
"SORT" INTEGER DEFAULT 0,
"V" INTEGER DEFAULT 0,
"RESPONSIBILITY" VARCHAR(50),
"IS_PASS" TINYINT DEFAULT FALSE,
"OPENID" VARCHAR(50),
"LEVEL" INTEGER,
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."ADDRESS_BOOK" IS '通讯录';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."ADCD" IS '行政区划';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."COMMENTS" IS '备注';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."FAXES" IS '传真';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."IS_PASS" IS '是否放行, 放行:true,拦截:false';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."NAME" IS '姓名';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."OPENID" IS 'openid';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."ORGANIZATION" IS '组织';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."PHONE" IS '手机号';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."POSITION" IS '职务';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."SORT" IS '序号';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."TEL" IS '电话';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."URL" IS '图片路径';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK"."V" IS '版本';


CREATE TABLE "FXKH_TXL"."ADDRESS_BOOK_CITY"
(
"ID" INT IDENTITY(1, 1) NOT NULL,
"UNIT" VARCHAR(50),
"NAME" VARCHAR(50) NOT NULL,
"POSITION" VARCHAR(50),
"PHONE" VARCHAR(50) NOT NULL,
"COMMENTS" VARCHAR(50),
"DEL" VARCHAR(2) DEFAULT 1,
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."ADDRESS_BOOK_CITY" IS '市级责任人通讯录';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_CITY"."COMMENTS" IS '备注';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_CITY"."DEL" IS '删除标识:1:未删除,0:已删除';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_CITY"."NAME" IS '名字';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_CITY"."PHONE" IS '电话';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_CITY"."POSITION" IS '职务';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_CITY"."UNIT" IS '单位';


CREATE TABLE "FXKH_TXL"."ADDRESS_BOOK_OLD"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"CTNM" VARCHAR(50),
"CNNM" VARCHAR(50),
"NAME" VARCHAR(50),
"POSITION" VARCHAR(50),
"PHONE" VARCHAR(50),
"CREATE_TIME" DATETIME(0),
"SALT" VARCHAR(50),
"LEVEL" INTEGER,
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."ADDRESS_BOOK_OLD" IS '旧的通讯录表';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."CNNM" IS '县名称';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."CREATE_TIME" IS '导入时间';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."CTNM" IS '市名称';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."LEVEL" IS '责任人级别';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."NAME" IS '姓名';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."PHONE" IS '手机号';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."POSITION" IS '职务';
COMMENT ON COLUMN "FXKH_TXL"."ADDRESS_BOOK_OLD"."SALT" IS '盐';


CREATE TABLE "FXKH_TXL"."ADINFO"
(
"ADCD" CHAR(15) NOT NULL,
"ADNM" VARCHAR(32) NOT NULL,
NOT CLUSTER PRIMARY KEY("ADCD") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."ADINFO" IS '行政区划基础信息';
COMMENT ON COLUMN "FXKH_TXL"."ADINFO"."ADCD" IS '政区编码';
COMMENT ON COLUMN "FXKH_TXL"."ADINFO"."ADNM" IS '政区名称';


CREATE TABLE "FXKH_TXL"."AUTOCALL"
(
"ID" INT IDENTITY(1, 1) NOT NULL,
"LEVEL" INT,
"STATUS" VARCHAR(50),
"_CREATE_TM" TIMESTAMP(6),
"__TALK_TIMES" INT,
"__SIP_TERM_CAUSE" VARCHAR(255),
"__CALLER" VARCHAR(255),
"__NUMBER" VARCHAR(50),
"__STARTRING_AT" TIMESTAMP(6),
"__STARTED_AT" TIMESTAMP(6),
"__CONNECTED_AT" TIMESTAMP(6),
"__DISCONNECTED_AT" TIMESTAMP(6),
"__ENDRING_AT" TIMESTAMP(6),
"__STOPPED_AT" TIMESTAMP(6),
"__LAST_MODIFY" TIMESTAMP(6),
"WCM_ID" INTEGER,
"RESPONDER_ID" INTEGER,
"RESPONDER_NAME" VARCHAR(100),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE TABLE "FXKH_TXL"."AUTOCALL_CONFIG"
(
"KEY" VARCHAR(50) NOT NULL,
"VALUE" VARCHAR(50),
CONSTRAINT "AUTOCALL_CONFIG_PK" NOT CLUSTER PRIMARY KEY("KEY")) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE TABLE "FXKH_TXL"."AUTOCALL_TEST"
(
"ID" INT NOT NULL,
"WARN_ID" INT,
"ADDRESS_BOOK_OLD_ID" INT,
"LEVEL" INT,
"STATUS" VARCHAR(50),
"_CREATE_TM" TIMESTAMP(6),
"__TALK_TIMES" INT,
"__TASK_NAME" VARCHAR(255),
"__DIAL_TASK_MAIN_SN" VARCHAR(255),
"__CUST_ID" VARCHAR(255),
"__SIP_TERM_CAUSE" VARCHAR(255),
"__CALLER" VARCHAR(255),
"__NUMBER" VARCHAR(50),
"__STARTRING_AT" TIMESTAMP(6),
"__STARTED_AT" TIMESTAMP(6),
"__CONNECTED_AT" TIMESTAMP(6),
"__DISCONNECTED_AT" TIMESTAMP(6),
"__ENDRING_AT" TIMESTAMP(6),
"__STOPPED_AT" TIMESTAMP(6),
"__LAST_MODIFY" TIMESTAMP(6),
"CUST_NAME" VARCHAR(50),
"ADDRESS_BOOK_OLD_NAME" VARCHAR(50),
"CNNM" VARCHAR(50),
"WARN_LEVEL" VARCHAR(50),
"UPLOAD_RESP_MSG" VARCHAR(50),
CONSTRAINT "CONS134A63138" NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE UNIQUE  INDEX "INDEX33664D23" ON "FXKH_TXL"."AUTOCALL_TEST"("ID" ASC) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE TABLE "FXKH_TXL"."AUTO_CALL_PERSON"
(
"ID" INT IDENTITY(1, 1) NOT NULL,
"TASK_ID" INT NOT NULL,
"STATUS" INT DEFAULT 0,
"LEVEL" INT NOT NULL,
"_CREATE_TM" TIMESTAMP(6) NOT NULL,
"ERROR_CODE" INT DEFAULT 0,
"__REQUEST_ID" VARCHAR(255) NOT NULL,
"__CUST_ID" VARCHAR(255) NOT NULL,
"__CUST_NAME" VARCHAR(255) NOT NULL,
"__CONTENT" VARCHAR(1000) NOT NULL,
"__NUMBER" VARCHAR(50) NOT NULL,
"__UPLOAD_RESP_MSG" VARCHAR(1000),
"__REMARK" VARCHAR(255),
"__TALK_TIMES" INT,
"__SIP_TERM_CAUSE" VARCHAR(255),
"__STARTRING_AT" TIMESTAMP(6),
"__CONNECTED_AT" TIMESTAMP(6),
"__STARTED_AT" TIMESTAMP(6),
"__ENDRING_AT" TIMESTAMP(6),
"__DISCONNECTED_AT" TIMESTAMP(6),
"__STOPPED_AT" TIMESTAMP(6),
"__LAST_MODIFY" TIMESTAMP(6),
"__TAG" VARCHAR(100),
"UPLOADED_TIMES" INTEGER DEFAULT 0,
"SMS_CONTENT" VARCHAR(1000),
"MANUAL_CLOSE" INTEGER DEFAULT 0,
"POSITION" VARCHAR(100),
"MANUAL_CLOSE_TM" TIMESTAMP(6),
"__IS_COMPLETE" INTEGER DEFAULT 0,
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE UNIQUE  INDEX "INDEX_AUTO_CALL_PERSON" ON "FXKH_TXL"."AUTO_CALL_PERSON"("ID" ASC) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE TABLE "FXKH_TXL"."AUTO_CALL_TASK"
(
"ID" INT IDENTITY(1, 1) NOT NULL,
"WARN_ID" INT NOT NULL,
"STATUS" INT DEFAULT 0,
"ERROR_CODE" INT DEFAULT 0,
"WARN_NAME" VARCHAR(255) NOT NULL,
"WARN_TM" TIMESTAMP(6) NOT NULL,
"WARN_LEVEL" VARCHAR(255) NOT NULL,
"WARN_CTNM" VARCHAR(255) NOT NULL,
"WARN_CNNM" VARCHAR(255) NOT NULL,
"WARN_CONTENT" VARCHAR(1000) NOT NULL,
"_CREATE_TM" TIMESTAMP(6) NOT NULL,
"_REMARK" VARCHAR(1000),
"__TAG" VARCHAR(100),
"SUBMIT" INTEGER DEFAULT 0,
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE UNIQUE  INDEX "INDEX_AUTO_CALL_TASK" ON "FXKH_TXL"."AUTO_CALL_TASK"("ID" ASC) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE TABLE "FXKH_TXL"."FC"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"USER_ID" INTEGER NOT NULL,
"AB_ID" INTEGER NOT NULL,
"SORT" INTEGER DEFAULT 0,
"TYPE" CHAR(1),
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."FC" IS '常用联系人';
COMMENT ON COLUMN "FXKH_TXL"."FC"."AB_ID" IS '通讯录编号';
COMMENT ON COLUMN "FXKH_TXL"."FC"."SORT" IS '序号';
COMMENT ON COLUMN "FXKH_TXL"."FC"."TYPE" IS '0:常用联系人,1:置顶联系人';
COMMENT ON COLUMN "FXKH_TXL"."FC"."USER_ID" IS '用户编号';


CREATE TABLE "FXKH_TXL"."LOGIN_INFO"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"IP" VARCHAR(50),
"CREATE_ID" VARCHAR(50),
"CREATE_TIME" DATETIME(0),
"TYPE" CHAR(1) NOT NULL,
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."LOGIN_INFO" IS '登录日志';
COMMENT ON COLUMN "FXKH_TXL"."LOGIN_INFO"."CREATE_ID" IS '新增人id';
COMMENT ON COLUMN "FXKH_TXL"."LOGIN_INFO"."CREATE_TIME" IS '新增时间';
COMMENT ON COLUMN "FXKH_TXL"."LOGIN_INFO"."TYPE" IS '0:密码登录 1:验证码登录';


CREATE TABLE "FXKH_TXL"."ORGANIZATION"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"NAME" VARCHAR(50) NOT NULL,
"SORT" INTEGER DEFAULT 0,
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."ORGANIZATION" IS '组织表';
COMMENT ON COLUMN "FXKH_TXL"."ORGANIZATION"."NAME" IS '名称';
COMMENT ON COLUMN "FXKH_TXL"."ORGANIZATION"."SORT" IS '序号';


CREATE TABLE "FXKH_TXL"."QXWARNING"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"CREATE_TIME" DATETIME(6),
"PUBLISH_TIME" DATETIME(0),
"START_TIME" DATETIME(0),
"END_TIME" DATETIME(0),
"WARN_SIGNAL_TYPE" VARCHAR(50),
"WARN_SIGNAL_LEVEL" VARCHAR(50),
"PUBLISH_UNIT" VARCHAR(50),
"CONTENT" VARCHAR(500),
"WARNID" INTEGER,
"CTNM" VARCHAR(50),
"CNNM" VARCHAR(1000),
"INSEART_TIME" TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."QXWARNING" IS '气象预警表';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."CNNM" IS '预警县名称';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."CONTENT" IS '预警内容';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."CTNM" IS '预警市名称';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."END_TIME" IS '预警结束时间';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."PUBLISH_TIME" IS '发布时间';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."PUBLISH_UNIT" IS '发布单位';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."START_TIME" IS '预警开始时间';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."WARNID" IS '预警ID';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."WARN_SIGNAL_LEVEL" IS '预警级别';
COMMENT ON COLUMN "FXKH_TXL"."QXWARNING"."WARN_SIGNAL_TYPE" IS '预警类型';


CREATE TABLE "FXKH_TXL"."SH_ADDRESS_BOOK"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"CITY" VARCHAR(50),
"COUNTY" VARCHAR(50),
"AREA" VARCHAR(50),
"VILLAGE" VARCHAR(100),
"TYPE1" VARCHAR(50),
"TYPE2" VARCHAR(50),
"NAME" VARCHAR(50),
"POSITION" VARCHAR(200),
"PHONE" VARCHAR(50),
"SORT" INTEGER,
"LAND" VARCHAR(100),
"IS_SPOT_CHECK" VARCHAR(2) DEFAULT 0,
"CALL_STATUS" VARCHAR(2),
"DEL" VARCHAR(2) DEFAULT 1,
"LEVEL" INTEGER,
UNIQUE("ID") USING INDEX TABLESPACE "SHZH" ,
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."SH_ADDRESS_BOOK" IS '山洪责任人通讯录';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."AREA" IS '乡';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."CALL_STATUS" IS '是否接听0:否,1是';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."CITY" IS '市';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."COUNTY" IS '县';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."DEL" IS '是否删除0:是,1:否';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."ID" IS '主键id';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."IS_SPOT_CHECK" IS '是否抽查：0：不抽查，1：抽查';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."LAND" IS '负责区域';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."NAME" IS '名字';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."PHONE" IS '手机号';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."POSITION" IS '职务';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."SORT" IS '排序字段';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."TYPE1" IS '责任人类型1 行政责任人,包保责任人';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."TYPE2" IS '责任人类型 县级,乡级,村级, 县干部,乡干部';
COMMENT ON COLUMN "FXKH_TXL"."SH_ADDRESS_BOOK"."VILLAGE" IS '村';


CREATE TABLE "FXKH_TXL"."SH_CALLS"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"SH_AB_ID" INTEGER,
"CALL_TIME" TIMESTAMP(0),
"STATUS" VARCHAR(2),
"TYPE" VARCHAR(2) DEFAULT 0,
"CALL_TYPE" VARCHAR(2),
"KNOW" VARCHAR(2) DEFAULT 0,
"REMARK" VARCHAR2(500),
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."SH_CALLS" IS '抽查日志';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."CALL_TIME" IS '抽查时间';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."CALL_TYPE" IS '叫应状态: 0:接通,1:拒接,2:忙线';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."KNOW" IS '知晓本人为山洪责任人, 0:否,1:是';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."REMARK" IS '叫应备注';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."SH_AB_ID" IS '山洪通讯录编号';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."STATUS" IS '是否接听0:否,1是';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALLS"."TYPE" IS '通话类型: 0:拨打,1:回拨';


CREATE TABLE "FXKH_TXL"."SH_CALL_WORD"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"SH_AB_TYPE1" VARCHAR(50),
"SH_PERIOD_ID" INTEGER,
"WORD" VARCHAR2(2000),
"CREATE_TIME" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."SH_CALL_WORD" IS '备注';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALL_WORD"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALL_WORD"."ID" IS '主键id';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALL_WORD"."SH_AB_TYPE1" IS '责任人类型1 行政责任人,包保责任人';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALL_WORD"."SH_PERIOD_ID" IS '防汛周期ID';
COMMENT ON COLUMN "FXKH_TXL"."SH_CALL_WORD"."WORD" IS '备注内容';


CREATE TABLE "FXKH_TXL"."SH_PERIOD"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"NAME" VARCHAR(50),
"CREATE_TIME" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."SH_PERIOD" IS '防汛周期';
COMMENT ON COLUMN "FXKH_TXL"."SH_PERIOD"."CREATE_TIME" IS '新增时间';
COMMENT ON COLUMN "FXKH_TXL"."SH_PERIOD"."ID" IS '主键id';
COMMENT ON COLUMN "FXKH_TXL"."SH_PERIOD"."NAME" IS '防汛周期';


CREATE TABLE "FXKH_TXL"."UNIT_DICT"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"NAME" VARCHAR(80) NOT NULL,
"SORT" INTEGER DEFAULT 0 NOT NULL,
"O_ID" INTEGER NOT NULL,
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."UNIT_DICT" IS '单位字典表';
COMMENT ON COLUMN "FXKH_TXL"."UNIT_DICT"."NAME" IS '名称';
COMMENT ON COLUMN "FXKH_TXL"."UNIT_DICT"."O_ID" IS '组织类型Id';
COMMENT ON COLUMN "FXKH_TXL"."UNIT_DICT"."SORT" IS '序号';


CREATE TABLE "FXKH_TXL"."USERS"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"USERNAME" VARCHAR(50) NOT NULL,
"PASSWORD" VARCHAR(50) NOT NULL,
"SALT" VARCHAR(50) NOT NULL,
"ROLE" VARCHAR(2) DEFAULT 0,
"AB_ID" INTEGER,
"LAST_DATE" DATETIME(0),
NOT CLUSTER PRIMARY KEY("ID") USING INDEX TABLESPACE "SHZH" ) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."USERS" IS '用户表';
COMMENT ON COLUMN "FXKH_TXL"."USERS"."AB_ID" IS '通讯录id';
COMMENT ON COLUMN "FXKH_TXL"."USERS"."LAST_DATE" IS '最后登录时间';
COMMENT ON COLUMN "FXKH_TXL"."USERS"."PASSWORD" IS '密码';
COMMENT ON COLUMN "FXKH_TXL"."USERS"."ROLE" IS '0:普通管理员,1:政区管理员,99:系统管理员';
COMMENT ON COLUMN "FXKH_TXL"."USERS"."SALT" IS '盐值';
COMMENT ON COLUMN "FXKH_TXL"."USERS"."USERNAME" IS '用户名';


CREATE TABLE "FXKH_TXL"."WARNMSG_FEEDBACK"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"HANDLE_TIME" DATETIME(6),
"CALL_TIME" DATETIME(6),
"CALLED_PERSON" VARCHAR(50),
"CALLED_POSITION" VARCHAR(50),
"CALLED_PHONE" VARCHAR(50),
"CALL_PERSON" VARCHAR(50),
"WARNID" INTEGER,
"PUBLISH_TIME" DATETIME(6),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

COMMENT ON TABLE "FXKH_TXL"."WARNMSG_FEEDBACK" IS '预警叫应信息表';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."CALLED_PERSON" IS '被呼叫人姓名';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."CALLED_PHONE" IS '被呼叫人电话';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."CALLED_POSITION" IS '被呼叫人职务';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."CALL_PERSON" IS '呼叫人';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."CALL_TIME" IS '呼叫时间';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."HANDLE_TIME" IS '处理时间';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."ID" IS '自增ID';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."PUBLISH_TIME" IS '预警发布时间';
COMMENT ON COLUMN "FXKH_TXL"."WARNMSG_FEEDBACK"."WARNID" IS '预警信息ID';


CREATE TABLE "FXKH_TXL"."WARN_CALL_MAP"
(
"ID" INTEGER IDENTITY(1, 1) NOT NULL,
"WARN_ID" INTEGER NOT NULL,
"SHOULD_GENERATE" INTEGER NOT NULL,
"GENERATED" INTEGER DEFAULT 0,
"UPLOADED" INTEGER DEFAULT 0,
"CNNM" VARCHAR(50) NOT NULL,
"UPLOAD_RESP_MSG" VARCHAR(100),
"REQUEST_ID" VARCHAR(100),
"CUST_ID" VARCHAR(100),
"WARN_NAME" VARCHAR(100),
"WARN_LEVEL" VARCHAR(100),
"WARN_TM" TIMESTAMP(6),
"CALLED" INTEGER DEFAULT 0,
"CALL_IS_PUT" INTEGER DEFAULT 0,
"ERR_STEP" INTEGER DEFAULT 0,
"CALL_CONTENT" VARCHAR(500),
"_REMARK" VARCHAR(100),
"CUST_NAME" VARCHAR(100),
"_CREATE_TM" TIMESTAMP(6),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE  INDEX "WARN_CALL_MAP_WARN_ID_IDX" ON "FXKH_TXL"."WARN_CALL_MAP"("WARN_ID" DESC,"WARN_TM" DESC) STORAGE(ON "SHZH", CLUSTERBTR) ;

CREATE TABLE FXKH_TXL.SMS_SPECIALIST (
	ID BIGINT NOT NULL,
	NAME VARCHAR(50) NOT NULL,
	"POSITION" VARCHAR(100),
	BIRTHDAY DATE,
	ADDRESS VARCHAR(20),
	PHONE VARCHAR(20),
	STATUS INT DEFAULT 1,
	CREATE_TM DATETIME DEFAULT SYSDATE,
	FLAG_BIRTHDAY_SENT_TODAY INT DEFAULT 0,
	FLAG_HOLIDAY_SENT_TODAY INT DEFAULT 0,
	CONSTRAINT CONS134219973 PRIMARY KEY (ID)
);
CREATE UNIQUE INDEX INDEX33558075 ON FXKH_TXL.SMS_SPECIALIST (ID);
CREATE UNIQUE INDEX INDEX33558076 ON FXKH_TXL.SMS_SPECIALIST (PHONE);
CREATE INDEX SMS_SPECIALIST_NAME_IDX ON FXKH_TXL.SMS_SPECIALIST (NAME,PHONE,ADDRESS);

COMMENT ON TABLE "FXKH_TXL"."SMS_SPECIALIST" IS '防汛专家表';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."NAME" IS '姓名';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."POSITION" IS '职务';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."BIRTHDAY" IS '生日';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."ADDRESS" IS '区域';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."PHONE" IS '手机号码';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."STATUS" IS '生效状态 1:有效 0:无效';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."CREATE_TM" IS '创建日期';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."FLAG_BIRTHDAY_SENT_TODAY" IS '今日是否发送过生日短信 0:没有发过 1:发过';
COMMENT ON COLUMN "FXKH_TXL"."SMS_SPECIALIST"."FLAG_HOLIDAY_SENT_TODAY" IS '今日是否发送过节日短信 0:没有发过 1:发过';

CREATE TABLE FXKH_TXL.SMS_BIRTHDAY (
	ID BIGINT NOT NULL,
	EXECUTION_TM_STR VARCHAR(8),
	STATUS INT DEFAULT 1,
	TEMPLATE VARCHAR(500),
	CONSTRAINT CONS134219970 PRIMARY KEY (ID)
);
CREATE UNIQUE INDEX INDEX33558070 ON FXKH_TXL.SMS_BIRTHDAY (ID);

COMMENT ON TABLE "FXKH_TXL"."SMS_BIRTHDAY" IS '生日短信模板表';
COMMENT ON COLUMN "FXKH_TXL"."SMS_BIRTHDAY"."EXECUTION_TM_STR" IS '任务执行时间';
COMMENT ON COLUMN "FXKH_TXL"."SMS_BIRTHDAY"."STATUS" IS '状态 1:有效 0:无效';
COMMENT ON COLUMN "FXKH_TXL"."SMS_BIRTHDAY"."TEMPLATE" IS '短信模板';

CREATE TABLE FXKH_TXL.SMS_HOLIDAY (
	ID BIGINT NOT NULL,
	SUBJECT_NAME VARCHAR(200) NOT NULL,
	START_DATE DATE,
	END_DATE DATE,
	EXECUTION_TM_STR VARCHAR(8),
	STATUS INT DEFAULT 1,
	TEMPLATE VARCHAR(500),
	CREATE_TM DATETIME DEFAULT SYSDATE,
	CONSTRAINT CONS134219972 PRIMARY KEY (ID)
);
CREATE UNIQUE INDEX INDEX33558073 ON FXKH_TXL.SMS_HOLIDAY (ID);

COMMENT ON TABLE "FXKH_TXL"."SMS_HOLIDAY" IS '节日短信模板表';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."SUBJECT_NAME" IS '节日名称';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."START_DATE" IS '任务开始时间';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."END_DATE" IS '任务结束时间';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."EXECUTION_TM_STR" IS '任务执行时间';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."STATUS" IS '状态 1:有效 0:无效';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."TEMPLATE" IS '短信模板';
COMMENT ON COLUMN "FXKH_TXL"."SMS_HOLIDAY"."CREATE_TM" IS '创建日期';

CREATE TABLE FXKH_TXL.SMS_LOG (
	ID BIGINT NOT NULL,
	SEND_TM DATETIME NOT NULL,
	NAME VARCHAR(50) NOT NULL,
	PHONE VARCHAR(20),
	REMARK VARCHAR(500),
	CONTENT VARCHAR(500),
	CONSTRAINT CONS134219969 PRIMARY KEY (ID)
);
CREATE UNIQUE INDEX INDEX33558068 ON FXKH_TXL.SMS_LOG (ID);

COMMENT ON TABLE "FXKH_TXL"."SMS_LOG" IS '短信发送日志';
COMMENT ON COLUMN "FXKH_TXL"."SMS_LOG"."SEND_TM" IS '发动时间';
COMMENT ON COLUMN "FXKH_TXL"."SMS_LOG"."NAME" IS '姓名';
COMMENT ON COLUMN "FXKH_TXL"."SMS_LOG"."PHONE" IS '手机号码';
COMMENT ON COLUMN "FXKH_TXL"."SMS_LOG"."REMARK" IS '备注';
COMMENT ON COLUMN "FXKH_TXL"."SMS_LOG"."CONTENT" IS '短信内容';