CREATE TABLE TP_BIZMSG_BIZTYPE_BIZCODE(
    S_TXBIZ VARCHAR(20) NOT NULL,
    S_TXBIZNAME VARCHAR(64),
    S_TXTYPECODE VARCHAR(10) NOT NULL,
    S_TXTYPENAME VARCHAR(64),
    S_TXTYPECLASSCODE VARCHAR(8) NOT NULL,
    S_TXBIZCLASSNAME VARCHAR(64),
    S_REMARK VARCHAR(512),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TXBIZ,S_TXTYPECODE,S_TXTYPECLASSCODE)
);

COMMENT ON TABLE TP_BIZMSG_BIZTYPE_BIZCODE IS '支付业务报文_支付业务类型_支付业务编码';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_TXBIZ IS '支付业务报文';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_TXBIZNAME IS '支付业务报文名称';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_TXTYPENAME IS '支付业务类型名称';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_TXTYPECLASSCODE IS '支付业务种类编码';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_TXBIZCLASSNAME IS '支付业务种类名称';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_REMARK IS '备注';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BIZMSG_BIZTYPE_BIZCODE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110644650 ON TP_BIZMSG_BIZTYPE_BIZCODE(S_TXBIZ,S_TXTYPECODE,S_TXTYPECLASSCODE);

CREATE TABLE TP_BNKNAMBNKNUM(
    S_PTCPTBNKCODE VARCHAR(18) NOT NULL,
    S_PTCPTTYPE VARCHAR(3),
    S_BKCTGYCODE VARCHAR(10),
    S_DRCTBNKCODE VARCHAR(18),
    S_LGLPERSON VARCHAR(60),
    S_HGHPTCPT VARCHAR(70),
    S_BRBNKCODE VARCHAR(18),
    S_CCPCCODE VARCHAR(18),
    S_CITYCODE VARCHAR(18),
    S_PTCPTNM VARCHAR(256),
    S_PTCPTSHRTNM VARCHAR(256),
    S_JOINSYSSGN VARCHAR(10),
    S_ADDRESS VARCHAR(256),
    S_POSTCODE VARCHAR(36),
    S_TELCABLE VARCHAR(256),
    S_EMAIL VARCHAR(256),
    S_REMARK VARCHAR(512),
    S_UPDTYPE VARCHAR(4),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PTCPTBNKCODE)
);

COMMENT ON TABLE TP_BNKNAMBNKNUM IS '支付系统行名行号表';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_PTCPTBNKCODE IS '参与机构行号';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_PTCPTTYPE IS '参与机构类别';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_BKCTGYCODE IS '行别代码';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_DRCTBNKCODE IS '所属直参行号';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_LGLPERSON IS '所属法人';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_HGHPTCPT IS '本行上级参与机构集合';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_BRBNKCODE IS '承接行行号';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_CCPCCODE IS '所属CCPC';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_CITYCODE IS '所在城市代码';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_PTCPTNM IS '参与机构全称';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_PTCPTSHRTNM IS '参与机构简称';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_JOINSYSSGN IS '加入业务系统标识';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_ADDRESS IS '地址';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_POSTCODE IS '邮政编码';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_TELCABLE IS '电话/电挂';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_EMAIL IS '电子邮件地址';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_REMARK IS '备注';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_UPDTYPE IS '变更类型';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BNKNAMBNKNUM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110722360 ON TP_BNKNAMBNKNUM(S_PTCPTBNKCODE);
CREATE INDEX IX_BNKNAMBNKNUM_PTCPTNM ON TP_BNKNAMBNKNUM(S_PTCPTNM);

CREATE TABLE TP_BRIEF(
    S_BRIEFCODE VARCHAR(36) NOT NULL,
    S_BRIEFNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BRIEFCODE)
);

COMMENT ON TABLE TP_BRIEF IS '摘要表';
COMMENT ON COLUMN TP_BRIEF.S_BRIEFCODE IS '摘要代码';
COMMENT ON COLUMN TP_BRIEF.S_BRIEFNAME IS '摘要名称';
COMMENT ON COLUMN TP_BRIEF.S_BRIEF IS '摘要';
COMMENT ON COLUMN TP_BRIEF.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BRIEF.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BRIEF.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BRIEF.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BRIEF.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BRIEF.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BRIEF.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BRIEF.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BRIEF.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BRIEF.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BRIEF.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BRIEF.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BRIEF.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110722590 ON TP_BRIEF(S_BRIEFCODE);

CREATE TABLE TP_CASHUNIT(
    S_CASHUNITACCTID VARCHAR(36) NOT NULL,
    S_CASHPAYUNITCODE VARCHAR(36) NOT NULL,
    S_CASHPAYUNITNAME VARCHAR(60),
    S_REVACCT VARCHAR(32) NOT NULL,
    S_REVACCTNAME VARCHAR(200),
    S_PAYEEOPENBANKCODE VARCHAR(18) NOT NULL,
    S_PAYEEOPENBANKNAME VARCHAR(60),
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    S_FUNDSOURCE CHAR(1) NOT NULL,
    S_BASEACCTFLAG CHAR(1) NOT NULL,
    S_ELEVOUID VARCHAR(100),
    D_VOUDATE DATE,
    S_VOUCHNO VARCHAR(42),
    S_OPENFLAG CHAR(1),
    S_FUNDSOURCENAME VARCHAR(256),
    S_OPERMODE VARCHAR(10),
    S_OPERDESC VARCHAR(10),
    D_ADJUSTDATE DATE,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CASHUNITACCTID)
);

COMMENT ON TABLE TP_CASHUNIT IS '现金支出单位表';
COMMENT ON COLUMN TP_CASHUNIT.S_CASHUNITACCTID IS '现金支出单位账户序号';
COMMENT ON COLUMN TP_CASHUNIT.S_CASHPAYUNITCODE IS '现金支出单位代码';
COMMENT ON COLUMN TP_CASHUNIT.S_CASHPAYUNITNAME IS '现金支出单位名称';
COMMENT ON COLUMN TP_CASHUNIT.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TP_CASHUNIT.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TP_CASHUNIT.S_PAYEEOPENBANKCODE IS '收款方开户行代码';
COMMENT ON COLUMN TP_CASHUNIT.S_PAYEEOPENBANKNAME IS '收款方开户行名称';
COMMENT ON COLUMN TP_CASHUNIT.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_CASHUNIT.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TP_CASHUNIT.S_FUNDSOURCE IS '资金来源';
COMMENT ON COLUMN TP_CASHUNIT.S_BASEACCTFLAG IS '基本户标志';
COMMENT ON COLUMN TP_CASHUNIT.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TP_CASHUNIT.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TP_CASHUNIT.S_VOUCHNO IS '凭证号码';
COMMENT ON COLUMN TP_CASHUNIT.S_OPENFLAG IS '启用标识';
COMMENT ON COLUMN TP_CASHUNIT.S_FUNDSOURCENAME IS '资金来源名称';
COMMENT ON COLUMN TP_CASHUNIT.S_OPERMODE IS '操作方式';
COMMENT ON COLUMN TP_CASHUNIT.S_OPERDESC IS '操作中文描述';
COMMENT ON COLUMN TP_CASHUNIT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_CASHUNIT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110722820 ON TP_CASHUNIT(S_CASHUNITACCTID);

CREATE TABLE TP_CONSIGNORG(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_CONSIGNORGCODE VARCHAR(36) NOT NULL,
    S_CONSIGNORGNAME VARCHAR(60) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    S_BANKSTATCODE VARCHAR(24),
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_CONSIGNORG IS '承销机构表';
COMMENT ON COLUMN TP_CONSIGNORG.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_CONSIGNORG.S_CONSIGNORGCODE IS '承销机构代码';
COMMENT ON COLUMN TP_CONSIGNORG.S_CONSIGNORGNAME IS '承销机构名称';
COMMENT ON COLUMN TP_CONSIGNORG.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_CONSIGNORG.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_CONSIGNORG.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_CONSIGNORG.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_CONSIGNORG.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_CONSIGNORG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_CONSIGNORG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_CONSIGNORG.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_CONSIGNORG.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_CONSIGNORG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_CONSIGNORG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_CONSIGNORG.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_CONSIGNORG.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TP_CONSIGNORG.S_BANKSTATCODE IS '金融机构分类代码';


CREATE UNIQUE INDEX SQL221020110726720 ON TP_CONSIGNORG(S_PARAMSRLNO);

CREATE TABLE TP_DATAENUM(
    S_ENUMCLASS VARCHAR(10) NOT NULL,
    S_ENUMCODE VARCHAR(36) NOT NULL,
    S_ENUMNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ENUMCLASS,S_ENUMCODE)
);

COMMENT ON TABLE TP_DATAENUM IS '数据枚举值';
COMMENT ON COLUMN TP_DATAENUM.S_ENUMCLASS IS '枚举值类别';
COMMENT ON COLUMN TP_DATAENUM.S_ENUMCODE IS '枚举值代码';
COMMENT ON COLUMN TP_DATAENUM.S_ENUMNAME IS '枚举值名称';
COMMENT ON COLUMN TP_DATAENUM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110722930 ON TP_DATAENUM(S_ENUMCLASS,S_ENUMCODE);

CREATE TABLE TP_DATAENUMTYPE(
    S_ENUMCLASS VARCHAR(10) NOT NULL,
    S_ENUMCLASSNAME VARCHAR(60),
    S_REMARK VARCHAR(512),
    S_ENUMCOLUMN VARCHAR(60),
    S_ENUMUUID VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ENUMCLASS)
);

COMMENT ON TABLE TP_DATAENUMTYPE IS '数据枚举值类型';
COMMENT ON COLUMN TP_DATAENUMTYPE.S_ENUMCLASS IS '枚举值类别';
COMMENT ON COLUMN TP_DATAENUMTYPE.S_ENUMCLASSNAME IS '枚举值类别名称';
COMMENT ON COLUMN TP_DATAENUMTYPE.S_REMARK IS '备注';
COMMENT ON COLUMN TP_DATAENUMTYPE.S_ENUMCOLUMN IS '枚举值所属列';
COMMENT ON COLUMN TP_DATAENUMTYPE.S_ENUMUUID IS '枚举值UUID';
COMMENT ON COLUMN TP_DATAENUMTYPE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110723060 ON TP_DATAENUMTYPE(S_ENUMCLASS);

CREATE TABLE TP_ISSUESBT(
    S_ISSUESBTCODE VARCHAR(36) NOT NULL,
    S_ISSUESBTNAME VARCHAR(60),
    S_ISSUESBTKIND VARCHAR(7) NOT NULL,
    S_NOINPUTFLAG CHAR(1) NOT NULL,
    S_BDGESBTPROPCODE VARCHAR(36) NOT NULL,
    S_STATSBTCODE VARCHAR(36) NOT NULL,
    S_EXUPSBTCODE VARCHAR(36),
    S_SBTORDERCODE VARCHAR(36) NOT NULL,
    I_ORDERNO INTEGER NOT NULL,
    S_SBTCLASS CHAR(1),
    S_OFYEAR CHAR(4) NOT NULL,
    S_PLANNUM VARCHAR(36),
    S_ISSUEREPSBTCODE VARCHAR(36),
    S_ISSUEERPSBTNAME VARCHAR(60),
    S_LASTDESC VARCHAR(512),
    S_PARAMSTATE CHAR(1) NOT NULL,
    D_INVALIDATE DATE,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_OPERTYPE CHAR(1) NOT NULL,
    S_INSTCODE VARCHAR(14),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    TS_SYSUPDATE TIMESTAMP,
    D_ADJUSTDATE DATE,
    S_ISSUETERM VARCHAR(128),
    S_ISSUERATE DECIMAL(7,2),
    S_ISSUETYPE VARCHAR(2),
    PRIMARY KEY (S_ISSUESBTCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_ISSUESBT IS '发行科目表';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUESBTCODE IS '发行科目代码';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUESBTNAME IS '发行科目名称';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUESBTKIND IS '发行科目种类';
COMMENT ON COLUMN TP_ISSUESBT.S_NOINPUTFLAG IS '禁录标志';
COMMENT ON COLUMN TP_ISSUESBT.S_BDGESBTPROPCODE IS '预算科目属性代码';
COMMENT ON COLUMN TP_ISSUESBT.S_STATSBTCODE IS '统计科目';
COMMENT ON COLUMN TP_ISSUESBT.S_EXUPSBTCODE IS '要扣除上级科目代码';
COMMENT ON COLUMN TP_ISSUESBT.S_SBTORDERCODE IS '科目顺序代码';
COMMENT ON COLUMN TP_ISSUESBT.I_ORDERNO IS '顺序号';
COMMENT ON COLUMN TP_ISSUESBT.S_SBTCLASS IS '科目分类';
COMMENT ON COLUMN TP_ISSUESBT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_ISSUESBT.S_PLANNUM IS '计划数';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUEREPSBTCODE IS '发行填报科目代码';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUEERPSBTNAME IS '发行填报科目名称';
COMMENT ON COLUMN TP_ISSUESBT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_ISSUESBT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_ISSUESBT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_ISSUESBT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_ISSUESBT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_ISSUESBT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_ISSUESBT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_ISSUESBT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_ISSUESBT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_ISSUESBT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_ISSUESBT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_ISSUESBT.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TP_ISSUESBT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUETERM IS '发行期限';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUERATE IS '发行利率';
COMMENT ON COLUMN TP_ISSUESBT.S_ISSUETYPE IS '发行种类';


CREATE UNIQUE INDEX SQL221020110723390 ON TP_ISSUESBT(S_ISSUESBTCODE,S_OFYEAR);

CREATE TABLE TP_LEVYUNIT(
    S_LEVUNITCODE VARCHAR(36) NOT NULL,
    S_LEVUNITNAME VARCHAR(60),
    S_CONTADDRES VARCHAR(100),
    S_TEL VARCHAR(20),
    S_SUMFLAG CHAR(1) NOT NULL,
    S_POSTCODE VARCHAR(36),
    S_LINKMAN VARCHAR(60),
    S_LINKPHONE VARCHAR(36),
    S_UNITCHRG VARCHAR(60),
    S_CRDNTNAME VARCHAR(60),
    S_CRDNTNO VARCHAR(36),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_LEVUNITCODE)
);

COMMENT ON TABLE TP_LEVYUNIT IS '征收单位表';
COMMENT ON COLUMN TP_LEVYUNIT.S_LEVUNITCODE IS '征收单位代码';
COMMENT ON COLUMN TP_LEVYUNIT.S_LEVUNITNAME IS '征收单位名称';
COMMENT ON COLUMN TP_LEVYUNIT.S_CONTADDRES IS '通讯地址';
COMMENT ON COLUMN TP_LEVYUNIT.S_TEL IS '电话号码';
COMMENT ON COLUMN TP_LEVYUNIT.S_SUMFLAG IS '汇总标志';
COMMENT ON COLUMN TP_LEVYUNIT.S_POSTCODE IS '邮政编码';
COMMENT ON COLUMN TP_LEVYUNIT.S_LINKMAN IS '联系人';
COMMENT ON COLUMN TP_LEVYUNIT.S_LINKPHONE IS '联系电话';
COMMENT ON COLUMN TP_LEVYUNIT.S_UNITCHRG IS '单位负责人';
COMMENT ON COLUMN TP_LEVYUNIT.S_CRDNTNAME IS '证件名称';
COMMENT ON COLUMN TP_LEVYUNIT.S_CRDNTNO IS '证件号码';
COMMENT ON COLUMN TP_LEVYUNIT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_LEVYUNIT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_LEVYUNIT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_LEVYUNIT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_LEVYUNIT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_LEVYUNIT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_LEVYUNIT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_LEVYUNIT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_LEVYUNIT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_LEVYUNIT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_LEVYUNIT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_LEVYUNIT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_LEVYUNIT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110723620 ON TP_LEVYUNIT(S_LEVUNITCODE);

CREATE TABLE TP_MOVEBASE(
    S_TABLENAME VARCHAR(128) NOT NULL,
    S_TBLCHINAME VARCHAR(100),
    S_RETAINLIMIT VARCHAR(20) NOT NULL,
    S_ISNEEDCLR CHAR(1) NOT NULL,
    S_ISNEEDMOVE CHAR(1) NOT NULL,
    S_EXPCONDITON VARCHAR(100) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TABLENAME)
);

COMMENT ON TABLE TP_MOVEBASE IS '历史表迁移参数表';
COMMENT ON COLUMN TP_MOVEBASE.S_TABLENAME IS '表名';
COMMENT ON COLUMN TP_MOVEBASE.S_TBLCHINAME IS '表中文名称';
COMMENT ON COLUMN TP_MOVEBASE.S_RETAINLIMIT IS '保留期限';
COMMENT ON COLUMN TP_MOVEBASE.S_ISNEEDCLR IS '是否需要清理';
COMMENT ON COLUMN TP_MOVEBASE.S_ISNEEDMOVE IS '是否需要迁移';
COMMENT ON COLUMN TP_MOVEBASE.S_EXPCONDITON IS '导出条件';
COMMENT ON COLUMN TP_MOVEBASE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110726840 ON TP_MOVEBASE(S_TABLENAME);

CREATE TABLE TP_MSGINOUTLOG(
    I_LOGNO BIGINT(19) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_RUNRESULT CHAR(2) NOT NULL,
    S_ISOPERAWORK CHAR(1) NOT NULL,
    I_IMPEXPNUM INTEGER,
    S_FILENAME VARCHAR(128) NOT NULL,
    S_FILEPATH VARCHAR(512),
    S_FILEBAKPATH VARCHAR(512),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60),
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_REMARK VARCHAR(512),
    S_BIZKNDCODE VARCHAR(7),
    S_BRHTREASCODE VARCHAR(36),
    S_MSGKINDCODE VARCHAR(32),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_LOGNO)
);

COMMENT ON TABLE TP_MSGINOUTLOG IS '报文导入导出日志表';
COMMENT ON COLUMN TP_MSGINOUTLOG.I_LOGNO IS '日志流水号';
COMMENT ON COLUMN TP_MSGINOUTLOG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_RUNRESULT IS '操作类型';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_ISOPERAWORK IS '是否操作成功';
COMMENT ON COLUMN TP_MSGINOUTLOG.I_IMPEXPNUM IS '导入导出次数';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_FILENAME IS '文件名';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_FILEPATH IS '文件路径[含文件名]';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_FILEBAKPATH IS '文件备份路径[含文件名]';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_REMARK IS '备注';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TP_MSGINOUTLOG.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TP_MSGINOUTLOG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110723810 ON TP_MSGINOUTLOG(I_LOGNO);

CREATE TABLE TP_MSGINOUTPARAM(
    S_TABLECODE VARCHAR(64) NOT NULL,
    S_TABLENAME VARCHAR(128),
    S_STRINGCODE VARCHAR(4096),
    S_EXPORTTABLECODE VARCHAR(64),
    S_MSGTYPECODE VARCHAR(32),
    S_ISENC CHAR(1),
    S_IMPEXPFLAG CHAR(1),
    S_MSGTABLETYPE VARCHAR(10),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TABLECODE)
);

COMMENT ON TABLE TP_MSGINOUTPARAM IS '报文导入导出参数表';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_TABLECODE IS '表英文名';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_TABLENAME IS '表名';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_STRINGCODE IS '字段串';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_EXPORTTABLECODE IS '导入出表英文名';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_ISENC IS '加密标志';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_IMPEXPFLAG IS '导入导出标志';
COMMENT ON COLUMN TP_MSGINOUTPARAM.S_MSGTABLETYPE IS '报文表类型';
COMMENT ON COLUMN TP_MSGINOUTPARAM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110723950 ON TP_MSGINOUTPARAM(S_TABLECODE);

CREATE TABLE TP_MSGKIND(
    S_MSGKINDCODE VARCHAR(32) NOT NULL,
    S_MSGTPNAME VARCHAR(60),
    S_SNDREVFLAG CHAR(1) NOT NULL,
    S_ACCTNO VARCHAR(36),
    S_DEBTCREDTFLAG CHAR(1),
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_MSGKINDCODE,S_SNDREVFLAG)
);

COMMENT ON TABLE TP_MSGKIND IS '报文种类表';
COMMENT ON COLUMN TP_MSGKIND.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TP_MSGKIND.S_MSGTPNAME IS '报文种类名称';
COMMENT ON COLUMN TP_MSGKIND.S_SNDREVFLAG IS '接收发送标志';
COMMENT ON COLUMN TP_MSGKIND.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_MSGKIND.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TP_MSGKIND.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TP_MSGKIND.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110724080 ON TP_MSGKIND(S_SNDREVFLAG,S_MSGKINDCODE);

CREATE TABLE TP_PARTREAS(
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    S_BRHTREASNAME VARCHAR(60),
    S_BRHTREASFULNAME VARCHAR(512),
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ADDRESS VARCHAR(256),
    S_TELCABLE VARCHAR(256),
    S_MONTHREPORT VARCHAR(36),
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60),
    S_MERGEFLAG CHAR(1) NOT NULL,
    S_PAYFLAG CHAR(1) NOT NULL,
    S_PAYMENTFLAG CHAR(1) NOT NULL,
    S_OPENBANKCODE VARCHAR(36) NOT NULL,
    S_OPENBANKNAME VARCHAR(60),
    S_SNDMSGCNTERCODE VARCHAR(36) NOT NULL,
    S_CNCCCODE VARCHAR(36) NOT NULL,
    S_SNDBANKCODE VARCHAR(36) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    I_ORDER INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BRHTREASCODE)
);

COMMENT ON TABLE TP_PARTREAS IS '分库表';
COMMENT ON COLUMN TP_PARTREAS.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TP_PARTREAS.S_BRHTREASNAME IS '分库名称';
COMMENT ON COLUMN TP_PARTREAS.S_BRHTREASFULNAME IS '分库名称全称';
COMMENT ON COLUMN TP_PARTREAS.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_PARTREAS.S_ADDRESS IS '地址';
COMMENT ON COLUMN TP_PARTREAS.S_TELCABLE IS '电话/电挂';
COMMENT ON COLUMN TP_PARTREAS.S_MONTHREPORT IS '月报';
COMMENT ON COLUMN TP_PARTREAS.S_PAYEEUNITCODE IS '收款单位代码';
COMMENT ON COLUMN TP_PARTREAS.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TP_PARTREAS.S_MERGEFLAG IS '归并标志';
COMMENT ON COLUMN TP_PARTREAS.S_PAYFLAG IS '付款标志';
COMMENT ON COLUMN TP_PARTREAS.S_PAYMENTFLAG IS '支付标志';
COMMENT ON COLUMN TP_PARTREAS.S_OPENBANKCODE IS '开户行代码';
COMMENT ON COLUMN TP_PARTREAS.S_OPENBANKNAME IS '开户行名称';
COMMENT ON COLUMN TP_PARTREAS.S_SNDMSGCNTERCODE IS '发报中心代码';
COMMENT ON COLUMN TP_PARTREAS.S_CNCCCODE IS '清算中心代码';
COMMENT ON COLUMN TP_PARTREAS.S_SNDBANKCODE IS '发报行号';
COMMENT ON COLUMN TP_PARTREAS.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PARTREAS.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PARTREAS.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PARTREAS.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PARTREAS.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PARTREAS.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PARTREAS.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PARTREAS.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PARTREAS.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PARTREAS.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PARTREAS.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PARTREAS.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PARTREAS.I_ORDER IS '顺序号';
COMMENT ON COLUMN TP_PARTREAS.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110645900 ON TP_PARTREAS(S_BRHTREASCODE);

CREATE TABLE TP_PAYERINFOMATION(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_PAYERACCTNO VARCHAR(32),
    S_PAYPSNFULNAME VARCHAR(60),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_PAYERINFOMATION IS '付款人信息表';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PAYERINFOMATION.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PAYERINFOMATION.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PAYERINFOMATION.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PAYERINFOMATION.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PAYERINFOMATION.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110724280 ON TP_PAYERINFOMATION(S_PARAMSRLNO);

CREATE TABLE TP_PROXYBANK(
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60),
    S_CONTADDRES VARCHAR(100),
    S_TEL VARCHAR(20),
    S_SUMFLAG CHAR(1) NOT NULL,
    S_PROXYBANKFLAG CHAR(1) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_POSTCODE VARCHAR(36),
    S_LINKMAN VARCHAR(60),
    S_LINKPHONE VARCHAR(36),
    S_OPENNTAXFLAG CHAR(1),
    S_OPENELECFLAG CHAR(1),
    S_UNITCHRG VARCHAR(60),
    S_CRDNTNAME VARCHAR(60),
    S_CRDNTNO VARCHAR(36),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PROXYBANKCODE)
);

COMMENT ON TABLE TP_PROXYBANK IS '代理银行表';
COMMENT ON COLUMN TP_PROXYBANK.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TP_PROXYBANK.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TP_PROXYBANK.S_CONTADDRES IS '通讯地址';
COMMENT ON COLUMN TP_PROXYBANK.S_TEL IS '电话号码';
COMMENT ON COLUMN TP_PROXYBANK.S_SUMFLAG IS '汇总标志';
COMMENT ON COLUMN TP_PROXYBANK.S_PROXYBANKFLAG IS '代理银行标志';
COMMENT ON COLUMN TP_PROXYBANK.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_PROXYBANK.S_POSTCODE IS '邮政编码';
COMMENT ON COLUMN TP_PROXYBANK.S_LINKMAN IS '联系人';
COMMENT ON COLUMN TP_PROXYBANK.S_LINKPHONE IS '联系电话';
COMMENT ON COLUMN TP_PROXYBANK.S_OPENNTAXFLAG IS '是否开通非税业务';
COMMENT ON COLUMN TP_PROXYBANK.S_OPENELECFLAG IS '是否开通集中支付业务';
COMMENT ON COLUMN TP_PROXYBANK.S_UNITCHRG IS '单位负责人';
COMMENT ON COLUMN TP_PROXYBANK.S_CRDNTNAME IS '证件名称';
COMMENT ON COLUMN TP_PROXYBANK.S_CRDNTNO IS '证件号码';
COMMENT ON COLUMN TP_PROXYBANK.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PROXYBANK.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PROXYBANK.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PROXYBANK.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PROXYBANK.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PROXYBANK.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PROXYBANK.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PROXYBANK.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PROXYBANK.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PROXYBANK.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PROXYBANK.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PROXYBANK.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PROXYBANK.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110724540 ON TP_PROXYBANK(S_PROXYBANKCODE);

CREATE TABLE TP_PTSK_OPER_CODE(
    S_BIZTYPECODE VARCHAR(7) NOT NULL,
    S_BIZTYPENAME VARCHAR(60),
    S_REVFLAG CHAR(1),
    S_SENDFLAG CHAR(1),
    S_REPDAYFLAG CHAR(1),
    S_REPTENDFLAG CHAR(1),
    S_REPMONTHFALG CHAR(1),
    S_REPYEARFLAG CHAR(1),
    S_REPTYPE CHAR(1),
    I_SHOWSCAL INTEGER,
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BIZTYPECODE)
);

COMMENT ON TABLE TP_PTSK_OPER_CODE IS '验签业务种类参数';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_BIZTYPENAME IS '业务类型名称';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_REVFLAG IS '接收标志';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_SENDFLAG IS '发送标志';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_REPDAYFLAG IS '日报标志';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_REPTENDFLAG IS '旬报标志';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_REPMONTHFALG IS '月报标志';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_REPYEARFLAG IS '年报标志';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_REPTYPE IS '报表类型';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.I_SHOWSCAL IS '显示比例';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_OPER_CODE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110727090 ON TP_PTSK_OPER_CODE(S_BIZTYPECODE);

CREATE TABLE TP_PTSK_OPER_ESEALID(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_PLACEID VARCHAR(10) NOT NULL,
    S_PLACEDESC VARCHAR(50),
    S_BIZTYPECODE VARCHAR(7),
    S_BIZTYPENAME VARCHAR(60),
    S_ESEALID VARCHAR(128),
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_PTSK_OPER_ESEALID IS '验章SN(财政)';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_PLACEID IS '盖章位置编号';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_PLACEDESC IS '盖章位置说明';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_BIZTYPENAME IS '业务类型名称';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_ESEALID IS '签章ID';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_OPER_ESEALID.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110727290 ON TP_PTSK_OPER_ESEALID(S_PARAMSRLNO);

CREATE TABLE TP_PTSK_OPER_FORM(
    S_BIZTYPECODE VARCHAR(7) NOT NULL,
    S_SHEETID VARCHAR(10) NOT NULL,
    S_SHEETTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BIZTYPECODE,S_SHEETID)
);

COMMENT ON TABLE TP_PTSK_OPER_FORM IS '电子凭证表单联表';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_SHEETID IS '联标识';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_SHEETTYPE IS '联类型';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_OPER_FORM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110644950 ON TP_PTSK_OPER_FORM(S_BIZTYPECODE,S_SHEETID);

CREATE TABLE TP_PTSK_OPER_MODEL(
    I_ORDERNO INTEGER NOT NULL,
    S_BIZTYPECODE VARCHAR(7) NOT NULL,
    S_ISVALID CHAR(1),
    D_STARTUSEDATE DATE,
    D_ENDUSEDATE DATE,
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    S_MODELCENT CLOB,
    PRIMARY KEY (I_ORDERNO,S_BIZTYPECODE)
);

COMMENT ON TABLE TP_PTSK_OPER_MODEL IS '验签模板参数表';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.I_ORDERNO IS '顺序号';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_ISVALID IS '是否有效';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.D_STARTUSEDATE IS '开始使用日期';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.D_ENDUSEDATE IS '终止使用日期';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TP_PTSK_OPER_MODEL.S_MODELCENT IS '模板内容';


CREATE UNIQUE INDEX SQL221020110727480 ON TP_PTSK_OPER_MODEL(I_ORDERNO,S_BIZTYPECODE);

CREATE TABLE TP_PTSK_OPER_PLACE(
    S_BIZTYPECODE VARCHAR(7) NOT NULL,
    S_STAMPTYPE VARCHAR(10) NOT NULL,
    S_SHEETID VARCHAR(10),
    S_PLACEDESC VARCHAR(50),
    S_PLACEID VARCHAR(10) NOT NULL,
    S_PLACETYPE VARCHAR(10) NOT NULL,
    S_ISVALID CHAR(1),
    I_STAMPORDER INTEGER,
    S_STAMPBFRSTATE VARCHAR(10),
    S_STAMPAFTSTATE VARCHAR(10),
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BIZTYPECODE,S_STAMPTYPE,S_PLACEID)
);

COMMENT ON TABLE TP_PTSK_OPER_PLACE IS '电子凭证盖章位置状态参数';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_STAMPTYPE IS '章类型';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_SHEETID IS '联标识';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_PLACEDESC IS '盖章位置说明';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_PLACEID IS '盖章位置编号';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_PLACETYPE IS '盖章位置类型';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_ISVALID IS '是否有效';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.I_STAMPORDER IS '盖章顺序';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_STAMPBFRSTATE IS '盖章前处理状态';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_STAMPAFTSTATE IS '盖章后处理状态';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_OPER_PLACE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110727720 ON TP_PTSK_OPER_PLACE(S_BIZTYPECODE,S_STAMPTYPE,S_PLACEID);

CREATE TABLE TP_PTSK_STAMP_PARAM(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_APPNAME VARCHAR(60) NOT NULL,
    S_APPVERSION VARCHAR(36) NOT NULL,
    S_FINACODE VARCHAR(18) NOT NULL,
    S_POPBANKCODE VARCHAR(18) NOT NULL,
    S_REVFLAG CHAR(1) NOT NULL,
    S_SENDFLAG CHAR(1) NOT NULL,
    S_STAMPSERVERURL VARCHAR(100),
    S_FINACHKSTMPFLAG CHAR(1) NOT NULL,
    S_POXYBANKCHKSTMPFLAG CHAR(1) NOT NULL,
    S_ISENC CHAR(1),
    S_CHECKSIGNFLAG CHAR(1),
    S_ESEALAUTOADDFLAG CHAR(1),
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_PTSK_STAMP_PARAM IS '验签参数表';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_APPNAME IS '应用名称';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_APPVERSION IS '应用版本';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_FINACODE IS '财政代码';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_POPBANKCODE IS '人行代码';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_REVFLAG IS '接收标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_SENDFLAG IS '发送标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_STAMPSERVERURL IS '印鉴服务器地址';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_FINACHKSTMPFLAG IS '财政印鉴检查标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_POXYBANKCHKSTMPFLAG IS '代理银行印鉴检查标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_ISENC IS '加密标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_CHECKSIGNFLAG IS '验证签名标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_ESEALAUTOADDFLAG IS '印鉴自动增加标志';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_STAMP_PARAM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110727980 ON TP_PTSK_STAMP_PARAM(S_PARAMSRLNO);

CREATE TABLE TP_PTSK_STAMP_TYPE(
    S_STAMPTYPE VARCHAR(10) NOT NULL,
    S_STAMPNAME VARCHAR(60) NOT NULL,
    S_STAMPID VARCHAR(10),
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_STAMPTYPE)
);

COMMENT ON TABLE TP_PTSK_STAMP_TYPE IS '章类型参数';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_STAMPTYPE IS '章类型';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_STAMPNAME IS '章名称';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_STAMPID IS '章标识';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_STAMP_TYPE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110728150 ON TP_PTSK_STAMP_TYPE(S_STAMPTYPE);

CREATE TABLE TP_PTSK_STAMP_USER(
    S_STAMPTYPE VARCHAR(10) NOT NULL,
    S_USERCODE VARCHAR(12) NOT NULL,
    S_ESEALID VARCHAR(128) NOT NULL,
    S_ISVALID CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_STAMPTYPE,S_USERCODE)
);

COMMENT ON TABLE TP_PTSK_STAMP_USER IS '章类型与用户对应关系表';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_STAMPTYPE IS '章类型';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_USERCODE IS '用户代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_ESEALID IS '签章ID';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_ISVALID IS '是否有效';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_STAMP_USER.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110645220 ON TP_PTSK_STAMP_USER(S_STAMPTYPE,S_USERCODE);

CREATE TABLE TP_PTSK_STAMP_USER_PLACE(
    S_USERCODE VARCHAR(12) NOT NULL,
    S_STAMPTYPE VARCHAR(10) NOT NULL,
    S_PLACEID VARCHAR(10) NOT NULL,
    S_BIZTYPECODE VARCHAR(7) NOT NULL,
    D_ADJUSTDATE DATE,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_USERCODE,S_STAMPTYPE,S_PLACEID,S_BIZTYPECODE)
);

COMMENT ON TABLE TP_PTSK_STAMP_USER_PLACE IS '用户盖章位置与权限对应关系';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_USERCODE IS '用户代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_STAMPTYPE IS '章类型';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_PLACEID IS '盖章位置编号';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_PTSK_STAMP_USER_PLACE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110645470 ON TP_PTSK_STAMP_USER_PLACE(S_USERCODE,S_STAMPTYPE,S_BIZTYPECODE,S_PLACEID);

CREATE TABLE TP_QUARTZ(
    S_QAZJOBNAME VARCHAR(128) NOT NULL,
    S_QAZJOBGROUPNAME VARCHAR(128) NOT NULL,
    S_TRIGGERNAME VARCHAR(128) NOT NULL,
    S_TRIGGERGROUPNAME VARCHAR(128) NOT NULL,
    S_CRONEXPRESSION VARCHAR(128) NOT NULL,
    S_CRONEXPRESSIONDESC VARCHAR(256),
    S_TRIGGERPRIORITY INTEGER NOT NULL,
    S_QAZJOBSTATE CHAR(1) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_QAZJOBNAME)
);

COMMENT ON TABLE TP_QUARTZ IS '定时任务配置表';
COMMENT ON COLUMN TP_QUARTZ.S_QAZJOBNAME IS '定时任务名称';
COMMENT ON COLUMN TP_QUARTZ.S_QAZJOBGROUPNAME IS '任务组名称';
COMMENT ON COLUMN TP_QUARTZ.S_TRIGGERNAME IS '触发器名称';
COMMENT ON COLUMN TP_QUARTZ.S_TRIGGERGROUPNAME IS '触发器组名称';
COMMENT ON COLUMN TP_QUARTZ.S_CRONEXPRESSION IS '执行计划';
COMMENT ON COLUMN TP_QUARTZ.S_CRONEXPRESSIONDESC IS '执行计划说明';
COMMENT ON COLUMN TP_QUARTZ.S_TRIGGERPRIORITY IS '触发器优先级';
COMMENT ON COLUMN TP_QUARTZ.S_QAZJOBSTATE IS '定时任务状态';
COMMENT ON COLUMN TP_QUARTZ.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_QUARTZ.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_QUARTZ.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_QUARTZ.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_QUARTZ.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_QUARTZ.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_QUARTZ.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_QUARTZ.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_QUARTZ.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_QUARTZ.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_QUARTZ.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_QUARTZ.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_QUARTZ.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110732170 ON TP_QUARTZ(S_QAZJOBNAME);

CREATE TABLE TP_QUARTZCONTROL(
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    S_ELEVOUKINDCODE VARCHAR(10) NOT NULL,
    S_QAZJOBNAME VARCHAR(128) NOT NULL,
    S_VOUOPERTYPE CHAR(1),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    S_ISRUNSTATE VARCHAR(1),
    S_RUNNUM VARCHAR(64),
    PRIMARY KEY (S_CZ_VTCODE,S_ELEVOUKINDCODE,S_QAZJOBNAME)
);

COMMENT ON TABLE TP_QUARTZCONTROL IS '定时任务控制表';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_ELEVOUKINDCODE IS '电子凭证种类代码';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_QAZJOBNAME IS '定时任务名称';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_VOUOPERTYPE IS '凭证操作类型';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_QUARTZCONTROL.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_QUARTZCONTROL.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_QUARTZCONTROL.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_QUARTZCONTROL.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_ISRUNSTATE IS '是否运行中';
COMMENT ON COLUMN TP_QUARTZCONTROL.S_RUNNUM IS '运行次数';


CREATE UNIQUE INDEX SQL221020110732370 ON TP_QUARTZCONTROL(S_CZ_VTCODE,S_ELEVOUKINDCODE,S_QAZJOBNAME);

CREATE TABLE TP_REALAMTACCT(
    I_REALAMTSERNO VARCHAR(36) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_PAYEEUNITNAME VARCHAR(60) NOT NULL,
    S_PAYEEUNOPNBNKNAME VARCHAR(200) NOT NULL,
    S_PAYEEUNITFULACCNO VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(36),
    S_BDGESBTNAME VARCHAR(200),
    S_FUNDSOURCECODE VARCHAR(20),
    S_FUNDSOURCENAME VARCHAR(256),
    S_REALAMTNO VARCHAR(10) NOT NULL,
    S_BASEACCTFLAG CHAR(1) NOT NULL,
    S_BASEACCTDESC VARCHAR(10) NOT NULL,
    S_ISENABLE CHAR(1),
    S_OPERMODE VARCHAR(10),
    S_OPERDESC VARCHAR(10),
    S_ELEVOUID VARCHAR(100),
    D_VOUDATE DATE,
    S_VOUCHERNO VARCHAR(42),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE NOT NULL,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1),
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_REALAMTSERNO)
);

COMMENT ON TABLE TP_REALAMTACCT IS '实有资金账户表';
COMMENT ON COLUMN TP_REALAMTACCT.I_REALAMTSERNO IS '实有资金账户序号';
COMMENT ON COLUMN TP_REALAMTACCT.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TP_REALAMTACCT.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TP_REALAMTACCT.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_REALAMTACCT.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_FUNDSOURCECODE IS '资金来源代码';
COMMENT ON COLUMN TP_REALAMTACCT.S_FUNDSOURCENAME IS '资金来源名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_REALAMTNO IS '实有资金序号';
COMMENT ON COLUMN TP_REALAMTACCT.S_BASEACCTFLAG IS '基本户标志';
COMMENT ON COLUMN TP_REALAMTACCT.S_BASEACCTDESC IS '是否基本户描述';
COMMENT ON COLUMN TP_REALAMTACCT.S_ISENABLE IS '启用标志';
COMMENT ON COLUMN TP_REALAMTACCT.S_OPERMODE IS '操作方式';
COMMENT ON COLUMN TP_REALAMTACCT.S_OPERDESC IS '操作中文描述';
COMMENT ON COLUMN TP_REALAMTACCT.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TP_REALAMTACCT.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TP_REALAMTACCT.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TP_REALAMTACCT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_REALAMTACCT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_REALAMTACCT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_REALAMTACCT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_REALAMTACCT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_REALAMTACCT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_REALAMTACCT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_REALAMTACCT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_REALAMTACCT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_REALAMTACCT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_REALAMTACCT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_REALAMTACCT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110724870 ON TP_REALAMTACCT(I_REALAMTSERNO);

CREATE TABLE TP_RECEIPTSBT(
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    S_OFYEAR CHAR(4) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BDGESBTCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_RECEIPTSBT IS '税收返还科目';
COMMENT ON COLUMN TP_RECEIPTSBT.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_RECEIPTSBT.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TP_RECEIPTSBT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_RECEIPTSBT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_RECEIPTSBT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_RECEIPTSBT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_RECEIPTSBT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_RECEIPTSBT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_RECEIPTSBT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_RECEIPTSBT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_RECEIPTSBT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_RECEIPTSBT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_RECEIPTSBT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_RECEIPTSBT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_RECEIPTSBT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_RECEIPTSBT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110738670 ON TP_RECEIPTSBT(S_BDGESBTCODE,S_OFYEAR);

CREATE TABLE TP_RECEIPTSCALE(
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    S_BRHTREASNAME VARCHAR(60),
    F_RETURNSCALE DECIMAL(24,4),
    S_OFYEAR CHAR(4) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BRHTREASCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_RECEIPTSCALE IS '税收返还比例';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_BRHTREASNAME IS '分库名称';
COMMENT ON COLUMN TP_RECEIPTSCALE.F_RETURNSCALE IS '返还比例';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_RECEIPTSCALE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_RECEIPTSCALE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_RECEIPTSCALE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_RECEIPTSCALE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_RECEIPTSCALE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110738890 ON TP_RECEIPTSCALE(S_BRHTREASCODE,S_OFYEAR);

CREATE TABLE TP_REPORTANDBDGESBT(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_REPORTNAME VARCHAR(100) NOT NULL,
    S_BDGESBTKIND VARCHAR(7) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    S_OFYEAR CHAR(4) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_REPORTANDBDGESBT IS '报表与预算科目对应关系表';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_REPORTNAME IS '报表名称';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_BDGESBTKIND IS '预算科目种类';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_REPORTANDBDGESBT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110739580 ON TP_REPORTANDBDGESBT(S_PARAMSRLNO);

CREATE TABLE TP_REPORTBIZTYPEREL(
    S_REPORTBIZTYPECODE VARCHAR(4) NOT NULL,
    S_REPORTBIZTYPENAME VARCHAR(120),
    S_KEYCODE VARCHAR(42) NOT NULL,
    S_KEYNAME VARCHAR(120),
    S_OFYEAR CHAR(4) NOT NULL,
    S_REMARK VARCHAR(512),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_REPORTBIZTYPECODE,S_KEYCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_REPORTBIZTYPEREL IS '报表业务类别对照表';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_REPORTBIZTYPECODE IS '报表业务类别代码';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_REPORTBIZTYPENAME IS '报表业务类别名称';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_KEYCODE IS '关键字代码';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_KEYNAME IS '关键字名称';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_REMARK IS '备注';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_REPORTBIZTYPEREL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110738480 ON TP_REPORTBIZTYPEREL(S_REPORTBIZTYPECODE,S_KEYCODE,S_OFYEAR);

CREATE TABLE TP_REPORTMANUALTYPEININFOR(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_BANKNO VARCHAR(18),
    F_COLLAMT DECIMAL(24,2),
    F_SUBAMT DECIMAL(24,2),
    D_ACCTDATE DATE,
    S_BUSINESSTYPE VARCHAR(10),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_TYPISTCHECKFLAG VARCHAR(4),
    S_DIRECODE VARCHAR(12),
    S_DIRENAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TP_REPORTMANUALTYPEININFOR IS '报表手工录入信息表';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_BANKNO IS '行号';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.F_SUBAMT IS '差额';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_BUSINESSTYPE IS '业务种类';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_TYPISTCHECKFLAG IS '录入复核状态';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_DIRECODE IS '主管代码';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.S_DIRENAME IS '主管名称';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFOR.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110725220 ON TP_REPORTMANUALTYPEININFOR(S_TRANSSERNO);

CREATE TABLE TP_REPORTMANUALTYPEININFORDTL(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_TRANSSERNO VARCHAR(36),
    S_BDGESBTCODE VARCHAR(36),
    S_BDGESBTNAME VARCHAR(200),
    S_ECNMCSBT VARCHAR(36),
    F_AMT DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TP_REPORTMANUALTYPEININFORDTL IS '报表手工录入明细表';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.S_SRLNO IS '流水号';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.F_AMT IS '金额';
COMMENT ON COLUMN TP_REPORTMANUALTYPEININFORDTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110725340 ON TP_REPORTMANUALTYPEININFORDTL(S_SRLNO);

CREATE TABLE TP_REPPRINT(
    I_PRINTNO INTEGER NOT NULL,
    S_REPKIND CHAR(3) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_PRINTNO)
);

COMMENT ON TABLE TP_REPPRINT IS '报表批量打印信息表';
COMMENT ON COLUMN TP_REPPRINT.I_PRINTNO IS '打印编号';
COMMENT ON COLUMN TP_REPPRINT.S_REPKIND IS '报表种类';
COMMENT ON COLUMN TP_REPPRINT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_REPPRINT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_REPPRINT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_REPPRINT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_REPPRINT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_REPPRINT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_REPPRINT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_REPPRINT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_REPPRINT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_REPPRINT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_REPPRINT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_REPPRINT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_REPPRINT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110725030 ON TP_REPPRINT(I_PRINTNO);

CREATE TABLE TP_REVPAYUNIT(
    S_REVPAYUNITCODE VARCHAR(36) NOT NULL,
    S_PAYINUNITTYPE VARCHAR(10) NOT NULL,
    S_REVPAYFLAG CHAR(1) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_REVPAYBNKNO VARCHAR(18) NOT NULL,
    S_REVPAYUNITNAME VARCHAR(60) NOT NULL,
    S_CONTADDRES VARCHAR(100),
    S_ASERTINFO VARCHAR(512),
    S_REVPAYBNKNAME VARCHAR(60),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    S_ACCTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PAYINUNITTYPE,S_REVPAYFLAG,S_ACCTNO,S_REVPAYBNKNO)
);

COMMENT ON TABLE TP_REVPAYUNIT IS '收付款单位表';
COMMENT ON COLUMN TP_REVPAYUNIT.S_REVPAYUNITCODE IS '收付款单位代码';
COMMENT ON COLUMN TP_REVPAYUNIT.S_PAYINUNITTYPE IS '缴款单位类别';
COMMENT ON COLUMN TP_REVPAYUNIT.S_REVPAYFLAG IS '收付款标志';
COMMENT ON COLUMN TP_REVPAYUNIT.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_REVPAYUNIT.S_REVPAYBNKNO IS '收付款行行号';
COMMENT ON COLUMN TP_REVPAYUNIT.S_REVPAYUNITNAME IS '收付款单位名称';
COMMENT ON COLUMN TP_REVPAYUNIT.S_CONTADDRES IS '通讯地址';
COMMENT ON COLUMN TP_REVPAYUNIT.S_ASERTINFO IS '维护信息';
COMMENT ON COLUMN TP_REVPAYUNIT.S_REVPAYBNKNAME IS '收付款行名称';
COMMENT ON COLUMN TP_REVPAYUNIT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_REVPAYUNIT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_REVPAYUNIT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_REVPAYUNIT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_REVPAYUNIT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_REVPAYUNIT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_REVPAYUNIT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_REVPAYUNIT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_REVPAYUNIT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_REVPAYUNIT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_REVPAYUNIT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_REVPAYUNIT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_REVPAYUNIT.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TP_REVPAYUNIT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110646280 ON TP_REVPAYUNIT(S_REVPAYFLAG,S_PAYINUNITTYPE,S_ACCTNO,S_REVPAYBNKNO);

CREATE TABLE TP_SHARESBTREL(
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_SHARESBTCODE VARCHAR(36) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BDGESBTCODE,S_SHARESBTCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_SHARESBTREL IS '共享分成科目对应关系表';
COMMENT ON COLUMN TP_SHARESBTREL.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_SHARESBTREL.S_SHARESBTCODE IS '分成科目代码';
COMMENT ON COLUMN TP_SHARESBTREL.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_SHARESBTREL.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_SHARESBTREL.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_SHARESBTREL.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_SHARESBTREL.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_SHARESBTREL.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_SHARESBTREL.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_SHARESBTREL.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_SHARESBTREL.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_SHARESBTREL.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_SHARESBTREL.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_SHARESBTREL.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_SHARESBTREL.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_SHARESBTREL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110725510 ON TP_SHARESBTREL(S_OFYEAR,S_BDGESBTCODE,S_SHARESBTCODE);

CREATE TABLE TP_SPECVOUCHDEF(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_BRIEF VARCHAR(512) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_SUMFLAG CHAR(1) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1),
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_ISPRINTFLAG CHAR(1) NOT NULL,
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_SPECVOUCHDEF IS '特种传票定义表';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_BRIEF IS '摘要';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_SUMFLAG IS '汇总标志';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_SPECVOUCHDEF.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_SPECVOUCHDEF.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_SPECVOUCHDEF.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_ISPRINTFLAG IS '是否打印标志';
COMMENT ON COLUMN TP_SPECVOUCHDEF.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_SPECVOUCHDEF.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110725760 ON TP_SPECVOUCHDEF(S_PARAMSRLNO);

CREATE TABLE TP_SYSRUNSTATE(
    D_ACCTDATE DATE NOT NULL,
    S_RUNSTATE CHAR(1) NOT NULL,
    S_DTLPOSTSTATE CHAR(1),
    S_AMTPOSTSTATE CHAR(1),
    S_YEARTRANFLAG CHAR(1),
    S_MONTHTRANFLAG CHAR(1),
    S_ADJPERFLAG CHAR(1),
    S_ENCTRETPATH VARCHAR(255),
    S_ENCCERTPATH VARCHAR(255),
    S_REMOTECERTPATH VARCHAR(255),
    S_PWD VARCHAR(64),
    S_GKCFCCNAME VARCHAR(60),
    S_CZCFCCNAME VARCHAR(60),
    S_HVPDEALACCT VARCHAR(36) NOT NULL,
    S_HVPWAITFORRCKACCT VARCHAR(36) NOT NULL,
    S_BEPDEALACCT VARCHAR(36) NOT NULL,
    S_BEPWAITFORRCKACCT VARCHAR(36) NOT NULL,
    S_BEPSUSPENDACCT VARCHAR(36) NOT NULL,
    S_HVPSUSPENDACCT VARCHAR(36) NOT NULL,
    S_BEPSWATRCKACCT VARCHAR(32),
    S_OLDPAYBNKNO VARCHAR(18) NOT NULL,
    S_NEWPAYBNKNO VARCHAR(18) NOT NULL,
    S_NATDDEBTTMPACCNO VARCHAR(36),
    S_EMGENACCTNO VARCHAR(36),
    D_LASTACCTDATE DATE,
    S_PREDAYENDFNSHFLAG CHAR(1) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJDUEDATE DATE,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    I_PASSWORDTIMELIMIT INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (D_ACCTDATE)
);

COMMENT ON TABLE TP_SYSRUNSTATE IS '系统运行状态';
COMMENT ON COLUMN TP_SYSRUNSTATE.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_RUNSTATE IS '运行状态';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_DTLPOSTSTATE IS '明细岗状态';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_AMTPOSTSTATE IS '资金岗状态';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_YEARTRANFLAG IS '年度结转标志';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_MONTHTRANFLAG IS '月度结转标志';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_ENCTRETPATH IS '加密协议存放路径';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_ENCCERTPATH IS '加密证书存放路径';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_REMOTECERTPATH IS '远程加密证书路径';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_PWD IS '密码';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_GKCFCCNAME IS '国库CFCC名称';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_CZCFCCNAME IS '财政CFCC名称';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_HVPDEALACCT IS '大额支付往来账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_HVPWAITFORRCKACCT IS '大额支付来账挂账账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_BEPDEALACCT IS '小额支付往来账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_BEPWAITFORRCKACCT IS '小额支付来账挂账账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_BEPSUSPENDACCT IS '小额支付往账挂账账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_HVPSUSPENDACCT IS '其他支付挂账账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_BEPSWATRCKACCT IS '小额支付待清算账号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_OLDPAYBNKNO IS '旧支付行号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_NEWPAYBNKNO IS '新支付行号';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_NATDDEBTTMPACCNO IS '国债暂收户';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_EMGENACCTNO IS '应急账户';
COMMENT ON COLUMN TP_SYSRUNSTATE.D_LASTACCTDATE IS '上一账务日期';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_PREDAYENDFNSHFLAG IS '上日日终结束标志';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_SYSRUNSTATE.D_ADJDUEDATE IS '调整期截止日期';
COMMENT ON COLUMN TP_SYSRUNSTATE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_SYSRUNSTATE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_SYSRUNSTATE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_SYSRUNSTATE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_SYSRUNSTATE.I_PASSWORDTIMELIMIT IS '用户密码维护期限';
COMMENT ON COLUMN TP_SYSRUNSTATE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110726140 ON TP_SYSRUNSTATE(D_ACCTDATE);

CREATE TABLE TP_SYSTEMWORKDATENO(
    D_ACCTDATE DATE NOT NULL,
    I_SERNO BIGINT(19) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (D_ACCTDATE,S_ADJPERFLAG)
);

COMMENT ON TABLE TP_SYSTEMWORKDATENO IS '系统序号表';
COMMENT ON COLUMN TP_SYSTEMWORKDATENO.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TP_SYSTEMWORKDATENO.I_SERNO IS '序号';
COMMENT ON COLUMN TP_SYSTEMWORKDATENO.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TP_SYSTEMWORKDATENO.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_SYSTEMWORKDATENO.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110726250 ON TP_SYSTEMWORKDATENO(D_ACCTDATE,S_ADJPERFLAG);

CREATE TABLE TP_VOUCHERCONFIG(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_APPNAME VARCHAR(60) NOT NULL,
    S_APPVERSION VARCHAR(36) NOT NULL,
    S_ISENC CHAR(1) NOT NULL,
    S_CHECKSIGNFLAG CHAR(1) NOT NULL,
    S_ESEALAUTOADDFLAG CHAR(1) NOT NULL,
    S_FINACHKSTMPFLAG CHAR(1) NOT NULL,
    S_POXYBANKCHKSTMPFLAG CHAR(1) NOT NULL,
    S_VOUURL VARCHAR(128) NOT NULL,
    S_VOUPDFURL VARCHAR(128),
    S_VOUCHKSTAMPURL VARCHAR(128) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    S_QUARTZCLUSTERURL VARCHAR(512),
    S_USELOCALCFGFLAG VARCHAR(1),
    S_TRANSFERFLAG VARCHAR(1),
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TP_VOUCHERCONFIG IS '电子凭证库配置信息表';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_APPNAME IS '应用名称';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_APPVERSION IS '应用版本';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_ISENC IS '加密标志';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_CHECKSIGNFLAG IS '验证签名标志';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_ESEALAUTOADDFLAG IS '印鉴自动增加标志';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_FINACHKSTMPFLAG IS '财政印鉴检查标志';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_POXYBANKCHKSTMPFLAG IS '代理银行印鉴检查标志';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_VOUURL IS '电子凭证库地址';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_VOUPDFURL IS '电子凭证库打印地址';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_VOUCHKSTAMPURL IS '验签服务器地址';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_VOUCHERCONFIG.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_VOUCHERCONFIG.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_VOUCHERCONFIG.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_VOUCHERCONFIG.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_QUARTZCLUSTERURL IS '核算定时任务集群地址';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_USELOCALCFGFLAG IS '使用本地配置标志';
COMMENT ON COLUMN TP_VOUCHERCONFIG.S_TRANSFERFLAG IS '转发标志';


CREATE UNIQUE INDEX SQL221020110732650 ON TP_VOUCHERCONFIG(S_PARAMSRLNO);

CREATE TABLE TP_VOUCHERDEFINE(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_BRIEF VARCHAR(512) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_SUMFLAG CHAR(1) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(30),
    S_OPERCODE VARCHAR(30) NOT NULL,
    S_OPERNAME VARCHAR(30) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(30),
    S_APROVERNAME VARCHAR(30),
    S_PARAMSTATE CHAR(1) NOT NULL,
    S_ISPRINTFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_PARAMSRLNO,S_OFYEAR)
);

COMMENT ON TABLE TP_VOUCHERDEFINE IS '传票定义表';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_BRIEF IS '摘要';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_SUMFLAG IS '汇总标志';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_VOUCHERDEFINE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_VOUCHERDEFINE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_VOUCHERDEFINE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_ISPRINTFLAG IS '是否打印标志';
COMMENT ON COLUMN TP_VOUCHERDEFINE.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_VOUCHERDEFINE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110646640 ON TP_VOUCHERDEFINE(S_PARAMSRLNO,S_OFYEAR);

CREATE TABLE TP_VOUCHKIND(
    S_VOUCHKNDCODE VARCHAR(36) NOT NULL,
    S_VOUNAME VARCHAR(60),
    S_VOUTYPE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_VOUCHKNDCODE)
);

COMMENT ON TABLE TP_VOUCHKIND IS '凭证种类表';
COMMENT ON COLUMN TP_VOUCHKIND.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TP_VOUCHKIND.S_VOUNAME IS '凭证种类名称';
COMMENT ON COLUMN TP_VOUCHKIND.S_VOUTYPE IS '凭证类别';
COMMENT ON COLUMN TP_VOUCHKIND.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110726330 ON TP_VOUCHKIND(S_VOUCHKNDCODE);

CREATE TABLE TP_WORKDAY(
    D_ACCTDATE DATE NOT NULL,
    S_DAYKIND CHAR(1),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_LASTDESC VARCHAR(512),
    S_OPERTYPE CHAR(1) NOT NULL,
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (D_ACCTDATE)
);

COMMENT ON TABLE TP_WORKDAY IS '工作日程表';
COMMENT ON COLUMN TP_WORKDAY.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TP_WORKDAY.S_DAYKIND IS '日程类型';
COMMENT ON COLUMN TP_WORKDAY.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_WORKDAY.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_WORKDAY.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_WORKDAY.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_WORKDAY.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_WORKDAY.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_WORKDAY.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_WORKDAY.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_WORKDAY.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_WORKDAY.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_WORKDAY.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_WORKDAY.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_WORKDAY.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110726510 ON TP_WORKDAY(D_ACCTDATE);

CREATE TABLE TV_A_CHKBIZBIGTOTAL(
    S_SRLNO VARCHAR(36) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    D_RECONCILIATION DATE NOT NULL,
    S_TXTYPECODE VARCHAR(10) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    S_PROCSTATE VARCHAR(4) NOT NULL,
    I_PMTSUMNUM INTEGER NOT NULL,
    I_CTASSUMNUM INTEGER NOT NULL,
    F_PMTSUMAMT DECIMAL(24,2) NOT NULL,
    F_CTASSUMAMT DECIMAL(24,2) NOT NULL,
    I_DEFNUM INTEGER NOT NULL,
    F_DEFAMT DECIMAL(24,2) NOT NULL,
    S_CHKACCTSTATE CHAR(1) NOT NULL,
    S_MSGTP VARCHAR(36) NOT NULL,
    I_SUMACCOUNT INTEGER NOT NULL,
    F_SUMACCOUNT DECIMAL(24,2) NOT NULL,
    I_DEFACCTNUM INTEGER NOT NULL,
    F_DEFACCTSUMAMT DECIMAL(24,2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_A_CHKBIZBIGTOTAL IS '大额汇总业务核对表';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.I_PMTSUMNUM IS '支付总笔数/总包数';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.I_CTASSUMNUM IS 'CTAS总笔数/总包数';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.F_PMTSUMAMT IS '支付总金额';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.F_CTASSUMAMT IS 'CTAS总金额';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.I_DEFNUM IS '相差包数';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.F_DEFAMT IS '相差金额';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.S_CHKACCTSTATE IS '业务对账状态';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.S_MSGTP IS '报文编号';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.I_SUMACCOUNT IS '记账总笔数';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.F_SUMACCOUNT IS '记账总金额';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.I_DEFACCTNUM IS '记账相差笔数';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.F_DEFACCTSUMAMT IS '记账相差金额';
COMMENT ON COLUMN TV_A_CHKBIZBIGTOTAL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110730610 ON TV_A_CHKBIZBIGTOTAL(S_SRLNO);

CREATE TABLE TV_A_CHKNOTE(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_MSGID VARCHAR(35),
    D_ACEPTDATE DATE,
    D_RECONCILIATION DATE,
    S_CHKACCTTYPE CHAR(1),
    S_CHKACCTSTATE CHAR(1),
    S_BATCHFLAT CHAR(1),
    S_SPENDFLAG CHAR(1),
    S_REMARK VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_A_CHKNOTE IS '对账状态登记表';
COMMENT ON COLUMN TV_A_CHKNOTE.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_A_CHKNOTE.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_A_CHKNOTE.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_A_CHKNOTE.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_A_CHKNOTE.S_CHKACCTTYPE IS '对账类型';
COMMENT ON COLUMN TV_A_CHKNOTE.S_CHKACCTSTATE IS '业务对账状态';
COMMENT ON COLUMN TV_A_CHKNOTE.S_BATCHFLAT IS '跑批标志';
COMMENT ON COLUMN TV_A_CHKNOTE.S_SPENDFLAG IS '挂账标志';
COMMENT ON COLUMN TV_A_CHKNOTE.S_REMARK IS '备注';
COMMENT ON COLUMN TV_A_CHKNOTE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110730780 ON TV_A_CHKNOTE(S_SRLNO);

CREATE TABLE TV_A_PAYDAYENDTOTAL(
    S_SRLNO VARCHAR(36) NOT NULL,
    D_RECONCILIATION DATE NOT NULL,
    S_CHKTYPEDESC VARCHAR(200) NOT NULL,
    F_PMTSUMAMT DECIMAL(24,2) NOT NULL,
    F_CTASSUMAMT DECIMAL(24,2) NOT NULL,
    F_DEFSUMAMT DECIMAL(24,2) NOT NULL,
    S_CHKACCTSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_A_PAYDAYENDTOTAL IS '支付日终汇总核对表';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.S_CHKTYPEDESC IS '核对类型描述';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.F_PMTSUMAMT IS '支付总金额';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.F_CTASSUMAMT IS 'CTAS总金额';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.F_DEFSUMAMT IS '相差总金额';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.S_CHKACCTSTATE IS '业务对账状态';
COMMENT ON COLUMN TV_A_PAYDAYENDTOTAL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110646810 ON TV_A_PAYDAYENDTOTAL(S_SRLNO);

CREATE TABLE TV_AMASSPAYTYPEINTEMPORARY(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE,
    S_BUSINESSTYPE VARCHAR(10),
    S_PAYTYPEFLAG CHAR(1),
    S_PROXYBANKCODE VARCHAR(36),
    S_VOUNO VARCHAR(42),
    F_COLLAMT DECIMAL(24,2),
    F_SUBAMT DECIMAL(24,2),
    S_DIRECODE VARCHAR(12),
    S_DIRENAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCHECKFLAG VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TV_AMASSPAYTYPEINTEMPORARY IS '集中支付手工录入临时表';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_BUSINESSTYPE IS '业务种类';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.F_SUBAMT IS '差额';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_DIRECODE IS '主管代码';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_DIRENAME IS '主管名称';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.S_TYPISTCHECKFLAG IS '录入复核状态';
COMMENT ON COLUMN TV_AMASSPAYTYPEINTEMPORARY.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110728320 ON TV_AMASSPAYTYPEINTEMPORARY(S_TRANSSERNO);

CREATE TABLE TV_B_BEPS_OUTRET(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_TRANPRCSTATE VARCHAR(10),
    I_SUMCMPSCREEN INTEGER,
    D_SUMCMPDATE DATE,
    D_RECKDATE DATE,
    S_ORIMSGID VARCHAR(36),
    S_MSGKINDCODE VARCHAR(32),
    I_CHILDSRLNO BIGINT(19),
    S_MSGID VARCHAR(35),
    S_MSGTXID VARCHAR(30),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_B_BEPS_OUTRET IS '小额往账回执信息';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.S_TRANPRCSTATE IS '支付处理状态';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.S_MSGTXID IS '明细标识号';
COMMENT ON COLUMN TV_B_BEPS_OUTRET.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110652250 ON TV_B_BEPS_OUTRET(I_MSGSRLNO);

CREATE TABLE TV_B_BEPS121_DETAIL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_MSGTXID VARCHAR(30) NOT NULL,
    S_VOUNO VARCHAR(42),
    S_PAYERNAME VARCHAR(256),
    S_PAYERADDR VARCHAR(256),
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYEROPENBANKNO VARCHAR(18) NOT NULL,
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYBANKNO VARCHAR(18) NOT NULL,
    S_PAYBANKNAME VARCHAR(256),
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_CDTRMMBANKNAME VARCHAR(256),
    S_PAYEEBANKNO VARCHAR(18),
    S_PAYEEBANKNAME VARCHAR(256),
    S_REVACCTNAME VARCHAR(200),
    S_PAYEERADDR VARCHAR(256),
    S_REVACCT VARCHAR(32),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_INSTDDRCTORG VARCHAR(14),
    S_DBTRMMBANKNAME VARCHAR(256),
    F_INTRBKSTTLMAMT DECIMAL(24,2),
    S_TXTYPECODE VARCHAR(10),
    S_CTGYPURPCODE VARCHAR(10) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_ADDDATA VARCHAR(2000),
    S_BILLKIND VARCHAR(4),
    D_BILLDATE DATE,
    S_BILLNO VARCHAR(36),
    F_COMPENSATIONAMT DECIMAL(24,2),
    F_REFUSEAMT DECIMAL(24,2),
    F_ORIACCEPTAMT DECIMAL(24,2),
    F_PAYMETAMT DECIMAL(24,2),
    F_EXCESSIVEAMT DECIMAL(24,2),
    S_CHARGUNITNO VARCHAR(30),
    S_TERMTIME VARCHAR(16),
    S_PAYTYPE CHAR(4),
    S_CHARGATHINFO VARCHAR(512),
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    S_ORISNDRCTORG VARCHAR(14),
    S_ORIREVRCTORG VARCHAR(14),
    S_ORIMSGTXID VARCHAR(36),
    S_ORITXTYPECODE VARCHAR(6),
    S_EXCHGRESON VARCHAR(512),
    D_ISSUEDATE DATE,
    S_REMITNAME VARCHAR(100),
    F_BILLAMT DECIMAL(24,2),
    S_BILLAMTCODE VARCHAR(3),
    S_CURBILLCODE VARCHAR(3),
    I_BILLCOUNT INTEGER,
    F_ISSUEAMT DECIMAL(24,2),
    S_APPLYERACCT VARCHAR(32),
    S_APPLYERNM VARCHAR(120),
    F_ACTLSTTLMAMT DECIMAL(24,2),
    F_RMNGAMT DECIMAL(24,2),
    S_DRAFTTYPE CHAR(4),
    S_REVQUBIZPROCSTAT VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_B_BEPS121_DETAIL IS '小额客户发起普通贷记业务报文';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_MSGTXID IS '明细标识号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYERADDR IS '付款人地址';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYBANKNAME IS '付款行名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_CDTRMMBANKNAME IS '付款清算行名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYEEBANKNAME IS '收款行名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYEERADDR IS '收款人地址';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_DBTRMMBANKNAME IS '收款清算行名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_INTRBKSTTLMAMT IS '货币符号金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ADDDATA IS '附加数据';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_BILLKIND IS '票据种类';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.D_BILLDATE IS '票据日期';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_BILLNO IS '票据号码';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_COMPENSATIONAMT IS '赔偿金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_REFUSEAMT IS '拒付金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_ORIACCEPTAMT IS '原托金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_PAYMETAMT IS '支付金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_EXCESSIVEAMT IS '多付金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_CHARGUNITNO IS '收费单位流水号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_TERMTIME IS '所属期间';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_PAYTYPE IS '缴费类型';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_CHARGATHINFO IS '收费附言';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORISNDRCTORG IS '原发起间接参与机构';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORIREVRCTORG IS '原接收间接参与机构';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORIMSGTXID IS '原明细标识号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_ORITXTYPECODE IS '原支付业务类型编码';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_EXCHGRESON IS '退汇原因';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.D_ISSUEDATE IS '出票日期';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_REMITNAME IS '出票人名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_BILLAMT IS '票据金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_BILLAMTCODE IS '票据金额代码';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_CURBILLCODE IS '牌价';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.I_BILLCOUNT IS '票据张数';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_ISSUEAMT IS '出票金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_APPLYERACCT IS '申请人账号';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_APPLYERNM IS '申请人名称';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_ACTLSTTLMAMT IS '实际结算金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.F_RMNGAMT IS '多余金额';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_DRAFTTYPE IS '汇票种类';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.S_REVQUBIZPROCSTAT IS '来账确认业务种类处理状态';
COMMENT ON COLUMN TV_B_BEPS121_DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110647750 ON TV_B_BEPS121_DETAIL(I_FLOWID);

CREATE TABLE TV_B_BEPS121_HEAD(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_INSTDDRCTORG VARCHAR(14) NOT NULL,
    I_DETAILSRLCOUNT INTEGER NOT NULL,
    F_DTLBIZCOLLAMT DECIMAL(24,2) NOT NULL,
    S_SYSTEMNO VARCHAR(36) NOT NULL,
    S_REMARK VARCHAR(512),
    S_NPCPROCSTATE VARCHAR(4),
    S_NPCPROCCODE VARCHAR(8),
    S_NPCRSNINFO VARCHAR(512),
    D_NPCNETGDATE DATE,
    I_NPCNETGSCREEN INTEGER,
    D_NPCRECKDATE DATE,
    TS_NPCREVTMS TIMESTAMP,
    TS_NPCFORWARDTMS TIMESTAMP,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_B_BEPS121_HEAD IS '小额客户发起普通贷记业务报文头';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.I_DETAILSRLCOUNT IS '明细业务总笔数';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.F_DTLBIZCOLLAMT IS '明细业务总金额';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_REMARK IS '备注';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_NPCPROCSTATE IS 'NPC处理状态';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_NPCPROCCODE IS 'NPC处理码';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.S_NPCRSNINFO IS 'NPC拒绝信息';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.D_NPCNETGDATE IS 'NPC轧差日期';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.I_NPCNETGSCREEN IS 'NPC轧差场次';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.D_NPCRECKDATE IS 'NPC清算日期/终态日期';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.TS_NPCREVTMS IS 'NPC接收时间';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.TS_NPCFORWARDTMS IS 'NPC转发时间';
COMMENT ON COLUMN TV_B_BEPS121_HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110648090 ON TV_B_BEPS121_HEAD(I_MSGSRLNO);

CREATE TABLE TV_B_BEPS122(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_INSTDDRCTORG VARCHAR(14) NOT NULL,
    I_DETAILSRLCOUNT INTEGER NOT NULL,
    F_DTLBIZCOLLAMT DECIMAL(24,2) NOT NULL,
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_NPCPROCSTATE VARCHAR(4),
    S_NPCPROCCODE VARCHAR(8),
    S_NPCRSNINFO VARCHAR(512),
    D_NPCNETGDATE DATE,
    I_NPCNETGSCREEN INTEGER,
    D_NPCRECKDATE DATE,
    TS_NPCREVTMS TIMESTAMP,
    TS_NPCFORWARDTMS TIMESTAMP,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_B_BEPS122 IS '小额金融机构发起普通贷记业务报文';
COMMENT ON COLUMN TV_B_BEPS122.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS122.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_B_BEPS122.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS122.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS122.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_B_BEPS122.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS122.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS122.I_DETAILSRLCOUNT IS '明细业务总笔数';
COMMENT ON COLUMN TV_B_BEPS122.F_DTLBIZCOLLAMT IS '明细业务总金额';
COMMENT ON COLUMN TV_B_BEPS122.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_B_BEPS122.S_REMARK IS '备注';
COMMENT ON COLUMN TV_B_BEPS122.S_NPCPROCSTATE IS 'NPC处理状态';
COMMENT ON COLUMN TV_B_BEPS122.S_NPCPROCCODE IS 'NPC处理码';
COMMENT ON COLUMN TV_B_BEPS122.S_NPCRSNINFO IS 'NPC拒绝信息';
COMMENT ON COLUMN TV_B_BEPS122.D_NPCNETGDATE IS 'NPC轧差日期';
COMMENT ON COLUMN TV_B_BEPS122.I_NPCNETGSCREEN IS 'NPC轧差场次';
COMMENT ON COLUMN TV_B_BEPS122.D_NPCRECKDATE IS 'NPC清算日期/终态日期';
COMMENT ON COLUMN TV_B_BEPS122.TS_NPCREVTMS IS 'NPC接收时间';
COMMENT ON COLUMN TV_B_BEPS122.TS_NPCFORWARDTMS IS 'NPC转发时间';
COMMENT ON COLUMN TV_B_BEPS122.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110648430 ON TV_B_BEPS122(I_MSGSRLNO);

CREATE TABLE TV_B_BEPS122DTL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_MSGTXID VARCHAR(30) NOT NULL,
    S_VOUNO VARCHAR(42),
    S_PAYERNAME VARCHAR(256),
    S_PAYERADDR VARCHAR(256),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYBANKNO VARCHAR(18),
    S_PAYBANKNAME VARCHAR(256),
    S_CDTRMMBANKNAME VARCHAR(256),
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_PAYEEBANKNO VARCHAR(18),
    S_PAYEEBANKNAME VARCHAR(256),
    S_REVACCTNAME VARCHAR(200),
    S_PAYEERADDR VARCHAR(256),
    S_REVACCT VARCHAR(32),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_DBTRMMBANKNAME VARCHAR(256),
    S_INSTDDRCTORG VARCHAR(14),
    F_INTRBKSTTLMAMT DECIMAL(24,2),
    S_TXTYPECODE VARCHAR(10),
    S_CTGYPURPCODE VARCHAR(10) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_ADDDATA VARCHAR(2000),
    S_INFOFLOWNO VARCHAR(36),
    F_DETAILSUMAMT DECIMAL(24,2),
    S_ADDRPTCODE VARCHAR(10),
    S_REVRPTCODE VARCHAR(10),
    D_REPDATE DATE,
    I_REPSEQNO INTEGER,
    S_TXBDGETLEVEL CHAR(4),
    S_TXADJPERFLAG CHAR(4),
    S_TXBDGETTYPE CHAR(4),
    I_DETAILNUM INTEGER,
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    S_ORISNDRCTORG VARCHAR(14),
    S_ORIREVRCTORG VARCHAR(14),
    S_ORIMSGTXID VARCHAR(36),
    S_ORITXTYPECODE VARCHAR(6),
    S_EXCHGRESON VARCHAR(512),
    S_REVQUBIZPROCSTAT VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_B_BEPS122DTL IS '小额金融机构发起普通贷记业务报文明细信息';
COMMENT ON COLUMN TV_B_BEPS122DTL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS122DTL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS122DTL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_MSGTXID IS '明细标识号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYERADDR IS '付款人地址';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYBANKNAME IS '付款行名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_CDTRMMBANKNAME IS '付款清算行名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYEEBANKNAME IS '收款行名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYEERADDR IS '收款人地址';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_DBTRMMBANKNAME IS '收款清算行名称';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS122DTL.F_INTRBKSTTLMAMT IS '货币符号金额';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ADDDATA IS '附加数据';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_INFOFLOWNO IS '信息流水号';
COMMENT ON COLUMN TV_B_BEPS122DTL.F_DETAILSUMAMT IS '明细汇总金额';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ADDRPTCODE IS '上报国库代码';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_REVRPTCODE IS '接收国库代码';
COMMENT ON COLUMN TV_B_BEPS122DTL.D_REPDATE IS '报表日期';
COMMENT ON COLUMN TV_B_BEPS122DTL.I_REPSEQNO IS '报表序号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_TXBDGETLEVEL IS '报文预算级次';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_TXADJPERFLAG IS '报文调整期标志';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_TXBDGETTYPE IS '报文预算种类';
COMMENT ON COLUMN TV_B_BEPS122DTL.I_DETAILNUM IS '明细条数';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORISNDRCTORG IS '原发起间接参与机构';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORIREVRCTORG IS '原接收间接参与机构';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORIMSGTXID IS '原明细标识号';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_ORITXTYPECODE IS '原支付业务类型编码';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_EXCHGRESON IS '退汇原因';
COMMENT ON COLUMN TV_B_BEPS122DTL.S_REVQUBIZPROCSTAT IS '来账确认业务种类处理状态';
COMMENT ON COLUMN TV_B_BEPS122DTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110649090 ON TV_B_BEPS122DTL(I_FLOWID);

CREATE TABLE TV_B_BEPS127(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_INSTDDRCTORG VARCHAR(14),
    I_DETAILSRLCOUNT INTEGER NOT NULL,
    F_DTLBIZCOLLAMT DECIMAL(24,2) NOT NULL,
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    I_PKGRETLTD INTEGER,
    D_TRANSFER DATE,
    TS_SYSUPDATE TIMESTAMP,
    S_AUTOGENRECPTFLAG CHAR(1),
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_B_BEPS127 IS '小额普通借记业务报文';
COMMENT ON COLUMN TV_B_BEPS127.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS127.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_B_BEPS127.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS127.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS127.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_B_BEPS127.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS127.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS127.I_DETAILSRLCOUNT IS '明细业务总笔数';
COMMENT ON COLUMN TV_B_BEPS127.F_DTLBIZCOLLAMT IS '明细业务总金额';
COMMENT ON COLUMN TV_B_BEPS127.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_B_BEPS127.S_REMARK IS '备注';
COMMENT ON COLUMN TV_B_BEPS127.I_PKGRETLTD IS '包回执期限';
COMMENT ON COLUMN TV_B_BEPS127.D_TRANSFER IS '转发日期';
COMMENT ON COLUMN TV_B_BEPS127.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TV_B_BEPS127.S_AUTOGENRECPTFLAG IS '是否自动生成回执标志';


CREATE UNIQUE INDEX SQL221020110649360 ON TV_B_BEPS127(I_MSGSRLNO);

CREATE TABLE TV_B_BEPS127DTL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_CDTRMMBANKNAME VARCHAR(256),
    S_MSGID VARCHAR(35) NOT NULL,
    S_MSGTXID VARCHAR(30) NOT NULL,
    S_VOUNO VARCHAR(42),
    S_AGRMTNO VARCHAR(60),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYERNAME VARCHAR(256),
    S_PAYERADDR VARCHAR(256),
    S_PAYBANKNO VARCHAR(18),
    S_PAYBANKNAME VARCHAR(256),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_REVACCT VARCHAR(32),
    S_REVACCTNAME VARCHAR(200),
    S_PAYEERADDR VARCHAR(256),
    S_PAYEEBANKNO VARCHAR(18),
    S_PAYEEBANKNAME VARCHAR(256),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_INSTDDRCTORG VARCHAR(14),
    S_DBTRMMBANKNAME VARCHAR(256),
    F_INTRBKSTTLMAMT DECIMAL(24,2),
    S_TXTYPECODE VARCHAR(10),
    S_CTGYPURPCODE VARCHAR(10) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_ADDDATA VARCHAR(2000),
    S_INFOFLOWNO VARCHAR(36),
    F_DETAILSUMAMT DECIMAL(24,2),
    S_ADDRPTCODE VARCHAR(10),
    S_REVRPTCODE VARCHAR(10),
    D_REPDATE DATE,
    I_REPSEQNO INTEGER,
    S_TXBDGETLEVEL CHAR(4),
    S_TXADJPERFLAG CHAR(4),
    S_TXBDGETTYPE CHAR(4),
    I_DETAILNUM INTEGER,
    D_ISSUEDATE DATE,
    D_PAYTIPSDATE DATE,
    S_CHECKNO VARCHAR(36),
    S_PAYPWD VARCHAR(512),
    S_USAGE VARCHAR(150),
    S_ISSUEIMGTYPE VARCHAR(10),
    I_ISSUEFRNTLEN INTEGER,
    S_ISSUEFRNTDATA VARCHAR(4096),
    I_ISSUEBCKLEN INTEGER,
    S_ISSUEBCKLEN VARCHAR(4096),
    I_ENDORSERNUM INTEGER,
    S_ENDORSERNAME VARCHAR(60),
    F_ISSUEAMT DECIMAL(24,2),
    S_BILLNO VARCHAR(36),
    D_MATURITYDATE DATE,
    S_MATURITYSEAL VARCHAR(20),
    S_ACCPTTRETNO VARCHAR(36),
    D_ACCPTDATE DATE,
    S_ACCPTERNAME VARCHAR(60),
    S_APPLYERNM VARCHAR(120),
    S_APPLYERACCT VARCHAR(32),
    S_REMITFULLNAME VARCHAR(60),
    S_REMITACCT VARCHAR(32),
    S_TRAAGREEMNTNO VARCHAR(30),
    S_ORIPAYEERNAME VARCHAR(60),
    S_AUTOGENRECPTFLAG CHAR(1),
    S_RETPROCSTATE CHAR(1),
    S_REVQUBIZPROCSTAT VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_B_BEPS127DTL IS '小额普通借记业务报文报文业务明细';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS127DTL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_CDTRMMBANKNAME IS '付款清算行名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_MSGTXID IS '明细标识号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_AGRMTNO IS '合同协议号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYERADDR IS '付款人地址';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYBANKNAME IS '付款行名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYEERADDR IS '收款人地址';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYEEBANKNAME IS '收款行名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_DBTRMMBANKNAME IS '收款清算行名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.F_INTRBKSTTLMAMT IS '货币符号金额';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ADDDATA IS '附加数据';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_INFOFLOWNO IS '信息流水号';
COMMENT ON COLUMN TV_B_BEPS127DTL.F_DETAILSUMAMT IS '明细汇总金额';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ADDRPTCODE IS '上报国库代码';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_REVRPTCODE IS '接收国库代码';
COMMENT ON COLUMN TV_B_BEPS127DTL.D_REPDATE IS '报表日期';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_REPSEQNO IS '报表序号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_TXBDGETLEVEL IS '报文预算级次';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_TXADJPERFLAG IS '报文调整期标志';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_TXBDGETTYPE IS '报文预算种类';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_DETAILNUM IS '明细条数';
COMMENT ON COLUMN TV_B_BEPS127DTL.D_ISSUEDATE IS '出票日期';
COMMENT ON COLUMN TV_B_BEPS127DTL.D_PAYTIPSDATE IS '提示付款日期';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_CHECKNO IS '支票号码';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_PAYPWD IS '支付密码';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_USAGE IS '用途';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ISSUEIMGTYPE IS '票据图像类型';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_ISSUEFRNTLEN IS '票据正面图像长度';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ISSUEFRNTDATA IS '票据正面图像数据';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_ISSUEBCKLEN IS '票背面据图像长度';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ISSUEBCKLEN IS '票据背面图像数据';
COMMENT ON COLUMN TV_B_BEPS127DTL.I_ENDORSERNUM IS '被背书人数';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ENDORSERNAME IS '被背书人名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.F_ISSUEAMT IS '出票金额';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_BILLNO IS '票据号码';
COMMENT ON COLUMN TV_B_BEPS127DTL.D_MATURITYDATE IS '票据到期日期';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_MATURITYSEAL IS '票据密押';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ACCPTTRETNO IS '承兑协议编号';
COMMENT ON COLUMN TV_B_BEPS127DTL.D_ACCPTDATE IS '承兑日期';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ACCPTERNAME IS '承兑人';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_APPLYERNM IS '申请人名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_APPLYERACCT IS '申请人账号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_REMITFULLNAME IS '出票人全称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_REMITACCT IS '出票人账号';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_TRAAGREEMNTNO IS '交易合同号码';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_ORIPAYEERNAME IS '原收款人名称';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_AUTOGENRECPTFLAG IS '是否自动生成回执标志';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_RETPROCSTATE IS '回执处理状态';
COMMENT ON COLUMN TV_B_BEPS127DTL.S_REVQUBIZPROCSTAT IS '来账确认业务种类处理状态';
COMMENT ON COLUMN TV_B_BEPS127DTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110650290 ON TV_B_BEPS127DTL(I_FLOWID);

CREATE TABLE TV_B_BEPS127ISCOMEDTLS(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_LEVYGENUSCODE VARCHAR(36),
    S_BDGESBTCODE VARCHAR(36),
    F_OCCURAMT DECIMAL(24,2),
    S_OCCAMTCURCODE CHAR(3),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TV_B_BEPS127ISCOMEDTLS IS '小额普通借记业务报文国库资金贷记划拨业务明细';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.S_LEVYGENUSCODE IS '征收机关大类代码';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.F_OCCURAMT IS '发生额';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.S_OCCAMTCURCODE IS '发生额货币代码';
COMMENT ON COLUMN TV_B_BEPS127ISCOMEDTLS.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110650540 ON TV_B_BEPS127ISCOMEDTLS(I_CHILDSRLNO);

CREATE TABLE TV_B_BEPS127ISGODTLS(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_BILLBNKKINDCODE VARCHAR(36),
    S_CORPUSCODE VARCHAR(36),
    F_CORPUSAMT DECIMAL(24,2),
    S_CPTLAMTCURCODE CHAR(3),
    S_ACRLCODE VARCHAR(36),
    F_ACRLAMT DECIMAL(24,2),
    S_ACRLAMTCURCODE CHAR(3),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TV_B_BEPS127ISGODTLS IS '小额普通借记业务报文国库资金国债兑付贷记划拨业务明细';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_BILLBNKKINDCODE IS '兑付国债银行大类';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_CORPUSCODE IS '本金代码';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.F_CORPUSAMT IS '本金金额';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_CPTLAMTCURCODE IS '本金金额货币代码';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_ACRLCODE IS '利息代码';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.F_ACRLAMT IS '利息金额';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.S_ACRLAMTCURCODE IS '利息金额货币代码';
COMMENT ON COLUMN TV_B_BEPS127ISGODTLS.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110650790 ON TV_B_BEPS127ISGODTLS(I_CHILDSRLNO);

CREATE TABLE TV_B_BEPS128(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_ORIMSGID VARCHAR(36),
    S_ORIMSGTYPECODE VARCHAR(35),
    I_RETDTLBIZSUCCCOUNT INTEGER,
    F_RETDTLBIZSUCCAMT DECIMAL(24,2),
    S_PKGPROCSTATE CHAR(4),
    D_NPCNETGDATE DATE,
    I_NPCNETGSCREEN INTEGER,
    D_NPCRECKDATE DATE,
    I_RETDTLBIZCOUNT INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_B_BEPS128 IS '小额普通借记业务回执报文';
COMMENT ON COLUMN TV_B_BEPS128.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS128.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_B_BEPS128.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS128.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS128.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_B_BEPS128.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS128.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_B_BEPS128.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS128.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_B_BEPS128.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_B_BEPS128.S_REMARK IS '备注';
COMMENT ON COLUMN TV_B_BEPS128.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_B_BEPS128.S_ORIMSGTYPECODE IS '原报文类型代码';
COMMENT ON COLUMN TV_B_BEPS128.I_RETDTLBIZSUCCCOUNT IS '回执明细业务成功总笔数';
COMMENT ON COLUMN TV_B_BEPS128.F_RETDTLBIZSUCCAMT IS '回执明细业务成功总金额';
COMMENT ON COLUMN TV_B_BEPS128.S_PKGPROCSTATE IS '包处理状态';
COMMENT ON COLUMN TV_B_BEPS128.D_NPCNETGDATE IS 'NPC轧差日期';
COMMENT ON COLUMN TV_B_BEPS128.I_NPCNETGSCREEN IS 'NPC轧差场次';
COMMENT ON COLUMN TV_B_BEPS128.D_NPCRECKDATE IS 'NPC清算日期/终态日期';
COMMENT ON COLUMN TV_B_BEPS128.I_RETDTLBIZCOUNT IS '回执明细业务总笔数';
COMMENT ON COLUMN TV_B_BEPS128.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110651120 ON TV_B_BEPS128(I_MSGSRLNO);

CREATE TABLE TV_B_BEPS128_DETAIL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_BIZRETSTATE VARCHAR(4) NOT NULL,
    S_ORIMSGTXID VARCHAR(36),
    F_ORIINTRBKSTTLMAMT DECIMAL(24,2),
    S_ORIBIZTYPECODE VARCHAR(4),
    S_ORIPAYEERCKBNKNO VARCHAR(18),
    S_ORIPAYEEBNKNO VARCHAR(18),
    S_ATTACHINFO VARCHAR(512),
    S_PROXYBNKPOUN VARCHAR(40),
    S_CDTRMMBANKNO VARCHAR(18),
    S_PAYBANKNO VARCHAR(18),
    S_DBTRMMBANKNO VARCHAR(18),
    S_PAYEEBANKNO VARCHAR(18),
    S_BIZRJCTPROCCODE CHAR(4),
    S_RJCTRSNINFO VARCHAR(210),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_B_BEPS128_DETAIL IS '小额普通借记业务回执报文明细';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_BIZRETSTATE IS '业务回执状态';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_ORIMSGTXID IS '原明细标识号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.F_ORIINTRBKSTTLMAMT IS '原货币符号结算金额';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_ORIBIZTYPECODE IS '原业务类型编码';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_ORIPAYEERCKBNKNO IS '原收款清算行行号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_ORIPAYEEBNKNO IS '原收款行行号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_PROXYBNKPOUN IS '代理行手续费';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_CDTRMMBANKNO IS '付款清算行行号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_DBTRMMBANKNO IS '收款清算行行号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_BIZRJCTPROCCODE IS '业务拒绝处理码';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.S_RJCTRSNINFO IS '业务拒绝原因';
COMMENT ON COLUMN TV_B_BEPS128_DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110651430 ON TV_B_BEPS128_DETAIL(I_FLOWID);

CREATE TABLE TV_B_BEPS721(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    D_RECONCILIATION DATE,
    I_TTLPMT INTEGER,
    I_TTLMSG INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_B_BEPS721 IS '小额业务包汇总核对报文';
COMMENT ON COLUMN TV_B_BEPS721.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS721.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS721.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS721.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_B_BEPS721.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS721.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_B_BEPS721.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_B_BEPS721.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_B_BEPS721.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_B_BEPS721.S_REMARK IS '备注';
COMMENT ON COLUMN TV_B_BEPS721.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_B_BEPS721.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_B_BEPS721.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_B_BEPS721.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_B_BEPS721.I_TTLPMT IS '业务报文对账记录数';
COMMENT ON COLUMN TV_B_BEPS721.I_TTLMSG IS '信息报文对账记录数';
COMMENT ON COLUMN TV_B_BEPS721.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110651720 ON TV_B_BEPS721(I_MSGSRLNO);

CREATE TABLE TV_B_BEPS721DTL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    D_SUMCMPDATE DATE,
    I_SUMCMPSCREEN INTEGER,
    S_MSGTYPECODE VARCHAR(32),
    I_SNDPKGCOUNT INTEGER,
    F_SNDPKGSUMAMT DECIMAL(24,2),
    I_REVPKGCOUNT INTEGER,
    F_REVPKGSUMAMT DECIMAL(24,2),
    S_PKGPROCSTATE CHAR(4),
    I_SNDTALCOUNT INTEGER,
    I_REVTALCOUNT INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_B_BEPS721DTL IS '小额业务包汇总核对报文明细';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_B_BEPS721DTL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_B_BEPS721DTL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_B_BEPS721DTL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_B_BEPS721DTL.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_B_BEPS721DTL.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_SNDPKGCOUNT IS '往账包总笔数';
COMMENT ON COLUMN TV_B_BEPS721DTL.F_SNDPKGSUMAMT IS '往账包总金额';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_REVPKGCOUNT IS '来账包总笔数';
COMMENT ON COLUMN TV_B_BEPS721DTL.F_REVPKGSUMAMT IS '来账包总金额';
COMMENT ON COLUMN TV_B_BEPS721DTL.S_PKGPROCSTATE IS '包处理状态';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_SNDTALCOUNT IS '往报总笔数';
COMMENT ON COLUMN TV_B_BEPS721DTL.I_REVTALCOUNT IS '来报总笔数';
COMMENT ON COLUMN TV_B_BEPS721DTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110652010 ON TV_B_BEPS721DTL(I_FLOWID);

CREATE TABLE TV_C_CCMS900(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    S_BIZSTATE CHAR(4),
    S_TXBIZPROCSTATE VARCHAR(8),
    S_RJCTBIZINVORGCODE VARCHAR(18),
    S_INVORGBIZRJCTCODE VARCHAR(4),
    S_BIZRJCTINFO VARCHAR(105),
    D_FINALPROCDATE DATE,
    I_SUMCMPSCREEN INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_C_CCMS900 IS '通用处理确认报文';
COMMENT ON COLUMN TV_C_CCMS900.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_C_CCMS900.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_C_CCMS900.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_C_CCMS900.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_C_CCMS900.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_C_CCMS900.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_C_CCMS900.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_C_CCMS900.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_C_CCMS900.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_C_CCMS900.S_REMARK IS '备注';
COMMENT ON COLUMN TV_C_CCMS900.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_C_CCMS900.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_C_CCMS900.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_C_CCMS900.S_BIZSTATE IS '业务状态';
COMMENT ON COLUMN TV_C_CCMS900.S_TXBIZPROCSTATE IS '支付业务处理码';
COMMENT ON COLUMN TV_C_CCMS900.S_RJCTBIZINVORGCODE IS '拒绝业务的参与机构行号';
COMMENT ON COLUMN TV_C_CCMS900.S_INVORGBIZRJCTCODE IS '参与机构业务拒绝码';
COMMENT ON COLUMN TV_C_CCMS900.S_BIZRJCTINFO IS '业务拒绝信息';
COMMENT ON COLUMN TV_C_CCMS900.D_FINALPROCDATE IS '处理日期（终态日期）';
COMMENT ON COLUMN TV_C_CCMS900.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_C_CCMS900.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110652640 ON TV_C_CCMS900(I_MSGSRLNO);

CREATE TABLE TV_CHKBIZSMALLTOTAL(
    S_SRLNO VARCHAR(36),
    D_ACEPTDATE DATE,
    D_RECONCILIATION DATE,
    D_SUMCMPDATE DATE,
    I_SUMCMPSCREEN INTEGER,
    S_MSGTYPECODE VARCHAR(32),
    S_CONTFLAG CHAR(1),
    S_PROCSTATE VARCHAR(4),
    S_CHKACCTSTATE CHAR(1),
    S_SUMCMPNODETYPE CHAR(1),
    I_PMTSUMNUM INTEGER,
    I_CTASSUMNUM INTEGER,
    F_PMTSUMAMT DECIMAL(24,2),
    F_CTASSUMAMT DECIMAL(24,2),
    I_DEFNUM INTEGER,
    F_DEFAMT DECIMAL(24,2),
    I_SUMACCOUNT INTEGER,
    F_SUMACCOUNT DECIMAL(24,2),
    I_DEFACCTNUM INTEGER,
    F_DEFACCTSUMAMT DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP
);

COMMENT ON TABLE TV_CHKBIZSMALLTOTAL IS '小额汇总业务核对表';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.S_CHKACCTSTATE IS '业务对账状态';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.S_SUMCMPNODETYPE IS '轧差节点类型';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.I_PMTSUMNUM IS '支付总笔数/总包数';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.I_CTASSUMNUM IS 'CTAS总笔数/总包数';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.F_PMTSUMAMT IS '支付总金额';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.F_CTASSUMAMT IS 'CTAS总金额';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.I_DEFNUM IS '相差包数';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.F_DEFAMT IS '相差金额';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.I_SUMACCOUNT IS '记账总笔数';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.F_SUMACCOUNT IS '记账总金额';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.I_DEFACCTNUM IS '记账相差笔数';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.F_DEFACCTSUMAMT IS '记账相差金额';
COMMENT ON COLUMN TV_CHKBIZSMALLTOTAL.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TV_H_HVPS_OUTRET(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_TRANPRCSTATE VARCHAR(10),
    D_RECKDATE DATE,
    S_ORIMSGID VARCHAR(36),
    S_MSGKINDCODE VARCHAR(32),
    I_CHILDSRLNO BIGINT(19),
    S_MSGID VARCHAR(35),
    S_MSGTXID VARCHAR(30),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_H_HVPS_OUTRET IS '大额往账回执信息';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.S_TRANPRCSTATE IS '支付处理状态';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.S_MSGTXID IS '明细标识号';
COMMENT ON COLUMN TV_H_HVPS_OUTRET.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110655140 ON TV_H_HVPS_OUTRET(I_MSGSRLNO);

CREATE TABLE TV_H_HVPS111(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_VOUNO VARCHAR(42),
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    I_DETAILSRLCOUNT INTEGER NOT NULL,
    S_NODTONODID VARCHAR(36) NOT NULL,
    S_TRANSID VARCHAR(36) NOT NULL,
    S_TXTYPECODE VARCHAR(10) NOT NULL,
    F_INTRBKSTTLMAMT DECIMAL(24,2) NOT NULL,
    S_BIZLEVEL CHAR(4),
    S_AGENCYCODE1 VARCHAR(35),
    S_AGENCYNAME1 VARCHAR(280),
    S_AGENCYCODE2 VARCHAR(35),
    S_AGENCYNAME2 VARCHAR(280),
    S_PAYERNAME VARCHAR(256),
    S_PAYERADDR VARCHAR(256),
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYBANKNO VARCHAR(18) NOT NULL,
    S_PAYBANKNAME VARCHAR(256),
    S_CDTRMMBANKNO VARCHAR(18) NOT NULL,
    S_CDTRMMBANKNAME VARCHAR(256),
    S_PAYEROPENBANKNO VARCHAR(18) NOT NULL,
    S_PAYOPENBANKNAME VARCHAR(150),
    S_REVACCTNAME VARCHAR(200),
    S_PAYEERADDR VARCHAR(256),
    S_PAYEEBANKNO VARCHAR(18) NOT NULL,
    S_PAYEEBANKNAME VARCHAR(256),
    S_REVACCT VARCHAR(32) NOT NULL,
    S_DBTRMMBANKNO VARCHAR(18) NOT NULL,
    S_DBTRMMBANKNAME VARCHAR(256),
    S_PAYEEROPENBANKNO VARCHAR(18) NOT NULL,
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_CTGYPURPCODE VARCHAR(10) NOT NULL,
    S_REMARK VARCHAR(512),
    S_REMARKS2 VARCHAR(512),
    S_ATTACHINFO VARCHAR(512),
    S_ATTACHINFO2 VARCHAR(512),
    D_RECKDATE DATE,
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTYPECODE VARCHAR(35),
    S_EXCHGRESON VARCHAR(512),
    S_REVQUBIZPROCSTAT VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_H_HVPS111 IS '大额客户发起汇兑业务报文';
COMMENT ON COLUMN TV_H_HVPS111.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS111.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_H_HVPS111.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_H_HVPS111.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS111.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_H_HVPS111.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_H_HVPS111.I_DETAILSRLCOUNT IS '明细业务总笔数';
COMMENT ON COLUMN TV_H_HVPS111.S_NODTONODID IS '端到端标识号';
COMMENT ON COLUMN TV_H_HVPS111.S_TRANSID IS '交易标识号';
COMMENT ON COLUMN TV_H_HVPS111.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_H_HVPS111.F_INTRBKSTTLMAMT IS '货币符号金额';
COMMENT ON COLUMN TV_H_HVPS111.S_BIZLEVEL IS '业务优先级';
COMMENT ON COLUMN TV_H_HVPS111.S_AGENCYCODE1 IS '中介机构1';
COMMENT ON COLUMN TV_H_HVPS111.S_AGENCYNAME1 IS '中介机构1名称';
COMMENT ON COLUMN TV_H_HVPS111.S_AGENCYCODE2 IS '中介机构2';
COMMENT ON COLUMN TV_H_HVPS111.S_AGENCYNAME2 IS '中介机构2名称';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYERADDR IS '付款人地址';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYBANKNAME IS '付款行名称';
COMMENT ON COLUMN TV_H_HVPS111.S_CDTRMMBANKNO IS '付款清算行行号';
COMMENT ON COLUMN TV_H_HVPS111.S_CDTRMMBANKNAME IS '付款清算行名称';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_H_HVPS111.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYEERADDR IS '收款人地址';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYEEBANKNAME IS '收款行名称';
COMMENT ON COLUMN TV_H_HVPS111.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TV_H_HVPS111.S_DBTRMMBANKNO IS '收款清算行行号';
COMMENT ON COLUMN TV_H_HVPS111.S_DBTRMMBANKNAME IS '收款清算行名称';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_H_HVPS111.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TV_H_HVPS111.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TV_H_HVPS111.S_REMARK IS '备注';
COMMENT ON COLUMN TV_H_HVPS111.S_REMARKS2 IS '备注2';
COMMENT ON COLUMN TV_H_HVPS111.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_H_HVPS111.S_ATTACHINFO2 IS '附言2';
COMMENT ON COLUMN TV_H_HVPS111.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_H_HVPS111.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_H_HVPS111.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_H_HVPS111.S_ORIMSGTYPECODE IS '原报文类型代码';
COMMENT ON COLUMN TV_H_HVPS111.S_EXCHGRESON IS '退汇原因';
COMMENT ON COLUMN TV_H_HVPS111.S_REVQUBIZPROCSTAT IS '来账确认业务种类处理状态';
COMMENT ON COLUMN TV_H_HVPS111.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110653250 ON TV_H_HVPS111(I_MSGSRLNO);

CREATE TABLE TV_H_HVPS112(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_CONTFLAG CHAR(1) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_VOUNO VARCHAR(42),
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    I_DETAILSRLCOUNT INTEGER NOT NULL,
    S_NODTONODID VARCHAR(36) NOT NULL,
    S_TRANSID VARCHAR(36) NOT NULL,
    S_TXTYPECODE VARCHAR(10) NOT NULL,
    F_INTRBKSTTLMAMT DECIMAL(24,2) NOT NULL,
    S_BIZLEVEL CHAR(4),
    S_PAYBANKNAME VARCHAR(256),
    S_CDTRMMBANKNAME VARCHAR(256),
    S_DBTRMMBANKNO VARCHAR(18) NOT NULL,
    S_DBTRMMBANKNAME VARCHAR(256),
    S_PAYEEBANKNO VARCHAR(18) NOT NULL,
    S_PAYEEBANKNAME VARCHAR(256),
    S_AGENCYCODE1 VARCHAR(35),
    S_AGENCYNAME1 VARCHAR(280),
    S_AGENCYCODE2 VARCHAR(35),
    S_AGENCYNAME2 VARCHAR(280),
    S_PAYERNAME VARCHAR(256),
    S_PAYBANKNO VARCHAR(18) NOT NULL,
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYEROPENBANKNO VARCHAR(18) NOT NULL,
    S_PAYOPENBANKNAME VARCHAR(150),
    S_CDTRMMBANKNO VARCHAR(18) NOT NULL,
    S_PAYERADDR VARCHAR(256),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_REVACCTNAME VARCHAR(200),
    S_PAYEERADDR VARCHAR(256),
    S_REVACCT VARCHAR(32) NOT NULL,
    S_CTGYPURPCODE VARCHAR(10) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_ATTACHINFO2 VARCHAR(512),
    D_RECKDATE DATE,
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTYPECODE VARCHAR(35),
    S_EXCHGRESON VARCHAR(512),
    S_REVQUBIZPROCSTAT VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_H_HVPS112 IS '大额金融机构发起汇兑业务报文';
COMMENT ON COLUMN TV_H_HVPS112.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS112.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TV_H_HVPS112.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_H_HVPS112.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS112.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_H_HVPS112.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_H_HVPS112.I_DETAILSRLCOUNT IS '明细业务总笔数';
COMMENT ON COLUMN TV_H_HVPS112.S_NODTONODID IS '端到端标识号';
COMMENT ON COLUMN TV_H_HVPS112.S_TRANSID IS '交易标识号';
COMMENT ON COLUMN TV_H_HVPS112.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_H_HVPS112.F_INTRBKSTTLMAMT IS '货币符号金额';
COMMENT ON COLUMN TV_H_HVPS112.S_BIZLEVEL IS '业务优先级';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYBANKNAME IS '付款行名称';
COMMENT ON COLUMN TV_H_HVPS112.S_CDTRMMBANKNAME IS '付款清算行名称';
COMMENT ON COLUMN TV_H_HVPS112.S_DBTRMMBANKNO IS '收款清算行行号';
COMMENT ON COLUMN TV_H_HVPS112.S_DBTRMMBANKNAME IS '收款清算行名称';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYEEBANKNAME IS '收款行名称';
COMMENT ON COLUMN TV_H_HVPS112.S_AGENCYCODE1 IS '中介机构1';
COMMENT ON COLUMN TV_H_HVPS112.S_AGENCYNAME1 IS '中介机构1名称';
COMMENT ON COLUMN TV_H_HVPS112.S_AGENCYCODE2 IS '中介机构2';
COMMENT ON COLUMN TV_H_HVPS112.S_AGENCYNAME2 IS '中介机构2名称';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_H_HVPS112.S_CDTRMMBANKNO IS '付款清算行行号';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYERADDR IS '付款人地址';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TV_H_HVPS112.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TV_H_HVPS112.S_PAYEERADDR IS '收款人地址';
COMMENT ON COLUMN TV_H_HVPS112.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TV_H_HVPS112.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TV_H_HVPS112.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TV_H_HVPS112.S_ATTACHINFO2 IS '附言2';
COMMENT ON COLUMN TV_H_HVPS112.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_H_HVPS112.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_H_HVPS112.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_H_HVPS112.S_ORIMSGTYPECODE IS '原报文类型代码';
COMMENT ON COLUMN TV_H_HVPS112.S_EXCHGRESON IS '退汇原因';
COMMENT ON COLUMN TV_H_HVPS112.S_REVQUBIZPROCSTAT IS '来账确认业务种类处理状态';
COMMENT ON COLUMN TV_H_HVPS112.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110653790 ON TV_H_HVPS112(I_MSGSRLNO);

CREATE TABLE TV_H_HVPS711(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_INSTORG VARCHAR(14) NOT NULL,
    S_INSTDDRCTORG VARCHAR(14) NOT NULL,
    S_REVINVORG VARCHAR(14) NOT NULL,
    S_SYSTEMNO VARCHAR(36) NOT NULL,
    S_REMARK VARCHAR(512),
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    D_RECONCILIATION DATE,
    I_TTLPMT INTEGER,
    I_TTLMSG INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_H_HVPS711 IS '大额业务汇总核对报文';
COMMENT ON COLUMN TV_H_HVPS711.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS711.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_H_HVPS711.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS711.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_H_HVPS711.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_H_HVPS711.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_H_HVPS711.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_H_HVPS711.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_H_HVPS711.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_H_HVPS711.S_REMARK IS '备注';
COMMENT ON COLUMN TV_H_HVPS711.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_H_HVPS711.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_H_HVPS711.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_H_HVPS711.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_H_HVPS711.I_TTLPMT IS '业务报文对账记录数';
COMMENT ON COLUMN TV_H_HVPS711.I_TTLMSG IS '信息报文对账记录数';
COMMENT ON COLUMN TV_H_HVPS711.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110654090 ON TV_H_HVPS711(I_MSGSRLNO);

CREATE TABLE TV_H_HVPS711DTL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_MSGTP VARCHAR(36) NOT NULL,
    S_TXTYPECODE VARCHAR(10) NOT NULL,
    I_SNDTOTALCOUNT INTEGER NOT NULL,
    F_SNDTOTALAMT DECIMAL(24,2) NOT NULL,
    I_REVTOTALCOUNT INTEGER NOT NULL,
    F_REVTOTALAMT DECIMAL(24,2) NOT NULL,
    S_PROCSTATE VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_H_HVPS711DTL IS '大额业务汇总核对报文对账清单';
COMMENT ON COLUMN TV_H_HVPS711DTL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_H_HVPS711DTL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS711DTL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_H_HVPS711DTL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_H_HVPS711DTL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS711DTL.S_MSGTP IS '报文编号';
COMMENT ON COLUMN TV_H_HVPS711DTL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_H_HVPS711DTL.I_SNDTOTALCOUNT IS '发起总笔数';
COMMENT ON COLUMN TV_H_HVPS711DTL.F_SNDTOTALAMT IS '发起总金额';
COMMENT ON COLUMN TV_H_HVPS711DTL.I_REVTOTALCOUNT IS '接收总笔数';
COMMENT ON COLUMN TV_H_HVPS711DTL.F_REVTOTALAMT IS '接收总金额';
COMMENT ON COLUMN TV_H_HVPS711DTL.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_H_HVPS711DTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110654330 ON TV_H_HVPS711DTL(I_FLOWID);

CREATE TABLE TV_H_HVPS713(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_INSTORG VARCHAR(14) NOT NULL,
    S_INSTDDRCTORG VARCHAR(14) NOT NULL,
    S_REVINVORG VARCHAR(14) NOT NULL,
    S_SYSTEMNO VARCHAR(36) NOT NULL,
    S_REMARK VARCHAR(512),
    I_SUMCOUNT INTEGER,
    I_MSGRECORDSRTNO INTEGER,
    I_MSGRECORDENDNO INTEGER,
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    D_RECONCILIATION DATE,
    S_ANSWERFLAG CHAR(1),
    I_CHECKINFOCOUNT INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_H_HVPS713 IS '大额业务明细核对应答报文';
COMMENT ON COLUMN TV_H_HVPS713.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS713.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_H_HVPS713.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS713.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_H_HVPS713.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_H_HVPS713.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_H_HVPS713.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_H_HVPS713.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_H_HVPS713.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_H_HVPS713.S_REMARK IS '备注';
COMMENT ON COLUMN TV_H_HVPS713.I_SUMCOUNT IS '总记录数';
COMMENT ON COLUMN TV_H_HVPS713.I_MSGRECORDSRTNO IS '本报文记录起始序号';
COMMENT ON COLUMN TV_H_HVPS713.I_MSGRECORDENDNO IS '本报文记录截止序号';
COMMENT ON COLUMN TV_H_HVPS713.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_H_HVPS713.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_H_HVPS713.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_H_HVPS713.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_H_HVPS713.S_ANSWERFLAG IS '应答状态';
COMMENT ON COLUMN TV_H_HVPS713.I_CHECKINFOCOUNT IS '对账记录数目';
COMMENT ON COLUMN TV_H_HVPS713.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110654640 ON TV_H_HVPS713(I_MSGSRLNO);

CREATE TABLE TV_H_HVPS713DTL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_MSGTP VARCHAR(36),
    S_TXTYPECODE VARCHAR(10),
    S_SNDREVFLAG CHAR(1),
    S_PROCSTATE VARCHAR(4),
    I_DETAILCOUNT INTEGER,
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    S_PAYDEBLOANFLAG CHAR(4),
    F_AMT DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_H_HVPS713DTL IS '大额业务明细核对应答报文对账明细清单';
COMMENT ON COLUMN TV_H_HVPS713DTL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_H_HVPS713DTL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_H_HVPS713DTL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_MSGTP IS '报文编号';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_SNDREVFLAG IS '接收发送标志';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_H_HVPS713DTL.I_DETAILCOUNT IS '明细总笔数';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_H_HVPS713DTL.S_PAYDEBLOANFLAG IS '支付借贷标识';
COMMENT ON COLUMN TV_H_HVPS713DTL.F_AMT IS '金额';
COMMENT ON COLUMN TV_H_HVPS713DTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110654920 ON TV_H_HVPS713DTL(I_FLOWID);

CREATE TABLE TV_MSGSTADT(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_RECONCILIATION DATE,
    S_SNDREVFLAG CHAR(1),
    S_OLDTRANPRCSTATE VARCHAR(10),
    S_TRANSSERNO VARCHAR(36),
    S_FILENAME VARCHAR(128),
    S_INPUTTYPE CHAR(1),
    S_TRANPRCSTATE VARCHAR(10),
    I_SUMACCOUT INTEGER,
    F_SUMAMT DECIMAL(24,2),
    D_RECKDATE DATE,
    I_SUMCMPSCREEN INTEGER,
    D_SUMCMPDATE DATE,
    S_PROCFLAG CHAR(1),
    S_MSGKINDCODE VARCHAR(32),
    S_SUBMITERCODE VARCHAR(12),
    S_SUBMITERNAME VARCHAR(60),
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID,I_MSGSRLNO)
);

COMMENT ON TABLE TV_MSGSTADT IS '报文状态调整表';
COMMENT ON COLUMN TV_MSGSTADT.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_MSGSTADT.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_MSGSTADT.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_MSGSTADT.S_SNDREVFLAG IS '接收发送标志';
COMMENT ON COLUMN TV_MSGSTADT.S_OLDTRANPRCSTATE IS '原支付处理状态';
COMMENT ON COLUMN TV_MSGSTADT.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TV_MSGSTADT.S_FILENAME IS '文件名';
COMMENT ON COLUMN TV_MSGSTADT.S_INPUTTYPE IS '录入方式';
COMMENT ON COLUMN TV_MSGSTADT.S_TRANPRCSTATE IS '支付处理状态';
COMMENT ON COLUMN TV_MSGSTADT.I_SUMACCOUT IS '合计笔数';
COMMENT ON COLUMN TV_MSGSTADT.F_SUMAMT IS '总金额';
COMMENT ON COLUMN TV_MSGSTADT.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_MSGSTADT.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_MSGSTADT.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_MSGSTADT.S_PROCFLAG IS '处理标志';
COMMENT ON COLUMN TV_MSGSTADT.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_MSGSTADT.S_SUBMITERCODE IS '提交人代码';
COMMENT ON COLUMN TV_MSGSTADT.S_SUBMITERNAME IS '提交人名称';
COMMENT ON COLUMN TV_MSGSTADT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TV_MSGSTADT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TV_MSGSTADT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110728750 ON TV_MSGSTADT(I_FLOWID,I_MSGSRLNO);

CREATE TABLE TV_OUTFINAINDEX(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_FLOWPROCSTATE VARCHAR(10),
    S_FLOWSORTCODE VARCHAR(36),
    D_ACCTDATE DATE,
    I_TOTALSUM INTEGER,
    F_SUMAMT DECIMAL(24,2),
    S_ADJPERFLAG CHAR(1),
    D_VOUDATE DATE,
    S_BIZKNDCODE VARCHAR(7),
    I_ATTACHNUM INTEGER,
    S_DRAWERID VARCHAR(12),
    S_DRAWERNAME VARCHAR(60),
    S_DRAWFLAG CHAR(1),
    S_REVERCODE VARCHAR(12),
    S_REVERNAME VARCHAR(60),
    S_MSGKINDCODE VARCHAR(32),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    TS_DRAWTIME TIMESTAMP,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_OUTFINAINDEX IS '往账资金索引表';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_OUTFINAINDEX.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TV_OUTFINAINDEX.F_SUMAMT IS '总金额';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TV_OUTFINAINDEX.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_DRAWERID IS '领取人代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_DRAWERNAME IS '领取人姓名';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_DRAWFLAG IS '领取标志';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_REVERCODE IS '接收人代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_REVERNAME IS '接收人名称';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TV_OUTFINAINDEX.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TV_OUTFINAINDEX.TS_DRAWTIME IS '领取时间';
COMMENT ON COLUMN TV_OUTFINAINDEX.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110728980 ON TV_OUTFINAINDEX(S_SRLNO);

CREATE TABLE TV_OUTTABLEBIZVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_VOUCHKNDCODE VARCHAR(36) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ACCTNAME VARCHAR(60),
    S_REVPAYFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    S_BRIEF VARCHAR(512),
    S_STATNO VARCHAR(36),
    S_ENDNO VARCHAR(36),
    I_CANCELNUM INTEGER NOT NULL,
    S_CERTPROCSTATE CHAR(1),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCFLAG CHAR(1),
    S_OPPACCTNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TV_OUTTABLEBIZVOUCH IS '表外业务凭证';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_REVPAYFLAG IS '收付标志';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_STATNO IS '起始号';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_ENDNO IS '截止号';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.I_CANCELNUM IS '作废张数';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_ACCFLAG IS '记账标志';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TV_OUTTABLEBIZVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110655450 ON TV_OUTTABLEBIZVOUCH(S_TRANSSERNO);

CREATE TABLE TV_PTL_XML_CONTENT(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELVVOU CLOB,
    S_ELEVOUTIPS CLOB,
    S_ELEENC CLOB,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_PTL_XML_CONTENT IS '电子凭证体';
COMMENT ON COLUMN TV_PTL_XML_CONTENT.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_PTL_XML_CONTENT.S_ELVVOU IS '凭证信息';
COMMENT ON COLUMN TV_PTL_XML_CONTENT.S_ELEVOUTIPS IS '凭证通知信息';
COMMENT ON COLUMN TV_PTL_XML_CONTENT.S_ELEENC IS '凭证加密信息';
COMMENT ON COLUMN TV_PTL_XML_CONTENT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110730920 ON TV_PTL_XML_CONTENT(S_SRLNO);

CREATE TABLE TV_PTL_XML_HEAD(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_APPNAME VARCHAR(60),
    S_APPVERSION VARCHAR(36),
    S_ELEVOUID VARCHAR(100),
    S_VOUID VARCHAR(36),
    S_VOUCHERNO VARCHAR(42),
    S_ELEVOUCNNAME VARCHAR(150),
    D_VOUBIZDATE DATE,
    S_BIZDESC VARCHAR(100),
    S_CANCELREASON VARCHAR(60),
    S_CANCELERCODE VARCHAR(12),
    D_VOUDATE DATE,
    D_RECPTDATE DATE,
    S_ELEVOUKINDCODE VARCHAR(10),
    S_ELEVOUBIZTYPECODE VARCHAR(36),
    S_ELEVOUSENDER VARCHAR(36),
    S_ELEVOUREVER VARCHAR(36),
    S_ELEFILENAME VARCHAR(130),
    S_MSGTYPECODE VARCHAR(32),
    S_RETELEVOUID VARCHAR(36),
    S_RTUELEVOUSERNO VARCHAR(30),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_PTL_XML_HEAD IS '电子凭证头信息';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_APPNAME IS '应用名称';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_APPVERSION IS '应用版本';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_VOUID IS '凭证ID';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEVOUCNNAME IS '电子凭证中文名称';
COMMENT ON COLUMN TV_PTL_XML_HEAD.D_VOUBIZDATE IS '凭证业务日期';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_BIZDESC IS '业务描述';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_CANCELREASON IS '作废原因/退回原因';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_CANCELERCODE IS '作废人/退回人';
COMMENT ON COLUMN TV_PTL_XML_HEAD.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TV_PTL_XML_HEAD.D_RECPTDATE IS '回执日期';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEVOUKINDCODE IS '电子凭证种类代码';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEVOUBIZTYPECODE IS '电子凭证业务类型代码';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEVOUSENDER IS '电子凭证发起方';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEVOUREVER IS '电子凭证接收方';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TV_PTL_XML_HEAD.S_RTUELEVOUSERNO IS '回执电子凭证流水号';
COMMENT ON COLUMN TV_PTL_XML_HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110731150 ON TV_PTL_XML_HEAD(S_SRLNO);

CREATE TABLE TV_PTL_XML_RECVLOG(
    S_SRLNO VARCHAR(36) NOT NULL,
    D_REVDATE DATE,
    I_ELEVOUSEQNUM BIGINT(19),
    S_ELEVOUKINDCODE VARCHAR(10),
    S_ELEVOUBIZTYPECODE VARCHAR(36),
    S_ELEFILENAME VARCHAR(130),
    TS_REVTIME TIMESTAMP,
    S_PROCSTATE VARCHAR(4),
    S_PROCCMT VARCHAR(1024),
    I_PRINTNUM INTEGER,
    S_JOBFLAG CHAR(1),
    S_ADJPERFLAG CHAR(1),
    S_RETGENFLAG CHAR(1),
    S_RETSRLNO VARCHAR(36),
    I_TOTALSUM INTEGER,
    F_SUMAMT DECIMAL(24,2),
    S_FLOWPROCSTATE VARCHAR(10),
    S_FLOWSORTCODE VARCHAR(36),
    S_DRAWFLAG CHAR(1) NOT NULL,
    S_DRAWERID VARCHAR(12),
    S_DRAWERNAME VARCHAR(60),
    TS_DRAWTIME TIMESTAMP,
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_DIRECODE VARCHAR(12),
    S_DIRENAME VARCHAR(60),
    S_NEXTPROCSTATE VARCHAR(10),
    S_ELEVOUID VARCHAR(100) NOT NULL,
    S_ELEVOUSERCONTENTNO VARCHAR(38),
    TS_SYSUPDATE TIMESTAMP,
    S_DATASOURCETYPE VARCHAR(2),
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_PTL_XML_RECVLOG IS '接收电子凭证日志';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.D_REVDATE IS '接收日期';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.I_ELEVOUSEQNUM IS '电子凭证顺序号';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_ELEVOUKINDCODE IS '电子凭证种类代码';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_ELEVOUBIZTYPECODE IS '电子凭证业务类型代码';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.TS_REVTIME IS '接收时间';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_PROCCMT IS '处理说明';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.I_PRINTNUM IS '打印次数';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_JOBFLAG IS '岗位标志';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_RETGENFLAG IS '回执生成标志';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_RETSRLNO IS '原流水号';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.F_SUMAMT IS '总金额';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_DRAWFLAG IS '领取标志';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_DRAWERID IS '领取人代码';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_DRAWERNAME IS '领取人姓名';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.TS_DRAWTIME IS '领取时间';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_DIRECODE IS '主管代码';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_DIRENAME IS '主管名称';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_NEXTPROCSTATE IS '下一步处理状态';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_ELEVOUSERCONTENTNO IS '电子凭证体流水号';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TV_PTL_XML_RECVLOG.S_DATASOURCETYPE IS '数据来源类型';


CREATE UNIQUE INDEX SQL221020110731420 ON TV_PTL_XML_RECVLOG(S_SRLNO);

CREATE TABLE TV_PTL_XML_SENDLOG(
    S_SRLNO VARCHAR(36) NOT NULL,
    D_DATE DATE,
    I_ELEVOUSEQNUM BIGINT(19),
    S_MSGTYPECODE VARCHAR(32),
    S_BIZTYPE VARCHAR(10),
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_MSGNAME VARCHAR(150),
    TS_SENDTIME TIMESTAMP,
    S_PROCSTATE VARCHAR(4),
    S_PROCCMT VARCHAR(1024),
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    I_PRINTNUM INTEGER,
    S_JOBFLAG CHAR(1),
    S_ADJPERFLAG CHAR(1),
    S_RETELEVOUID VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_ELEVOUID VARCHAR(100) NOT NULL,
    S_RTUELEVOUSERNO VARCHAR(30),
    S_ELEFILENAME VARCHAR(130),
    S_ELEVOUSERCONTENTNO VARCHAR(38),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TV_PTL_XML_SENDLOG IS '电子凭证发送日志表';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.D_DATE IS '日期';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.I_ELEVOUSEQNUM IS '电子凭证顺序号';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_BIZTYPE IS '业务类型';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_MSGNAME IS '报文名称';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.TS_SENDTIME IS '发送时间';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_PROCCMT IS '处理说明';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.I_PRINTNUM IS '打印次数';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_JOBFLAG IS '岗位标志';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_REMARK IS '备注';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_RTUELEVOUSERNO IS '回执电子凭证流水号';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.S_ELEVOUSERCONTENTNO IS '电子凭证体流水号';
COMMENT ON COLUMN TV_PTL_XML_SENDLOG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110731700 ON TV_PTL_XML_SENDLOG(S_SRLNO);

CREATE TABLE TV_REVBIZINDEX(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    I_MSGSRLNO BIGINT(19),
    S_MSGKINDCODE VARCHAR(32),
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_AMTPOSTSTATEACCT CHAR(1) NOT NULL,
    S_DTLPOSTSTATEACCT CHAR(1) NOT NULL,
    S_AMTFLOWPROCSTATE VARCHAR(10),
    S_FLOWPROCSTATE VARCHAR(10),
    S_FLOWSORTCODE VARCHAR(36),
    S_DRAWFLAG CHAR(1) NOT NULL,
    S_DRAWERID VARCHAR(12),
    S_DRAWERNAME VARCHAR(60),
    TS_DRAWTIME TIMESTAMP,
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_DIRECODE VARCHAR(12),
    S_DIRENAME VARCHAR(60),
    S_NEXTPROCSTATE VARCHAR(10),
    S_PROCFLAG CHAR(1) NOT NULL,
    S_ERRMSG VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TV_REVBIZINDEX IS '来账业务索引表';
COMMENT ON COLUMN TV_REVBIZINDEX.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TV_REVBIZINDEX.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_REVBIZINDEX.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_REVBIZINDEX.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_REVBIZINDEX.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_REVBIZINDEX.S_AMTPOSTSTATEACCT IS '资金岗记账状态';
COMMENT ON COLUMN TV_REVBIZINDEX.S_DTLPOSTSTATEACCT IS '明细岗记账状态';
COMMENT ON COLUMN TV_REVBIZINDEX.S_AMTFLOWPROCSTATE IS '资金岗流程处理状态';
COMMENT ON COLUMN TV_REVBIZINDEX.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TV_REVBIZINDEX.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TV_REVBIZINDEX.S_DRAWFLAG IS '领取标志';
COMMENT ON COLUMN TV_REVBIZINDEX.S_DRAWERID IS '领取人代码';
COMMENT ON COLUMN TV_REVBIZINDEX.S_DRAWERNAME IS '领取人姓名';
COMMENT ON COLUMN TV_REVBIZINDEX.TS_DRAWTIME IS '领取时间';
COMMENT ON COLUMN TV_REVBIZINDEX.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TV_REVBIZINDEX.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TV_REVBIZINDEX.S_DIRECODE IS '主管代码';
COMMENT ON COLUMN TV_REVBIZINDEX.S_DIRENAME IS '主管名称';
COMMENT ON COLUMN TV_REVBIZINDEX.S_NEXTPROCSTATE IS '下一步处理状态';
COMMENT ON COLUMN TV_REVBIZINDEX.S_PROCFLAG IS '处理标志';
COMMENT ON COLUMN TV_REVBIZINDEX.S_ERRMSG IS '错误信息';
COMMENT ON COLUMN TV_REVBIZINDEX.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110729230 ON TV_REVBIZINDEX(S_TRANSSERNO);

CREATE TABLE TV_REVMSGINDEX(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_MSGKINDCODE VARCHAR(32) NOT NULL,
    S_MSGVER VARCHAR(10) NOT NULL,
    D_ENTRUSTDATE DATE,
    D_ACCTDATE DATE NOT NULL,
    S_PROCFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    I_SUMCOUNT INTEGER NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    S_BIZKNDCODE VARCHAR(7),
    S_SNDRECKBANKNO VARCHAR(18) NOT NULL,
    S_SNDRECKBANKNAME VARCHAR(60),
    S_REVRECKBANKNO VARCHAR(18) NOT NULL,
    S_REVRECKBANKNAME VARCHAR(60),
    S_REVBANKNO VARCHAR(18),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_MMBANKNO VARCHAR(18),
    S_MSGTYPECODE VARCHAR(32),
    D_SUMCMPDATE DATE,
    I_SUMCMPSCREEN INTEGER,
    S_SUMCMPNODETYPE CHAR(1),
    S_TXTYPECODE VARCHAR(10),
    S_INACCPROCSTATE VARCHAR(10),
    S_INACCPROCTYPE CHAR(1),
    D_RECKDATE DATE,
    S_SYSTEMNO VARCHAR(36) NOT NULL,
    S_TRANPRCSTATE VARCHAR(10),
    S_COMMUNMSGNO VARCHAR(30),
    S_CHKSIGNFLAG CHAR(1),
    S_CURCODE VARCHAR(10),
    S_SNDBNKPAYBNKNO VARCHAR(18),
    S_REISUEFLAG CHAR(1) NOT NULL,
    S_EXCPAYFLAG CHAR(1),
    S_DEBTCREDTFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_REVMSGINDEX IS '来账报文索引表';
COMMENT ON COLUMN TV_REVMSGINDEX.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_REVMSGINDEX.S_MSGVER IS '报文版本号';
COMMENT ON COLUMN TV_REVMSGINDEX.D_ENTRUSTDATE IS '委托日期';
COMMENT ON COLUMN TV_REVMSGINDEX.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_REVMSGINDEX.S_PROCFLAG IS '处理标志';
COMMENT ON COLUMN TV_REVMSGINDEX.F_AMT IS '金额';
COMMENT ON COLUMN TV_REVMSGINDEX.I_SUMCOUNT IS '总记录数';
COMMENT ON COLUMN TV_REVMSGINDEX.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_REVMSGINDEX.S_SNDRECKBANKNO IS '发起清算行行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_SNDRECKBANKNAME IS '发起清算行名称';
COMMENT ON COLUMN TV_REVMSGINDEX.S_REVRECKBANKNO IS '接收清算行行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_REVRECKBANKNAME IS '接收清算行名称';
COMMENT ON COLUMN TV_REVMSGINDEX.S_REVBANKNO IS '接收行行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_REVMSGINDEX.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TV_REVMSGINDEX.S_MMBANKNO IS '特许参与者发起行行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TV_REVMSGINDEX.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_REVMSGINDEX.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_REVMSGINDEX.S_SUMCMPNODETYPE IS '轧差节点类型';
COMMENT ON COLUMN TV_REVMSGINDEX.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_REVMSGINDEX.S_INACCPROCSTATE IS '来账账务处理状态';
COMMENT ON COLUMN TV_REVMSGINDEX.S_INACCPROCTYPE IS '来账处理方式';
COMMENT ON COLUMN TV_REVMSGINDEX.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_REVMSGINDEX.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_TRANPRCSTATE IS '支付处理状态';
COMMENT ON COLUMN TV_REVMSGINDEX.S_COMMUNMSGNO IS '通信级标识号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_CHKSIGNFLAG IS '验签核押标志';
COMMENT ON COLUMN TV_REVMSGINDEX.S_CURCODE IS '货币代码';
COMMENT ON COLUMN TV_REVMSGINDEX.S_SNDBNKPAYBNKNO IS '发起行支付行号';
COMMENT ON COLUMN TV_REVMSGINDEX.S_REISUEFLAG IS '补发标志';
COMMENT ON COLUMN TV_REVMSGINDEX.S_EXCPAYFLAG IS '异常支付标志';
COMMENT ON COLUMN TV_REVMSGINDEX.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TV_REVMSGINDEX.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110729590 ON TV_REVMSGINDEX(I_MSGSRLNO);

CREATE TABLE TV_S_SAPS603(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE,
    S_MSGID VARCHAR(35),
    S_INSTGDRCTORG VARCHAR(14),
    TS_MSGSNDTIME TIMESTAMP,
    I_SUMCMPSCREEN INTEGER NOT NULL,
    S_NETGTP VARCHAR(4),
    S_MMBANKNO VARCHAR(18),
    S_PRTRY VARCHAR(35),
    F_AMT DECIMAL(24,2),
    S_CURCODE VARCHAR(10),
    S_PAYDEBLOANFLAG CHAR(4),
    D_NPCRECKDATE DATE,
    F_CREDTAMT DECIMAL(24,2),
    F_DEBTAMT DECIMAL(24,2),
    F_NETAMT DECIMAL(24,2),
    S_ENTRYCURCODE VARCHAR(3),
    S_ENTRYCDTDBTIND VARCHAR(4),
    S_STATUS VARCHAR(4),
    D_SUMCMPDATE DATE NOT NULL,
    D_RECKDATE DATE NOT NULL,
    S_DOMAINCD VARCHAR(4),
    S_FAMILYCD VARCHAR(4),
    S_SUBFAMILYCD VARCHAR(4),
    S_CLRSYSREF VARCHAR(35),
    S_DGTSGNTR VARCHAR(2048),
    S_CHKSIGNFLAG CHAR(1),
    S_MSGPRCSTS VARCHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_S_SAPS603 IS '小额/网银净额清算通知报文';
COMMENT ON COLUMN TV_S_SAPS603.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS603.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS603.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS603.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS603.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_S_SAPS603.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_S_SAPS603.S_NETGTP IS '轧差类型';
COMMENT ON COLUMN TV_S_SAPS603.S_MMBANKNO IS '特许参与者发起行行号';
COMMENT ON COLUMN TV_S_SAPS603.S_PRTRY IS '所有者';
COMMENT ON COLUMN TV_S_SAPS603.F_AMT IS '金额';
COMMENT ON COLUMN TV_S_SAPS603.S_CURCODE IS '货币代码';
COMMENT ON COLUMN TV_S_SAPS603.S_PAYDEBLOANFLAG IS '支付借贷标识';
COMMENT ON COLUMN TV_S_SAPS603.D_NPCRECKDATE IS 'NPC清算日期/终态日期';
COMMENT ON COLUMN TV_S_SAPS603.F_CREDTAMT IS '贷方发生额';
COMMENT ON COLUMN TV_S_SAPS603.F_DEBTAMT IS '借方发生额';
COMMENT ON COLUMN TV_S_SAPS603.F_NETAMT IS '轧差净额';
COMMENT ON COLUMN TV_S_SAPS603.S_ENTRYCURCODE IS '轧差净额货币代码';
COMMENT ON COLUMN TV_S_SAPS603.S_ENTRYCDTDBTIND IS '轧差净额借贷标志';
COMMENT ON COLUMN TV_S_SAPS603.S_STATUS IS '状态(二代)';
COMMENT ON COLUMN TV_S_SAPS603.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_S_SAPS603.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_S_SAPS603.S_DOMAINCD IS '域代码';
COMMENT ON COLUMN TV_S_SAPS603.S_FAMILYCD IS '家族代码';
COMMENT ON COLUMN TV_S_SAPS603.S_SUBFAMILYCD IS '子家族代码';
COMMENT ON COLUMN TV_S_SAPS603.S_CLRSYSREF IS '清算系统参考';
COMMENT ON COLUMN TV_S_SAPS603.S_DGTSGNTR IS '数字签名';
COMMENT ON COLUMN TV_S_SAPS603.S_CHKSIGNFLAG IS '验签核押标志';
COMMENT ON COLUMN TV_S_SAPS603.S_MSGPRCSTS IS '报文处理状态';
COMMENT ON COLUMN TV_S_SAPS603.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110655900 ON TV_S_SAPS603(I_MSGSRLNO);

CREATE TABLE TV_S_SAPS604(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_ORIMSGID VARCHAR(36),
    S_ORIINSTORG VARCHAR(14),
    S_ORIMSGTPCODE VARCHAR(35),
    S_NPCPROCSTATE VARCHAR(4),
    S_NPCPROCCODE VARCHAR(8),
    S_NPCRSNINFO VARCHAR(512),
    D_NPCNETGDATE DATE,
    I_NPCNETGSCREEN INTEGER,
    D_NPCRECKDATE DATE,
    TS_NPCREVTMS TIMESTAMP,
    TS_NPCFORWARDTMS TIMESTAMP,
    F_CURRAMT DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_S_SAPS604 IS '清算回执报文';
COMMENT ON COLUMN TV_S_SAPS604.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS604.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS604.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS604.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_S_SAPS604.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS604.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_S_SAPS604.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_S_SAPS604.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_S_SAPS604.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_S_SAPS604.S_REMARK IS '备注';
COMMENT ON COLUMN TV_S_SAPS604.S_ORIMSGID IS '原报文标识号';
COMMENT ON COLUMN TV_S_SAPS604.S_ORIINSTORG IS '原发起参与机构';
COMMENT ON COLUMN TV_S_SAPS604.S_ORIMSGTPCODE IS '原报文类型';
COMMENT ON COLUMN TV_S_SAPS604.S_NPCPROCSTATE IS 'NPC处理状态';
COMMENT ON COLUMN TV_S_SAPS604.S_NPCPROCCODE IS 'NPC处理码';
COMMENT ON COLUMN TV_S_SAPS604.S_NPCRSNINFO IS 'NPC拒绝信息';
COMMENT ON COLUMN TV_S_SAPS604.D_NPCNETGDATE IS 'NPC轧差日期';
COMMENT ON COLUMN TV_S_SAPS604.I_NPCNETGSCREEN IS 'NPC轧差场次';
COMMENT ON COLUMN TV_S_SAPS604.D_NPCRECKDATE IS 'NPC清算日期/终态日期';
COMMENT ON COLUMN TV_S_SAPS604.TS_NPCREVTMS IS 'NPC接收时间';
COMMENT ON COLUMN TV_S_SAPS604.TS_NPCFORWARDTMS IS 'NPC转发时间';
COMMENT ON COLUMN TV_S_SAPS604.F_CURRAMT IS '当前余额';
COMMENT ON COLUMN TV_S_SAPS604.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110656230 ON TV_S_SAPS604(I_MSGSRLNO);

CREATE TABLE TV_S_SAPS733(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    I_SUMCOUNT INTEGER,
    I_MSGRECORDSRTNO INTEGER,
    I_MSGRECORDENDNO INTEGER,
    D_WORKDATE DATE,
    I_DTLCOUNT INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_S_SAPS733 IS '日终账务数据下载报文';
COMMENT ON COLUMN TV_S_SAPS733.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS733.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS733.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS733.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_S_SAPS733.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS733.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_S_SAPS733.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_S_SAPS733.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_S_SAPS733.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_S_SAPS733.S_REMARK IS '备注';
COMMENT ON COLUMN TV_S_SAPS733.I_SUMCOUNT IS '总记录数';
COMMENT ON COLUMN TV_S_SAPS733.I_MSGRECORDSRTNO IS '本报文记录起始序号';
COMMENT ON COLUMN TV_S_SAPS733.I_MSGRECORDENDNO IS '本报文记录截止序号';
COMMENT ON COLUMN TV_S_SAPS733.D_WORKDATE IS '工作日期';
COMMENT ON COLUMN TV_S_SAPS733.I_DTLCOUNT IS '明细数目';
COMMENT ON COLUMN TV_S_SAPS733.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110656470 ON TV_S_SAPS733(I_MSGSRLNO);

CREATE TABLE TV_S_SAPS733DETAIL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_ACCTSBTTYPE CHAR(4),
    S_ACCTNO VARCHAR(36),
    F_DAYSTATBALNC DECIMAL(24,2),
    F_DAYENDBALNC DECIMAL(24,2),
    F_DEBTAMT DECIMAL(24,2),
    F_CREDTAMT DECIMAL(24,2),
    F_HVPSDEBAMT DECIMAL(24,2),
    F_HVPSCREDAMT DECIMAL(24,2),
    F_BEPSDEBAMT DECIMAL(24,2),
    F_BEPSCREDAMT DECIMAL(24,2),
    F_IBPSDEBAMT DECIMAL(24,2),
    F_IBPSCREDAMT DECIMAL(24,2),
    F_NNPMTDEBAMT DECIMAL(24,2),
    F_NNPMTCREDAMT DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_S_SAPS733DETAIL IS '日终账务数据下载报文明细';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.S_ACCTSBTTYPE IS '账户科目类型';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.S_ACCTNO IS '账号';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_DAYSTATBALNC IS '日初余额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_DAYENDBALNC IS '日终余额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_DEBTAMT IS '借方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_CREDTAMT IS '贷方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_HVPSDEBAMT IS '清算账户大额业务借方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_HVPSCREDAMT IS '清算账户大额业务贷方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_BEPSDEBAMT IS '清算账户小额业务借方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_BEPSCREDAMT IS '清算账户小额业务贷方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_IBPSDEBAMT IS '清算账户网银业务借方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_IBPSCREDAMT IS '清算账户网银业务贷方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_NNPMTDEBAMT IS '不涉及支付往来的借方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.F_NNPMTCREDAMT IS '不涉及支付往来的贷方发生额';
COMMENT ON COLUMN TV_S_SAPS733DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110656780 ON TV_S_SAPS733DETAIL(I_FLOWID);

CREATE TABLE TV_S_SAPS734(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14) NOT NULL,
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_ACCTNO VARCHAR(36),
    F_YEARSTATBALNC DECIMAL(24,2),
    F_CURRYEARDEBAMT DECIMAL(24,2),
    F_CURRYEARCREDAMT DECIMAL(24,2),
    F_YEARENDBALNC DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_S_SAPS734 IS '年终账户账务数据下载报文';
COMMENT ON COLUMN TV_S_SAPS734.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS734.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS734.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS734.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_S_SAPS734.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS734.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_S_SAPS734.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_S_SAPS734.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_S_SAPS734.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_S_SAPS734.S_REMARK IS '备注';
COMMENT ON COLUMN TV_S_SAPS734.S_ACCTNO IS '账号';
COMMENT ON COLUMN TV_S_SAPS734.F_YEARSTATBALNC IS '年初余额';
COMMENT ON COLUMN TV_S_SAPS734.F_CURRYEARDEBAMT IS '本年借方发生额';
COMMENT ON COLUMN TV_S_SAPS734.F_CURRYEARCREDAMT IS '本年贷方发生额';
COMMENT ON COLUMN TV_S_SAPS734.F_YEARENDBALNC IS '年终余额';
COMMENT ON COLUMN TV_S_SAPS734.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110657080 ON TV_S_SAPS734(I_MSGSRLNO);

CREATE TABLE TV_S_SAPS735(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    TS_MSGSNDTIME TIMESTAMP NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_INSTORG VARCHAR(14),
    S_INSTDDRCTORG VARCHAR(14),
    S_REVINVORG VARCHAR(14),
    S_SYSTEMNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    I_SUMCOUNT INTEGER,
    I_MSGRECORDSRTNO INTEGER,
    I_MSGRECORDENDNO INTEGER,
    D_RECONCILIATION DATE,
    I_ACCTCOUNT INTEGER,
    S_ACCTSBTTYPE CHAR(4),
    S_ACCTNO VARCHAR(36),
    I_ACCDTLCOUNT INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_S_SAPS735 IS '账户账务明细下载报文';
COMMENT ON COLUMN TV_S_SAPS735.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS735.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS735.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS735.TS_MSGSNDTIME IS '报文发送时间';
COMMENT ON COLUMN TV_S_SAPS735.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS735.S_INSTORG IS '发起参与机构';
COMMENT ON COLUMN TV_S_SAPS735.S_INSTDDRCTORG IS '接收直接参与机构';
COMMENT ON COLUMN TV_S_SAPS735.S_REVINVORG IS '接收参与机构';
COMMENT ON COLUMN TV_S_SAPS735.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_S_SAPS735.S_REMARK IS '备注';
COMMENT ON COLUMN TV_S_SAPS735.I_SUMCOUNT IS '总记录数';
COMMENT ON COLUMN TV_S_SAPS735.I_MSGRECORDSRTNO IS '本报文记录起始序号';
COMMENT ON COLUMN TV_S_SAPS735.I_MSGRECORDENDNO IS '本报文记录截止序号';
COMMENT ON COLUMN TV_S_SAPS735.D_RECONCILIATION IS '对账日期';
COMMENT ON COLUMN TV_S_SAPS735.I_ACCTCOUNT IS '账户数目';
COMMENT ON COLUMN TV_S_SAPS735.S_ACCTSBTTYPE IS '账户科目类型';
COMMENT ON COLUMN TV_S_SAPS735.S_ACCTNO IS '账号';
COMMENT ON COLUMN TV_S_SAPS735.I_ACCDTLCOUNT IS '记账明细数目';
COMMENT ON COLUMN TV_S_SAPS735.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110657420 ON TV_S_SAPS735(I_MSGSRLNO);

CREATE TABLE TV_S_SAPS735DTL(
    I_FLOWID BIGINT(19) NOT NULL,
    I_MSGSRLNO BIGINT(19) NOT NULL,
    D_ACEPTDATE DATE NOT NULL,
    S_MSGID VARCHAR(35) NOT NULL,
    S_INSTGDRCTORG VARCHAR(14),
    S_MSGTP VARCHAR(36),
    S_SNDBNKNO VARCHAR(18),
    D_ENTRUSTSUMCMPDATE DATE,
    S_SUMCMPSCRMSGID VARCHAR(35),
    S_TXTYPECODE VARCHAR(10),
    S_CTGYPURPCODE VARCHAR(10) NOT NULL,
    S_DEBRCKBNKNO VARCHAR(18),
    S_CREDRCKBNKNO VARCHAR(18),
    S_PAYDEBLOANFLAG CHAR(4),
    F_OCCURAMT DECIMAL(24,2),
    S_OCCURAMTPLUSFLAG CHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TV_S_SAPS735DTL IS '账户账务明细下载报文明细';
COMMENT ON COLUMN TV_S_SAPS735DTL.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TV_S_SAPS735DTL.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_S_SAPS735DTL.D_ACEPTDATE IS '受理日期';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_INSTGDRCTORG IS '发起直接参与机构';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_MSGTP IS '报文编号';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_SNDBNKNO IS '发起行行号/系统';
COMMENT ON COLUMN TV_S_SAPS735DTL.D_ENTRUSTSUMCMPDATE IS '委托日期/轧差日期';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_SUMCMPSCRMSGID IS '报文标识号/轧差场次';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_DEBRCKBNKNO IS '借记清算行行号';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_CREDRCKBNKNO IS '贷记清算行行号';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_PAYDEBLOANFLAG IS '支付借贷标识';
COMMENT ON COLUMN TV_S_SAPS735DTL.F_OCCURAMT IS '发生额';
COMMENT ON COLUMN TV_S_SAPS735DTL.S_OCCURAMTPLUSFLAG IS '发生额正负标志';
COMMENT ON COLUMN TV_S_SAPS735DTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110657650 ON TV_S_SAPS735DTL(I_FLOWID);

CREATE TABLE TV_SNDBIZINDEX(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BIZKNDNAME VARCHAR(60),
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_FLOWPROCSTATE VARCHAR(10) NOT NULL,
    S_AMTPOSTSTATEACCT CHAR(1),
    S_DTLPOSTSTATEACCT CHAR(1),
    S_AMTPOSTRESVFLAG CHAR(1),
    I_TOTALSUM INTEGER NOT NULL,
    F_SUMAMT DECIMAL(24,2) NOT NULL,
    F_SUBAMT DECIMAL(24,2) NOT NULL,
    S_INPUTTYPE CHAR(1) NOT NULL,
    S_DRAWFLAG CHAR(1) NOT NULL,
    S_DRAWERID VARCHAR(12),
    S_DRAWERNAME VARCHAR(60),
    TS_DRAWTIME TIMESTAMP,
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_DIRECODE VARCHAR(12),
    S_DIRENAME VARCHAR(60),
    S_NEXTPROCSTATE VARCHAR(10),
    S_PROCSTATE VARCHAR(4),
    S_PROCCMT VARCHAR(1024),
    S_ADJPERFLAG CHAR(1),
    S_PAYPSNFULNAME VARCHAR(60),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_BIZTIMETYPECODE VARCHAR(36),
    D_ACCTDATE DATE NOT NULL,
    I_ATTACHNUM INTEGER,
    D_VOUDATE DATE,
    S_PAYTYPEFLAG CHAR(1),
    S_PROXYBANKCODE VARCHAR(36),
    S_VOUNO VARCHAR(42),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO,S_BIZKNDCODE)
);

COMMENT ON TABLE TV_SNDBIZINDEX IS '往账业务索引表';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_SRLNO IS '流水号';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_BIZKNDNAME IS '业务种类名称';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_AMTPOSTSTATEACCT IS '资金岗记账状态';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_DTLPOSTSTATEACCT IS '明细岗记账状态';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_AMTPOSTRESVFLAG IS '资金岗接收状态';
COMMENT ON COLUMN TV_SNDBIZINDEX.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TV_SNDBIZINDEX.F_SUMAMT IS '总金额';
COMMENT ON COLUMN TV_SNDBIZINDEX.F_SUBAMT IS '差额';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_INPUTTYPE IS '录入方式';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_DRAWFLAG IS '领取标志';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_DRAWERID IS '领取人代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_DRAWERNAME IS '领取人姓名';
COMMENT ON COLUMN TV_SNDBIZINDEX.TS_DRAWTIME IS '领取时间';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_DIRECODE IS '主管代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_DIRENAME IS '主管名称';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_NEXTPROCSTATE IS '下一步处理状态';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PROCCMT IS '处理说明';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_BIZTIMETYPECODE IS '业务期间类型代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_SNDBIZINDEX.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TV_SNDBIZINDEX.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TV_SNDBIZINDEX.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TV_SNDBIZINDEX.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110729980 ON TV_SNDBIZINDEX(S_SRLNO,S_BIZKNDCODE);

CREATE TABLE TV_SNDMSGINDEX(
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_MSGKINDCODE VARCHAR(32),
    S_MSGVER VARCHAR(10),
    S_TELEOBLIGATE VARCHAR(3),
    S_LOCALNOTEFLAG CHAR(1),
    S_RECKNOTEFLAG CHAR(1),
    S_NPCPROCCODE VARCHAR(8),
    S_NODEORGCODE VARCHAR(14),
    S_NPCREVFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    I_SUMCOUNT INTEGER,
    S_BIZSRLNO VARCHAR(36),
    S_BIZKNDCODE VARCHAR(7),
    S_TXTYPECODE VARCHAR(10),
    S_SNDRECKBANKNO VARCHAR(18),
    S_REVRECKBANKNO VARCHAR(18),
    S_REVBANKNO VARCHAR(18),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_MMBANKNO VARCHAR(18),
    D_SUMCMPDATE DATE,
    I_SUMCMPSCREEN INTEGER,
    S_MSGTYPECODE VARCHAR(32),
    S_MSGID VARCHAR(35),
    D_ENTRUSTDATE DATE,
    D_RECKDATE DATE,
    S_PAYERNAME VARCHAR(256),
    S_PAYERACCTNO VARCHAR(32),
    S_SYSTEMNO VARCHAR(36),
    S_TRANPRCSTATE VARCHAR(10),
    S_PROCSTATE VARCHAR(4),
    S_COMMUNMSGNO VARCHAR(30),
    S_PAYSENDFLAG CHAR(1),
    S_TRANSID VARCHAR(36),
    S_SUMCMPNODETYPE CHAR(1),
    S_REISUEFLAG CHAR(1),
    I_PRINTNUM INTEGER,
    S_EXCRESERVEFLAG CHAR(1),
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_DIRECODE VARCHAR(12),
    S_DIRENAME VARCHAR(60),
    D_EXPORTDATE DATE,
    I_EXPORTNUM INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_MSGSRLNO)
);

COMMENT ON TABLE TV_SNDMSGINDEX IS '往账报文索引表';
COMMENT ON COLUMN TV_SNDMSGINDEX.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_MSGVER IS '报文版本号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_TELEOBLIGATE IS '报文预留号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_LOCALNOTEFLAG IS '本地记账标志';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_RECKNOTEFLAG IS '清算记账标志';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_NPCPROCCODE IS 'NPC处理码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_NODEORGCODE IS '网点机构代码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_NPCREVFLAG IS 'NPC接收标志';
COMMENT ON COLUMN TV_SNDMSGINDEX.F_AMT IS '金额';
COMMENT ON COLUMN TV_SNDMSGINDEX.I_SUMCOUNT IS '总记录数';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_BIZSRLNO IS '业务流水号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_SNDRECKBANKNO IS '发起清算行行号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_REVRECKBANKNO IS '接收清算行行号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_REVBANKNO IS '接收行行号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_MMBANKNO IS '特许参与者发起行行号';
COMMENT ON COLUMN TV_SNDMSGINDEX.D_SUMCMPDATE IS '轧差日期';
COMMENT ON COLUMN TV_SNDMSGINDEX.I_SUMCMPSCREEN IS '轧差场次';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TV_SNDMSGINDEX.D_ENTRUSTDATE IS '委托日期';
COMMENT ON COLUMN TV_SNDMSGINDEX.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_SYSTEMNO IS '系统编号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_TRANPRCSTATE IS '支付处理状态';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_COMMUNMSGNO IS '通信级标识号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_PAYSENDFLAG IS '支付报文发送标志';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_TRANSID IS '交易标识号';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_SUMCMPNODETYPE IS '轧差节点类型';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_REISUEFLAG IS '补发标志';
COMMENT ON COLUMN TV_SNDMSGINDEX.I_PRINTNUM IS '打印次数';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_EXCRESERVEFLAG IS '异常暂留标志';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_DIRECODE IS '主管代码';
COMMENT ON COLUMN TV_SNDMSGINDEX.S_DIRENAME IS '主管名称';
COMMENT ON COLUMN TV_SNDMSGINDEX.D_EXPORTDATE IS '导出日期';
COMMENT ON COLUMN TV_SNDMSGINDEX.I_EXPORTNUM IS '导出批次';
COMMENT ON COLUMN TV_SNDMSGINDEX.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110730360 ON TV_SNDMSGINDEX(I_MSGSRLNO);

CREATE TABLE TV_VOUCHER2301DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42),
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_EXPFUNCCODE VARCHAR(42) NOT NULL,
    S_CZ_EXPFUNCNAME VARCHAR(120) NOT NULL,
    S_CZ_EXPECOCODE VARCHAR(42) NOT NULL,
    S_CZ_EXPECONAME VARCHAR(120) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_PROCATNAME VARCHAR(60) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PAYSUMMARYNAME VARCHAR(200),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2301DETAIL IS '申请划款报文明细信息_2301';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_EXPFUNCCODE IS '财政_支出功能分类科目编码';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_EXPFUNCNAME IS '财政_支出功能分类科目名称';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_EXPECOCODE IS '财政_支出经济分类科目编码';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_EXPECONAME IS '财政_支出经济分类科目名称';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_PROCATNAME IS '财政_收支管理名称';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_PAYSUMMARYNAME IS '财政_用途名称';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2301DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110732900 ON TV_VOUCHER2301DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER2301HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_TRECODE VARCHAR(10) NOT NULL,
    S_CZ_FINORGCODE VARCHAR(12) NOT NULL,
    S_CZ_BGTTYPECODE VARCHAR(42),
    S_CZ_BGTTYPENAME VARCHAR(60),
    S_CZ_FUNDTYPECODE VARCHAR(42),
    S_CZ_FUNDTYPENAME VARCHAR(60),
    S_CZ_PAYTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_AGENTACCTNO VARCHAR(42) NOT NULL,
    S_CZ_AGENTACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_AGENTACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_CLEARACCTNO VARCHAR(60) NOT NULL,
    S_CZ_CLEARACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARACCTBANKNAME VARCHAR(200) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMTSUM DECIMAL(24,2) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PAYBANKNO VARCHAR(42) NOT NULL,
    S_CZ_REMARK VARCHAR(255),
    S_CZ_MONEYCORPCODE VARCHAR(14),
    S_CZ_XPAYSNDBNKNO VARCHAR(14),
    S_CZ_XADDWORD VARCHAR(60),
    D_CZ_XCLEARDATE DATE,
    F_CZ_XPAYAMT DECIMAL(24,2),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2301HEAD IS '申请划款报文主单信息_2301';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_TRECODE IS '财政_国库主体代码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_FINORGCODE IS '财政_财政机关代码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_BGTTYPECODE IS '财政_预算类型编码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_BGTTYPENAME IS '财政_预算类型名称';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_FUNDTYPECODE IS '财政_资金性质编码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_FUNDTYPENAME IS '财政_资金性质名称';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_PAYTYPECODE IS '财政_支付方式编码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_PAYTYPENAME IS '财政_支付方式名称';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_AGENTACCTNO IS '财政_收款银行账号';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_AGENTACCTNAME IS '财政_收款银行账户名称';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_AGENTACCTBANKNAME IS '财政_收款银行';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_CLEARACCTNO IS '财政_付款账号';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_CLEARACCTNAME IS '财政_付款账户名称';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_CLEARACCTBANKNAME IS '财政_付款银行';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.F_CZ_PAYAMTSUM IS '财政_总金额';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_PAYBANKNO IS '财政_代理银行行号';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_MONEYCORPCODE IS '财政_金融机构编码';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_XPAYSNDBNKNO IS '财政_支付发起行行号';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_XADDWORD IS '财政_附言';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.D_CZ_XCLEARDATE IS '财政_清算日期';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.F_CZ_XPAYAMT IS '财政_实际金额';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2301HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110733180 ON TV_VOUCHER2301HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2302DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42),
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_EXPFUNCCODE VARCHAR(42) NOT NULL,
    S_CZ_EXPFUNCNAME VARCHAR(120) NOT NULL,
    S_CZ_EXPECOCODE VARCHAR(42),
    S_CZ_EXPECONAME VARCHAR(120),
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_PROCATNAME VARCHAR(60) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PAYSUMMARYNAME VARCHAR(200),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2302DETAIL IS '申请划款报文明细信息_2302';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_EXPFUNCCODE IS '财政_支出功能分类科目编码';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_EXPFUNCNAME IS '财政_支出功能分类科目名称';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_EXPECOCODE IS '财政_支出经济分类科目编码';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_EXPECONAME IS '财政_支出经济分类科目名称';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_PROCATNAME IS '财政_收支管理名称';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_PAYSUMMARYNAME IS '财政_用途名称';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2302DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110733400 ON TV_VOUCHER2302DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER2302HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_TRECODE VARCHAR(10) NOT NULL,
    S_CZ_FINORGCODE VARCHAR(12) NOT NULL,
    S_CZ_BGTTYPECODE VARCHAR(42),
    S_CZ_BGTTYPENAME VARCHAR(60),
    S_CZ_FUNDTYPECODE VARCHAR(42),
    S_CZ_FUNDTYPENAME VARCHAR(60),
    S_CZ_PAYTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_AGENTACCTNO VARCHAR(42) NOT NULL,
    S_CZ_AGENTACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_AGENTACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_CLEARACCTNO VARCHAR(60) NOT NULL,
    S_CZ_CLEARACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARACCTBANKNAME VARCHAR(200) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMTSUM DECIMAL(24,2) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PAYBANKNO VARCHAR(42) NOT NULL,
    S_CZ_REMARK VARCHAR(255),
    S_CZ_MONEYCORPCODE VARCHAR(14),
    S_CZ_XPAYSNDBNKNO VARCHAR(14),
    S_CZ_XADDWORD VARCHAR(60),
    D_CZ_XCLEARDATE DATE,
    F_CZ_XPAYAMT DECIMAL(24,2),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2302HEAD IS '申请退款报文主单信息_2302';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_TRECODE IS '财政_国库主体代码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_FINORGCODE IS '财政_财政机关代码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_BGTTYPECODE IS '财政_预算类型编码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_BGTTYPENAME IS '财政_预算类型名称';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_FUNDTYPECODE IS '财政_资金性质编码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_FUNDTYPENAME IS '财政_资金性质名称';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_PAYTYPECODE IS '财政_支付方式编码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_PAYTYPENAME IS '财政_支付方式名称';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_AGENTACCTNO IS '财政_收款银行账号';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_AGENTACCTNAME IS '财政_收款银行账户名称';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_AGENTACCTBANKNAME IS '财政_收款银行';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_CLEARACCTNO IS '财政_付款账号';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_CLEARACCTNAME IS '财政_付款账户名称';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_CLEARACCTBANKNAME IS '财政_付款银行';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.F_CZ_PAYAMTSUM IS '财政_总金额';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_PAYBANKNO IS '财政_代理银行行号';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_MONEYCORPCODE IS '财政_金融机构编码';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_XPAYSNDBNKNO IS '财政_支付发起行行号';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_XADDWORD IS '财政_附言';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.D_CZ_XCLEARDATE IS '财政_清算日期';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.F_CZ_XPAYAMT IS '财政_实际金额';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2302HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110733720 ON TV_VOUCHER2302HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2306DETAIL(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_BUDSUBJECTCODE VARCHAR(42) NOT NULL,
    S_CZ_BUDSUBJECTNAME VARCHAR(120) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID,S_CZ_DETAILID)
);

COMMENT ON TABLE TV_VOUCHER2306DETAIL IS '非税报文明细信息_2306';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_BUDSUBJECTCODE IS '财政_预算科目代码';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_BUDSUBJECTNAME IS '财政_预算科目名称';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2306DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110733890 ON TV_VOUCHER2306DETAIL(S_CZ_ID,S_CZ_DETAILID);

CREATE TABLE TV_VOUCHER2306HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_AGENTACCTNO VARCHAR(42) NOT NULL,
    S_CZ_AGENTACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_AGENTACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_CLEARACCTNO VARCHAR(60) NOT NULL,
    S_CZ_CLEARACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMTSUM DECIMAL(24,2) NOT NULL,
    S_CZ_PAYSUMMARYNAME VARCHAR(200),
    S_CZ_REMARK VARCHAR(255),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2306HEAD IS '非税报文主单信息_2306';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_AGENTACCTNO IS '财政_收款银行账号';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_AGENTACCTNAME IS '财政_收款银行账户名称';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_AGENTACCTBANKNAME IS '财政_收款银行';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_CLEARACCTNO IS '财政_付款账号';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_CLEARACCTNAME IS '财政_付款账户名称';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_CLEARACCTBANKNAME IS '财政_付款银行';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.F_CZ_PAYAMTSUM IS '财政_总金额';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_PAYSUMMARYNAME IS '财政_用途名称';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2306HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110734140 ON TV_VOUCHER2306HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2391DETAIL(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_CLEARACCTNO VARCHAR(60) NOT NULL,
    S_CZ_CLEARACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_PAYBANKNO VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPE VARCHAR(2) NOT NULL,
    S_CZ_AGENTACCTNAME VARCHAR(120),
    S_CZ_AGENTACCTBANKNAME VARCHAR(200),
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_BASE_ORG_CODE VARCHAR(42) NOT NULL,
    S_CZ_BASE_ORG_NAME VARCHAR(200) NOT NULL,
    D_CZ_XPAYDATE DATE NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    S_CZ_EXPFUNCCODE VARCHAR(42) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_FUNDUSEDESC VARCHAR(200) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID,S_CZ_DETAILID)
);

COMMENT ON TABLE TV_VOUCHER2391DETAIL IS '申请划款明细清算报文明细信息_2391';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_CLEARACCTNO IS '财政_付款账号';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_CLEARACCTNAME IS '财政_付款账户名称';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_CLEARACCTBANKNAME IS '财政_付款银行';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_PAYBANKNO IS '财政_代理银行行号';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_PAYTYPE IS '财政_支付类型';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_AGENTACCTNAME IS '财政_收款银行账户名称';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_AGENTACCTBANKNAME IS '财政_收款银行';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_BASE_ORG_CODE IS '财政_基层预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_BASE_ORG_NAME IS '财政_基层预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.D_CZ_XPAYDATE IS '财政_支付日期';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_EXPFUNCCODE IS '财政_支出功能分类科目编码';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_FUNDUSEDESC IS '财政_资金用途';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2391DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110734390 ON TV_VOUCHER2391DETAIL(S_CZ_ID,S_CZ_DETAILID);

CREATE TABLE TV_VOUCHER2391HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_SUMVOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PAYTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PAYSUMMARYNAME VARCHAR(200),
    S_CZ_REMARK VARCHAR(255),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2391HEAD IS '申请划款明细清算报文主单信息_2391';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_SUMVOUCHERNO IS '财政_汇总凭证号';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_PAYTYPECODE IS '财政_支付方式编码';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_PAYTYPENAME IS '财政_支付方式名称';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_PAYSUMMARYNAME IS '财政_用途名称';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2391HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110734650 ON TV_VOUCHER2391HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2392DETAIL(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    D_CZ_ORIPAYDATE DATE NOT NULL,
    D_CZ_PAYBACKDATE DATE NOT NULL,
    S_CZ_CLEARACCTNO VARCHAR(60) NOT NULL,
    S_CZ_CLEARACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_PAYBANKNO VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPE VARCHAR(2) NOT NULL,
    S_CZ_AGENTACCTNAME VARCHAR(120),
    S_CZ_AGENTACCTBANKNAME VARCHAR(200),
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_BASE_ORG_CODE VARCHAR(42) NOT NULL,
    S_CZ_BASE_ORG_NAME VARCHAR(200) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    S_CZ_EXPFUNCCODE VARCHAR(42) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_FUNDUSEDESC VARCHAR(200) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID,S_CZ_DETAILID)
);

COMMENT ON TABLE TV_VOUCHER2392DETAIL IS '申请退款明细报文明细信息_2392';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.D_CZ_ORIPAYDATE IS '财政_原支付凭证日期';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.D_CZ_PAYBACKDATE IS '财政_退款日期';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_CLEARACCTNO IS '财政_付款账号';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_CLEARACCTNAME IS '财政_付款账户名称';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_CLEARACCTBANKNAME IS '财政_付款银行';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_PAYBANKNO IS '财政_代理银行行号';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_PAYTYPE IS '财政_支付类型';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_AGENTACCTNAME IS '财政_收款银行账户名称';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_AGENTACCTBANKNAME IS '财政_收款银行';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_BASE_ORG_CODE IS '财政_基层预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_BASE_ORG_NAME IS '财政_基层预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_EXPFUNCCODE IS '财政_支出功能分类科目编码';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_FUNDUSEDESC IS '财政_资金用途';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2392DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110734900 ON TV_VOUCHER2392DETAIL(S_CZ_ID,S_CZ_DETAILID);

CREATE TABLE TV_VOUCHER2392HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_SUMVOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PAYTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PAYSUMMARYNAME VARCHAR(200),
    S_CZ_REMARK VARCHAR(255),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2392HEAD IS '申请退款明细报文主单信息_2392';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_SUMVOUCHERNO IS '财政_汇总凭证号';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_PAYTYPECODE IS '财政_支付方式编码';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_PAYTYPENAME IS '财政_支付方式名称';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_PAYSUMMARYNAME IS '财政_用途名称';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2392HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110735140 ON TV_VOUCHER2392HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2396DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_AGENCYNAME VARCHAR(200),
    S_CZ_BUDSUBJECTCODE VARCHAR(42) NOT NULL,
    S_CZ_BUDSUBJECTNAME VARCHAR(120) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2396DETAIL IS '非税明细报文明细信息_2396';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_AGENCYNAME IS '财政_预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_BUDSUBJECTCODE IS '财政_预算科目代码';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_BUDSUBJECTNAME IS '财政_预算科目名称';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2396DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110735290 ON TV_VOUCHER2396DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER2396HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_SUMVOUCHERNO VARCHAR(42),
    S_CZ_AGENTACCTNO VARCHAR(42) NOT NULL,
    S_CZ_AGENTACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_AGENTACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_CLEARACCTNO VARCHAR(60) NOT NULL,
    S_CZ_CLEARACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARACCTBANKNAME VARCHAR(200) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_PAYSUMMARYNAME VARCHAR(200),
    S_CZ_REMARK VARCHAR(255),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2396HEAD IS '非税明细报文主单信息_2396';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_SUMVOUCHERNO IS '财政_汇总凭证号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_AGENTACCTNO IS '财政_收款银行账号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_AGENTACCTNAME IS '财政_收款银行账户名称';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_AGENTACCTBANKNAME IS '财政_收款银行';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_CLEARACCTNO IS '财政_付款账号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_CLEARACCTNAME IS '财政_付款账户名称';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_CLEARACCTBANKNAME IS '财政_付款银行';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_PAYSUMMARYNAME IS '财政_用途名称';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2396HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110735580 ON TV_VOUCHER2396HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2530DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_BUDSUBJECTCODE VARCHAR(42) NOT NULL,
    S_CZ_BUDSUBJECTNAME VARCHAR(120) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_PROCATNAME VARCHAR(60) NOT NULL,
    F_CZ_EDMONEY DECIMAL(24,2) NOT NULL,
    F_CZ_TKMONEY DECIMAL(24,2) NOT NULL,
    F_CZ_QSMONEY DECIMAL(24,2) NOT NULL,
    F_CZ_REMONEY DECIMAL(24,2) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2530DETAIL IS '集中支付月度对账报文明细信息_2530';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_BUDSUBJECTCODE IS '财政_预算科目代码';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_BUDSUBJECTNAME IS '财政_预算科目名称';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_PROCATNAME IS '财政_收支管理名称';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.F_CZ_EDMONEY IS '财政_额度金额';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.F_CZ_TKMONEY IS '财政_退款金额';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.F_CZ_QSMONEY IS '财政_清算金额';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.F_CZ_REMONEY IS '财政_余额';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2530DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110735760 ON TV_VOUCHER2530DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER2530HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PAYTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_STYEARMONTH VARCHAR(6) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2530HEAD IS '集中支付月度对账报文主单信息_2530';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_PAYTYPECODE IS '财政_支付方式编码';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_PAYTYPENAME IS '财政_支付方式名称';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_STYEARMONTH IS '财政_对账年月';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2530HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110736010 ON TV_VOUCHER2530HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER2532DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_BUDSUBJECTCODE VARCHAR(42) NOT NULL,
    S_CZ_BUDSUBJECTNAME VARCHAR(120) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    F_CZ_YEARAMT DECIMAL(24,2) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2532DETAIL IS '非税月度对账报文明细信息_2532';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_BUDSUBJECTCODE IS '财政_预算科目代码';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_BUDSUBJECTNAME IS '财政_预算科目名称';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.F_CZ_YEARAMT IS '财政_自年初累计';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER2532DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110736180 ON TV_VOUCHER2532DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER2532HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_STYEARMONTH VARCHAR(6) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER2532HEAD IS '非税月度对账报文主单信息_2532';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_STYEARMONTH IS '财政_对账年月';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER2532HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110736390 ON TV_VOUCHER2532HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER3530DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_BUDSUBJECTCODE VARCHAR(42) NOT NULL,
    S_CZ_BUDSUBJECTNAME VARCHAR(120) NOT NULL,
    S_CZ_PROCATCODE VARCHAR(42) NOT NULL,
    S_CZ_PROCATNAME VARCHAR(60) NOT NULL,
    S_CZ_XCHECKRESULT VARCHAR(4) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    F_NTLIMTAMT DECIMAL(24,2),
    F_CZ_EDMONEY DECIMAL(24,2),
    F_NTPAYBACKAMT DECIMAL(24,2),
    F_CZ_TKMONEY DECIMAL(24,2),
    F_NTCLEARAMT DECIMAL(24,2),
    F_CZ_QSMONEY DECIMAL(24,2),
    F_NTBALANCE DECIMAL(24,2),
    F_CZ_REMONEY DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER3530DETAIL IS '集中支付月度对账回执报文明细信息_3530';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_BUDSUBJECTCODE IS '财政_预算科目代码';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_BUDSUBJECTNAME IS '财政_预算科目名称';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_PROCATNAME IS '财政_收支管理名称';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_XCHECKRESULT IS '财政_对账结果';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_NTLIMTAMT IS '国库额度金额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_CZ_EDMONEY IS '财政_额度金额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_NTPAYBACKAMT IS '国库退款金额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_CZ_TKMONEY IS '财政_退款金额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_NTCLEARAMT IS '国库清算金额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_CZ_QSMONEY IS '财政_清算金额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_NTBALANCE IS '国库余额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.F_CZ_REMONEY IS '财政_余额';
COMMENT ON COLUMN TV_VOUCHER3530DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110736610 ON TV_VOUCHER3530DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER3530HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_PAYTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_PAYTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_STYEARMONTH VARCHAR(6) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_XCHECKRESULT VARCHAR(4) NOT NULL,
    I_CZ_XDIFFNUM BIGINT(19) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER3530HEAD IS '集中支付月度对账回执报文主单信息_3530';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_PAYTYPECODE IS '财政_支付方式编码';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_PAYTYPENAME IS '财政_支付方式名称';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_STYEARMONTH IS '财政_对账年月';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_XCHECKRESULT IS '财政_对账结果';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.I_CZ_XDIFFNUM IS '财政_不符笔数';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER3530HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110736890 ON TV_VOUCHER3530HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER3532DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_BUDSUBJECTCODE VARCHAR(42) NOT NULL,
    F_AMT DECIMAL(24,2),
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    F_YEARSTRSUMAMT DECIMAL(24,2),
    F_CZ_YEARAMT DECIMAL(24,2) NOT NULL,
    S_CZ_XCHECKRESULT VARCHAR(4) NOT NULL,
    S_CZ_XCHECKREASON VARCHAR(1) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER3532DETAIL IS '非税月度对账回执报文明细信息_3532';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_BUDSUBJECTCODE IS '财政_预算科目代码';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.F_AMT IS '金额';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.F_YEARSTRSUMAMT IS '自年初累计金额';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.F_CZ_YEARAMT IS '财政_自年初累计';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_XCHECKRESULT IS '财政_对账结果';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_XCHECKREASON IS '财政_不符原因';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER3532DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110737060 ON TV_VOUCHER3532DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER3532HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42) NOT NULL,
    S_CZ_PAYBANKNAME VARCHAR(60) NOT NULL,
    S_CZ_STYEARMONTH VARCHAR(6) NOT NULL,
    S_CZ_PACKNO VARCHAR(42) NOT NULL,
    I_CZ_CHILDPACKNUM BIGINT(19) NOT NULL,
    I_CZ_CURPACKNO BIGINT(19) NOT NULL,
    I_CZ_PAYCOUNT BIGINT(19) NOT NULL,
    F_CZ_PAYAMT DECIMAL(24,2) NOT NULL,
    I_CZ_DETAILCOUNT BIGINT(19) NOT NULL,
    F_CZ_DETAILAMT DECIMAL(24,2) NOT NULL,
    S_CZ_XCHECKRESULT VARCHAR(4) NOT NULL,
    I_CZ_XDIFFNUM BIGINT(19) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER3532HEAD IS '非税月度对账回执报文主单信息_3532';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_STYEARMONTH IS '财政_对账年月';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_PACKNO IS '财政_包凭证号';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.I_CZ_CHILDPACKNUM IS '财政_子包总数';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.I_CZ_CURPACKNO IS '财政_本包序号';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.I_CZ_PAYCOUNT IS '财政_明细总笔数';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.F_CZ_PAYAMT IS '财政_金额';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.I_CZ_DETAILCOUNT IS '财政_当前明细总笔数';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.F_CZ_DETAILAMT IS '财政_明细总金额';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_XCHECKRESULT IS '财政_对账结果';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.I_CZ_XDIFFNUM IS '财政_不符笔数';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER3532HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110737280 ON TV_VOUCHER3532HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER5106DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42),
    S_CZ_PAYBANKNAME VARCHAR(60),
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_EXPFUNCCODE VARCHAR(42),
    S_CZ_EXPFUNCNAME VARCHAR(120),
    S_CZ_EXPFUNCCODE1 VARCHAR(42),
    S_CZ_EXPFUNCNAME1 VARCHAR(120),
    S_CZ_EXPFUNCCODE2 VARCHAR(42),
    S_CZ_EXPFUNCNAME2 VARCHAR(120),
    S_CZ_EXPFUNCCODE3 VARCHAR(42),
    S_CZ_EXPFUNCNAME3 VARCHAR(120),
    S_CZ_PROCATCODE VARCHAR(42),
    S_CZ_PROCATNAME VARCHAR(60),
    S_CZ_SETMONTH VARCHAR(2) NOT NULL,
    F_CZ_PLANAMT DECIMAL(24,2) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER5106DETAIL IS '财政授权支付汇总清算额度通知单明细信息_5106';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCCODE IS '财政_支出功能分类科目编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCNAME IS '财政_支出功能分类科目名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCCODE1 IS '财政_支出功能分类科目类编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCNAME1 IS '财政_支出功能分类科目类名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCCODE2 IS '财政_支出功能分类科目款编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCNAME2 IS '财政_支出功能分类科目款名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCCODE3 IS '财政_支出功能分类科目项编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_EXPFUNCNAME3 IS '财政_支出功能分类科目项名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_PROCATNAME IS '财政_收支管理名称';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_SETMONTH IS '财政_计划月份';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.F_CZ_PLANAMT IS '财政_清算额度金额';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER5106DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110737500 ON TV_VOUCHER5106DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER5106HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_TRECODE VARCHAR(10) NOT NULL,
    S_CZ_FINORGCODE VARCHAR(12) NOT NULL,
    F_CZ_TOTALPLANAMT DECIMAL(24,2) NOT NULL,
    S_CZ_SETMONTH VARCHAR(2) NOT NULL,
    I_CZ_DEPTNUM VARCHAR(4),
    S_CZ_FUNDTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_FUNDTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_BGTTYPECODE VARCHAR(42),
    S_CZ_BGTTYPENAME VARCHAR(60),
    S_CZ_PAYACCTNO VARCHAR(42) NOT NULL,
    S_CZ_PAYACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_PAYEEACCTNO VARCHAR(42) NOT NULL,
    S_CZ_PAYEEACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_CLEARBANKCODE VARCHAR(42),
    S_CZ_CLEARBANKNAME VARCHAR(60),
    S_CZ_PAYBANKCODE VARCHAR(42),
    S_CZ_PAYBANKNAME VARCHAR(60),
    S_CZ_PAYBANKNO VARCHAR(42) NOT NULL,
    D_CZ_XACCTDATE DATE NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    D_ACCTDATE DATE NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER5106HEAD IS '财政授权支付汇总清算额度通知单主单信息_5106';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_TRECODE IS '财政_国库主体代码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_FINORGCODE IS '财政_财政机关代码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.F_CZ_TOTALPLANAMT IS '财政_合计清算额度金额';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_SETMONTH IS '财政_计划月份';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.I_CZ_DEPTNUM IS '财政_一级预算单位数量';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_FUNDTYPECODE IS '财政_资金性质编码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_FUNDTYPENAME IS '财政_资金性质名称';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_BGTTYPECODE IS '财政_预算类型编码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_BGTTYPENAME IS '财政_预算类型名称';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYACCTNO IS '财政_付款人账号';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYACCTNAME IS '财政_付款人名称';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYEEACCTNO IS '财政_收款人账号';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYEEACCTNAME IS '财政_收款人名称';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_CLEARBANKCODE IS '财政_人民银行编码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_CLEARBANKNAME IS '财政_人民银行名称';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_PAYBANKNO IS '财政_代理银行行号';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.D_CZ_XACCTDATE IS '财政_处理日期';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_VOUCHER5106HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110737780 ON TV_VOUCHER5106HEAD(S_CZ_ID);

CREATE TABLE TV_VOUCHER5108DETAIL(
    S_CZ_DETAILID VARCHAR(38) NOT NULL,
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_SUPDEPCODE VARCHAR(42) NOT NULL,
    S_CZ_SUPDEPNAME VARCHAR(200) NOT NULL,
    S_CZ_EXPFUNCCODE VARCHAR(42),
    S_CZ_EXPFUNCNAME VARCHAR(120),
    S_CZ_EXPFUNCCODE1 VARCHAR(42),
    S_CZ_EXPFUNCNAME1 VARCHAR(120),
    S_CZ_EXPFUNCCODE2 VARCHAR(42),
    S_CZ_EXPFUNCNAME2 VARCHAR(120),
    S_CZ_EXPFUNCCODE3 VARCHAR(42),
    S_CZ_EXPFUNCNAME3 VARCHAR(120),
    S_CZ_PROCATCODE VARCHAR(42),
    S_CZ_PROCATNAME VARCHAR(60),
    F_CZ_PLANAMT DECIMAL(24,2) NOT NULL,
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    S_CZ_HOLD3 VARCHAR(42),
    S_CZ_HOLD4 VARCHAR(42),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_DETAILID,S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER5108DETAIL IS '财政直接支付汇总清算额度通知单明细信息_5108';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_DETAILID IS '财政_明细序号';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_SUPDEPCODE IS '财政_一级预算单位编码';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_SUPDEPNAME IS '财政_一级预算单位名称';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCCODE IS '财政_支出功能分类科目编码';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCNAME IS '财政_支出功能分类科目名称';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCCODE1 IS '财政_支出功能分类科目类编码';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCNAME1 IS '财政_支出功能分类科目类名称';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCCODE2 IS '财政_支出功能分类科目款编码';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCNAME2 IS '财政_支出功能分类科目款名称';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCCODE3 IS '财政_支出功能分类科目项编码';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_EXPFUNCNAME3 IS '财政_支出功能分类科目项名称';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_PROCATCODE IS '财政_收支管理编码';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_PROCATNAME IS '财政_收支管理名称';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.F_CZ_PLANAMT IS '财政_清算额度金额';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_HOLD3 IS '财政_预留字段3';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.S_CZ_HOLD4 IS '财政_预留字段4';
COMMENT ON COLUMN TV_VOUCHER5108DETAIL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110737980 ON TV_VOUCHER5108DETAIL(S_CZ_DETAILID,S_CZ_ID);

CREATE TABLE TV_VOUCHER5108HEAD(
    S_CZ_ID VARCHAR(38) NOT NULL,
    S_CZ_ADMDIVCODE VARCHAR(9) NOT NULL,
    S_CZ_STYEAR VARCHAR(4) NOT NULL,
    S_CZ_VTCODE VARCHAR(4) NOT NULL,
    D_CZ_VOUDATE DATE NOT NULL,
    S_CZ_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CZ_TRECODE VARCHAR(10) NOT NULL,
    S_CZ_FINORGCODE VARCHAR(12) NOT NULL,
    F_CZ_TOTALPLANAMT DECIMAL(24,2) NOT NULL,
    S_CZ_FUNDTYPECODE VARCHAR(42) NOT NULL,
    S_CZ_FUNDTYPENAME VARCHAR(60) NOT NULL,
    S_CZ_BGTTYPECODE VARCHAR(42),
    S_CZ_BGTTYPENAME VARCHAR(60),
    S_CZ_PAYEEACCTNO VARCHAR(42) NOT NULL,
    S_CZ_PAYEEACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_PAYEEACCTBANKNAME VARCHAR(120) NOT NULL,
    S_CZ_PAYACCTNO VARCHAR(42) NOT NULL,
    S_CZ_PAYACCTNAME VARCHAR(120) NOT NULL,
    S_CZ_PAYACCTBANKNAME VARCHAR(120) NOT NULL,
    S_CZ_PAYBANKCODE VARCHAR(42),
    S_CZ_PAYBANKNAME VARCHAR(60),
    S_CZ_PAYBANKNO VARCHAR(42) NOT NULL,
    D_CZ_XACCTDATE DATE NOT NULL,
    S_CZ_REMARK VARCHAR(255),
    S_CZ_HOLD1 VARCHAR(42),
    S_CZ_HOLD2 VARCHAR(42),
    D_ACCTDATE DATE NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CZ_ID)
);

COMMENT ON TABLE TV_VOUCHER5108HEAD IS '财政直接支付汇总清算额度通知单主单信息_5108';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_ID IS '财政_Id';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_ADMDIVCODE IS '财政_行政区划代码';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_STYEAR IS '财政_业务年度';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_VTCODE IS '财政_凭证类型编号';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.D_CZ_VOUDATE IS '财政_凭证日期';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_VOUCHERNO IS '财政_凭证号';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_TRECODE IS '财政_国库主体代码';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_FINORGCODE IS '财政_财政机关代码';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.F_CZ_TOTALPLANAMT IS '财政_合计清算额度金额';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_FUNDTYPECODE IS '财政_资金性质编码';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_FUNDTYPENAME IS '财政_资金性质名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_BGTTYPECODE IS '财政_预算类型编码';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_BGTTYPENAME IS '财政_预算类型名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYEEACCTNO IS '财政_收款人账号';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYEEACCTNAME IS '财政_收款人名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYEEACCTBANKNAME IS '财政_收款人银行名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYACCTNO IS '财政_付款人账号';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYACCTNAME IS '财政_付款人名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYACCTBANKNAME IS '财政_付款人银行名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYBANKCODE IS '财政_代理银行编码';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYBANKNAME IS '财政_代理银行名称';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_PAYBANKNO IS '财政_代理银行行号';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.D_CZ_XACCTDATE IS '财政_处理日期';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_REMARK IS '财政_备注';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_HOLD1 IS '财政_预留字段1';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.S_CZ_HOLD2 IS '财政_预留字段2';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_VOUCHER5108HEAD.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110738260 ON TV_VOUCHER5108HEAD(S_CZ_ID);

CREATE TABLE TL_FILESPLITLOG(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_ELEFILENAME VARCHAR(130),
    S_ELEFILESIZE VARCHAR(128),
    S_ELEFILEUNIQUEID VARCHAR(128),
    S_ELEFILESTATUS VARCHAR(2),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    TS_SYSCREATE TIMESTAMP,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TL_FILESPLITLOG IS '文件拆分操作日志表';
COMMENT ON COLUMN TL_FILESPLITLOG.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TL_FILESPLITLOG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TL_FILESPLITLOG.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TL_FILESPLITLOG.S_ELEFILESIZE IS '通讯文件大小';
COMMENT ON COLUMN TL_FILESPLITLOG.S_ELEFILEUNIQUEID IS '通讯文件唯一标识';
COMMENT ON COLUMN TL_FILESPLITLOG.S_ELEFILESTATUS IS '通讯文件状态';
COMMENT ON COLUMN TL_FILESPLITLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TL_FILESPLITLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TL_FILESPLITLOG.TS_SYSCREATE IS '系统创建时间';
COMMENT ON COLUMN TL_FILESPLITLOG.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TV_SUBT_INSURANCEDETAIL(
    I_SERNO BIGINT NOT NULL,
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO,S_TRANSSERNO)
);

COMMENT ON TABLE TV_SUBT_INSURANCEDETAIL IS '央保报文明细信息表';
COMMENT ON COLUMN TV_SUBT_INSURANCEDETAIL.I_SERNO IS '序号';
COMMENT ON COLUMN TV_SUBT_INSURANCEDETAIL.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TV_SUBT_INSURANCEDETAIL.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TV_SUBT_INSURANCEDETAIL.F_AMT IS '金额';
COMMENT ON COLUMN TV_SUBT_INSURANCEDETAIL.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TV_SUBT_INSURANCEHEAD(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_ELEFILENAME VARCHAR(130),
    S_INITELEFILENAME VARCHAR(130),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BIZKNDNAME VARCHAR(60),
    S_SNDMSGBNKNO VARCHAR(18),
    S_REVMSGBNKNO VARCHAR(18),
    S_RESDLREASON VARCHAR(512),
    I_SUBMITUNTACCNO INTEGER NOT NULL,
    I_REPCOUNT INTEGER,
    S_SCRETNO VARCHAR(36) NOT NULL,
    S_PAYTRANSNO VARCHAR(36) NOT NULL,
    S_SUBMITUNTACCMNH CHAR(2) NOT NULL,
    S_SUBMITUNTACCDAY CHAR(2) NOT NULL,
    S_TOREPUNITBANKNO VARCHAR(18) NOT NULL,
    S_DATA31 VARCHAR(256),
    S_DATA32 VARCHAR(256),
    S_DATA33 VARCHAR(256),
    S_DATA34 VARCHAR(256),
    S_DATA40 VARCHAR(256),
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TV_SUBT_INSURANCEHEAD IS '央保报文主信息表';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_INITELEFILENAME IS '拆分前文件名称';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_BIZKNDNAME IS '业务种类名称';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_SNDMSGBNKNO IS '发报行行号';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_REVMSGBNKNO IS '收报行行号';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_RESDLREASON IS '差误原因';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.I_SUBMITUNTACCNO IS '报送单位记账序号（报表序号 、上报序号）';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.I_REPCOUNT IS '报单笔数';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_SCRETNO IS '密押号';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_PAYTRANSNO IS '支付交易序号';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_SUBMITUNTACCMNH IS '报送单位记账月份';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_SUBMITUNTACCDAY IS '报送单位记账日';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_TOREPUNITBANKNO IS '上报单位行号';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_DATA31 IS '央保预留字段1';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_DATA32 IS '央保预留字段2';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_DATA33 IS '央保预留字段3';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_DATA34 IS '央保预留字段4';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.S_DATA40 IS '央保预留字段5';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TV_SUBT_INSURANCEHEAD.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TBV_INSURANCETRANVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42),
    S_REALFUNDBILLTYPECODE VARCHAR(36),
    S_REALFUNDBILLTYPENO VARCHAR(36) NOT NULL,
    S_PAYPSNFULNAME VARCHAR(60) NOT NULL,
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150) NOT NULL,
    S_BIZTIMETYPENAME VARCHAR(60),
    S_BIZTIMETYPECODE VARCHAR(36) NOT NULL,
    S_REALPAYVOUCHNO VARCHAR(36) NOT NULL,
    S_PAYMNTODRNO VARCHAR(36),
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60) NOT NULL,
    S_PAYEEUNITFULACCNO VARCHAR(36) NOT NULL,
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_CASHBILLNO VARCHAR(36) NOT NULL,
    S_USAGE VARCHAR(150),
    S_BIZUNIT VARCHAR(60) NOT NULL,
    S_FUNDTYPE VARCHAR(10),
    S_PROJCODE VARCHAR(10),
    S_PROJNAME VARCHAR(60),
    S_ECNMCSBT VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_FUNDTSFTYPE CHAR(1),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_CERTPROCSTATE CHAR(1),
    S_ELEVOUSERNO VARCHAR(36),
    D_PBCPAYDATE DATE,
    D_VOUDATE DATE NOT NULL,
    I_APROPRATVOUCHERNO INTEGER NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60) NOT NULL,
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_FLOWSORTCODE VARCHAR(36),
    S_FLOWPROCSTATE VARCHAR(10),
    TS_SYSUPDATE TIMESTAMP,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_INSURANCETRANVOUCH IS '社会保险划转凭证';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_REALFUNDBILLTYPECODE IS '实拨资金单据类型代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_REALFUNDBILLTYPENO IS '实拨资金单据类型编号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_BIZTIMETYPENAME IS '业务期间类型';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_BIZTIMETYPECODE IS '业务期间类型代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_REALPAYVOUCHNO IS '对应的实拨支付凭证号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYMNTODRNO IS '支付令编号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYEEUNITCODE IS '收款单位代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_CASHBILLNO IS '请款单编号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_USAGE IS '用途';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_BIZUNIT IS '业务单元';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PROJCODE IS '项目代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PROJNAME IS '项目名称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_FUNDTSFTYPE IS '资金划拨方式';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.D_PBCPAYDATE IS '人行付款日期';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.I_APROPRATVOUCHERNO IS '拨款凭证编号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TBV_INSURANCETRANVOUCH.S_ADJPERFLAG IS '调整期标志';

CREATE TABLE TBV_INSURANCEDETAILVOUCHER(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_PAYINBOKNO VARCHAR(36) NOT NULL,
    S_PAYINBOKTYPE CHAR(1) NOT NULL,
    S_PAYINDPMTCODE VARCHAR(36) NOT NULL,
    S_PAYINDPMTNAME VARCHAR(60),
    S_PAYINUNITACCTNO VARCHAR(36) NOT NULL,
    S_OPENBANKCODE VARCHAR(36) NOT NULL,
    S_OPENBANKNAME VARCHAR(60),
    S_CAPTURETRE VARCHAR(60) NOT NULL,
    S_LEVUNITCODE VARCHAR(36) NOT NULL,
    S_INCOMETYPE CHAR(1) NOT NULL,
    D_TAXDATE DATE,
    S_BDGESBTCODE VARCHAR(36),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_REMARK VARCHAR(512),
    S_INPUTTYPE CHAR(1),
    S_CANCELFLAG CHAR(1) NOT NULL,
    S_ELEVOUID VARCHAR(100),
    S_ELEVOUSERNO VARCHAR(36),
    S_TYPISTNAME VARCHAR(60) NOT NULL,
    S_TYPISTCODE VARCHAR(12) NOT NULL,
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_CERTPROCSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_INSURANCEDETAILVOUCHER IS '社会保险费利息款项明细凭证表';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_PAYINBOKNO IS '缴款书号';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_PAYINBOKTYPE IS '缴款书种类';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_PAYINDPMTCODE IS '缴款部门编码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_PAYINDPMTNAME IS '缴款部门名称';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_PAYINUNITACCTNO IS '缴款单位账号';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_OPENBANKCODE IS '开户行代码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_OPENBANKNAME IS '开户行名称';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_CAPTURETRE IS '收款国库';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_LEVUNITCODE IS '征收单位代码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_INCOMETYPE IS '收入种类';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.D_TAXDATE IS '税款日期';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.F_AMT IS '金额';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_INPUTTYPE IS '录入方式';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_CANCELFLAG IS '作废标志';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TBV_INSURANCEDETAILVOUCHER.S_OPPACCTNO IS '对方账号';

CREATE TABLE TN_INSURANCEINCREG(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BDGETUNCODE VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BDGESBTKINDCODE VARCHAR(30),
    S_BDGESBTPROPCODE VARCHAR(36),
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    S_LEVUNITCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PAYTRANSNO VARCHAR(30) NOT NULL,
    I_SUBMITUNTACCNO INTEGER NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    I_PAYINPROCENO INTEGER NOT NULL,
    S_CERTPROCSTATE CHAR(1) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_IFSECRET CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TN_INSURANCEINCREG IS '社会保险费收入登记簿';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TN_INSURANCEINCREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_BDGESBTKINDCODE IS '预算科目种类代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_BDGESBTPROPCODE IS '预算科目属性代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_LEVUNITCODE IS '征收单位代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_PAYTRANSNO IS '支付交易序号（报单号）';
COMMENT ON COLUMN TN_INSURANCEINCREG.I_SUBMITUNTACCNO IS '报送单位记账序号（报表序号 、上报序号）';
COMMENT ON COLUMN TN_INSURANCEINCREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_INSURANCEINCREG.I_PAYINPROCENO IS '报解批次';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TN_INSURANCEINCREG.S_IFSECRET IS '是否涉密';
COMMENT ON COLUMN TN_INSURANCEINCREG.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TBV_INSURANCEINCVOUCH(
    I_SERNO BIGINT NOT NULL,
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_TOREPUNITBANKNO VARCHAR(18) NOT NULL,
    I_SUBMITUNTACCNO INTEGER NOT NULL,
    S_REPBILLNO VARCHAR(18),
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_SUBMITUNTACCYEAR CHAR(4) NOT NULL,
    S_SUBMITUNTACCMNH CHAR(2) NOT NULL,
    S_SUBMITUNTACCDAY CHAR(2) NOT NULL,
    S_SCRETNO VARCHAR(36) NOT NULL,
    S_PAYTRANSNO VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    F_COLLAMT DECIMAL(24,2),
    S_RESDLREASON VARCHAR(512),
    S_ELEFILENAME VARCHAR(130) NOT NULL,
    S_SNDMSGBNKNO VARCHAR(18),
    S_REVMSGBNKNO VARCHAR(18),
    I_REPCOUNT INTEGER,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36),
    S_BEPSDEBFLAG CHAR(1),
    S_CERTPROCSTATE CHAR(1),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    F_DETAILSUMAMT DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    S_ADJPERFLAG CHAR(1),
    PRIMARY KEY (I_SERNO,S_TRANSSERNO)
);

COMMENT ON TABLE TBV_INSURANCEINCVOUCH IS '社会保险费上划凭证';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_TOREPUNITBANKNO IS '上报单位行号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.I_SUBMITUNTACCNO IS '报送单位记账序号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_REPBILLNO IS '报单号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_SUBMITUNTACCYEAR IS '报送单位记账年';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_SUBMITUNTACCMNH IS '报送单位记账月份';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_SUBMITUNTACCDAY IS '报送单位记账日';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_SCRETNO IS '密押号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_PAYTRANSNO IS '支付交易序号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_RESDLREASON IS '差误原因';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_SNDMSGBNKNO IS '发报行行号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_REVMSGBNKNO IS '收报行行号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.I_REPCOUNT IS '报单笔数';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_BEPSDEBFLAG IS '小额借记标志';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.F_DETAILSUMAMT IS '明细汇总金额';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TBV_INSURANCEINCVOUCH.S_ADJPERFLAG IS '调整期标志';

