CREATE TABLE TP_BIZKNDANDBDGESBT(
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BIZKNDNAME VARCHAR(60),
    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_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_BIZKNDCODE,S_BDGESBTCODE,S_OFYEAR)
);

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

CREATE TABLE TP_BIZKNDACCTREL(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_SPLITJOBFLAG CHAR(1),
    I_PRIORITY INTEGER,
    S_QUEUEFLAG CHAR(1),
    S_CURRYEARACCT VARCHAR(36) NOT NULL,
    S_LASTYEARACCT VARCHAR(36),
    S_CURRTRANACCT VARCHAR(36),
    S_LASTTRANACCT VARCHAR(36),
    S_DEBTCREDTFLAG 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,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PARAMSRLNO,S_OFYEAR)
);

COMMENT ON TABLE TP_BIZKNDACCTREL IS '业务种类与账号对应关系表';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_SPLITJOBFLAG IS '分岗标志';
COMMENT ON COLUMN TP_BIZKNDACCTREL.I_PRIORITY IS '优先级';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_QUEUEFLAG IS '排队标志';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_CURRYEARACCT IS '本年账号';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_LASTYEARACCT IS '上年账号';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_CURRTRANACCT IS '本年过渡账号';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_LASTTRANACCT IS '上年过渡账号';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TP_BIZKNDACCTREL.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BIZKNDACCTREL.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BIZKNDACCTREL.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BIZKNDACCTREL.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_BIZKNDACCTREL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110722040 ON TP_BIZKNDACCTREL(S_PARAMSRLNO,S_OFYEAR);

CREATE TABLE TP_BDGESBT(
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    S_BDGESBTKIND 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_ADDUPSBTCODE VARCHAR(36),
    S_SBTORDERCODE VARCHAR(36) NOT NULL,
    I_ORDERNO INTEGER NOT NULL,
    S_SBTCLASS CHAR(1),
    S_INTERPRINCFLAG 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,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BDGESBTCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_BDGESBT IS '预算科目表';
COMMENT ON COLUMN TP_BDGESBT.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TP_BDGESBT.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TP_BDGESBT.S_BDGESBTKIND IS '预算科目种类';
COMMENT ON COLUMN TP_BDGESBT.S_NOINPUTFLAG IS '禁录标志';
COMMENT ON COLUMN TP_BDGESBT.S_BDGESBTPROPCODE IS '预算科目属性代码';
COMMENT ON COLUMN TP_BDGESBT.S_STATSBTCODE IS '统计科目';
COMMENT ON COLUMN TP_BDGESBT.S_EXUPSBTCODE IS '要扣除上级科目代码';
COMMENT ON COLUMN TP_BDGESBT.S_ADDUPSBTCODE IS '要增加上级科目代码';
COMMENT ON COLUMN TP_BDGESBT.S_SBTORDERCODE IS '科目顺序代码';
COMMENT ON COLUMN TP_BDGESBT.I_ORDERNO IS '顺序号';
COMMENT ON COLUMN TP_BDGESBT.S_SBTCLASS IS '科目分类';
COMMENT ON COLUMN TP_BDGESBT.S_INTERPRINCFLAG IS '本息标志';
COMMENT ON COLUMN TP_BDGESBT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BDGESBT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BDGESBT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BDGESBT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BDGESBT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BDGESBT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BDGESBT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BDGESBT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BDGESBT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BDGESBT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BDGESBT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BDGESBT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BDGESBT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_BDGESBT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110721230 ON TP_BDGESBT(S_BDGESBTCODE,S_OFYEAR);

CREATE TABLE TP_BIZKND(
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BIZKNDNAME VARCHAR(60),
    S_BIZGENUSCODE VARCHAR(7) NOT NULL,
    S_BIZGENUSNAME VARCHAR(60),
    S_BIZKINDTYPE VARCHAR(2),
    S_BIZTBLNAME VARCHAR(60) NOT NULL,
    S_FLOWSORTCODE VARCHAR(36),
    S_QUREBIZKNDDISABLEFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BIZKNDCODE)
);

COMMENT ON TABLE TP_BIZKND IS '业务种类表';
COMMENT ON COLUMN TP_BIZKND.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TP_BIZKND.S_BIZKNDNAME IS '业务种类名称';
COMMENT ON COLUMN TP_BIZKND.S_BIZGENUSCODE IS '业务大类代码';
COMMENT ON COLUMN TP_BIZKND.S_BIZGENUSNAME IS '业务大类名称';
COMMENT ON COLUMN TP_BIZKND.S_BIZKINDTYPE IS '业务类别';
COMMENT ON COLUMN TP_BIZKND.S_BIZTBLNAME IS '业务表表名';
COMMENT ON COLUMN TP_BIZKND.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TP_BIZKND.S_QUREBIZKNDDISABLEFLAG IS '确认业务种类显示标志';
COMMENT ON COLUMN TP_BIZKND.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110721790 ON TP_BIZKND(S_BIZKNDCODE);

CREATE TABLE TL_FINANCESPLITLOG(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_ELEFILENAME VARCHAR(130),
    S_SPLITELEFILENAME VARCHAR(130),
    I_MSGSRLNO BIGINT NOT NULL,
    I_SPLITMSGSRLNO BIGINT,
    S_MSGID VARCHAR(35) NOT NULL,
    S_SPLITMSGID VARCHAR(35),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_DETAILTBLNAME VARCHAR(60) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TL_FINANCESPLITLOG IS '资金拆分操作日志表';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TL_FINANCESPLITLOG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_SPLITELEFILENAME IS '拆分后通讯文件名称';
COMMENT ON COLUMN TL_FINANCESPLITLOG.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TL_FINANCESPLITLOG.I_SPLITMSGSRLNO IS '拆分后报文流水号';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_SPLITMSGID IS '拆分后报文标识号';
COMMENT ON COLUMN TL_FINANCESPLITLOG.F_AMT IS '金额';
COMMENT ON COLUMN TL_FINANCESPLITLOG.S_DETAILTBLNAME IS '拆分支付报文明细表名称';
COMMENT ON COLUMN TL_FINANCESPLITLOG.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE ETL_DAYENDBALNC(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ACCTCODE VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_BALNCPROP CHAR(1) NOT NULL,
    F_CURBALNC DECIMAL(24,2) NOT NULL,
    S_CURBALNCORIT CHAR(1) NOT NULL,
    F_DEBTAMT DECIMAL(24,2) NOT NULL,
    F_CREDTAMT DECIMAL(24,2) NOT NULL,
    I_DEBTCOUNT INTEGER NOT NULL,
    I_CREDTCOUNT INTEGER NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    F_PREBALNC DECIMAL(24,2) NOT NULL,
    S_PREBALNCORIT CHAR(1) NOT NULL,
    F_PREMONBALNC DECIMAL(24,2) NOT NULL,
    S_PREMONBALNCORIT CHAR(1) NOT NULL,
    F_PREYEARBALNC DECIMAL(24,2) NOT NULL,
    S_PREYEARBALNCORIT CHAR(1) NOT NULL,
    F_CURYEARDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURYEARCREDTAMT DECIMAL(24,2) NOT NULL,
    F_CURMONDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURMONCREDTAMT DECIMAL(24,2) NOT NULL,
    I_CURYEARDEBTCOUNT INTEGER NOT NULL,
    I_CURYEARCREDTCOUNT INTEGER NOT NULL,
    I_CURMONDEBTCOUNT INTEGER NOT NULL,
    I_CURMONCREDTCOUNT INTEGER NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE ETL_DAYENDBALNC IS '日终余额移植表';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_SRLNO IS '流水号';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_ACCTCODE IS '账户';
COMMENT ON COLUMN ETL_DAYENDBALNC.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_BALNCPROP IS '余额性质';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_CURBALNC IS '当日余额';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_CURBALNCORIT IS '当日余额方向';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_DEBTAMT IS '借方发生额';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_CREDTAMT IS '贷方发生额';
COMMENT ON COLUMN ETL_DAYENDBALNC.I_DEBTCOUNT IS '借方笔数';
COMMENT ON COLUMN ETL_DAYENDBALNC.I_CREDTCOUNT IS '贷方笔数';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_PREBALNC IS '上日余额';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_PREBALNCORIT IS '上日余额方向';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_PREMONBALNC IS '上月余额';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_PREMONBALNCORIT IS '上月余额方向';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_PREYEARBALNC IS '上年余额';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_PREYEARBALNCORIT IS '上年余额方向';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_CURYEARDEBTAMT IS '本年累计借方发生额';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_CURYEARCREDTAMT IS '本年累计贷方发生额';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_CURMONDEBTAMT IS '本月累计借方发生额';
COMMENT ON COLUMN ETL_DAYENDBALNC.F_CURMONCREDTAMT IS '本月累计贷方发生额';
COMMENT ON COLUMN ETL_DAYENDBALNC.I_CURYEARDEBTCOUNT IS '本年累计借方笔数';
COMMENT ON COLUMN ETL_DAYENDBALNC.I_CURYEARCREDTCOUNT IS '本年累计贷方笔数';
COMMENT ON COLUMN ETL_DAYENDBALNC.I_CURMONDEBTCOUNT IS '本月累计借方笔数';
COMMENT ON COLUMN ETL_DAYENDBALNC.I_CURMONCREDTCOUNT IS '本月累计贷方笔数';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN ETL_DAYENDBALNC.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN ETL_DAYENDBALNC.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX P_IDENTIFIER_1 ON ETL_DAYENDBALNC(S_SRLNO);

CREATE TABLE ETL_SUBACCDATA(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ACCTNAME VARCHAR(60) NOT NULL,
    S_OFACCTSBTCODE VARCHAR(36) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    F_BEARPRODNUM DECIMAL(24,2),
    S_BRIEF VARCHAR(512) NOT NULL,
    S_TYPISTCODE VARCHAR(12) NOT NULL,
    S_TYPISTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE ETL_SUBACCDATA IS '分户账数据移植表';
COMMENT ON COLUMN ETL_SUBACCDATA.S_SRLNO IS '流水号';
COMMENT ON COLUMN ETL_SUBACCDATA.S_ACCTNO IS '账号';
COMMENT ON COLUMN ETL_SUBACCDATA.S_ACCTNAME IS '户名';
COMMENT ON COLUMN ETL_SUBACCDATA.S_OFACCTSBTCODE IS '所属会计科目代码';
COMMENT ON COLUMN ETL_SUBACCDATA.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN ETL_SUBACCDATA.F_BALNC IS '余额';
COMMENT ON COLUMN ETL_SUBACCDATA.F_BEARPRODNUM IS '计息积数';
COMMENT ON COLUMN ETL_SUBACCDATA.S_BRIEF IS '摘要';
COMMENT ON COLUMN ETL_SUBACCDATA.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN ETL_SUBACCDATA.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN ETL_SUBACCDATA.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110635780 ON ETL_SUBACCDATA(S_SRLNO);

CREATE TABLE ETL_TN(
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BDGESBTCODE VARCHAR(30) NOT NULL,
    S_ECNMCSBT VARCHAR(36) NOT NULL,
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    S_LEVUNITCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    I_SUBMITUNTACCNO INTEGER NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_BDGETUNCODE VARCHAR(36),
    S_REALFUNDBILLTYPECODE VARCHAR(36),
    S_PAYTYPEFLAG CHAR(1),
    S_BIZKINDTYPE VARCHAR(2)
);

COMMENT ON TABLE ETL_TN IS '登记薄数据迁移中间表';
COMMENT ON COLUMN ETL_TN.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN ETL_TN.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN ETL_TN.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN ETL_TN.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN ETL_TN.S_BDGESBTCODE IS '预算科目代码（项目代码）';
COMMENT ON COLUMN ETL_TN.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN ETL_TN.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN ETL_TN.S_LEVUNITCODE IS '征收单位代码';
COMMENT ON COLUMN ETL_TN.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN ETL_TN.I_SUBMITUNTACCNO IS '报送单位记账序号（报表序号 、上报序号）';
COMMENT ON COLUMN ETL_TN.F_AMT IS '金额';
COMMENT ON COLUMN ETL_TN.S_ACCTNO IS '账号';
COMMENT ON COLUMN ETL_TN.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN ETL_TN.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN ETL_TN.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN ETL_TN.S_REALFUNDBILLTYPECODE IS '实拨资金单据类型代码';
COMMENT ON COLUMN ETL_TN.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN ETL_TN.S_BIZKINDTYPE IS '业务类别';

CREATE TABLE ETL_TOTALACCTDATA(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_ACCTSBTNAME VARCHAR(60) NOT NULL,
    S_TABOUTSIFLAG CHAR(1) NOT NULL,
    S_PREYEARBALDBTCRTFLAG CHAR(1) NOT NULL,
    F_CURYEARCREDTAMT DECIMAL(24,2) NOT NULL,
    F_CURYEARDEBTAMT DECIMAL(24,2) NOT NULL,
    F_PREYEARBALNC DECIMAL(24,2) NOT NULL,
    S_PREMONBALDBTCRTFLAG CHAR(1) NOT NULL,
    F_CURMONCREDTAMT DECIMAL(24,2) NOT NULL,
    F_CURMONDEBTAMT DECIMAL(24,2) NOT NULL,
    F_PREMONBALNC DECIMAL(24,2) NOT NULL,
    S_PREBALDBTCRTFLAG CHAR(1) NOT NULL,
    F_PREBALNC DECIMAL(24,2) NOT NULL,
    F_CURCREDTAMT DECIMAL(24,2) NOT NULL,
    F_CURDEBTAMT DECIMAL(24,2) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE ETL_TOTALACCTDATA IS '总账数据移植表';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_SRLNO IS '流水号';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_ACCTSBTNAME IS '会计科目名称';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_PREYEARBALDBTCRTFLAG IS '上年余额借贷标志';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_CURYEARCREDTAMT IS '本年累计贷方发生额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_CURYEARDEBTAMT IS '本年累计借方发生额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_PREYEARBALNC IS '上年余额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_PREMONBALDBTCRTFLAG IS '上月余额借贷标志';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_CURMONCREDTAMT IS '本月累计贷方发生额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_CURMONDEBTAMT IS '本月累计借方发生额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_PREMONBALNC IS '上月余额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_PREBALDBTCRTFLAG IS '上日余额借贷标志';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_PREBALNC IS '上日余额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_CURCREDTAMT IS '当日贷方发生额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_CURDEBTAMT IS '当日借方发生额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN ETL_TOTALACCTDATA.F_BALNC IS '余额';
COMMENT ON COLUMN ETL_TOTALACCTDATA.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110636360 ON ETL_TOTALACCTDATA(S_SRLNO);

CREATE TABLE TB_ACCTDAYTIMEBALNC(
    S_ACCTNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    S_BALNCORIT CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_ACCTNO)
);

COMMENT ON TABLE TB_ACCTDAYTIMEBALNC IS '账户日间余额表';
COMMENT ON COLUMN TB_ACCTDAYTIMEBALNC.S_ACCTNO IS '账号';
COMMENT ON COLUMN TB_ACCTDAYTIMEBALNC.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_ACCTDAYTIMEBALNC.F_BALNC IS '余额';
COMMENT ON COLUMN TB_ACCTDAYTIMEBALNC.S_BALNCORIT IS '余额方向';
COMMENT ON COLUMN TB_ACCTDAYTIMEBALNC.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110659260 ON TB_ACCTDAYTIMEBALNC(S_ACCTNO);

CREATE TABLE TB_ACCTENDTIMEBALNC(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ACCTCODE VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_BALNCPROP CHAR(1) NOT NULL,
    F_CURBALNC DECIMAL(24,2) NOT NULL,
    S_CURBALNCORIT CHAR(1) NOT NULL,
    F_DEBTAMT DECIMAL(24,2) NOT NULL,
    F_CREDTAMT DECIMAL(24,2) NOT NULL,
    I_DEBTCOUNT INTEGER NOT NULL,
    I_CREDTCOUNT INTEGER NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    F_PREBALNC DECIMAL(24,2) NOT NULL,
    S_PREBALNCORIT CHAR(1) NOT NULL,
    F_PREMONBALNC DECIMAL(24,2) NOT NULL,
    S_PREMONBALNCORIT CHAR(1) NOT NULL,
    F_PREYEARBALNC DECIMAL(24,2) NOT NULL,
    S_PREYEARBALNCORIT CHAR(1) NOT NULL,
    F_CURYEARDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURYEARCREDTAMT DECIMAL(24,2) NOT NULL,
    F_CURMONDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURMONCREDTAMT DECIMAL(24,2) NOT NULL,
    I_CURYEARDEBTCOUNT INTEGER NOT NULL,
    I_CURYEARCREDTCOUNT INTEGER NOT NULL,
    I_CURMONDEBTCOUNT INTEGER NOT NULL,
    I_CURMONCREDTCOUNT INTEGER NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO,D_ACCTDATE)
);

COMMENT ON TABLE TB_ACCTENDTIMEBALNC IS '账户日终余额表';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_SRLNO IS '流水号';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_ACCTCODE IS '账户';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_BALNCPROP IS '余额性质';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_CURBALNC IS '当日余额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_CURBALNCORIT IS '当日余额方向';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_DEBTAMT IS '借方发生额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_CREDTAMT IS '贷方发生额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.I_DEBTCOUNT IS '借方笔数';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.I_CREDTCOUNT IS '贷方笔数';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_PREBALNC IS '上日余额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_PREBALNCORIT IS '上日余额方向';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_PREMONBALNC IS '上月余额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_PREMONBALNCORIT IS '上月余额方向';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_PREYEARBALNC IS '上年余额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_PREYEARBALNCORIT IS '上年余额方向';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_CURYEARDEBTAMT IS '本年累计借方发生额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_CURYEARCREDTAMT IS '本年累计贷方发生额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_CURMONDEBTAMT IS '本月累计借方发生额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.F_CURMONCREDTAMT IS '本月累计贷方发生额';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.I_CURYEARDEBTCOUNT IS '本年累计借方笔数';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.I_CURYEARCREDTCOUNT IS '本年累计贷方笔数';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.I_CURMONDEBTCOUNT IS '本月累计借方笔数';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.I_CURMONCREDTCOUNT IS '本月累计贷方笔数';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TB_ACCTENDTIMEBALNC.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110659670 ON TB_ACCTENDTIMEBALNC(S_SRLNO,D_ACCTDATE);

CREATE TABLE TB_CHARGEVOUCHER(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_VOUCHERTYPE CHAR(1) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_BRIEF VARCHAR(512) NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_OPPACCTSBTCODE VARCHAR(36) NOT NULL,
    S_TABOUTSIFLAG CHAR(1) NOT NULL,
    S_SUMFLAG CHAR(1) NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TB_CHARGEVOUCHER IS '记账凭证表';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_VOUCHERTYPE IS '传票种类';
COMMENT ON COLUMN TB_CHARGEVOUCHER.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_ACCTNO IS '账号';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TB_CHARGEVOUCHER.F_AMT IS '金额';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_BRIEF IS '摘要';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_OPPACCTSBTCODE IS '对方会计科目代码';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_SUMFLAG IS '汇总标志';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TB_CHARGEVOUCHER.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TB_CHARGEVOUCHER.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110659980 ON TB_CHARGEVOUCHER(S_TRANSSERNO);

CREATE TABLE TB_CHRGBIZ(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    F_CHRGAMT DECIMAL(24,2) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    D_CHRGDATE DATE NOT NULL,
    S_CHRGSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TB_CHRGBIZ IS '记账状态表';
COMMENT ON COLUMN TB_CHRGBIZ.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TB_CHRGBIZ.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_CHRGBIZ.F_CHRGAMT IS '记账金额';
COMMENT ON COLUMN TB_CHRGBIZ.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TB_CHRGBIZ.D_CHRGDATE IS '记账时间';
COMMENT ON COLUMN TB_CHRGBIZ.S_CHRGSTATE IS '记账状态';
COMMENT ON COLUMN TB_CHRGBIZ.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110700120 ON TB_CHRGBIZ(S_TRANSSERNO);

CREATE TABLE TB_CHRGPREP(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_CHRGNO VARCHAR(36),
    D_ACCTDATE DATE NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ACCTNAME VARCHAR(60) NOT NULL,
    S_ACCTKNDCODE VARCHAR(36) NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_OFORGCODE VARCHAR(14) NOT NULL,
    S_BOOKORGCODE VARCHAR(14) NOT NULL,
    F_OCCURAMT DECIMAL(24,2) NOT NULL,
    S_CURNCYFLAG CHAR(1) NOT NULL,
    S_BRIEF VARCHAR(512),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_CHRGKNDCODE VARCHAR(36) NOT NULL,
    S_VOUCHKNDCODE VARCHAR(36),
    S_VOUCHNO VARCHAR(42),
    S_OPPACCTNO VARCHAR(36),
    S_OPPACCTSBTCODE VARCHAR(36),
    S_CHRGVOUCHSRLNO VARCHAR(36),
    S_CREDTFORLOADSTAT CHAR(1) NOT NULL,
    S_CHRGSTATE CHAR(1) NOT NULL,
    S_SPONSRINSTCODE VARCHAR(14) NOT NULL,
    S_SPONSRORGCODE VARCHAR(14),
    S_RECVINSTCODE VARCHAR(14),
    S_RECVORGCODE VARCHAR(14),
    S_BALNCINCDECFLAG CHAR(1),
    S_TABOUTSIFLAG CHAR(1) NOT NULL,
    S_ACCTANTNAME VARCHAR(60),
    S_TYPISTNAME VARCHAR(60),
    S_SPLITJOBFLAG CHAR(1),
    S_BIZCODE CHAR(1),
    S_ADJPERFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TB_CHRGPREP IS '记账准备表';
COMMENT ON COLUMN TB_CHRGPREP.S_SRLNO IS '流水号';
COMMENT ON COLUMN TB_CHRGPREP.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TB_CHRGPREP.S_CHRGNO IS '记账序号';
COMMENT ON COLUMN TB_CHRGPREP.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_CHRGPREP.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TB_CHRGPREP.S_ACCTNO IS '账号';
COMMENT ON COLUMN TB_CHRGPREP.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TB_CHRGPREP.S_ACCTKNDCODE IS '账户种类代码';
COMMENT ON COLUMN TB_CHRGPREP.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TB_CHRGPREP.S_OFORGCODE IS '所属机构代码';
COMMENT ON COLUMN TB_CHRGPREP.S_BOOKORGCODE IS '核算主体代码';
COMMENT ON COLUMN TB_CHRGPREP.F_OCCURAMT IS '发生额';
COMMENT ON COLUMN TB_CHRGPREP.S_CURNCYFLAG IS '币种标志';
COMMENT ON COLUMN TB_CHRGPREP.S_BRIEF IS '摘要';
COMMENT ON COLUMN TB_CHRGPREP.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TB_CHRGPREP.S_CHRGKNDCODE IS '记账种类代码';
COMMENT ON COLUMN TB_CHRGPREP.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TB_CHRGPREP.S_VOUCHNO IS '凭证号码';
COMMENT ON COLUMN TB_CHRGPREP.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TB_CHRGPREP.S_OPPACCTSBTCODE IS '对方会计科目代码';
COMMENT ON COLUMN TB_CHRGPREP.S_CHRGVOUCHSRLNO IS '记账凭证流水号';
COMMENT ON COLUMN TB_CHRGPREP.S_CREDTFORLOADSTAT IS '圈存状态';
COMMENT ON COLUMN TB_CHRGPREP.S_CHRGSTATE IS '记账状态';
COMMENT ON COLUMN TB_CHRGPREP.S_SPONSRINSTCODE IS '发起机构代码';
COMMENT ON COLUMN TB_CHRGPREP.S_SPONSRORGCODE IS '发起核算主体代码';
COMMENT ON COLUMN TB_CHRGPREP.S_RECVINSTCODE IS '接收机构代码';
COMMENT ON COLUMN TB_CHRGPREP.S_RECVORGCODE IS '接收核算主体代码';
COMMENT ON COLUMN TB_CHRGPREP.S_BALNCINCDECFLAG IS '余额增减标志';
COMMENT ON COLUMN TB_CHRGPREP.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN TB_CHRGPREP.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TB_CHRGPREP.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TB_CHRGPREP.S_SPLITJOBFLAG IS '分岗标志';
COMMENT ON COLUMN TB_CHRGPREP.S_BIZCODE IS '业务码';
COMMENT ON COLUMN TB_CHRGPREP.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TB_CHRGPREP.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110700610 ON TB_CHRGPREP(S_SRLNO);

CREATE TABLE TB_CHRGQUEUE(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    F_CHRGAMT DECIMAL(24,2) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    D_COMMITDATE DATE NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TB_CHRGQUEUE IS '记账排队表';
COMMENT ON COLUMN TB_CHRGQUEUE.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TB_CHRGQUEUE.S_ACCTNO IS '账号';
COMMENT ON COLUMN TB_CHRGQUEUE.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_CHRGQUEUE.F_CHRGAMT IS '记账金额';
COMMENT ON COLUMN TB_CHRGQUEUE.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TB_CHRGQUEUE.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TB_CHRGQUEUE.D_COMMITDATE IS '提交日期';
COMMENT ON COLUMN TB_CHRGQUEUE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110700790 ON TB_CHRGQUEUE(S_TRANSSERNO);

CREATE TABLE TB_DAYBALANCE(
    D_ACCTDATE DATE NOT NULL,
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    F_PREBALNC DECIMAL(24,2),
    F_BALNC DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (D_ACCTDATE,S_PAYTYPEFLAG,S_PROXYBANKCODE,S_DPMTCODE,S_BDGESBTCODE,S_BDGEMANGETYPE)
);

COMMENT ON TABLE TB_DAYBALANCE IS '额度每日余额表';
COMMENT ON COLUMN TB_DAYBALANCE.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_DAYBALANCE.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TB_DAYBALANCE.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TB_DAYBALANCE.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TB_DAYBALANCE.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TB_DAYBALANCE.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TB_DAYBALANCE.F_PREBALNC IS '上日余额';
COMMENT ON COLUMN TB_DAYBALANCE.F_BALNC IS '余额';
COMMENT ON COLUMN TB_DAYBALANCE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110700950 ON TB_DAYBALANCE(D_ACCTDATE,S_PAYTYPEFLAG,S_PROXYBANKCODE,S_DPMTCODE,S_BDGESBTCODE,S_BDGEMANGETYPE);

CREATE TABLE TB_SRLACCT(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_ACCTCODE VARCHAR(36) NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_SBTCODE VARCHAR(36),
    F_OCCURAMT DECIMAL(24,2) NOT NULL,
    S_BRIEF VARCHAR(512) NOT NULL,
    S_BIZKNDCODE VARCHAR(30) NOT NULL,
    S_CHRGKNDCODE VARCHAR(36) NOT NULL,
    S_VOUCHKNDCODE VARCHAR(36) NOT NULL,
    S_VOUCHNO VARCHAR(42) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTSBTCODE VARCHAR(36) NOT NULL,
    S_TABOUTSIFLAG CHAR(1) NOT NULL,
    S_CHRGVOUCHSRLNO VARCHAR(36) NOT NULL,
    I_ATTCHCOUNT INTEGER NOT NULL,
    S_ACCTANTFLAG CHAR(1) NOT NULL,
    S_TYPISTNAME VARCHAR(30) NOT NULL,
    S_ACCTANTNAME VARCHAR(30) NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_SPLITJOBFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_CHRGERCODE VARCHAR(30) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TB_SRLACCT IS '流水账表';
COMMENT ON COLUMN TB_SRLACCT.S_SRLNO IS '流水号';
COMMENT ON COLUMN TB_SRLACCT.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TB_SRLACCT.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_SRLACCT.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TB_SRLACCT.S_ACCTCODE IS '账户';
COMMENT ON COLUMN TB_SRLACCT.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TB_SRLACCT.S_SBTCODE IS '科目代码';
COMMENT ON COLUMN TB_SRLACCT.F_OCCURAMT IS '发生额';
COMMENT ON COLUMN TB_SRLACCT.S_BRIEF IS '摘要';
COMMENT ON COLUMN TB_SRLACCT.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TB_SRLACCT.S_CHRGKNDCODE IS '记账种类代码';
COMMENT ON COLUMN TB_SRLACCT.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TB_SRLACCT.S_VOUCHNO IS '凭证号码';
COMMENT ON COLUMN TB_SRLACCT.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TB_SRLACCT.S_OPPACCTSBTCODE IS '对方会计科目代码';
COMMENT ON COLUMN TB_SRLACCT.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN TB_SRLACCT.S_CHRGVOUCHSRLNO IS '记账凭证流水号';
COMMENT ON COLUMN TB_SRLACCT.I_ATTCHCOUNT IS '附件张数';
COMMENT ON COLUMN TB_SRLACCT.S_ACCTANTFLAG IS '复核标志';
COMMENT ON COLUMN TB_SRLACCT.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TB_SRLACCT.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TB_SRLACCT.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TB_SRLACCT.S_SPLITJOBFLAG IS '分岗标志';
COMMENT ON COLUMN TB_SRLACCT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TB_SRLACCT.S_CHRGERCODE IS '记账员代码';
COMMENT ON COLUMN TB_SRLACCT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110701370 ON TB_SRLACCT(S_SRLNO);

CREATE TABLE TB_SUBACCT(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(30) NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_VOUCHNO VARCHAR(42) NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    S_BALNCORIT CHAR(1) NOT NULL,
    S_BALNCPROP CHAR(1) NOT NULL,
    F_DEBTAMT DECIMAL(24,2) NOT NULL,
    F_CREDTAMT DECIMAL(24,2) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTSBTCODE VARCHAR(36) NOT NULL,
    S_BRIEF VARCHAR(512) NOT NULL,
    S_SUMFLAG CHAR(1) NOT NULL,
    S_TABOUTSIFLAG CHAR(1) NOT NULL,
    S_CHRGERNAME VARCHAR(30) NOT NULL,
    S_ACCTANTNAME VARCHAR(30) NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_OLDGNKSRLNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TB_SUBACCT IS '分户账表';
COMMENT ON COLUMN TB_SUBACCT.S_SRLNO IS '流水号';
COMMENT ON COLUMN TB_SUBACCT.S_ACCTNO IS '账号';
COMMENT ON COLUMN TB_SUBACCT.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_SUBACCT.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TB_SUBACCT.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TB_SUBACCT.S_VOUCHNO IS '凭证号码';
COMMENT ON COLUMN TB_SUBACCT.F_BALNC IS '余额';
COMMENT ON COLUMN TB_SUBACCT.S_BALNCORIT IS '余额方向';
COMMENT ON COLUMN TB_SUBACCT.S_BALNCPROP IS '余额性质';
COMMENT ON COLUMN TB_SUBACCT.F_DEBTAMT IS '借方发生额';
COMMENT ON COLUMN TB_SUBACCT.F_CREDTAMT IS '贷方发生额';
COMMENT ON COLUMN TB_SUBACCT.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TB_SUBACCT.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TB_SUBACCT.S_OPPACCTSBTCODE IS '对方会计科目代码';
COMMENT ON COLUMN TB_SUBACCT.S_BRIEF IS '摘要';
COMMENT ON COLUMN TB_SUBACCT.S_SUMFLAG IS '汇总标志';
COMMENT ON COLUMN TB_SUBACCT.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN TB_SUBACCT.S_CHRGERNAME IS '记账员名称';
COMMENT ON COLUMN TB_SUBACCT.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TB_SUBACCT.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TB_SUBACCT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TB_SUBACCT.S_OLDGNKSRLNO IS '老总库流水号';
COMMENT ON COLUMN TB_SUBACCT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110701720 ON TB_SUBACCT(S_SRLNO);

CREATE TABLE TB_TOTALACCT(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_SBTBALNCPROP CHAR(1) NOT NULL,
    F_CURDAYDEBTBALNC DECIMAL(24,2) NOT NULL,
    F_CURDAYCREDTBALNC DECIMAL(24,2) NOT NULL,
    F_CURDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURCREDTAMT DECIMAL(24,2) NOT NULL,
    I_CURDEBTCOUNT INTEGER NOT NULL,
    I_CURCREDTCOUNT INTEGER NOT NULL,
    F_PREDAYDEBTBALNC DECIMAL(24,2) NOT NULL,
    F_PREDAYCREDTBALNC DECIMAL(24,2) NOT NULL,
    F_PREMONDEBTBALNC DECIMAL(24,2) NOT NULL,
    F_PREMONCREDTBALNC DECIMAL(24,2) NOT NULL,
    F_PREYEARDEBTBALNC DECIMAL(24,2) NOT NULL,
    F_PREYEARCREDTBALNC DECIMAL(24,2) NOT NULL,
    F_CURYEARDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURYEARCREDTAMT DECIMAL(24,2) NOT NULL,
    I_CURYEARDEBTCOUNT INTEGER NOT NULL,
    I_CURYEARCREDTCOUNT INTEGER NOT NULL,
    F_CURMONDEBTAMT DECIMAL(24,2) NOT NULL,
    F_CURMONCREDTAMT DECIMAL(24,2) NOT NULL,
    I_CURMONDEBTCOUNT INTEGER NOT NULL,
    I_CURMONCREDTCOUNT INTEGER NOT NULL,
    S_TABOUTSIFLAG CHAR(1) NOT NULL,
    I_ATTCHCOUNT INTEGER NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    S_OPERNAME VARCHAR(60),
    PRIMARY KEY (S_SRLNO,S_ACCTSBTCODE,D_ACCTDATE)
);

COMMENT ON TABLE TB_TOTALACCT IS '总账表';
COMMENT ON COLUMN TB_TOTALACCT.S_SRLNO IS '流水号';
COMMENT ON COLUMN TB_TOTALACCT.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TB_TOTALACCT.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TB_TOTALACCT.S_SBTBALNCPROP IS '科目余额性质';
COMMENT ON COLUMN TB_TOTALACCT.F_CURDAYDEBTBALNC IS '当日借方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_CURDAYCREDTBALNC IS '当日贷方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_CURDEBTAMT IS '当日借方发生额';
COMMENT ON COLUMN TB_TOTALACCT.F_CURCREDTAMT IS '当日贷方发生额';
COMMENT ON COLUMN TB_TOTALACCT.I_CURDEBTCOUNT IS '当日借方笔数';
COMMENT ON COLUMN TB_TOTALACCT.I_CURCREDTCOUNT IS '当日贷方笔数';
COMMENT ON COLUMN TB_TOTALACCT.F_PREDAYDEBTBALNC IS '上日借方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_PREDAYCREDTBALNC IS '上日贷方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_PREMONDEBTBALNC IS '上月借方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_PREMONCREDTBALNC IS '上月贷方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_PREYEARDEBTBALNC IS '上年借方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_PREYEARCREDTBALNC IS '上年贷方余额';
COMMENT ON COLUMN TB_TOTALACCT.F_CURYEARDEBTAMT IS '本年累计借方发生额';
COMMENT ON COLUMN TB_TOTALACCT.F_CURYEARCREDTAMT IS '本年累计贷方发生额';
COMMENT ON COLUMN TB_TOTALACCT.I_CURYEARDEBTCOUNT IS '本年累计借方笔数';
COMMENT ON COLUMN TB_TOTALACCT.I_CURYEARCREDTCOUNT IS '本年累计贷方笔数';
COMMENT ON COLUMN TB_TOTALACCT.F_CURMONDEBTAMT IS '本月累计借方发生额';
COMMENT ON COLUMN TB_TOTALACCT.F_CURMONCREDTAMT IS '本月累计贷方发生额';
COMMENT ON COLUMN TB_TOTALACCT.I_CURMONDEBTCOUNT IS '本月累计借方笔数';
COMMENT ON COLUMN TB_TOTALACCT.I_CURMONCREDTCOUNT IS '本月累计贷方笔数';
COMMENT ON COLUMN TB_TOTALACCT.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN TB_TOTALACCT.I_ATTCHCOUNT IS '附件张数';
COMMENT ON COLUMN TB_TOTALACCT.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TB_TOTALACCT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TB_TOTALACCT.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TB_TOTALACCT.S_OPERNAME IS '操作员名称';


CREATE UNIQUE INDEX SQL221020110702220 ON TB_TOTALACCT(S_SRLNO,S_ACCTSBTCODE,D_ACCTDATE);

CREATE TABLE TBV_ACCTVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE,
    S_VOUNO VARCHAR(42),
    S_VOUCHKNDCODE VARCHAR(36),
    S_DEBTCREDTFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_ACCTNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    I_ATTACHNUM INTEGER,
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_ACCTVOUCH IS '会计凭证';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_ACCTVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_ACCTVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_ACCTVOUCH.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_ACCTVOUCH.S_ACCTANTFLAG IS '复核标志';
COMMENT ON COLUMN TBV_ACCTVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110702510 ON TBV_ACCTVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_ADJRPTINCVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    D_ACCTDATE DATE,
    S_ELEVOUID VARCHAR(100) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    S_BIZKNDCODE VARCHAR(7),
    D_VOUDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42) NOT NULL,
    S_PAYPSNFULNAME VARCHAR(60) NOT NULL,
    S_PAYBANKCODE VARCHAR(36) NOT NULL,
    S_PAYBANKNAME VARCHAR(256) NOT NULL,
    S_DESC VARCHAR(512) NOT NULL,
    S_BIZTIMETYPENAME VARCHAR(60),
    S_BIZTIMETYPECODE VARCHAR(36) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_ONELVLBDGEUNCODE VARCHAR(36) NOT NULL,
    S_ONELVLBDGEUNNAME VARCHAR(60) NOT NULL,
    F_PAYMETAMT DECIMAL(24,2) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60) NOT NULL,
    S_ECONITEM VARCHAR(36),
    S_FUNDTYPE VARCHAR(10) NOT NULL,
    S_RESERVED VARCHAR(100),
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    S_FLOWPROCSTATE VARCHAR(10),
    S_FLOWSORTCODE VARCHAR(36),
    S_CERTPROCSTATE CHAR(1),
    S_ELEVOUSERNO VARCHAR(36),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_ADJRPTINCVOUCH IS '调库收入凭证表';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_PAYBANKCODE IS '付款银行编码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_PAYBANKNAME IS '付款银行名称';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_DESC IS '描述';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_BIZTIMETYPENAME IS '业务期间类型';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_BIZTIMETYPECODE IS '业务期间类型代码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ONELVLBDGEUNCODE IS '一级预算单位代码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ONELVLBDGEUNNAME IS '一级预算单位名称';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.F_PAYMETAMT IS '支付金额';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_ADJRPTINCVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110636760 ON TBV_ADJRPTINCVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_BCKDTLVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_VOUNO VARCHAR(42),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNO VARCHAR(18),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_ELEVOUID VARCHAR(100),
    S_ELEVOUSERNO VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_ORIALCTNVOUCHNO VARCHAR(36),
    S_PAYMNTODRNO VARCHAR(36),
    S_BIZTYPE VARCHAR(10),
    S_CASHBILLNO VARCHAR(36),
    S_BIZUNIT VARCHAR(60),
    S_FUNDTYPE VARCHAR(10),
    S_REVEXPCTRL VARCHAR(10),
    S_FUNDUSAGE VARCHAR(300),
    S_BDGESBTCODE VARCHAR(36),
    S_REALDIALTYPE VARCHAR(10),
    S_ONELVLBDGEUNCODE VARCHAR(36),
    S_ONELVLBDGEUNNAME VARCHAR(60),
    S_BNKREFUNDRESON CHAR(1),
    S_BNKBILLTYPE CHAR(1),
    S_REMARK VARCHAR(512),
    S_BANKREMARK VARCHAR(512),
    S_PROJNO VARCHAR(36),
    S_ECNMCSBT VARCHAR(36),
    S_FUNDPAYMNTTYPE CHAR(1),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_CERTPROCSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_BCKDTLVOUCH IS '退库退回凭证明细信息表';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYUNOPNBNKNO IS '付款单位开户行行号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ORIALCTNVOUCHNO IS '原拨款凭证号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PAYMNTODRNO IS '支付令编号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BIZTYPE IS '业务类型';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_CASHBILLNO IS '请款单编号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BIZUNIT IS '业务单元';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_REVEXPCTRL IS '收支管理';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_FUNDUSAGE IS '资金用途';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_REALDIALTYPE IS '实拨单据类型';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ONELVLBDGEUNCODE IS '一级预算单位代码';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ONELVLBDGEUNNAME IS '一级预算单位名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BNKREFUNDRESON IS '银行退票原因';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BNKBILLTYPE IS '银行单据类型';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_BANKREMARK IS '银行备注';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_PROJNO IS '项目编码';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_FUNDPAYMNTTYPE IS '资金支付方式';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_BCKDTLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110637390 ON TBV_BCKDTLVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_BCKTREAVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36),
    S_AMTSRLNO VARCHAR(36),
    S_ELEVOUID VARCHAR(100) NOT NULL,
    S_BIZKNDCODE VARCHAR(7),
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    D_VOUDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42) NOT NULL,
    S_REALFUNDBILLTYPECODE VARCHAR(36) NOT NULL,
    S_REALFUNDBILLTYPENO VARCHAR(36) NOT NULL,
    S_PAYPSNFULNAME VARCHAR(60) NOT NULL,
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYOPENBANKNAME VARCHAR(150) NOT NULL,
    S_BIZTIMETYPENAME VARCHAR(60),
    S_BIZTIMETYPECODE VARCHAR(36),
    S_REALPAYVOUCHNO VARCHAR(36) NOT NULL,
    S_PAYMNTODRNO VARCHAR(36) NOT NULL,
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60) NOT NULL,
    S_PAYEEUNOPNBNKNAME VARCHAR(200) NOT NULL,
    S_PAYEEUNITFULACCNO VARCHAR(36) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_PRESBTFOUNDCLASSCODE VARCHAR(15) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    S_CASHBILLNO VARCHAR(36) NOT NULL,
    S_USAGE VARCHAR(150),
    S_BIZUNIT VARCHAR(60) NOT NULL,
    S_FUNDTYPE VARCHAR(10),
    S_PYMAGPREMAGTYPE VARCHAR(4) NOT NULL,
    S_PROJCODE VARCHAR(10),
    S_PROJNAME VARCHAR(60),
    S_ECONSBTECONCLASSCODE VARCHAR(10),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_FUNDTSFTYPE CHAR(1),
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTSBTCODE VARCHAR(36),
    S_OLDPAYUNITACCNO VARCHAR(36),
    S_OLDBDGESBTCODE VARCHAR(36),
    S_OLDECNMCSBT VARCHAR(36),
    S_CERTPROCSTATE CHAR(1),
    S_FLOWPROCSTATE VARCHAR(10),
    S_FLOWSORTCODE VARCHAR(36),
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_OPPACCTNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_BCKTREAVOUCH IS '退库凭证表';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_REALFUNDBILLTYPECODE IS '实拨资金单据类型代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_REALFUNDBILLTYPENO IS '实拨资金单据类型编号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_BIZTIMETYPENAME IS '业务期间类型';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_BIZTIMETYPECODE IS '业务期间类型代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_REALPAYVOUCHNO IS '对应的实拨支付凭证号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYMNTODRNO IS '支付令编号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYEEUNITCODE IS '收款单位代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PRESBTFOUNDCLASSCODE IS '预算科目/功能分类代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_CASHBILLNO IS '请款单编号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_USAGE IS '用途';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_BIZUNIT IS '业务单元';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PYMAGPREMAGTYPE IS '收支管理/预算管理类型';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PROJCODE IS '项目代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_PROJNAME IS '项目名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ECONSBTECONCLASSCODE IS '经济科目/经济分类代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_FUNDTSFTYPE IS '资金划拨方式';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_OPPACCTSBTCODE IS '对方会计科目代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_OLDPAYUNITACCNO IS '原付款单位账号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_OLDBDGESBTCODE IS '原预算科目代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_OLDECNMCSBT IS '原经济科目';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_BCKTREAVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110703120 ON TBV_BCKTREAVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_BEPSRECPTTRAN(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    F_COLLAMT DECIMAL(24,2),
    S_AUTOGENRECPTFLAG CHAR(1),
    S_GENFLAG CHAR(1),
    S_REVFLAG CHAR(1),
    S_TESTINGMSG VARCHAR(60),
    S_TESTFLAG CHAR(1),
    S_SUBMITERCODE VARCHAR(12),
    S_SUBMITERNAME VARCHAR(60),
    S_REVERCODE VARCHAR(12),
    S_REVERNAME VARCHAR(60),
    S_ELEFILENAME VARCHAR(130),
    S_ADJPERFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_BEPSRECPTTRAN IS '小额回执传递信息';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_AUTOGENRECPTFLAG IS '是否自动生成回执标志';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_GENFLAG IS '生成标志';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_REVFLAG IS '接收标志';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_TESTINGMSG IS '检测信息';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_TESTFLAG IS '检测标志';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_SUBMITERCODE IS '提交人代码';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_SUBMITERNAME IS '提交人名称';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_REVERCODE IS '接收人代码';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_REVERNAME IS '接收人名称';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_BEPSRECPTTRAN.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110703450 ON TBV_BEPSRECPTTRAN(S_TRANSSERNO);

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


CREATE UNIQUE INDEX SQL221020110704000 ON TBV_BRHTREASINCVOUCH(S_TRANSSERNO,I_SERNO);
CREATE INDEX IX_TBV_BRHTREASINCVOUCH_DACCTDATE ON TBV_BRHTREASINCVOUCH(D_ACCTDATE);
CREATE INDEX IX_TBV_BRHTREASINCVOUCH_SAMTSRLNO ON TBV_BRHTREASINCVOUCH(S_AMTSRLNO);
CREATE INDEX IX_TBV_BRHTREASINCVOUCH_SELEFILENAME ON TBV_BRHTREASINCVOUCH(S_ELEFILENAME);

CREATE TABLE TBV_CASHAPPROBACKVOUCHDETAL(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36) NOT NULL,
    S_PAYUNOPNBNKNO VARCHAR(18) NOT NULL,
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_DEPOSITNO VARCHAR(36) NOT NULL,
    S_ATTACHINFO VARCHAR(512),
    S_PROJNO VARCHAR(36),
    S_FUNDPAYMNTTYPE CHAR(1) NOT NULL,
    S_BDGESBTCODE VARCHAR(36),
    S_BDGESBTNAME VARCHAR(200),
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_CERTPROCSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_CASHAPPROBACKVOUCHDETAL IS '现金拨付收回凭证明细表';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYUNOPNBNKNO IS '付款单位开户行行号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.F_AMT IS '金额';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_DEPOSITNO IS '存款编号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_PROJNO IS '项目编码';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_FUNDPAYMNTTYPE IS '资金支付方式';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_CASHAPPROBACKVOUCHDETAL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110704820 ON TBV_CASHAPPROBACKVOUCHDETAL(S_TRANSSERNO);

CREATE TABLE TBV_CASHMANAGEVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    D_GRANTDATE DATE NOT NULL,
    S_DATACLASSES CHAR(1),
    D_ACCTDATE DATE,
    S_VOUNO VARCHAR(42),
    S_CORRECTFLAG CHAR(1),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNO VARCHAR(18),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    F_AMT DECIMAL(24,2),
    S_AMTWORDS VARCHAR(512),
    S_DEPOSITNO VARCHAR(36),
    S_ATTACHINFO VARCHAR(512),
    S_PROJNO VARCHAR(36),
    S_FUNDPAYMNTTYPE CHAR(1),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_ACCTENTRYLOAN VARCHAR(36),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_CHRGERCODE VARCHAR(12),
    S_CHRGERNAME VARCHAR(60),
    S_CERTPROCSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_CASHMANAGEVOUCH IS '现金管理凭证表';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.D_GRANTDATE IS '拨款日期';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_DATACLASSES IS '数据类别';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_CORRECTFLAG IS '冲正标识';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PAYUNOPNBNKNO IS '付款单位开户行行号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_AMTWORDS IS '大写金额';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_DEPOSITNO IS '存款编号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_PROJNO IS '项目编码';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_FUNDPAYMNTTYPE IS '资金支付方式';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_ACCTENTRYLOAN IS '会计分录(贷)';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_CHRGERCODE IS '记账员代码';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_CHRGERNAME IS '记账员名称';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_CASHMANAGEVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110705280 ON TBV_CASHMANAGEVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_CASHMANGEOUTLYVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    S_ELEVOUID VARCHAR(100),
    F_COLLAMT DECIMAL(24,2),
    D_ACCTDATE DATE,
    S_VOUNO VARCHAR(42),
    S_REALFUNDBILLTYPECODE VARCHAR(36),
    S_REALFUNDBILLTYPENO VARCHAR(36),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNO VARCHAR(18),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_REALPAYVOUCHNO VARCHAR(36),
    S_ALCTNVOUCHNO VARCHAR(36),
    S_PAYMNTODRNO VARCHAR(36),
    S_ADJPERFLAG CHAR(1),
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_BDGESBTCODE VARCHAR(36),
    S_BDGESBTNAME VARCHAR(200),
    S_CASHBILLNO VARCHAR(36),
    I_SAVINGDUETIME INTEGER,
    F_SAVINGRATE DECIMAL(7,4),
    S_BIZUNIT VARCHAR(60),
    S_FUNDTYPE VARCHAR(10),
    S_REVEXPCTRL VARCHAR(10),
    S_PROJCODE VARCHAR(10),
    S_PROJNAME VARCHAR(60),
    S_ECNMCSBT VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_FUNDTSFTYPE CHAR(1),
    S_BIZKNDCODE VARCHAR(7),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_ELEVOUSERNO VARCHAR(36),
    S_VOUCHRATE VARCHAR(20),
    S_VOUCHEXPIRE VARCHAR(50),
    S_FLOWPROCSTATE VARCHAR(10),
    TS_SYSUPDATE TIMESTAMP,
    S_CERTPROCSTATE CHAR(1),
    S_FLOWSORTCODE VARCHAR(36),
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_CASHMANGEOUTLYVOUCH IS '现金管理支出凭证';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_REALFUNDBILLTYPECODE IS '实拨资金单据类型代码';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_REALFUNDBILLTYPENO IS '实拨资金单据类型编号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYUNOPNBNKNO IS '付款单位开户行行号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_REALPAYVOUCHNO IS '对应的实拨支付凭证号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_ALCTNVOUCHNO IS '拨款凭证号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYMNTODRNO IS '支付令编号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYEEUNITCODE IS '收款单位代码';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_CASHBILLNO IS '请款单编号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.I_SAVINGDUETIME IS '存款期限';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.F_SAVINGRATE IS '存款利率';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_BIZUNIT IS '业务单元';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_REVEXPCTRL IS '收支管理';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PROJCODE IS '项目代码';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_PROJNAME IS '项目名称';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_FUNDTSFTYPE IS '资金划拨方式';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_VOUCHRATE IS '凭证利率';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_VOUCHEXPIRE IS '凭证期限';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_CASHMANGEOUTLYVOUCH.S_FLOWSORTCODE IS '流程类别代码';


CREATE UNIQUE INDEX SQL221020110638030 ON TBV_CASHMANGEOUTLYVOUCH(S_TRANSSERNO);

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

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


CREATE UNIQUE INDEX SQL221020110705700 ON TBV_CBDGEINCGLOANVOUCH(S_TRANSSERNO,I_SERNO);

CREATE TABLE TBV_CRECTBUSIDET(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_ADTTASKSRLNO VARCHAR(36),
    S_ELEVOUID VARCHAR(100) NOT NULL,
    S_VOUCHERNO VARCHAR(42),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ADJPERFLAG CHAR(1),
    D_ACCTDATE DATE NOT NULL,
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_ADTDATE DATE,
    S_OLDFUNITEMCODE VARCHAR(10),
    S_OLDFUNITEMNAME VARCHAR(60),
    F_OLDPAYAMT DECIMAL(24,2),
    S_OLDCHRGVOUNO VARCHAR(20),
    D_OLDCHRGDATE DATE,
    S_OLDDPMTCODE VARCHAR(36),
    S_OLDDPMTNAME VARCHAR(60),
    S_OLDDPMTINTERCODE VARCHAR(9),
    S_ADTFUNITEMCODE VARCHAR(10),
    S_ADTFUNITEMNAME VARCHAR(60),
    F_ADTPAYAMT DECIMAL(24,2),
    S_ADTCHRGVOUNO VARCHAR(20),
    D_ADTCHRGDATE DATE,
    S_ADTDPMTCODE VARCHAR(36),
    S_ADTDPMTNAME VARCHAR(60),
    S_ADTDPMTINTERCODE VARCHAR(9),
    S_ITEM VARCHAR(10),
    S_CERTPROCSTATE CHAR(1),
    S_OPPITEM VARCHAR(10),
    S_OPPACCTNO VARCHAR(36),
    S_ADTREASON VARCHAR(200),
    S_DURATIONNAME VARCHAR(30),
    S_ACCTNO VARCHAR(36),
    S_DURATIONFLAG VARCHAR(5),
    D_PRCCHARGEDATE DATE,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_CRECTBUSIDET IS '更正业务明细表';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTTASKSRLNO IS '更正业务编号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_CRECTBUSIDET.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTDATE IS '更正日期';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OLDFUNITEMCODE IS '原功能分类代码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OLDFUNITEMNAME IS '原功能分类名称';
COMMENT ON COLUMN TBV_CRECTBUSIDET.F_OLDPAYAMT IS '原缴款金额';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OLDCHRGVOUNO IS '原记账凭证号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.D_OLDCHRGDATE IS '原记账时间';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OLDDPMTCODE IS '原部门代码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OLDDPMTNAME IS '原部门名称';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OLDDPMTINTERCODE IS '原部门国标码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTFUNITEMCODE IS '更正后功能分类代码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTFUNITEMNAME IS '更正后功能分类名称';
COMMENT ON COLUMN TBV_CRECTBUSIDET.F_ADTPAYAMT IS '更正后缴款金额';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTCHRGVOUNO IS '更正后记账凭证号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.D_ADTCHRGDATE IS '更正后记账时间';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTDPMTCODE IS '更正后部门代码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTDPMTNAME IS '更正后部门名称';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTDPMTINTERCODE IS '更正后部门国标码';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ITEM IS '事项';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OPPITEM IS '对方事项';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ADTREASON IS '更正原因';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_DURATIONNAME IS '期间名称';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_CRECTBUSIDET.S_DURATIONFLAG IS '期间标记';
COMMENT ON COLUMN TBV_CRECTBUSIDET.D_PRCCHARGEDATE IS '人行记账日期';
COMMENT ON COLUMN TBV_CRECTBUSIDET.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110706250 ON TBV_CRECTBUSIDET(S_TRANSSERNO);

CREATE TABLE TBV_CTLPAYBCKDTLVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_FUNDPAYMNTTYPE CHAR(1),
    S_VOUNO VARCHAR(42),
    S_PAYERCODE VARCHAR(12),
    S_PAYPSNFULNAME VARCHAR(60),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYEERFULNAME VARCHAR(200),
    S_REVACCT VARCHAR(32),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    F_AMT DECIMAL(24,2),
    S_BRIEF VARCHAR(512),
    S_BDGETUNCODE VARCHAR(36),
    S_BDGETUNNAME VARCHAR(60),
    S_BDGESBTCODE VARCHAR(36),
    S_ECNMCSBT VARCHAR(36),
    S_REVEXPCTRLTYPE VARCHAR(4),
    F_COLLAMT DECIMAL(24,2),
    S_REMARK VARCHAR(512),
    S_RESERVED VARCHAR(100),
    S_PAYTYPECMT VARCHAR(512),
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_CERTPROCSTATE CHAR(1),
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_OPERNAME VARCHAR(60),
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_FLOWPROCSTATE VARCHAR(10),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_FLOWSORTCODE VARCHAR(36),
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_CTLPAYBCKDTLVOUCH IS '集中支付退回凭证明细表';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_FUNDPAYMNTTYPE IS '资金支付方式';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYERCODE IS '付款人代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYEERFULNAME IS '收款人全称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_BDGETUNNAME IS '预算单位名称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_REVEXPCTRLTYPE IS '收支管理类型';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYTYPECMT IS '支付方式说明';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_CTLPAYBCKDTLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110638560 ON TBV_CTLPAYBCKDTLVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_CZVOUCHKRS36(
    I_FLOWID BIGINT(19) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_FUNITEMCODE VARCHAR(10),
    S_FUNITEMNAME VARCHAR(60),
    D_ACCTDATE DATE,
    S_FUNDTYPE VARCHAR(10),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_BDGEMANGETYPE VARCHAR(4),
    F_CLEARSUMAMT DECIMAL(24,2),
    F_NATONTREASUM DECIMAL(24,2),
    S_CHKRSLTFLAG CHAR(1),
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_BGNAMTMEGNO VARCHAR(20),
    S_ENDAMTMEGNO VARCHAR(20),
    S_RETELEVOUID VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_CZVOUCHKRS36 IS '直接支付汇总清算额度对账结果';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.F_CLEARSUMAMT IS '清算累计额度';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.F_NATONTREASUM IS '国库汇总金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_BGNAMTMEGNO IS '起始额度通知单号';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_ENDAMTMEGNO IS '截止额度通知单号';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TBV_CZVOUCHKRS36.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110638890 ON TBV_CZVOUCHKRS36(I_FLOWID);

CREATE TABLE TBV_CZVOUCHKRS37(
    I_FLOWID BIGINT(19) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_FUNITEMCODE VARCHAR(10),
    S_FUNITEMNAME VARCHAR(60),
    D_ACCTDATE DATE,
    S_FUNDTYPE VARCHAR(10),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_BDGEMANGETYPE VARCHAR(4),
    F_CLEARSUMAMT DECIMAL(24,2),
    F_NATONTREASUM DECIMAL(24,2),
    S_CHKRSLTFLAG CHAR(1),
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_BGNAMTMEGNO VARCHAR(20),
    S_ENDAMTMEGNO VARCHAR(20),
    S_RETELEVOUID VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_CZVOUCHKRS37 IS '授权支付汇总清算额度对账结果';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.F_CLEARSUMAMT IS '清算累计额度';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.F_NATONTREASUM IS '国库汇总金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_BGNAMTMEGNO IS '起始额度通知单号';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_ENDAMTMEGNO IS '截止额度通知单号';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TBV_CZVOUCHKRS37.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110639200 ON TBV_CZVOUCHKRS37(I_FLOWID);

CREATE TABLE TBV_CZVOUCHKRS88(
    I_FLOWID BIGINT(19) NOT NULL,
    D_ACCTDATE DATE,
    I_VOUDUR INTEGER,
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_FUNITEMCODE VARCHAR(10),
    S_FUNITEMNAME VARCHAR(60),
    F_NATONTREAYEARSUMAMT DECIMAL(24,2),
    F_NATONTREACURPRIAMT DECIMAL(24,2),
    S_CHKRSLTFLAG CHAR(1),
    F_YEARAPRAMT DECIMAL(24,2),
    F_CURMONTHAPRAMT DECIMAL(24,2),
    S_RETELEVOUID VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_CZVOUCHKRS88 IS '与财政拨款信息月度对账结果';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.I_VOUDUR IS '凭证期间';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.F_NATONTREAYEARSUMAMT IS '国库年累计金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.F_NATONTREACURPRIAMT IS '国库本月拨款金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.F_YEARAPRAMT IS '年累计拨款金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.F_CURMONTHAPRAMT IS '本月拨款金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TBV_CZVOUCHKRS88.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110639470 ON TBV_CZVOUCHKRS88(I_FLOWID);

CREATE TABLE TBV_CZVOUCHKRS89(
    I_FLOWID BIGINT(19) NOT NULL,
    D_ACCTDATE DATE,
    I_VOUDUR INTEGER,
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_FUNITEMCODE VARCHAR(10),
    S_FUNITEMNAME VARCHAR(60),
    F_NATONTREAYEARSUMAMT DECIMAL(24,2),
    F_NATONTREACURPRIAMT DECIMAL(24,2),
    S_CHKRSLTFLAG CHAR(1),
    F_YEARAPRAMT DECIMAL(24,2),
    F_CURMONTHAPRAMT DECIMAL(24,2),
    S_RETELEVOUID VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_CZVOUCHKRS89 IS '与财政退库信息月度对账结果';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.I_VOUDUR IS '凭证期间';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.F_NATONTREAYEARSUMAMT IS '国库年累计金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.F_NATONTREACURPRIAMT IS '国库本月拨款金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.F_YEARAPRAMT IS '年累计拨款金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.F_CURMONTHAPRAMT IS '本月拨款金额';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TBV_CZVOUCHKRS89.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110639700 ON TBV_CZVOUCHKRS89(I_FLOWID);

CREATE TABLE TBV_CZVOUDTL36(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60),
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    S_BDGEMANGETYPENAME VARCHAR(150) NOT NULL,
    F_CLEARSUMAMT DECIMAL(24,2) NOT NULL,
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_FUNDTYPE VARCHAR(10),
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_CZVOUDTL36 IS '直接支付汇总清算额度对帐单明细表';
COMMENT ON COLUMN TBV_CZVOUDTL36.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_BDGEMANGETYPENAME IS '预算管理类型名称';
COMMENT ON COLUMN TBV_CZVOUDTL36.F_CLEARSUMAMT IS '清算累计额度';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_CZVOUDTL36.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_CZVOUDTL36.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110640000 ON TBV_CZVOUDTL36(I_CHILDSRLNO);

CREATE TABLE TBV_CZVOUDTL37(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60),
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    S_BDGEMANGETYPENAME VARCHAR(150) NOT NULL,
    F_CLEARSUMAMT DECIMAL(24,2) NOT NULL,
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_FUNDTYPE VARCHAR(10),
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_CZVOUDTL37 IS '授权支付汇总清算额度对账单明细表';
COMMENT ON COLUMN TBV_CZVOUDTL37.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_BDGEMANGETYPENAME IS '预算管理类型名称';
COMMENT ON COLUMN TBV_CZVOUDTL37.F_CLEARSUMAMT IS '清算累计额度';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_CZVOUDTL37.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_CZVOUDTL37.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110640290 ON TBV_CZVOUDTL37(I_CHILDSRLNO);

CREATE TABLE TBV_CZVOUDTL88(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60),
    F_CURMONTHAPRAMT DECIMAL(24,2) NOT NULL,
    F_CURYEARAPRAMT DECIMAL(24,2) NOT NULL,
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_CZVOUDTL88 IS '中央预算拨款对账单明细表';
COMMENT ON COLUMN TBV_CZVOUDTL88.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_CZVOUDTL88.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUDTL88.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUDTL88.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUDTL88.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUDTL88.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUDTL88.F_CURMONTHAPRAMT IS '本月拨款金额';
COMMENT ON COLUMN TBV_CZVOUDTL88.F_CURYEARAPRAMT IS '年初至本月累计拨款金额';
COMMENT ON COLUMN TBV_CZVOUDTL88.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_CZVOUDTL88.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110640510 ON TBV_CZVOUDTL88(I_CHILDSRLNO);

CREATE TABLE TBV_CZVOUDTL89(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60),
    F_CURMONTHAPRAMT DECIMAL(24,2) NOT NULL,
    F_CURYEARAPRAMT DECIMAL(24,2) NOT NULL,
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_CZVOUDTL89 IS '收入退还拨款对账单明细表';
COMMENT ON COLUMN TBV_CZVOUDTL89.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_CZVOUDTL89.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUDTL89.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_CZVOUDTL89.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_CZVOUDTL89.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_CZVOUDTL89.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_CZVOUDTL89.F_CURMONTHAPRAMT IS '本月拨款金额';
COMMENT ON COLUMN TBV_CZVOUDTL89.F_CURYEARAPRAMT IS '年初至本月累计拨款金额';
COMMENT ON COLUMN TBV_CZVOUDTL89.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_CZVOUDTL89.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110640700 ON TBV_CZVOUDTL89(I_CHILDSRLNO);

CREATE TABLE TBV_CZVOUSNDCHKRS(
    I_FLOWID BIGINT(19) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    S_ELEFILENAME VARCHAR(130) NOT NULL,
    S_PROCSTATE VARCHAR(4),
    S_VOUID VARCHAR(36),
    S_VOUCHERNO VARCHAR(42),
    S_ELEVOUKINDCODE VARCHAR(10),
    D_ACCTDATE DATE,
    I_ELEVOUSEQNUM BIGINT(19),
    S_MSGTYPECODE VARCHAR(32),
    S_ELEVOUBIZTYPECODE VARCHAR(36),
    S_SNDREVFLAG CHAR(1),
    S_CHECKFLAG CHAR(1),
    S_CZPROCSTATE VARCHAR(4),
    D_CHECKDATE DATE,
    S_RETELEVOUID VARCHAR(36),
    S_ELEVOUCNNAME VARCHAR(150),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_CZVOUSNDCHKRS IS '电子凭证财政发送清单核对结果表';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_VOUID IS '凭证ID';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_ELEVOUKINDCODE IS '电子凭证种类代码';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.I_ELEVOUSEQNUM IS '电子凭证顺序号';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_ELEVOUBIZTYPECODE IS '电子凭证业务类型代码';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_SNDREVFLAG IS '接收发送标志';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_CHECKFLAG IS '核对标志';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_CZPROCSTATE IS '财政电子凭证状态';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.D_CHECKDATE IS '核对日期';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_RETELEVOUID IS '回执电子凭证标识号';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.S_ELEVOUCNNAME IS '电子凭证中文名称';
COMMENT ON COLUMN TBV_CZVOUSNDCHKRS.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110704420 ON TBV_CZVOUSNDCHKRS(I_FLOWID);

CREATE TABLE TBV_CZVOUSNDDTL99(
    I_CHILDSRLNO BIGINT(19),
    S_VOUID VARCHAR(36),
    S_SNDREVFLAG CHAR(1),
    I_ELEVOUSEQNUM BIGINT(19),
    S_ELEVOUKINDCODE VARCHAR(10),
    S_MSGTYPECODE VARCHAR(32),
    D_VOUDATE DATE,
    S_VOUCHERNO VARCHAR(42),
    S_SRLNO VARCHAR(36),
    S_ELEFILENAME VARCHAR(130),
    S_ELEVOUBIZTYPECODE VARCHAR(36),
    S_CZPROCSTATE VARCHAR(4),
    S_CANCELREASON VARCHAR(60),
    S_ELEVOUCNNAME VARCHAR(150),
    TS_SYSUPDATE TIMESTAMP
);

COMMENT ON TABLE TBV_CZVOUSNDDTL99 IS '电子凭证财政发送清单明细表';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_VOUID IS '凭证ID';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_SNDREVFLAG IS '接收发送标志';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.I_ELEVOUSEQNUM IS '电子凭证顺序号';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_ELEVOUKINDCODE IS '电子凭证种类代码';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_ELEVOUBIZTYPECODE IS '电子凭证业务类型代码';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_CZPROCSTATE IS '财政电子凭证状态';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_CANCELREASON IS '作废原因/退回原因';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.S_ELEVOUCNNAME IS '电子凭证中文名称';
COMMENT ON COLUMN TBV_CZVOUSNDDTL99.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TBV_CZVOUSNDSUM99(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100),
    D_VOUDATE DATE,
    I_FILENUM INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_CZVOUSNDSUM99 IS '电子凭证财政发送清单汇总表';
COMMENT ON COLUMN TBV_CZVOUSNDSUM99.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUSNDSUM99.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CZVOUSNDSUM99.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSNDSUM99.I_FILENUM IS '文件个数';
COMMENT ON COLUMN TBV_CZVOUSNDSUM99.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715070 ON TBV_CZVOUSNDSUM99(S_SRLNO);

CREATE TABLE TBV_CZVOUSUM36(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100),
    D_VOUDATE DATE,
    S_VOUCHERNO VARCHAR(42),
    F_COLLAMT DECIMAL(24,2),
    S_BGNAMTMEGNO VARCHAR(20),
    S_ENDAMTMEGNO VARCHAR(20),
    I_FILENUM INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_CZVOUSUM36 IS '直接支付汇总清算额度对帐单汇总表';
COMMENT ON COLUMN TBV_CZVOUSUM36.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUSUM36.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CZVOUSUM36.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSUM36.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CZVOUSUM36.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_CZVOUSUM36.S_BGNAMTMEGNO IS '起始额度通知单号';
COMMENT ON COLUMN TBV_CZVOUSUM36.S_ENDAMTMEGNO IS '截止额度通知单号';
COMMENT ON COLUMN TBV_CZVOUSUM36.I_FILENUM IS '文件个数';
COMMENT ON COLUMN TBV_CZVOUSUM36.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110640890 ON TBV_CZVOUSUM36(S_SRLNO);

CREATE TABLE TBV_CZVOUSUM37(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100),
    D_VOUDATE DATE,
    S_VOUCHERNO VARCHAR(42),
    F_COLLAMT DECIMAL(24,2),
    S_BGNAMTMEGNO VARCHAR(20),
    S_ENDAMTMEGNO VARCHAR(20),
    I_FILENUM INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_CZVOUSUM37 IS '授权支付汇总清算额度对账单汇总表';
COMMENT ON COLUMN TBV_CZVOUSUM37.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUSUM37.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CZVOUSUM37.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSUM37.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CZVOUSUM37.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_CZVOUSUM37.S_BGNAMTMEGNO IS '起始额度通知单号';
COMMENT ON COLUMN TBV_CZVOUSUM37.S_ENDAMTMEGNO IS '截止额度通知单号';
COMMENT ON COLUMN TBV_CZVOUSUM37.I_FILENUM IS '文件个数';
COMMENT ON COLUMN TBV_CZVOUSUM37.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110641110 ON TBV_CZVOUSUM37(S_SRLNO);

CREATE TABLE TBV_CZVOUSUM88(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    I_VOUDUR INTEGER NOT NULL,
    S_VOUDURDCRIB VARCHAR(50) NOT NULL,
    S_VOUCHERNO VARCHAR(42) NOT NULL,
    S_REPORTNAME VARCHAR(100) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_CZVOUSUM88 IS '中央预算拨款对账单汇总表';
COMMENT ON COLUMN TBV_CZVOUSUM88.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUSUM88.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CZVOUSUM88.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSUM88.I_VOUDUR IS '凭证期间';
COMMENT ON COLUMN TBV_CZVOUSUM88.S_VOUDURDCRIB IS '凭证期间描述';
COMMENT ON COLUMN TBV_CZVOUSUM88.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CZVOUSUM88.S_REPORTNAME IS '报表名称';
COMMENT ON COLUMN TBV_CZVOUSUM88.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110641260 ON TBV_CZVOUSUM88(S_SRLNO);

CREATE TABLE TBV_CZVOUSUM89(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    I_VOUDUR INTEGER NOT NULL,
    S_VOUDURDCRIB VARCHAR(50) NOT NULL,
    S_VOUCHERNO VARCHAR(42) NOT NULL,
    S_REPORTNAME VARCHAR(100) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_CZVOUSUM89 IS '收入退还拨款对账单汇总表';
COMMENT ON COLUMN TBV_CZVOUSUM89.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_CZVOUSUM89.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_CZVOUSUM89.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_CZVOUSUM89.I_VOUDUR IS '凭证期间';
COMMENT ON COLUMN TBV_CZVOUSUM89.S_VOUDURDCRIB IS '凭证期间描述';
COMMENT ON COLUMN TBV_CZVOUSUM89.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_CZVOUSUM89.S_REPORTNAME IS '报表名称';
COMMENT ON COLUMN TBV_CZVOUSUM89.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110641450 ON TBV_CZVOUSUM89(S_SRLNO);

CREATE TABLE TBV_DAYTIMEAMTBALNC(
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    F_BALNC DECIMAL(24,2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PAYTYPEFLAG,S_PROXYBANKCODE,S_DPMTCODE,S_BDGESBTCODE,S_BDGEMANGETYPE)
);

COMMENT ON TABLE TBV_DAYTIMEAMTBALNC IS '日间额度余额表';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.F_BALNC IS '余额';
COMMENT ON COLUMN TBV_DAYTIMEAMTBALNC.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110706430 ON TBV_DAYTIMEAMTBALNC(S_PAYTYPEFLAG,S_PROXYBANKCODE,S_DPMTCODE,S_BDGESBTCODE,S_BDGEMANGETYPE);

CREATE TABLE TBV_ELECVMQDTLVOUCH(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60),
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_PAYTYPECMT VARCHAR(512) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    S_VOUINFONO VARCHAR(36) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    I_TOTALSUM INTEGER NOT NULL,
    S_OPERNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    S_REMARK VARCHAR(512),
    S_RESERVED VARCHAR(100),
    I_SERNO BIGINT(19) NOT NULL,
    S_PAYPSNFULNAME VARCHAR(60) NOT NULL,
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYOPENBANKNAME VARCHAR(150) NOT NULL,
    S_PAYEROPENBANKNO VARCHAR(18) NOT NULL,
    S_PAYTYPE VARCHAR(10) NOT NULL,
    S_PAYEERFULNAME VARCHAR(200),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_ONELVLBDGEUNCODE VARCHAR(36) NOT NULL,
    S_ONELVLBDGEUNNAME VARCHAR(60) NOT NULL,
    S_BSLVLBDGEUNCODE VARCHAR(36) NOT NULL,
    S_BSLVLBDGEUNNAME VARCHAR(60) NOT NULL,
    D_PAYDATE DATE NOT NULL,
    D_RECKDATE DATE NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60),
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_REVEXPCTRLTYPE VARCHAR(4),
    S_FUNDTYPE VARCHAR(10),
    S_FUNDUSAGE VARCHAR(300),
    S_ELEVOUSERNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_ELECVMQDTLVOUCH IS '集中支付清算明细凭证表';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYTYPECMT IS '支付方式说明';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_VOUINFONO IS '信息编号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYTYPE IS '支付类型';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYEERFULNAME IS '收款人全称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_ONELVLBDGEUNCODE IS '一级预算单位代码';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_ONELVLBDGEUNNAME IS '一级预算单位名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_BSLVLBDGEUNCODE IS '基层预算单位代码';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_BSLVLBDGEUNNAME IS '基层预算科目名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.D_PAYDATE IS '支付日期';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.D_RECKDATE IS '清算日期';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_REVEXPCTRLTYPE IS '收支管理类型';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_FUNDUSAGE IS '资金用途';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_ELECVMQDTLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110707720 ON TBV_ELECVMQDTLVOUCH(S_SRLNO);

CREATE TABLE TBV_ELECVMTDTLVOUCH(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60),
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_PAYTYPECMT VARCHAR(512) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    S_VOUINFONO VARCHAR(36) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    I_TOTALSUM INTEGER NOT NULL,
    S_OPERNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    S_REMARK VARCHAR(512),
    S_RESERVED VARCHAR(100),
    I_SERNO BIGINT(19) NOT NULL,
    D_OLDPAYVOUDATE DATE,
    D_PAYBACKDATE DATE,
    S_PAYPSNFULNAME VARCHAR(60) NOT NULL,
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYOPENBANKNAME VARCHAR(150) NOT NULL,
    S_PAYEROPENBANKNO VARCHAR(18) NOT NULL,
    S_PAYTYPE VARCHAR(10) NOT NULL,
    S_PAYEERFULNAME VARCHAR(200),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_ONELVLBDGEUNCODE VARCHAR(36) NOT NULL,
    S_ONELVLBDGEUNNAME VARCHAR(60) NOT NULL,
    S_BSLVLBDGEUNCODE VARCHAR(36) NOT NULL,
    S_BSLVLBDGEUNNAME VARCHAR(60) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_FUNITEMCODE VARCHAR(10) NOT NULL,
    S_FUNITEMNAME VARCHAR(60),
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_REVEXPCTRLTYPE VARCHAR(4),
    S_FUNDTYPE VARCHAR(10),
    S_FUNDUSAGE VARCHAR(300),
    S_PAYBACKRESON VARCHAR(512),
    S_ELEVOUSERNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_ELECVMTDTLVOUCH IS '集中支付退库明细凭证表';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYTYPECMT IS '支付方式说明';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_VOUINFONO IS '信息编号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.D_OLDPAYVOUDATE IS '原支付凭证日期';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.D_PAYBACKDATE IS '退款日期';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYTYPE IS '支付类型';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYEERFULNAME IS '收款人全称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_ONELVLBDGEUNCODE IS '一级预算单位代码';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_ONELVLBDGEUNNAME IS '一级预算单位名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_BSLVLBDGEUNCODE IS '基层预算单位代码';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_BSLVLBDGEUNNAME IS '基层预算科目名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_REVEXPCTRLTYPE IS '收支管理类型';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_FUNDUSAGE IS '资金用途';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_PAYBACKRESON IS '退款原因';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_ELECVMTDTLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110708310 ON TBV_ELECVMTDTLVOUCH(S_SRLNO);

CREATE TABLE TBV_ELECVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    S_ELEVOUSERNO VARCHAR(36),
    S_PAYTYPEFLAG CHAR(1),
    S_PAYTYPECMT VARCHAR(512),
    S_BIZKNDCODE VARCHAR(7),
    S_ELEVOUID VARCHAR(100),
    D_ACCTDATE DATE,
    S_VOUNO VARCHAR(42),
    D_VOUDATE DATE,
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_PAYEEROPENBANKNO VARCHAR(18),
    F_COLLAMT DECIMAL(24,2),
    S_OPERNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    S_REMARK VARCHAR(512),
    S_BDGETUNCODE VARCHAR(36),
    S_BDGETUNNAME VARCHAR(60),
    F_AMT DECIMAL(24,2),
    S_BDGESBTCODE VARCHAR(36),
    S_FUNITEMNAME VARCHAR(60),
    S_BDGEMANGETYPE VARCHAR(4),
    S_BDGEMANGETYPENAME VARCHAR(150),
    S_ECNMCSBT VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_FUNDTYPE VARCHAR(10),
    S_RESERVED VARCHAR(100),
    S_USAGE VARCHAR(150),
    S_FUNDTSFTYPE CHAR(1),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_TYPISTCODE VARCHAR(12),
    S_ACCTANTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTNAME VARCHAR(60),
    S_FLOWPROCSTATE VARCHAR(10),
    S_FLOWSORTCODE VARCHAR(36),
    S_CERTPROCSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_ELECVOUCH IS '集中支付电子凭证表';
COMMENT ON COLUMN TBV_ELECVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYTYPECMT IS '支付方式说明';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_ELECVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_ELECVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_ELECVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYEEUNITCODE IS '收款单位代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TBV_ELECVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_ELECVOUCH.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_ELECVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BDGETUNNAME IS '预算单位名称';
COMMENT ON COLUMN TBV_ELECVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_ELECVOUCH.S_BDGEMANGETYPENAME IS '预算管理类型名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_ELECVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_ELECVOUCH.S_USAGE IS '用途';
COMMENT ON COLUMN TBV_ELECVOUCH.S_FUNDTSFTYPE IS '资金划拨方式';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_ELECVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_ELECVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_ELECVOUCH.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TBV_ELECVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_ELECVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110707120 ON TBV_ELECVOUCH(S_TRANSSERNO);
CREATE INDEX IX_TBV_ELECVOUCH_DACCTDATE ON TBV_ELECVOUCH(D_ACCTDATE);
CREATE INDEX IX_TBV_ELECVOUCH_ELEVOUSERNO ON TBV_ELECVOUCH(S_ELEVOUSERNO);

CREATE TABLE TBV_FINAALCTNVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    S_ELEVOUID VARCHAR(100) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42) NOT NULL,
    S_REALFUNDBILLTYPECODE VARCHAR(36) NOT NULL,
    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),
    S_BIZTIMETYPENAME VARCHAR(60),
    S_BIZTIMETYPECODE VARCHAR(36) NOT NULL,
    S_REALPAYVOUCHNO VARCHAR(36) NOT NULL,
    S_PAYMNTODRNO VARCHAR(36) NOT NULL,
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60) NOT NULL,
    S_PAYEEUNITFULACCNO VARCHAR(36) NOT NULL,
    S_PAYEEUNOPNBNKNAME VARCHAR(200) NOT NULL,
    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),
    S_FUNDTYPE VARCHAR(10),
    S_PROJCODE VARCHAR(10),
    S_PROJNAME VARCHAR(60),
    S_ECNMCSBT VARCHAR(36),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_FUNDTSFTYPE CHAR(1),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    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),
    S_FUNITEMNAME VARCHAR(60),
    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),
    PRIMARY KEY (S_TRANSSERNO)
);

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


CREATE UNIQUE INDEX SQL221020110708810 ON TBV_FINAALCTNVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_INCFUNDVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42),
    I_MSGSRLNO BIGINT(19) NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_DTLPOSTBIZKND VARCHAR(7),
    S_ACCTNO VARCHAR(36),
    S_DEBTCREDTFLAG CHAR(1),
    F_SUMAMT DECIMAL(24,2) NOT NULL,
    I_ATTACHNUM INTEGER,
    S_MSGKINDCODE VARCHAR(32) NOT NULL,
    S_FUNDORIT CHAR(1) NOT NULL,
    S_CTGYPURPCODE VARCHAR(10),
    D_ENTRUSTDATE DATE,
    S_TXTYPECODE VARCHAR(10),
    S_PAYERACCTNO VARCHAR(32) NOT NULL,
    S_PAYERNAME 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_PAYEEBANKNO VARCHAR(18),
    S_PAYEEBANKNAME VARCHAR(256),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_CDTRMMBANKNO VARCHAR(18),
    S_CDTRMMBANKNAME VARCHAR(256),
    S_DBTRMMBANKNO VARCHAR(18),
    S_DBTRMMBANKNAME VARCHAR(256),
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_INACCFUNDPROCSTATE CHAR(1),
    S_REVERCODE VARCHAR(12),
    S_REVERNAME VARCHAR(60),
    S_SUBMITERCODE VARCHAR(12),
    S_SUBMITERNAME VARCHAR(60),
    S_BRIEFCODE VARCHAR(36),
    S_ATTACHINFO VARCHAR(512),
    S_OPPACCTNO VARCHAR(36) NOT NULL,
    S_PAYTRANSNO VARCHAR(36),
    S_MSGID VARCHAR(35),
    S_ORIAMTSRLNO VARCHAR(30),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_INCFUNDVOUCH IS '来帐资金凭证表';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_DTLPOSTBIZKND IS '明细岗业务种类';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.F_SUMAMT IS '总金额';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_FUNDORIT IS '资金方向';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_CTGYPURPCODE IS '业务种类编码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.D_ENTRUSTDATE IS '委托日期';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_TXTYPECODE IS '支付业务类型编码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYBANKNO IS '付款行行号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYBANKNAME IS '付款行名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYEEBANKNO IS '收款行行号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYEEBANKNAME IS '收款行名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_CDTRMMBANKNO IS '付款清算行行号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_CDTRMMBANKNAME IS '付款清算行名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_DBTRMMBANKNO IS '收款清算行行号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_DBTRMMBANKNAME IS '收款清算行名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_INACCFUNDPROCSTATE IS '资金处理状态';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_REVERCODE IS '接收人代码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_REVERNAME IS '接收人名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_SUBMITERCODE IS '提交人代码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_SUBMITERNAME IS '提交人名称';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_BRIEFCODE IS '摘要代码';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_PAYTRANSNO IS '支付交易序号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.S_ORIAMTSRLNO IS '原资金交易流水号';
COMMENT ON COLUMN TBV_INCFUNDVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110709200 ON TBV_INCFUNDVOUCH(S_TRANSSERNO);
CREATE INDEX IX_TBV_INCFUNDVOUCH_DACCTDATE ON TBV_INCFUNDVOUCH(D_ACCTDATE);
CREATE INDEX IX_TBV_INCFUNDVOUCH_IMSGSRLNO ON TBV_INCFUNDVOUCH(I_MSGSRLNO);

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


CREATE UNIQUE INDEX SQL221020110709500 ON TBV_INTFUNDDETAILVOUCHER(S_TRANSSERNO);

CREATE TABLE TBV_LIMITELECVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36),
    S_PAYTYPEFLAG CHAR(1),
    S_ELEVOUID VARCHAR(100),
    F_COLLAMT DECIMAL(24,2),
    D_ACCTDATE DATE,
    S_BIZKNDCODE VARCHAR(7),
    S_VOUNO VARCHAR(42),
    D_VOUDATE DATE,
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_PAYPSNFULNAME VARCHAR(60),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYEERFULNAME VARCHAR(200),
    S_REVACCT VARCHAR(32),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_DIRECTPAYVOUCHNO VARCHAR(150),
    S_SECRETFLAG VARCHAR(20),
    S_SRLNO VARCHAR(36),
    S_BDGESBTCODE VARCHAR(36),
    S_FUNITEMCODE VARCHAR(10),
    S_FUNITEMNAME VARCHAR(60),
    I_DPMTNUM INTEGER,
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_BDGEMANGETYPE VARCHAR(4),
    S_BDGEMANGETYPENAME VARCHAR(150),
    F_RECKAMT DECIMAL(24,2),
    S_ECONITEM VARCHAR(36),
    S_ECNMCSBT VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_FUNDTYPE VARCHAR(10),
    S_RESERVED VARCHAR(100),
    S_CERTPROCSTATE CHAR(1),
    S_PROCSTATE VARCHAR(4),
    S_TYPISTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_LIMITELECVOUCH IS '额度电子凭证表';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PAYEERFULNAME IS '收款人全称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_DIRECTPAYVOUCHNO IS '对应的直接支付凭证号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_SECRETFLAG IS '涉密标志';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_FUNITEMCODE IS '功能分类代码';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_FUNITEMNAME IS '功能分类名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.I_DPMTNUM IS '部门个数';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_BDGEMANGETYPENAME IS '预算管理类型名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.F_RECKAMT IS '清算额度';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_LIMITELECVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110709900 ON TBV_LIMITELECVOUCH(S_TRANSSERNO);
CREATE INDEX IX_TBV_LIMITELECVOUCH_DACCTDATE ON TBV_LIMITELECVOUCH(D_ACCTDATE);

CREATE TABLE TBV_LIMITSIRACCT(
    I_SERNO BIGINT(19) NOT NULL,
    D_ACCTDATE DATE,
    S_DETAILTRANSNO VARCHAR(30),
    S_ELEVOUSERNO VARCHAR(36),
    S_LIMITRECKFLG CHAR(1),
    S_PAYTYPEFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    F_CURRAMT DECIMAL(24,2),
    S_VOUCHNO VARCHAR(42),
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    S_PAYPSNFULNAME VARCHAR(60),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYEERFULNAME VARCHAR(200),
    S_REVACCT VARCHAR(32),
    S_PAYEERACCTBNK VARCHAR(80),
    S_PRESBTFOUNDCLASSCODE VARCHAR(15),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_ECONSBTECONCLASSCODE VARCHAR(10),
    S_DIRECTPAYVOUCHNO VARCHAR(150),
    S_SECRETFLAG VARCHAR(20),
    S_BDGEMANGETYPE VARCHAR(4),
    S_FUNDTYPE VARCHAR(10),
    S_PROXYBANKACCT VARCHAR(30),
    S_ELEVOUID VARCHAR(100),
    S_ADJPERFLAG CHAR(1),
    S_RESERVED VARCHAR(100),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO)
);

COMMENT ON TABLE TBV_LIMITSIRACCT IS '额度流水账表';
COMMENT ON COLUMN TBV_LIMITSIRACCT.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_LIMITRECKFLG IS '额度清算标志';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_LIMITSIRACCT.F_AMT IS '金额';
COMMENT ON COLUMN TBV_LIMITSIRACCT.F_CURRAMT IS '当前余额';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_VOUCHNO IS '凭证号码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PAYEERFULNAME IS '收款人全称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PAYEERACCTBNK IS '收款人开户银行(名称)';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PRESBTFOUNDCLASSCODE IS '预算科目/功能分类代码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_ECONSBTECONCLASSCODE IS '经济科目/经济分类代码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_DIRECTPAYVOUCHNO IS '对应的直接支付凭证号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_SECRETFLAG IS '涉密标志';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_PROXYBANKACCT IS '代理银行帐号';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_LIMITSIRACCT.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_LIMITSIRACCT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110710220 ON TBV_LIMITSIRACCT(I_SERNO);
CREATE INDEX IX_TBV_LIMITSIRACCT_DACCTDATE ON TBV_LIMITSIRACCT(D_ACCTDATE);

CREATE TABLE TBV_NTAXDAYCHKDTLVOU(
    I_SERNO BIGINT(19) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_VOUCHERNO VARCHAR(42) NOT NULL,
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO,S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXDAYCHKDTLVOU IS '非税日对账文件明细信息';
COMMENT ON COLUMN TBV_NTAXDAYCHKDTLVOU.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_NTAXDAYCHKDTLVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXDAYCHKDTLVOU.F_AMT IS '金额';
COMMENT ON COLUMN TBV_NTAXDAYCHKDTLVOU.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_NTAXDAYCHKDTLVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXDAYCHKDTLVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110710360 ON TBV_NTAXDAYCHKDTLVOU(I_SERNO,S_ELEVOUSERNO);

CREATE TABLE TBV_NTAXDAYCHKSUMVOU(
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_SENDERCODE VARCHAR(10) NOT NULL,
    S_SENDERNAME VARCHAR(60) NOT NULL,
    I_TOTALSUM INTEGER NOT NULL,
    D_CHECKDATE DATE NOT NULL,
    S_ELECOPERNAME VARCHAR(60) NOT NULL,
    S_RESERVED VARCHAR(100),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXDAYCHKSUMVOU IS '非税日对账文件汇总信息';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_SENDERCODE IS '发送方代码';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_SENDERNAME IS '发送方名称';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.D_CHECKDATE IS '核对日期';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_ELECOPERNAME IS '通讯文件操作员名称';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_NTAXDAYCHKSUMVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110710510 ON TBV_NTAXDAYCHKSUMVOU(S_ELEVOUSERNO);

CREATE TABLE TBV_NTAXDAYRPTCHKDTLVOU(
    I_SERNO BIGINT(19) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_VOUCHERNO VARCHAR(42) NOT NULL,
    S_CHKRSLTFLAG CHAR(1) NOT NULL,
    S_CHKRSLTCMT VARCHAR(64),
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP
);

COMMENT ON TABLE TBV_NTAXDAYRPTCHKDTLVOU IS '非税日对账回执文件明细信息';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.F_AMT IS '金额';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKDTLVOU.TS_SYSUPDATE IS '系统更新时间';

CREATE TABLE TBV_NTAXDAYRPTCHKSUMVOU(
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_SENDERCODE VARCHAR(10) NOT NULL,
    S_SENDERNAME VARCHAR(60) NOT NULL,
    S_RECEIVERCODE VARCHAR(36) NOT NULL,
    S_RECEIVERNAME VARCHAR(60) NOT NULL,
    I_TOTALSUM INTEGER NOT NULL,
    D_CHECKDATE DATE NOT NULL,
    S_RESERVED VARCHAR(100),
    D_ACCTDATE DATE NOT NULL,
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_CHKRSLTFLAG CHAR(1),
    S_CHKRSLTCMT VARCHAR(64),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXDAYRPTCHKSUMVOU IS '非税日对账回执文件汇总信息';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_SENDERCODE IS '发送方代码';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_SENDERNAME IS '发送方名称';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_RECEIVERCODE IS '接收方代码';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_RECEIVERNAME IS '接收方名称';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.D_CHECKDATE IS '核对日期';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_NTAXDAYRPTCHKSUMVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110710760 ON TBV_NTAXDAYRPTCHKSUMVOU(S_ELEVOUSERNO);

CREATE TABLE TBV_NTAXDTLVOUCH(
    I_SERNO BIGINT(19) NOT NULL,
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_FEESUNITCODE VARCHAR(36) NOT NULL,
    S_FEESUNITNAME VARCHAR(150) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_ECONITEM VARCHAR(36),
    S_ECONITEMNAME VARCHAR(150),
    S_BDGEMANGETYPE VARCHAR(4) NOT NULL,
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO,S_TRANSSERNO)
);

COMMENT ON TABLE TBV_NTAXDTLVOUCH IS '非税电子凭证明细信息';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_FEESUNITCODE IS '执收单位代码';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_FEESUNITNAME IS '执收单位名称';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_ECONITEMNAME IS '经济分类名称';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXDTLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110710920 ON TBV_NTAXDTLVOUCH(I_SERNO,S_TRANSSERNO);

CREATE TABLE TBV_NTAXMONCHKDTLVOU(
    I_SERNO BIGINT(19) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_FEESUNITCODE VARCHAR(36) NOT NULL,
    S_FEESUNITNAME VARCHAR(150) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    F_AMT DECIMAL(24,2) NOT NULL,
    F_YEARSTRSUMAMT DECIMAL(24,2),
    S_RESERVED VARCHAR(100),
    S_CHKRSLTFLAG CHAR(1),
    S_CHKRSLTCMT VARCHAR(64),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO,S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXMONCHKDTLVOU IS '非税月度对账文件明细信息';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_FEESUNITCODE IS '执收单位代码';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_FEESUNITNAME IS '执收单位名称';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.F_AMT IS '金额';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.F_YEARSTRSUMAMT IS '自年初累计金额';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_NTAXMONCHKDTLVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110711070 ON TBV_NTAXMONCHKDTLVOU(S_ELEVOUSERNO,I_SERNO);

CREATE TABLE TBV_NTAXMONCHKSUMVOU(
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_SENDERNAME VARCHAR(60) NOT NULL,
    S_SENDERCODE VARCHAR(10) NOT NULL,
    S_RECEIVERCODE VARCHAR(36) NOT NULL,
    S_RECEIVERNAME VARCHAR(60) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    I_TOTALSUM INTEGER,
    S_CHKMONTH VARCHAR(6),
    S_RESERVED VARCHAR(100),
    D_ACCTDATE DATE NOT NULL,
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    S_CHKRSLTFLAG CHAR(1),
    S_CHKRSLTCMT VARCHAR(64),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXMONCHKSUMVOU IS '非税月度对账文件汇总信息';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_SENDERNAME IS '发送方名称';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_SENDERCODE IS '发送方代码';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_RECEIVERCODE IS '接收方代码';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_RECEIVERNAME IS '接收方名称';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_CHKMONTH IS '对帐月度';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_NTAXMONCHKSUMVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110711250 ON TBV_NTAXMONCHKSUMVOU(S_ELEVOUSERNO);

CREATE TABLE TBV_NTAXMONRPTCHKDTLVOU(
    I_SERNO BIGINT(19) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_FEESUNITCODE VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    F_AMT DECIMAL(24,2) NOT NULL,
    F_YEARSTRSUMAMT DECIMAL(24,2),
    S_CHKRSLTFLAG CHAR(1) NOT NULL,
    S_RESERVED VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO,S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXMONRPTCHKDTLVOU IS '非税月度对账回执文件明细信息';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.S_FEESUNITCODE IS '执收单位代码';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.F_AMT IS '金额';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.F_YEARSTRSUMAMT IS '自年初累计金额';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKDTLVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110711400 ON TBV_NTAXMONRPTCHKDTLVOU(I_SERNO,S_ELEVOUSERNO);

CREATE TABLE TBV_NTAXMONRPTCHKSUMVOU(
    S_ELEVOUSERNO VARCHAR(36) NOT NULL,
    S_SENDERNAME VARCHAR(60) NOT NULL,
    S_SENDERCODE VARCHAR(10) NOT NULL,
    S_CHKMONTH VARCHAR(6),
    I_TOTALSUM INTEGER,
    S_ELECOPERNAME VARCHAR(60),
    S_RESERVED VARCHAR(100),
    D_ACCTDATE DATE NOT NULL,
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ELEVOUSERNO)
);

COMMENT ON TABLE TBV_NTAXMONRPTCHKSUMVOU IS '非税月度对账回执文件汇总信息';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_SENDERNAME IS '发送方名称';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_SENDERCODE IS '发送方代码';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_CHKMONTH IS '对帐月度';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_ELECOPERNAME IS '通讯文件操作员名称';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_NTAXMONRPTCHKSUMVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110711560 ON TBV_NTAXMONRPTCHKSUMVOU(S_ELEVOUSERNO);

CREATE TABLE TBV_NTAXSUMVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36),
    D_ACCTDATE DATE,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_SENDERNAME VARCHAR(60) NOT NULL,
    S_VOUCHERNO VARCHAR(42) NOT NULL,
    S_BIZKNDCODE VARCHAR(7),
    S_REMARK VARCHAR(512),
    S_BRIEF VARCHAR(512),
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    I_TOTALSUM INTEGER NOT NULL,
    D_DATE DATE NOT NULL,
    S_RESERVED VARCHAR(100),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_ELECOPERNAME VARCHAR(60) NOT NULL,
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_CERTPROCSTATE CHAR(1),
    S_AMTSRLNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_NTAXSUMVOUCH IS '非税电子凭证汇总信息';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_SENDERNAME IS '发送方名称';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.I_TOTALSUM IS '总笔数';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.D_DATE IS '日期';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_ELECOPERNAME IS '通讯文件操作员名称';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_NTAXSUMVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110711780 ON TBV_NTAXSUMVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_OUTFUNDVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    I_ATTACHNUM INTEGER,
    S_TRANPRCSTATE VARCHAR(10),
    S_REMARK VARCHAR(512),
    S_MSGKINDCODE VARCHAR(32),
    S_ADJPERFLAG CHAR(1) NOT NULL,
    I_MSGSRLNO BIGINT(19),
    S_MSGID VARCHAR(35),
    S_INACCFUNDPROCSTATE CHAR(1),
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_BDGEMANGETYPE VARCHAR(4),
    S_FLOWPROCSTATE VARCHAR(10) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_REVERCODE VARCHAR(12),
    S_REVERNAME VARCHAR(60),
    S_DRAWERID VARCHAR(12),
    S_DRAWERNAME VARCHAR(60),
    S_DRAWFLAG CHAR(1) NOT NULL,
    TS_DRAWTIME TIMESTAMP,
    S_REVPAYUNITCODE VARCHAR(36),
    S_REVACCTNAME VARCHAR(200),
    S_REVACCT VARCHAR(32),
    S_PAYEEROPENBANKNO VARCHAR(18),
    S_PAYEEROPENBNKNAME VARCHAR(256),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYPSNFULNAME VARCHAR(60),
    S_PAYEROPENBANKNO VARCHAR(18),
    S_ORIAMTSRLNO VARCHAR(30),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_OUTFUNDVOUCH IS '往账资金凭证';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_TRANPRCSTATE IS '支付处理状态';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_MSGID IS '报文标识号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_INACCFUNDPROCSTATE IS '资金处理状态';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_REVERCODE IS '接收人代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_REVERNAME IS '接收人名称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_DRAWERID IS '领取人代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_DRAWERNAME IS '领取人姓名';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_DRAWFLAG IS '领取标志';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.TS_DRAWTIME IS '领取时间';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_REVPAYUNITCODE IS '收付款单位代码';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_REVACCTNAME IS '收款人名称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_REVACCT IS '收款人账号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_PAYEEROPENBANKNO IS '收款人开户行行号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_PAYEEROPENBNKNAME IS '收款人开户行名称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_PAYPSNFULNAME IS '付款人全称';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_PAYEROPENBANKNO IS '付款人开户行行号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.S_ORIAMTSRLNO IS '原资金交易流水号';
COMMENT ON COLUMN TBV_OUTFUNDVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110712180 ON TBV_OUTFUNDVOUCH(S_TRANSSERNO);
CREATE INDEX IX_TBV_OUTFUNDVOUCH_DACCTDATE ON TBV_OUTFUNDVOUCH(D_ACCTDATE);

CREATE TABLE TBV_OUTLAYBACKVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_CORRECTFLAG CHAR(1) NOT NULL,
    D_PULMONEYDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42) NOT NULL,
    D_ACCTDATE DATE,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_PAYUNITFULNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYUNOPNBNKNO VARCHAR(18),
    S_PAYEEUNITFULNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    F_AMT DECIMAL(24,2),
    S_AMTWORDS VARCHAR(512),
    S_ORIALCTNVOUCHNO VARCHAR(36),
    S_PAYMNTODRNO VARCHAR(36),
    S_BIZTYPECODE VARCHAR(7),
    S_CASHBILLNO VARCHAR(36),
    S_BIZUNIT VARCHAR(60),
    S_FUNDTYPE VARCHAR(10),
    S_REVEXPCTRL VARCHAR(10),
    S_PROXYBANKCODE VARCHAR(36),
    S_FUNDUSAGE VARCHAR(300) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_REALDIALTYPE VARCHAR(10) NOT NULL,
    S_ONELVLBDGEUNCODE VARCHAR(36),
    S_ONELVLBDGEUNNAME VARCHAR(60),
    S_BNKREFUNDRESON CHAR(1) NOT NULL,
    S_BNKBILLTYPE CHAR(1) NOT NULL,
    S_BANKREMARK VARCHAR(512),
    S_PROJNO VARCHAR(36),
    S_ECONITEM VARCHAR(36) NOT NULL,
    S_FUNDPAYMNTTYPE CHAR(1) NOT NULL,
    S_ACCTENTRYLEND VARCHAR(36) NOT NULL,
    S_OPPACCTNO VARCHAR(36),
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_CHRGERCODE VARCHAR(12),
    S_CHRGERNAME VARCHAR(60),
    S_CERTPROCSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_OUTLAYBACKVOUCH IS '支出退回凭证信息';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_CORRECTFLAG IS '冲正标识';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.D_PULMONEYDATE IS '划款日期';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYUNITFULNAME IS '付款单位全称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYUNOPNBNKNO IS '付款单位开户行行号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYEEUNITFULNAME IS '收款单位全称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_AMTWORDS IS '大写金额';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ORIALCTNVOUCHNO IS '原拨款凭证号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PAYMNTODRNO IS '支付令编号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_CASHBILLNO IS '请款单编号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BIZUNIT IS '业务单元';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_REVEXPCTRL IS '收支管理';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_FUNDUSAGE IS '资金用途';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_REALDIALTYPE IS '实拨单据类型';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ONELVLBDGEUNCODE IS '一级预算单位代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ONELVLBDGEUNNAME IS '一级预算单位名称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BNKREFUNDRESON IS '银行退票原因';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BNKBILLTYPE IS '银行单据类型';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_BANKREMARK IS '银行备注';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_PROJNO IS '项目编码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ECONITEM IS '经济分类代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_FUNDPAYMNTTYPE IS '资金支付方式';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ACCTENTRYLEND IS '会计分录(借)';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_CHRGERCODE IS '记账员代码';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_CHRGERNAME IS '记账员名称';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_OUTLAYBACKVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110712640 ON TBV_OUTLAYBACKVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_PREREVTBILLCHKFILDTL(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36) NOT NULL,
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    S_MAINNO VARCHAR(20) NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    F_OCCURAMT DECIMAL(24,2) NOT NULL,
    S_REPBILLNO VARCHAR(18) NOT NULL,
    D_REPDATE DATE,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_OFMONTH VARCHAR(2) NOT NULL,
    S_OFDAY CHAR(2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_PREREVTBILLCHKFILDTL IS '中央预算收入（国债兑付）对账通讯文件明细表';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_MAINNO IS '主序号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.F_BALNC IS '余额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.F_OCCURAMT IS '发生额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_REPBILLNO IS '报单号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.D_REPDATE IS '报表日期';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_OFMONTH IS '所属月度';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.S_OFDAY IS '所属日';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILDTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110657900 ON TBV_PREREVTBILLCHKFILDTL(I_CHILDSRLNO);

CREATE TABLE TBV_PREREVTBILLCHKFILSUM(
    S_SRLNO VARCHAR(36) NOT NULL,
    F_PREMONBALNC DECIMAL(24,2) NOT NULL,
    S_BIZTYPE VARCHAR(10) NOT NULL,
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    S_PROCFLAG CHAR(1) NOT NULL,
    S_FILENAME VARCHAR(128) NOT NULL,
    S_PROCCMT VARCHAR(1024),
    S_OFYEAR CHAR(4) NOT NULL,
    S_OFMONTH VARCHAR(2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_PREREVTBILLCHKFILSUM IS '中央预算收入（国债兑付）对账通讯文件汇总表';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.F_PREMONBALNC IS '上月余额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_BIZTYPE IS '业务类型';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_PROCFLAG IS '处理标志';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_FILENAME IS '文件名';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_PROCCMT IS '处理说明';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.S_OFMONTH IS '所属月度';
COMMENT ON COLUMN TBV_PREREVTBILLCHKFILSUM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110658090 ON TBV_PREREVTBILLCHKFILSUM(S_SRLNO);

CREATE TABLE TBV_PREREVTBILLCHKRRST(
    I_FLOWID BIGINT(19) NOT NULL,
    S_BUSINESSTYPE VARCHAR(10) NOT NULL,
    S_MAINNO VARCHAR(20),
    F_BALNC DECIMAL(24,2) NOT NULL,
    F_BALANCEMARGIN DECIMAL(24,2) NOT NULL,
    S_BRHTREASCODE VARCHAR(36) NOT NULL,
    F_OCCURAMT DECIMAL(24,2) NOT NULL,
    F_OCCURBALANCEAMT DECIMAL(24,2) NOT NULL,
    F_NTBALANCE DECIMAL(24,2) NOT NULL,
    F_NTOCCURAMT DECIMAL(24,2) NOT NULL,
    S_CHKRSLTCMT VARCHAR(64) NOT NULL,
    S_CHKRSLTFLAG CHAR(1) NOT NULL,
    S_REPBILLNO VARCHAR(18),
    D_REPDATE DATE,
    D_TNREPDATE DATE,
    D_ACCTDATE DATE NOT NULL,
    S_FILENAME VARCHAR(128) NOT NULL,
    S_OFMONTH VARCHAR(2) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_OFDAY CHAR(2),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_PREREVTBILLCHKRRST IS '中央预算收入（国债兑付）对账结果表';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_BUSINESSTYPE IS '业务种类';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_MAINNO IS '主序号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.F_BALNC IS '余额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.F_BALANCEMARGIN IS '余额差额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.F_OCCURAMT IS '发生额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.F_OCCURBALANCEAMT IS '发生额差额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.F_NTBALANCE IS '国库余额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.F_NTOCCURAMT IS '国库发生额';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_REPBILLNO IS '报单号';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.D_REPDATE IS '报表日期';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.D_TNREPDATE IS '国库报表日期';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_FILENAME IS '文件名';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_OFMONTH IS '所属月度';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.S_OFDAY IS '所属日';
COMMENT ON COLUMN TBV_PREREVTBILLCHKRRST.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110658450 ON TBV_PREREVTBILLCHKRRST(I_FLOWID);

CREATE TABLE TBV_PREREVTBILLYEARCHKFILDTL(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36),
    S_BRHTREASCODE VARCHAR(36),
    D_REPDATE DATE,
    F_COLLAMT DECIMAL(24,2),
    S_BDGESBTCODE VARCHAR(36),
    S_OFMONTH VARCHAR(2),
    S_OFYEAR CHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_PREREVTBILLYEARCHKFILDTL IS '中央预算收入（国债兑付）年度对账通讯文件明细表';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.D_REPDATE IS '报表日期';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.S_OFMONTH IS '所属月度';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILDTL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110658670 ON TBV_PREREVTBILLYEARCHKFILDTL(I_CHILDSRLNO);

CREATE TABLE TBV_PREREVTBILLYEARCHKFILSUM(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_BRHTREASCODE VARCHAR(36),
    S_BDGESBTCODE VARCHAR(36),
    S_BRHTREASAMT DECIMAL(24,2),
    S_GENERALAMT DECIMAL(24,2),
    F_SUBAMT DECIMAL(24,2),
    S_PROCFLAG CHAR(1),
    S_FILENAME VARCHAR(128),
    S_OFYEAR CHAR(4),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_PREREVTBILLYEARCHKFILSUM IS '中央预算收入（国债兑付）年度对账通讯文件汇总表';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_BRHTREASAMT IS '分库上报金额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_GENERALAMT IS '总库金额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.F_SUBAMT IS '差额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_PROCFLAG IS '处理标志';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_FILENAME IS '文件名';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKFILSUM.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110658870 ON TBV_PREREVTBILLYEARCHKFILSUM(S_SRLNO);

CREATE TABLE TBV_PREREVTBILLYEARCHKRRST(
    I_FLOWID BIGINT(19) NOT NULL,
    S_BUSINESSTYPE VARCHAR(10),
    S_BRHTREASCODE VARCHAR(36),
    S_BDGESBTCODE VARCHAR(36),
    S_CHKRSLTFLAG CHAR(1),
    F_SUBAMT DECIMAL(24,2),
    S_OFYEAR CHAR(4),
    D_REPDATE DATE,
    S_BRHTREASAMT DECIMAL(24,2),
    S_GENERALAMT DECIMAL(24,2),
    S_FILENAME VARCHAR(128),
    S_CHKRSLTCMT VARCHAR(64),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_PREREVTBILLYEARCHKRRST IS '中央预算收入（国债兑付）年度对账结果表';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_BUSINESSTYPE IS '业务种类';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.F_SUBAMT IS '差额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.D_REPDATE IS '报表日期';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_BRHTREASAMT IS '分库上报金额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_GENERALAMT IS '总库金额';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_FILENAME IS '文件名';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_PREREVTBILLYEARCHKRRST.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110659120 ON TBV_PREREVTBILLYEARCHKRRST(I_FLOWID);

CREATE TABLE TBV_PROXYBANKCHECKRESULT(
    I_FLOWID BIGINT(19) NOT NULL,
    S_FILENAME VARCHAR(128) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_OFMONTH VARCHAR(2) NOT NULL,
    S_BDGETUNCODE VARCHAR(36) NOT NULL,
    S_BDGETUNNAME VARCHAR(60),
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_BDGESBTNAME VARCHAR(200),
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60),
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_REVEXPCTRLTYPE VARCHAR(4) NOT NULL,
    F_NTCLEARAMT DECIMAL(24,2) NOT NULL,
    F_NTPAYBACKAMT DECIMAL(24,2) NOT NULL,
    F_NTLIMTAMT DECIMAL(24,2) NOT NULL,
    F_NTBALANCE DECIMAL(24,2) NOT NULL,
    F_LIMITAMT DECIMAL(24,2) NOT NULL,
    F_RECKAMT DECIMAL(24,2) NOT NULL,
    F_PAYBACKAMT DECIMAL(24,2) NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    F_LIMTAMTBALANCE DECIMAL(24,2) NOT NULL,
    F_CLEARAMTBALANCE DECIMAL(24,2) NOT NULL,
    F_PAYBACKBALANCE DECIMAL(24,2) NOT NULL,
    F_BALANCEMARGIN DECIMAL(24,2) NOT NULL,
    S_CHKRSLTCMT VARCHAR(64) NOT NULL,
    S_CHKRSLTFLAG CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_FLOWID)
);

COMMENT ON TABLE TBV_PROXYBANKCHECKRESULT IS '与代理银行对账结果表';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.I_FLOWID IS '主键/流水号';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_FILENAME IS '文件名';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_OFMONTH IS '所属月度';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_BDGETUNNAME IS '预算单位名称';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_BDGESBTNAME IS '预算科目名称';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_REVEXPCTRLTYPE IS '收支管理类型';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_NTCLEARAMT IS '国库清算金额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_NTPAYBACKAMT IS '国库退款金额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_NTLIMTAMT IS '国库额度金额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_NTBALANCE IS '国库余额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_LIMITAMT IS '额度金额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_RECKAMT IS '清算额度';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_PAYBACKAMT IS '退款金额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_BALNC IS '余额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_LIMTAMTBALANCE IS '额度金额差额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_CLEARAMTBALANCE IS '清算金额差额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_PAYBACKBALANCE IS '退款金额差额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.F_BALANCEMARGIN IS '余额差额';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_CHKRSLTCMT IS '对账结果描述';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.S_CHKRSLTFLAG IS '对账结果标志';
COMMENT ON COLUMN TBV_PROXYBANKCHECKRESULT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110712930 ON TBV_PROXYBANKCHECKRESULT(I_FLOWID);

CREATE TABLE TBV_PROXYBANKFILEDETINFO(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    F_BALNC DECIMAL(24,2) NOT NULL,
    S_REVEXPCTRLTYPE VARCHAR(4) NOT NULL,
    F_RECKAMT DECIMAL(24,2) NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    S_RESERVED VARCHAR(100),
    S_SRLNO VARCHAR(36) NOT NULL,
    F_PAYBACKAMT DECIMAL(24,2) NOT NULL,
    S_BDGETUNCODE VARCHAR(36) NOT NULL,
    S_BDGETUNNAME VARCHAR(60),
    F_LIMITAMT DECIMAL(24,2) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_PROXYBANKFILEDETINFO IS '代理银行对账文件明细信息表';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.F_BALNC IS '余额';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.S_REVEXPCTRLTYPE IS '收支管理类型';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.F_RECKAMT IS '清算额度';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.F_PAYBACKAMT IS '退款金额';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.S_BDGETUNNAME IS '预算单位名称';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.F_LIMITAMT IS '额度金额';
COMMENT ON COLUMN TBV_PROXYBANKFILEDETINFO.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110713090 ON TBV_PROXYBANKFILEDETINFO(I_CHILDSRLNO);

CREATE TABLE TBV_PROXYBANKFILESUMINFO(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_FILENAME VARCHAR(128) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKNAME VARCHAR(60),
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_PAYTYPECMT VARCHAR(512) NOT NULL,
    S_PROCFLAG CHAR(1) NOT NULL,
    S_OFMONTH VARCHAR(2) NOT NULL,
    S_OPERNAME VARCHAR(60),
    S_RESERVED VARCHAR(100),
    S_PROCCMT VARCHAR(1024),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_PROXYBANKFILESUMINFO IS '代理银行对账文件汇总信息表';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_FILENAME IS '文件名';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_PAYTYPECMT IS '支付方式说明';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_PROCFLAG IS '处理标志';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_OFMONTH IS '所属月度';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.S_PROCCMT IS '处理说明';
COMMENT ON COLUMN TBV_PROXYBANKFILESUMINFO.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110713230 ON TBV_PROXYBANKFILESUMINFO(S_SRLNO);

CREATE TABLE TBV_REFUNDBCKDTLVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_VOUNO VARCHAR(42),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNO VARCHAR(18),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    F_AMT DECIMAL(24,2),
    S_ORIALCTNVOUCHNO VARCHAR(36),
    S_PAYMNTODRNO VARCHAR(36),
    S_BIZTYPE VARCHAR(10),
    S_CASHBILLNO VARCHAR(36),
    S_BIZUNIT VARCHAR(60),
    S_FUNDTYPE VARCHAR(10),
    S_REVEXPCTRL VARCHAR(10),
    S_FUNDUSAGE VARCHAR(300),
    S_BDGESBTCODE VARCHAR(36),
    S_REALDIALTYPE VARCHAR(10),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_ONELVLBDGEUNCODE VARCHAR(36),
    S_ONELVLBDGEUNNAME VARCHAR(60),
    S_BNKREFUNDRESON CHAR(1),
    S_BNKBILLTYPE CHAR(1),
    S_BANKREMARK VARCHAR(512),
    S_PROJNO VARCHAR(36),
    S_ECNMCSBT VARCHAR(36),
    S_FUNDPAYMNTTYPE CHAR(1),
    S_REMARK VARCHAR(512),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_TYPISTNAME VARCHAR(60),
    S_TYPISTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_CERTPROCSTATE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_REFUNDBCKDTLVOUCH IS '财政拨款退回凭证明细信息表';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYUNOPNBNKNO IS '付款单位开户行行号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ORIALCTNVOUCHNO IS '原拨款凭证号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PAYMNTODRNO IS '支付令编号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BIZTYPE IS '业务类型';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_CASHBILLNO IS '请款单编号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BIZUNIT IS '业务单元';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_REVEXPCTRL IS '收支管理';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_FUNDUSAGE IS '资金用途';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_REALDIALTYPE IS '实拨单据类型';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ONELVLBDGEUNCODE IS '一级预算单位代码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ONELVLBDGEUNNAME IS '一级预算单位名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BNKREFUNDRESON IS '银行退票原因';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BNKBILLTYPE IS '银行单据类型';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_BANKREMARK IS '银行备注';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_PROJNO IS '项目编码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_FUNDPAYMNTTYPE IS '资金支付方式';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_REFUNDBCKDTLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110642110 ON TBV_REFUNDBCKDTLVOUCH(S_TRANSSERNO);

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


CREATE UNIQUE INDEX SQL221020110713540 ON TBV_REVENVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_RHVOUSNDDTL98(
    I_CHILDSRLNO BIGINT(19) NOT NULL,
    S_SRLNO VARCHAR(36) NOT NULL,
    I_ELEVOUSEQNUM BIGINT(19) NOT NULL,
    S_SNDREVFLAG CHAR(1) NOT NULL,
    S_ELEVOUKINDCODE VARCHAR(10) NOT NULL,
    S_MSGTYPECODE VARCHAR(32) NOT NULL,
    S_VOUID VARCHAR(36) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    S_VOUCHERNO VARCHAR(42),
    S_ELEVOUBIZTYPECODE VARCHAR(36) NOT NULL,
    S_ELEFILENAME VARCHAR(130) NOT NULL,
    S_PROCSTATE VARCHAR(4),
    S_CANCELREASON VARCHAR(60),
    S_ELEVOUCNNAME VARCHAR(150) NOT NULL,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (I_CHILDSRLNO)
);

COMMENT ON TABLE TBV_RHVOUSNDDTL98 IS '电子凭证人行发送清单明细表';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.I_CHILDSRLNO IS '子表流水号';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.I_ELEVOUSEQNUM IS '电子凭证顺序号';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_SNDREVFLAG IS '接收发送标志';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_ELEVOUKINDCODE IS '电子凭证种类代码';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_MSGTYPECODE IS '报文类型代码';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_VOUID IS '凭证ID';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_ELEVOUBIZTYPECODE IS '电子凭证业务类型代码';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_CANCELREASON IS '作废原因/退回原因';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.S_ELEVOUCNNAME IS '电子凭证中文名称';
COMMENT ON COLUMN TBV_RHVOUSNDDTL98.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110642370 ON TBV_RHVOUSNDDTL98(I_CHILDSRLNO);

CREATE TABLE TBV_RHVOUSNDSUM98(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUID VARCHAR(100) NOT NULL,
    D_VOUDATE DATE NOT NULL,
    I_FILENUM INTEGER NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_RHVOUSNDSUM98 IS '电子凭证人行发送清单汇总表';
COMMENT ON COLUMN TBV_RHVOUSNDSUM98.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_RHVOUSNDSUM98.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_RHVOUSNDSUM98.D_VOUDATE IS '凭证日期';
COMMENT ON COLUMN TBV_RHVOUSNDSUM98.I_FILENUM IS '文件个数';
COMMENT ON COLUMN TBV_RHVOUSNDSUM98.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110642500 ON TBV_RHVOUSNDSUM98(S_SRLNO);

CREATE TABLE TBV_SAPSSUMACCVOU(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    I_MSGSRLNO BIGINT(19),
    D_ACCTDATE DATE,
    S_BIZKNDCODE VARCHAR(7),
    S_DEBTCREDTFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    S_ACCTNO VARCHAR(36),
    S_ACCTNAME VARCHAR(60),
    S_OPPACCTNO VARCHAR(36),
    S_BRIEF VARCHAR(512),
    S_INACCFUNDPROCSTATE CHAR(1),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_SAPSSUMACCVOU IS '小额清算汇总记账凭证';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.F_AMT IS '金额';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_INACCFUNDPROCSTATE IS '资金处理状态';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_SAPSSUMACCVOU.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110713720 ON TBV_SAPSSUMACCVOU(S_TRANSSERNO);

CREATE TABLE TBV_SHAREOUTLYVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    S_ELEVOUID VARCHAR(100) NOT NULL,
    F_COLLAMT DECIMAL(24,2) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42) NOT NULL,
    S_REALFUNDBILLTYPECODE VARCHAR(36) NOT NULL,
    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),
    S_BIZTIMETYPENAME VARCHAR(60),
    S_BIZTIMETYPECODE VARCHAR(36) NOT NULL,
    S_REALPAYVOUCHNO VARCHAR(36) NOT NULL,
    S_PAYMNTODRNO VARCHAR(36) NOT NULL,
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60) NOT NULL,
    S_PAYEEUNITFULACCNO VARCHAR(36) NOT NULL,
    S_PAYEEUNOPNBNKNAME VARCHAR(200) NOT NULL,
    S_DPMTCODE VARCHAR(36) NOT NULL,
    S_DPMTNAME VARCHAR(60) NOT NULL,
    S_CASHBILLNO VARCHAR(36) NOT NULL,
    S_REFUNDRSN VARCHAR(150),
    S_BIZUNIT VARCHAR(60),
    S_FUNDTYPE VARCHAR(10),
    S_PROJCODE VARCHAR(10),
    S_PROJNAME VARCHAR(60),
    S_ECNMCSBT VARCHAR(36),
    F_AMT DECIMAL(24,2) NOT NULL,
    S_FUNDTSFTYPE CHAR(1),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_OPPACCTNO VARCHAR(36),
    S_CERTPROCSTATE CHAR(1),
    S_ELEVOUSERNO VARCHAR(36),
    D_VOUDATE DATE,
    S_BDGEMANGETYPE VARCHAR(4),
    S_FUNITEMCODE VARCHAR(10),
    S_FUNITEMNAME VARCHAR(60),
    I_APROPRATVOUCHERNO INTEGER,
    S_FLOWSORTCODE VARCHAR(36),
    S_FLOWPROCSTATE VARCHAR(10),
    S_ACCTNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    S_ADJPERFLAG CHAR(1),
    PRIMARY KEY (S_TRANSSERNO)
);

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


CREATE UNIQUE INDEX SQL221020110643170 ON TBV_SHAREOUTLYVOUCH(S_TRANSSERNO);

CREATE TABLE TBV_SNDAMTBCKVOUCH(
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_VOUNO VARCHAR(42),
    S_BIZKNDCODE VARCHAR(7),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_DEBTCREDTFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    I_ATTACHNUM INTEGER,
    S_PAYTRANSNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_MSGKINDCODE VARCHAR(32),
    S_FUNDORIT CHAR(1),
    S_ADJPERFLAG CHAR(1),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    I_MSGSRLNO BIGINT(19),
    S_DRAWERID VARCHAR(12),
    S_DRAWERNAME VARCHAR(60),
    TS_DRAWTIME TIMESTAMP,
    S_DRAWFLAG CHAR(1),
    I_PAYBACKSRLNO BIGINT(19),
    S_PAYBACKMSGKINDCODE VARCHAR(32),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_AMTSRLNO)
);

COMMENT ON TABLE TBV_SNDAMTBCKVOUCH IS '往账资金退回凭证';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_PAYTRANSNO IS '支付交易序号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_FUNDORIT IS '资金方向';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_DRAWERID IS '领取人代码';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_DRAWERNAME IS '领取人姓名';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.TS_DRAWTIME IS '领取时间';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_DRAWFLAG IS '领取标志';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.I_PAYBACKSRLNO IS '退汇报文流水号';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.S_PAYBACKMSGKINDCODE IS '退汇报文报文种类代码';
COMMENT ON COLUMN TBV_SNDAMTBCKVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110643530 ON TBV_SNDAMTBCKVOUCH(S_AMTSRLNO);

CREATE TABLE TBV_SPICALVOUCH(
    S_SRLNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE,
    S_ACCTSRLNO VARCHAR(30),
    S_ACCTNO VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_OPPACCTNO VARCHAR(36),
    S_DEBTCREDTFLAG CHAR(1),
    S_PAYUNOPNBNKNO VARCHAR(18),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTFLAG CHAR(1),
    S_TYPISTCODE VARCHAR(12),
    S_PRINTFLAG CHAR(1),
    S_ACCTANTNAME VARCHAR(60),
    I_ATTCHCOUNT INTEGER,
    S_TYPISTNAME VARCHAR(60),
    S_ACCTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_SPICALVOUCH IS '特种凭证';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_SPICALVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_ACCTSRLNO IS '会计流水号';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_SPICALVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PAYUNOPNBNKNO IS '付款单位行号';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_ACCTANTFLAG IS '复核标志';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_PRINTFLAG IS '允许打印标志';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_SPICALVOUCH.I_ATTCHCOUNT IS '附件张数';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_SPICALVOUCH.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TBV_SPICALVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110713950 ON TBV_SPICALVOUCH(S_SRLNO);

CREATE TABLE TBV_SUBPOVSHARETDLVOUCH(
    I_SUBPOVID BIGINT(19) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30),
    S_ELEVOUSERNO VARCHAR(36),
    D_ACCTDATE DATE NOT NULL,
    S_BDGESBTCODE VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_BANKNO VARCHAR(18) NOT NULL,
    S_BNKNAME VARCHAR(60) NOT NULL,
    S_ELEFILENAME VARCHAR(130) NOT NULL,
    I_GRANTAMTTALNO INTEGER,
    I_GRANTAMTSUBNO INTEGER,
    I_GRANTAMTFILENO INTEGER,
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_PROCSTATE VARCHAR(4),
    I_EXPORTNUM INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SUBPOVID)
);

COMMENT ON TABLE TBV_SUBPOVSHARETDLVOUCH IS '分省分享拨款明细凭证';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.I_SUBPOVID IS '分享拨款凭证序号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_BDGESBTCODE IS '预算科目代码';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_BANKNO IS '行号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_BNKNAME IS '行名';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_ELEFILENAME IS '电子凭证/通讯文件名称';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.I_GRANTAMTTALNO IS '拨款时总套号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.I_GRANTAMTSUBNO IS '拨款时分套号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.I_GRANTAMTFILENO IS '拨款文件序号';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.I_EXPORTNUM IS '导出批次';
COMMENT ON COLUMN TBV_SUBPOVSHARETDLVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110643810 ON TBV_SUBPOVSHARETDLVOUCH(I_SUBPOVID);

CREATE TABLE TBV_TBILLOUTLYVOUCH(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_ELEVOUSERNO VARCHAR(36),
    D_ACCTDATE DATE,
    S_IMPFILNAME VARCHAR(60),
    D_DATE DATE NOT NULL,
    F_COLLAMT DECIMAL(24,2),
    S_VOUNO VARCHAR(42),
    S_PAYERNAME VARCHAR(256),
    S_PAYOPENBANKNAME VARCHAR(150),
    S_PAYERACCTNO VARCHAR(32),
    S_PAYEEUNITCODE VARCHAR(36),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNOPNBNKNO VARCHAR(18),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_ATTACHINFO VARCHAR(512),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_PROCSTATE VARCHAR(4),
    S_PROCCMT VARCHAR(1024),
    S_AMTSRLNO VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TBV_TBILLOUTLYVOUCH IS '国债支出通讯文件明细表';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_SRLNO IS '流水号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_ELEVOUSERNO IS '电子凭证流水号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_IMPFILNAME IS '导入文件名';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.D_DATE IS '日期';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYERNAME IS '付款人名称';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYOPENBANKNAME IS '付款人开户行名称';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYERACCTNO IS '付款人账号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYEEUNITCODE IS '收款单位代码';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYEEUNOPNBNKNO IS '收款单位开户行行号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_ATTACHINFO IS '附言';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PROCSTATE IS '处理状态';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_PROCCMT IS '处理说明';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_TBILLOUTLYVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110644170 ON TBV_TBILLOUTLYVOUCH(S_SRLNO);

CREATE TABLE TBV_TREISSUEVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_CORRECTFLAG CHAR(1) NOT NULL,
    S_VOUNO VARCHAR(42) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_PAYINUNITACCTNO VARCHAR(36),
    S_OPENBANKCODE VARCHAR(36),
    S_OPENBANKNAME VARCHAR(60),
    S_CAPTURETRE VARCHAR(60),
    S_LEVUNITCODE VARCHAR(36),
    S_LEVUNITNAME VARCHAR(60),
    S_PAYINDPMTCODE VARCHAR(36),
    S_PAYINDPMTNAME VARCHAR(60),
    D_ISUDATE DATE,
    S_ISSUESBTCODE VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_REMARK VARCHAR(512),
    S_TYPISTNAME VARCHAR(60) NOT NULL,
    S_TYPISTCODE VARCHAR(12) NOT NULL,
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_CERTPROCSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO,S_AMTSRLNO)
);

COMMENT ON TABLE TBV_TREISSUEVOUCH IS '国债发行明细凭证表';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_CORRECTFLAG IS '冲正标识';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_PAYINUNITACCTNO IS '缴款单位账号';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_OPENBANKCODE IS '开户行代码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_OPENBANKNAME IS '开户行名称';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_CAPTURETRE IS '收款国库';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_LEVUNITCODE IS '征收单位代码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_LEVUNITNAME IS '征收单位名称';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_PAYINDPMTCODE IS '缴款部门编码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_PAYINDPMTNAME IS '缴款部门名称';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.D_ISUDATE IS '发行日期';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_ISSUESBTCODE IS '发行科目代码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_REMARK IS '备注';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TBV_TREISSUEVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110714250 ON TBV_TREISSUEVOUCH(S_TRANSSERNO,S_AMTSRLNO);

CREATE TABLE TBV_VOUCHSRLACCT(
    I_SERNO BIGINT(19) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30),
    S_LIMITRECKFLG CHAR(1),
    S_PAYTYPEFLAG CHAR(1),
    F_AMT DECIMAL(24,2),
    D_ACCTDATE DATE,
    S_VOUCHERNO VARCHAR(42),
    S_PROXYBANKCODE VARCHAR(36),
    S_PROXYBANKNAME VARCHAR(60),
    S_PROXYBANKACCT VARCHAR(30),
    S_BRIEF VARCHAR(512),
    S_PAYUNITNAME VARCHAR(60),
    S_PAYUNITACCNO VARCHAR(36),
    S_PAYUNOPNBNKNAME VARCHAR(80),
    S_PAYEEUNOPNBNKNAME VARCHAR(200),
    S_PAYEEUNITNAME VARCHAR(60),
    S_PAYEEUNITFULACCNO VARCHAR(36),
    S_PRESBTFOUNDCLASSCODE VARCHAR(15),
    S_DPMTCODE VARCHAR(36),
    S_DPMTNAME VARCHAR(60),
    S_ECONSBTECONCLASSCODE VARCHAR(10),
    S_DIRECTPAYVOUCHNO VARCHAR(150),
    S_SECRETFLAG VARCHAR(20),
    S_BDGEMANGETYPE VARCHAR(4),
    S_FUNDTYPE VARCHAR(10),
    S_ELEVOUID VARCHAR(100),
    S_ADJPERFLAG CHAR(1),
    S_RESERVED VARCHAR(100),
    S_TYPISTNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_SERNO)
);

COMMENT ON TABLE TBV_VOUCHSRLACCT IS '集中支付流水账表';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.I_SERNO IS '序号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_LIMITRECKFLG IS '额度清算标志';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.F_AMT IS '金额';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_VOUCHERNO IS '凭证编号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PROXYBANKNAME IS '代理银行名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PROXYBANKACCT IS '代理银行帐号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYUNITNAME IS '付款单位名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYUNITACCNO IS '付款单位账号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYUNOPNBNKNAME IS '付款单位开户银行名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYEEUNOPNBNKNAME IS '收款单位开户银行名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYEEUNITNAME IS '收款单位名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PAYEEUNITFULACCNO IS '收款单位账号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_PRESBTFOUNDCLASSCODE IS '预算科目/功能分类代码';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_DPMTCODE IS '部门代码';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_DPMTNAME IS '部门名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_ECONSBTECONCLASSCODE IS '经济科目/经济分类代码';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_DIRECTPAYVOUCHNO IS '对应的直接支付凭证号';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_SECRETFLAG IS '涉密标志';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_BDGEMANGETYPE IS '预算管理类型';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_FUNDTYPE IS '资金类型';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_ELEVOUID IS '电子凭证唯一标识ID';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_RESERVED IS '预留';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_VOUCHSRLACCT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110714540 ON TBV_VOUCHSRLACCT(I_SERNO);

CREATE TABLE TBV_YEARTRANVOUCH(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE,
    S_VOUNO VARCHAR(42),
    S_VOUCHKNDCODE VARCHAR(36),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1),
    S_ACCTNO VARCHAR(36),
    S_OPPACCTNO VARCHAR(36),
    S_ACCTNAME VARCHAR(60),
    F_AMT DECIMAL(24,2),
    S_BRIEF VARCHAR(512),
    I_ATTACHNUM INTEGER,
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_ACCTANTFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TBV_YEARTRANVOUCH IS '年度结转凭证';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_ACCTNO IS '账号';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.F_AMT IS '金额';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_BRIEF IS '摘要';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.S_ACCTANTFLAG IS '复核标志';
COMMENT ON COLUMN TBV_YEARTRANVOUCH.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110714760 ON TBV_YEARTRANVOUCH(S_TRANSSERNO);

CREATE TABLE TF_FLOWCONFIG(
    S_PROCSTS VARCHAR(2) NOT NULL,
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_PROCCODE VARCHAR(7) NOT NULL,
    S_NEXTPROCCOD VARCHAR(7) NOT NULL,
    S_SUBTPCODE VARCHAR(60),
    S_DEFADVICE VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PROCSTS,S_FLOWSORTCODE,S_PROCCODE,S_NEXTPROCCOD)
);

COMMENT ON TABLE TF_FLOWCONFIG IS '流程配置表';
COMMENT ON COLUMN TF_FLOWCONFIG.S_PROCSTS IS '处理状态代码';
COMMENT ON COLUMN TF_FLOWCONFIG.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TF_FLOWCONFIG.S_PROCCODE IS '处理代码';
COMMENT ON COLUMN TF_FLOWCONFIG.S_NEXTPROCCOD IS '下步处理代码';
COMMENT ON COLUMN TF_FLOWCONFIG.S_SUBTPCODE IS '子类别代码';
COMMENT ON COLUMN TF_FLOWCONFIG.S_DEFADVICE IS '默认意见';
COMMENT ON COLUMN TF_FLOWCONFIG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715180 ON TF_FLOWCONFIG(S_PROCSTS,S_FLOWSORTCODE,S_PROCCODE,S_NEXTPROCCOD);

CREATE TABLE TF_FLOWCONTRAREA(
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_NODECODE VARCHAR(128) NOT NULL,
    S_NODENAME VARCHAR(256),
    S_FUNCCODE VARCHAR(128) NOT NULL,
    S_FUNCNAME VARCHAR(256),
    S_FLOWPROCSTATE VARCHAR(10) NOT NULL,
    S_FLOWPROCSTATEUSECOL VARCHAR(100),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_FLOWSORTCODE,S_NODECODE,S_FUNCCODE,S_FLOWPROCSTATE)
);

COMMENT ON TABLE TF_FLOWCONTRAREA IS '流程控制范围表';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_NODECODE IS '节点代码';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_NODENAME IS '节点名称';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_FUNCCODE IS '功能点代码';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_FUNCNAME IS '功能点名称';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TF_FLOWCONTRAREA.S_FLOWPROCSTATEUSECOL IS '流程处理状态使用列';
COMMENT ON COLUMN TF_FLOWCONTRAREA.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715310 ON TF_FLOWCONTRAREA(S_FLOWSORTCODE,S_NODECODE,S_FUNCCODE,S_FLOWPROCSTATE);

CREATE TABLE TF_FLOWSIMPLE(
    S_PARAMSRLNO VARCHAR(36) NOT NULL,
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_FLOWSORTNAME VARCHAR(60),
    S_FLOWPROCSTATE VARCHAR(10) NOT NULL,
    S_FLOWPROCSTATEUSECOL VARCHAR(100),
    S_PROCSTSNAME VARCHAR(60),
    S_PROCCODE VARCHAR(7) NOT NULL,
    S_PROCNAME VARCHAR(60),
    S_NEXTPROCSTATE VARCHAR(10),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PARAMSRLNO)
);

COMMENT ON TABLE TF_FLOWSIMPLE IS '流程简化表';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_PARAMSRLNO IS '参数流水号';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_FLOWSORTNAME IS '流程类别名称';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_FLOWPROCSTATE IS '流程处理状态';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_FLOWPROCSTATEUSECOL IS '流程处理状态使用列';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_PROCSTSNAME IS '处理状态名称';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_PROCCODE IS '处理代码';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_PROCNAME IS '处理名称';
COMMENT ON COLUMN TF_FLOWSIMPLE.S_NEXTPROCSTATE IS '下一步处理状态';
COMMENT ON COLUMN TF_FLOWSIMPLE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715450 ON TF_FLOWSIMPLE(S_PARAMSRLNO);

CREATE TABLE TF_FLOWSORT(
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_FLOWSORTNAME VARCHAR(60),
    I_WAITTASKSEC INTEGER,
    S_TASKBIGKIND VARCHAR(10),
    S_DESC VARCHAR(512),
    S_BIZTYPECODE VARCHAR(7),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_FLOWSORTCODE)
);

COMMENT ON TABLE TF_FLOWSORT IS '流程类别表';
COMMENT ON COLUMN TF_FLOWSORT.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TF_FLOWSORT.S_FLOWSORTNAME IS '流程类别名称';
COMMENT ON COLUMN TF_FLOWSORT.I_WAITTASKSEC IS '任务超时时间间隔';
COMMENT ON COLUMN TF_FLOWSORT.S_TASKBIGKIND IS '待办任务大类代码';
COMMENT ON COLUMN TF_FLOWSORT.S_DESC IS '描述';
COMMENT ON COLUMN TF_FLOWSORT.S_BIZTYPECODE IS '业务类型代码';
COMMENT ON COLUMN TF_FLOWSORT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715570 ON TF_FLOWSORT(S_FLOWSORTCODE);

CREATE TABLE TF_FLOWSTATE(
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_PROCSTS VARCHAR(2) NOT NULL,
    S_PROCSTSNAME VARCHAR(60),
    S_LIMITTYPE CHAR(1) NOT NULL,
    S_IIMITVAL VARCHAR(60),
    S_LIMUSERTYP CHAR(1),
    S_LIMUSER VARCHAR(512),
    S_LIMORGTYPE CHAR(1),
    S_LIMORG VARCHAR(512),
    S_TASKKINDCODE VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_FLOWSORTCODE)
);

COMMENT ON TABLE TF_FLOWSTATE IS '流程状态表';
COMMENT ON COLUMN TF_FLOWSTATE.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TF_FLOWSTATE.S_PROCSTS IS '处理状态代码';
COMMENT ON COLUMN TF_FLOWSTATE.S_PROCSTSNAME IS '处理状态名称';
COMMENT ON COLUMN TF_FLOWSTATE.S_LIMITTYPE IS '限制类型';
COMMENT ON COLUMN TF_FLOWSTATE.S_IIMITVAL IS '限制值';
COMMENT ON COLUMN TF_FLOWSTATE.S_LIMUSERTYP IS '限制用户类型';
COMMENT ON COLUMN TF_FLOWSTATE.S_LIMUSER IS '限制用户值';
COMMENT ON COLUMN TF_FLOWSTATE.S_LIMORGTYPE IS '限制机构类型';
COMMENT ON COLUMN TF_FLOWSTATE.S_LIMORG IS '限制机构值';
COMMENT ON COLUMN TF_FLOWSTATE.S_TASKKINDCODE IS '待办任务种类代码';
COMMENT ON COLUMN TF_FLOWSTATE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715700 ON TF_FLOWSTATE(S_FLOWSORTCODE);

CREATE TABLE TF_OPERNOTE(
    S_FLOWSORTCODE VARCHAR(36) NOT NULL,
    S_TASKSRLNO VARCHAR(36) NOT NULL,
    I_CORRNO INTEGER NOT NULL,
    S_PROCCODE VARCHAR(7),
    S_PROCNAME VARCHAR(60),
    S_PROCSTS VARCHAR(2),
    S_PROCSTSNAME VARCHAR(60),
    D_PROCDATE DATE,
    TS_PROCTMS TIMESTAMP NOT NULL,
    S_PROCUSERCODE VARCHAR(12),
    S_PROCUSERNAME VARCHAR(60),
    S_PROCORGCOD VARCHAR(14),
    S_PROCORGNAM VARCHAR(60),
    S_PROCADVICE VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_FLOWSORTCODE,S_TASKSRLNO,I_CORRNO)
);

COMMENT ON TABLE TF_OPERNOTE IS '操作过程记录表';
COMMENT ON COLUMN TF_OPERNOTE.S_FLOWSORTCODE IS '流程类别代码';
COMMENT ON COLUMN TF_OPERNOTE.S_TASKSRLNO IS '业务编号';
COMMENT ON COLUMN TF_OPERNOTE.I_CORRNO IS '过程序号';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCCODE IS '处理代码';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCNAME IS '处理名称';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCSTS IS '处理状态代码';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCSTSNAME IS '处理状态名称';
COMMENT ON COLUMN TF_OPERNOTE.D_PROCDATE IS '处理日期';
COMMENT ON COLUMN TF_OPERNOTE.TS_PROCTMS IS '处理时间';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCUSERCODE IS '处理人员代码';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCUSERNAME IS '处理人员名称';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCORGCOD IS '处理机构代码';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCORGNAM IS '处理机构名称';
COMMENT ON COLUMN TF_OPERNOTE.S_PROCADVICE IS '处理意见';
COMMENT ON COLUMN TF_OPERNOTE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110715870 ON TF_OPERNOTE(S_FLOWSORTCODE,S_TASKSRLNO,I_CORRNO);

CREATE TABLE TF_TASKKIND(
    S_TASKKINDCODE VARCHAR(36) NOT NULL,
    S_S_TASKKINDNAM VARCHAR(60),
    S_TASKBIGKIND VARCHAR(10),
    S_PAGENAME VARCHAR(60),
    S_TASKVIEWNAME VARCHAR(60),
    S_FUNCCODE VARCHAR(36),
    S_FUNCNAME VARCHAR(60),
    S_FUNCUUID VARCHAR(60),
    S_METHODDESC VARCHAR(512),
    S_DAYENDDEALTPY CHAR(1),
    S_TASKMETHOD VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TASKKINDCODE)
);

COMMENT ON TABLE TF_TASKKIND IS '待办任务种类表';
COMMENT ON COLUMN TF_TASKKIND.S_TASKKINDCODE IS '待办任务种类代码';
COMMENT ON COLUMN TF_TASKKIND.S_S_TASKKINDNAM IS '待办任务种类名称';
COMMENT ON COLUMN TF_TASKKIND.S_TASKBIGKIND IS '待办任务大类代码';
COMMENT ON COLUMN TF_TASKKIND.S_PAGENAME IS '页面名称';
COMMENT ON COLUMN TF_TASKKIND.S_TASKVIEWNAME IS '视图名称';
COMMENT ON COLUMN TF_TASKKIND.S_FUNCCODE IS '功能编号';
COMMENT ON COLUMN TF_TASKKIND.S_FUNCNAME IS '功能名称';
COMMENT ON COLUMN TF_TASKKIND.S_FUNCUUID IS '功能UUID';
COMMENT ON COLUMN TF_TASKKIND.S_METHODDESC IS '接口描述';
COMMENT ON COLUMN TF_TASKKIND.S_DAYENDDEALTPY IS '日终处理类型';
COMMENT ON COLUMN TF_TASKKIND.S_TASKMETHOD IS '任务撤销方法';
COMMENT ON COLUMN TF_TASKKIND.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110716030 ON TF_TASKKIND(S_TASKKINDCODE);

CREATE TABLE TF_TASKLIST(
    S_TASKKINDCODE VARCHAR(36) NOT NULL,
    S_S_TASKKINDNAM VARCHAR(60),
    S_TASKSRLNO VARCHAR(36) NOT NULL,
    S_LIMITTYPE CHAR(1),
    S_FLOWROLE CHAR(1),
    S_INSTCODE VARCHAR(14),
    S_USERCODE VARCHAR(12),
    S_JOBCODE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TASKKINDCODE,S_TASKSRLNO)
);

COMMENT ON TABLE TF_TASKLIST IS '待办任务表';
COMMENT ON COLUMN TF_TASKLIST.S_TASKKINDCODE IS '待办任务种类代码';
COMMENT ON COLUMN TF_TASKLIST.S_S_TASKKINDNAM IS '待办任务种类名称';
COMMENT ON COLUMN TF_TASKLIST.S_TASKSRLNO IS '业务编号';
COMMENT ON COLUMN TF_TASKLIST.S_LIMITTYPE IS '限制类型';
COMMENT ON COLUMN TF_TASKLIST.S_FLOWROLE IS '流程角色代码';
COMMENT ON COLUMN TF_TASKLIST.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TF_TASKLIST.S_USERCODE IS '用户代码';
COMMENT ON COLUMN TF_TASKLIST.S_JOBCODE IS '岗位代码';
COMMENT ON COLUMN TF_TASKLIST.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110716180 ON TF_TASKLIST(S_TASKKINDCODE,S_TASKSRLNO);

CREATE TABLE TF_TASKOPER(
    S_PROCCODE VARCHAR(7) NOT NULL,
    S_PROCNAME VARCHAR(60),
    S_CORRMETHOD VARCHAR(512),
    S_METHODDESC VARCHAR(512),
    S_PROCSTS VARCHAR(2),
    S_PROCSTSNAME VARCHAR(60),
    S_TASKKINDCODE VARCHAR(36),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_PROCCODE)
);

COMMENT ON TABLE TF_TASKOPER IS '任务操作表';
COMMENT ON COLUMN TF_TASKOPER.S_PROCCODE IS '处理代码';
COMMENT ON COLUMN TF_TASKOPER.S_PROCNAME IS '处理名称';
COMMENT ON COLUMN TF_TASKOPER.S_CORRMETHOD IS '对应接口';
COMMENT ON COLUMN TF_TASKOPER.S_METHODDESC IS '接口描述';
COMMENT ON COLUMN TF_TASKOPER.S_PROCSTS IS '处理状态代码';
COMMENT ON COLUMN TF_TASKOPER.S_PROCSTSNAME IS '处理状态名称';
COMMENT ON COLUMN TF_TASKOPER.S_TASKKINDCODE IS '待办任务种类代码';
COMMENT ON COLUMN TF_TASKOPER.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110716310 ON TF_TASKOPER(S_PROCCODE);

CREATE TABLE TL_AMTPOSTCHECKINFO(
    S_SRLNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE,
    S_CONTFLAG CHAR(1),
    S_TRANSSERNO VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_BIZKNDCODE VARCHAR(7),
    S_INACCFUNDPROCSTATE CHAR(1),
    S_CHRGSTATE CHAR(1),
    S_CHKTYPECODE CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TL_AMTPOSTCHECKINFO IS '资金岗核对信息表';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_SRLNO IS '流水号';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_CONTFLAG IS '往来标识';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.F_AMT IS '金额';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_INACCFUNDPROCSTATE IS '资金处理状态';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_CHRGSTATE IS '记账状态';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.S_CHKTYPECODE IS '核对业务类型代码';
COMMENT ON COLUMN TL_AMTPOSTCHECKINFO.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110716450 ON TL_AMTPOSTCHECKINFO(S_SRLNO);

CREATE TABLE TL_BAKCLEARDTLLOG(
    I_LOGNO BIGINT(19) NOT NULL,
    I_SERNO BIGINT(19) NOT NULL,
    S_TABLENAME VARCHAR(128),
    I_NEEDMOVENUM BIGINT(19),
    I_SUCCESSMOVENUM BIGINT(19),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_LOGNO,I_SERNO)
);

COMMENT ON TABLE TL_BAKCLEARDTLLOG IS '备份明细日志表';
COMMENT ON COLUMN TL_BAKCLEARDTLLOG.I_LOGNO IS '日志流水号';
COMMENT ON COLUMN TL_BAKCLEARDTLLOG.I_SERNO IS '序号';
COMMENT ON COLUMN TL_BAKCLEARDTLLOG.S_TABLENAME IS '表名';
COMMENT ON COLUMN TL_BAKCLEARDTLLOG.I_NEEDMOVENUM IS '待迁移条数';
COMMENT ON COLUMN TL_BAKCLEARDTLLOG.I_SUCCESSMOVENUM IS '成功迁移条数';
COMMENT ON COLUMN TL_BAKCLEARDTLLOG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110739360 ON TL_BAKCLEARDTLLOG(I_LOGNO,I_SERNO);

CREATE TABLE TL_BAKCLEARLOG(
    I_LOGNO BIGINT(19) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    D_STARTDATE DATE NOT NULL,
    D_ENDDATE DATE NOT NULL,
    S_OPERTYPE CHAR(1) NOT NULL,
    S_OPERSTATE VARCHAR(2) NOT NULL,
    S_FILEBAKPATH VARCHAR(512),
    S_REMARK VARCHAR(512),
    S_OPERCODE VARCHAR(12) NOT NULL,
    S_OPERNAME VARCHAR(60),
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_LOGNO)
);

COMMENT ON TABLE TL_BAKCLEARLOG IS '备份清理日志';
COMMENT ON COLUMN TL_BAKCLEARLOG.I_LOGNO IS '日志流水号';
COMMENT ON COLUMN TL_BAKCLEARLOG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TL_BAKCLEARLOG.D_STARTDATE IS '开始日期';
COMMENT ON COLUMN TL_BAKCLEARLOG.D_ENDDATE IS '结束日期';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_OPERSTATE IS '操作状态';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_FILEBAKPATH IS '文件备份路径[含文件名]';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_REMARK IS '备注';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TL_BAKCLEARLOG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TL_BAKCLEARLOG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110739220 ON TL_BAKCLEARLOG(I_LOGNO);

CREATE TABLE TL_FILEIMPORTLOG(
    I_LOGNO BIGINT(19) NOT NULL,
    S_BIZSRLNO VARCHAR(36),
    D_ACCTDATE DATE NOT NULL,
    D_SUBMITDATE DATE NOT NULL,
    S_ISOPERAWORK CHAR(1) NOT NULL,
    S_WROCLASS CHAR(1),
    S_RESDLREASON VARCHAR(512),
    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_BIZKNDCODE VARCHAR(7),
    S_BRHTREASCODE VARCHAR(36),
    I_SUBMITUNTACCNO INTEGER,
    I_REPCOUNT INTEGER,
    F_COLLAMT DECIMAL(24,2),
    S_ADJPERFLAG CHAR(1),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_LOGNO)
);

COMMENT ON TABLE TL_FILEIMPORTLOG IS '通讯文件导入日志表';
COMMENT ON COLUMN TL_FILEIMPORTLOG.I_LOGNO IS '日志流水号';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_BIZSRLNO IS '业务流水号';
COMMENT ON COLUMN TL_FILEIMPORTLOG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TL_FILEIMPORTLOG.D_SUBMITDATE IS '报送日期';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_ISOPERAWORK IS '是否操作成功';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_WROCLASS IS '差误类别';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_RESDLREASON IS '差误原因';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_FILENAME IS '文件名';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_FILEPATH IS '文件路径[含文件名]';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_FILEBAKPATH IS '文件备份路径[含文件名]';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TL_FILEIMPORTLOG.I_SUBMITUNTACCNO IS '报送单位记账序号';
COMMENT ON COLUMN TL_FILEIMPORTLOG.I_REPCOUNT IS '报单笔数';
COMMENT ON COLUMN TL_FILEIMPORTLOG.F_COLLAMT IS '汇总金额';
COMMENT ON COLUMN TL_FILEIMPORTLOG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TL_FILEIMPORTLOG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110716670 ON TL_FILEIMPORTLOG(I_LOGNO);

CREATE TABLE TL_OPERLOG(
    S_INSTCODE VARCHAR(14),
    D_ACCTDATE DATE,
    S_OPERCODE VARCHAR(12),
    S_FUNCTIONCODE VARCHAR(10),
    S_RUNRESULT CHAR(2),
    I_LOGNO BIGINT(19) NOT NULL,
    S_BIZPK VARCHAR(4096),
    F_AMT DECIMAL(24,2),
    S_LOGBIZTYPE CHAR(6),
    S_OFSUBSYS CHAR(1),
    S_BIZSRLNO VARCHAR(36),
    S_BIZKNDCODE VARCHAR(7),
    S_VOUCHKNDCODE VARCHAR(36),
    S_LOGINTYPE CHAR(1),
    I_LOGINERRNUM INTEGER,
    S_ORGNAME VARCHAR(60),
    S_IP VARCHAR(36),
    S_MACADDRESS VARCHAR(72),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (I_LOGNO)
);

COMMENT ON TABLE TL_OPERLOG IS '操作日志表';
COMMENT ON COLUMN TL_OPERLOG.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TL_OPERLOG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TL_OPERLOG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TL_OPERLOG.S_FUNCTIONCODE IS '功能代码';
COMMENT ON COLUMN TL_OPERLOG.S_RUNRESULT IS '操作类型';
COMMENT ON COLUMN TL_OPERLOG.I_LOGNO IS '日志流水号';
COMMENT ON COLUMN TL_OPERLOG.S_BIZPK IS '业务关键字';
COMMENT ON COLUMN TL_OPERLOG.F_AMT IS '金额';
COMMENT ON COLUMN TL_OPERLOG.S_LOGBIZTYPE IS '日志业务类型';
COMMENT ON COLUMN TL_OPERLOG.S_OFSUBSYS IS '所属子系统';
COMMENT ON COLUMN TL_OPERLOG.S_BIZSRLNO IS '业务流水号';
COMMENT ON COLUMN TL_OPERLOG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TL_OPERLOG.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TL_OPERLOG.S_LOGINTYPE IS '登录方式';
COMMENT ON COLUMN TL_OPERLOG.I_LOGINERRNUM IS '非法登录次数';
COMMENT ON COLUMN TL_OPERLOG.S_ORGNAME IS '机构名称';
COMMENT ON COLUMN TL_OPERLOG.S_IP IS 'ip地址';
COMMENT ON COLUMN TL_OPERLOG.S_MACADDRESS IS 'MAC地址';
COMMENT ON COLUMN TL_OPERLOG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110716890 ON TL_OPERLOG(I_LOGNO);

CREATE TABLE TM_ACCTENTRYCFG(
    S_CHRGBIZKNDCODE VARCHAR(7) NOT NULL,
    S_ACCTENTRYCODE VARCHAR(36) NOT NULL,
    S_DEBTCREDTFLAG CHAR(1) NOT NULL,
    S_ACCTNOCMT VARCHAR(36),
    S_ACCTNODATASRC CHAR(1),
    S_ACCTNOGENMETHOD VARCHAR(60),
    S_ACCTNOCOLNAME VARCHAR(60),
    S_AMTCMT VARCHAR(512),
    S_AMTCOLNAME VARCHAR(60) NOT NULL,
    S_AMTDATASRC CHAR(1),
    S_AMTGENMETHOD VARCHAR(60),
    S_REDBLUEFLAG CHAR(1) NOT NULL,
    S_ENTRYKND CHAR(1) NOT NULL,
    S_OPPACCTNOCOLNAME VARCHAR(60),
    S_OPPSBTCOLNAME VARCHAR(60) NOT NULL,
    S_REMARK VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CHRGBIZKNDCODE,S_ACCTENTRYCODE)
);

COMMENT ON TABLE TM_ACCTENTRYCFG IS '会计分录配置表';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_CHRGBIZKNDCODE IS '记账业务种类代码';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_ACCTENTRYCODE IS '会计分录代码';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_ACCTNOCMT IS '账号说明';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_ACCTNODATASRC IS '账号数据来源';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_ACCTNOGENMETHOD IS '账号生成方法';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_ACCTNOCOLNAME IS '账号列名';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_AMTCMT IS '金额说明';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_AMTCOLNAME IS '金额列名';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_AMTDATASRC IS '金额数据来源';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_AMTGENMETHOD IS '金额生成方法';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_REDBLUEFLAG IS '红蓝字标志';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_ENTRYKND IS '分录类别';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_OPPACCTNOCOLNAME IS '对方账号列名';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_OPPSBTCOLNAME IS '对方科目列名';
COMMENT ON COLUMN TM_ACCTENTRYCFG.S_REMARK IS '备注';
COMMENT ON COLUMN TM_ACCTENTRYCFG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110717070 ON TM_ACCTENTRYCFG(S_CHRGBIZKNDCODE,S_ACCTENTRYCODE);

CREATE TABLE TM_CHRGBIZKND(
    S_CHRGBIZKNDCODE VARCHAR(7) NOT NULL,
    S_CHRGBIZKNDNAME VARCHAR(60),
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BIZTBLNAME VARCHAR(60) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CHRGBIZKNDCODE)
);

COMMENT ON TABLE TM_CHRGBIZKND IS '记账业务种类表';
COMMENT ON COLUMN TM_CHRGBIZKND.S_CHRGBIZKNDCODE IS '记账业务种类代码';
COMMENT ON COLUMN TM_CHRGBIZKND.S_CHRGBIZKNDNAME IS '记账业务种类名称';
COMMENT ON COLUMN TM_CHRGBIZKND.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TM_CHRGBIZKND.S_BIZTBLNAME IS '业务表表名';
COMMENT ON COLUMN TM_CHRGBIZKND.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110717170 ON TM_CHRGBIZKND(S_CHRGBIZKNDCODE);

CREATE TABLE TM_FUNC(
    S_FUNCNAME VARCHAR(60) NOT NULL,
    S_FUNCTIONCODE VARCHAR(10) NOT NULL,
    S_LAYER CHAR(1) NOT NULL,
    S_FUNCTYPE CHAR(1),
    S_OFSUPFUNCCODE VARCHAR(10) NOT NULL,
    S_SPLITJOBFLAG CHAR(1) NOT NULL,
    S_ROLETYPE CHAR(1) NOT NULL,
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_FUNCTIONCODE)
);

COMMENT ON TABLE TM_FUNC IS '功能表';
COMMENT ON COLUMN TM_FUNC.S_FUNCNAME IS '功能名称';
COMMENT ON COLUMN TM_FUNC.S_FUNCTIONCODE IS '功能代码';
COMMENT ON COLUMN TM_FUNC.S_LAYER IS '层次';
COMMENT ON COLUMN TM_FUNC.S_FUNCTYPE IS '功能类型';
COMMENT ON COLUMN TM_FUNC.S_OFSUPFUNCCODE IS '所属上级功能代码';
COMMENT ON COLUMN TM_FUNC.S_SPLITJOBFLAG IS '分岗标志';
COMMENT ON COLUMN TM_FUNC.S_ROLETYPE IS '角色类型';
COMMENT ON COLUMN TM_FUNC.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TM_FUNC.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110718420 ON TM_FUNC(S_FUNCTIONCODE);

CREATE TABLE TM_JOBS(
    S_JOBCODE CHAR(1) NOT NULL,
    S_JOBNAME 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,
    PRIMARY KEY (S_JOBCODE)
);

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


CREATE UNIQUE INDEX SQL221020110717340 ON TM_JOBS(S_JOBCODE);

CREATE TABLE TM_REPORTNO(
    D_ACCTDATE DATE NOT NULL,
    S_REPKIND CHAR(3) NOT NULL,
    S_REPORTPERIOD CHAR(1) NOT NULL,
    S_ADJPERFLAG CHAR(1) NOT NULL,
    S_OFYEAR CHAR(4) NOT NULL,
    S_REPORTNAME VARCHAR(100),
    I_REPSEQNO INTEGER,
    TS_SYSUPDATE TIMESTAMP NOT NULL,
    PRIMARY KEY (D_ACCTDATE,S_REPKIND,S_REPORTPERIOD,S_ADJPERFLAG,S_OFYEAR)
);

COMMENT ON TABLE TM_REPORTNO IS '报表序号';
COMMENT ON COLUMN TM_REPORTNO.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TM_REPORTNO.S_REPKIND IS '报表种类';
COMMENT ON COLUMN TM_REPORTNO.S_REPORTPERIOD IS '报表期';
COMMENT ON COLUMN TM_REPORTNO.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TM_REPORTNO.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TM_REPORTNO.S_REPORTNAME IS '报表名称';
COMMENT ON COLUMN TM_REPORTNO.I_REPSEQNO IS '报表序号';
COMMENT ON COLUMN TM_REPORTNO.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110717480 ON TM_REPORTNO(D_ACCTDATE,S_REPKIND,S_REPORTPERIOD,S_ADJPERFLAG,S_OFYEAR);

CREATE TABLE TM_ROLE(
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_ROLENAME VARCHAR(60) NOT NULL,
    S_SPLITJOBFLAG CHAR(1) NOT NULL,
    S_ROLETYPE CHAR(1) NOT NULL,
    S_OPERTYPE CHAR(1),
    S_PARAMSTATE CHAR(1) NOT NULL,
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_INSTCODE VARCHAR(14),
    S_LASTDESC VARCHAR(512),
    S_APROVERCODE VARCHAR(12),
    S_APROVERNAME VARCHAR(60),
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ROLECODE)
);

COMMENT ON TABLE TM_ROLE IS '角色表';
COMMENT ON COLUMN TM_ROLE.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TM_ROLE.S_ROLENAME IS '角色名称';
COMMENT ON COLUMN TM_ROLE.S_SPLITJOBFLAG IS '分岗标志';
COMMENT ON COLUMN TM_ROLE.S_ROLETYPE IS '角色类型';
COMMENT ON COLUMN TM_ROLE.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TM_ROLE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TM_ROLE.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TM_ROLE.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TM_ROLE.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TM_ROLE.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TM_ROLE.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TM_ROLE.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TM_ROLE.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TM_ROLE.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TM_ROLE.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TM_ROLE.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TM_ROLE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110717670 ON TM_ROLE(S_ROLECODE);

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

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


CREATE UNIQUE INDEX SQL221020110718640 ON TM_ROLEFUNC(S_ROLECODE,S_FUNCTIONCODE);

CREATE TABLE TM_SEQREGIST(
    D_ACCTDATE DATE NOT NULL,
    S_DATATYPE CHAR(2) NOT NULL,
    S_DATAVALUE VARCHAR(20),
    S_REMARK VARCHAR(512),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (D_ACCTDATE,S_DATATYPE)
);

COMMENT ON TABLE TM_SEQREGIST IS '顺序号码登记表';
COMMENT ON COLUMN TM_SEQREGIST.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TM_SEQREGIST.S_DATATYPE IS '登记类型';
COMMENT ON COLUMN TM_SEQREGIST.S_DATAVALUE IS '数值';
COMMENT ON COLUMN TM_SEQREGIST.S_REMARK IS '备注';
COMMENT ON COLUMN TM_SEQREGIST.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110717760 ON TM_SEQREGIST(D_ACCTDATE,S_DATATYPE);

CREATE TABLE TM_USERBASEINFO(
    S_USERCODE VARCHAR(12) NOT NULL,
    S_USERNAME VARCHAR(60) NOT NULL,
    S_PWD VARCHAR(64) NOT NULL,
    S_WORKPROP CHAR(1),
    S_LOGINTYPE CHAR(1) NOT NULL,
    S_CADN VARCHAR(100),
    S_CRDNTKIND CHAR(1),
    S_CRDNTNO VARCHAR(36),
    S_IPMCADDRESS VARCHAR(20),
    I_PWDERRTIMES INTEGER,
    D_BIRTHDAY DATE,
    S_SEX CHAR(1),
    S_EDUCATION CHAR(1),
    S_NATIONCODE VARCHAR(10),
    S_NATIONNAME VARCHAR(60),
    S_POLITSTATUS CHAR(1),
    S_BIRTHPLACE VARCHAR(10),
    S_LINKPHONE VARCHAR(36),
    TS_LASTLOGIN TIMESTAMP,
    S_CHGPWDWEEKS CHAR(1),
    TS_LASTUPPWDTIME TIMESTAMP,
    S_BOOKORGCODE VARCHAR(14),
    S_USERSTATE 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 (S_USERCODE)
);

COMMENT ON TABLE TM_USERBASEINFO IS '用户表';
COMMENT ON COLUMN TM_USERBASEINFO.S_USERCODE IS '用户代码';
COMMENT ON COLUMN TM_USERBASEINFO.S_USERNAME IS '用户姓名';
COMMENT ON COLUMN TM_USERBASEINFO.S_PWD IS '密码';
COMMENT ON COLUMN TM_USERBASEINFO.S_WORKPROP IS '工作性质';
COMMENT ON COLUMN TM_USERBASEINFO.S_LOGINTYPE IS '登录方式';
COMMENT ON COLUMN TM_USERBASEINFO.S_CADN IS 'CA证书DN';
COMMENT ON COLUMN TM_USERBASEINFO.S_CRDNTKIND IS '证件种类';
COMMENT ON COLUMN TM_USERBASEINFO.S_CRDNTNO IS '证件号码';
COMMENT ON COLUMN TM_USERBASEINFO.S_IPMCADDRESS IS 'IPMAC绑定';
COMMENT ON COLUMN TM_USERBASEINFO.I_PWDERRTIMES IS '密码输错次数';
COMMENT ON COLUMN TM_USERBASEINFO.D_BIRTHDAY IS '出生日期';
COMMENT ON COLUMN TM_USERBASEINFO.S_SEX IS '性别';
COMMENT ON COLUMN TM_USERBASEINFO.S_EDUCATION IS '学历';
COMMENT ON COLUMN TM_USERBASEINFO.S_NATIONCODE IS '民族代码';
COMMENT ON COLUMN TM_USERBASEINFO.S_NATIONNAME IS '民族名称';
COMMENT ON COLUMN TM_USERBASEINFO.S_POLITSTATUS IS '政治面貌';
COMMENT ON COLUMN TM_USERBASEINFO.S_BIRTHPLACE IS '籍贯';
COMMENT ON COLUMN TM_USERBASEINFO.S_LINKPHONE IS '联系电话';
COMMENT ON COLUMN TM_USERBASEINFO.TS_LASTLOGIN IS '上次登陆时间';
COMMENT ON COLUMN TM_USERBASEINFO.S_CHGPWDWEEKS IS '口令更新周期';
COMMENT ON COLUMN TM_USERBASEINFO.TS_LASTUPPWDTIME IS '上次口令修改时间';
COMMENT ON COLUMN TM_USERBASEINFO.S_BOOKORGCODE IS '核算主体代码';
COMMENT ON COLUMN TM_USERBASEINFO.S_USERSTATE IS '用户状态';
COMMENT ON COLUMN TM_USERBASEINFO.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TM_USERBASEINFO.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TM_USERBASEINFO.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TM_USERBASEINFO.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TM_USERBASEINFO.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TM_USERBASEINFO.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TM_USERBASEINFO.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TM_USERBASEINFO.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TM_USERBASEINFO.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TM_USERBASEINFO.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TM_USERBASEINFO.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TM_USERBASEINFO.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TM_USERBASEINFO.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110718120 ON TM_USERBASEINFO(S_USERCODE);

CREATE TABLE TM_USERROLE(
    S_USERCODE VARCHAR(12) NOT NULL,
    S_ROLECODE VARCHAR(10) NOT NULL,
    S_SPLITJOBFLAG CHAR(1) NOT NULL,
    S_ROLETYPE CHAR(1) NOT NULL,
    S_PARAMSTATE CHAR(1) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_USERCODE,S_ROLECODE)
);

COMMENT ON TABLE TM_USERROLE IS '用户与角色对应关系表';
COMMENT ON COLUMN TM_USERROLE.S_USERCODE IS '用户代码';
COMMENT ON COLUMN TM_USERROLE.S_ROLECODE IS '角色代码';
COMMENT ON COLUMN TM_USERROLE.S_SPLITJOBFLAG IS '分岗标志';
COMMENT ON COLUMN TM_USERROLE.S_ROLETYPE IS '角色类型';
COMMENT ON COLUMN TM_USERROLE.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TM_USERROLE.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110718230 ON TM_USERROLE(S_USERCODE,S_ROLECODE);

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


CREATE UNIQUE INDEX SQL221020110718870 ON TN_CBDGEINCREG(S_SRLNO);
CREATE INDEX IX_CBDGEINCREG_ACCDATE ON TN_CBDGEINCREG(D_ACCTDATE);
CREATE INDEX IX_CBDGEINCREG_BIZKNDCODE ON TN_CBDGEINCREG(S_BIZKNDCODE);
CREATE INDEX IX_CBDGEINCREG_BRHTREASCODE ON TN_CBDGEINCREG(S_BRHTREASCODE);

CREATE TABLE TN_CBDGEOUTREG(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BDGETUNCODE VARCHAR(36) NOT NULL,
    S_BDGESBTCODE VARCHAR(30) NOT NULL,
    S_BDGESBTKINDCODE VARCHAR(30),
    S_BDGESBTPROPCODE VARCHAR(36),
    S_ECNMCSBT VARCHAR(36),
    S_LEVUNITCODE VARCHAR(36) NOT NULL,
    S_PROXYBANKCODE VARCHAR(36) NOT NULL,
    S_SBTCLASS CHAR(1),
    S_PAYTRANSNO VARCHAR(30) NOT NULL,
    I_SUBMITUNTACCNO INTEGER NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_PAYTYPEFLAG CHAR(1) NOT NULL,
    S_REALFUNDBILLTYPECODE 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_CBDGEOUTREG IS '中央预算支出登记簿';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TN_CBDGEOUTREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_BDGESBTCODE IS '预算科目代码（项目代码）';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_BDGESBTKINDCODE IS '预算科目种类代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_BDGESBTPROPCODE IS '预算科目属性代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_ECNMCSBT IS '经济科目';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_LEVUNITCODE IS '征收单位代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_SBTCLASS IS '科目分类';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_PAYTRANSNO IS '支付交易序号（报单号）';
COMMENT ON COLUMN TN_CBDGEOUTREG.I_SUBMITUNTACCNO IS '报送单位记账序号（报表序号 、上报序号）';
COMMENT ON COLUMN TN_CBDGEOUTREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_PAYTYPEFLAG IS '支付方式';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_REALFUNDBILLTYPECODE IS '实拨资金单据类型代码';
COMMENT ON COLUMN TN_CBDGEOUTREG.I_PAYINPROCENO IS '报解批次';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TN_CBDGEOUTREG.S_IFSECRET IS '是否涉密';
COMMENT ON COLUMN TN_CBDGEOUTREG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110719170 ON TN_CBDGEOUTREG(S_SRLNO);
CREATE INDEX IX_CBDGEOUTREG_ACCDATE ON TN_CBDGEOUTREG(D_ACCTDATE);

CREATE TABLE TN_OFFACCTREG(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7),
    S_ACCTSRLNO VARCHAR(30),
    S_DEBTCREDTFLAG CHAR(1),
    S_VOUNO VARCHAR(42),
    S_REMARK VARCHAR(512),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_OPPACCTNO VARCHAR(36),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_ACCTNAME VARCHAR(60),
    S_MSGKINDCODE VARCHAR(32),
    S_BRIEF VARCHAR(512),
    S_PAYTRANSNO VARCHAR(36),
    S_OFFACCTBUSINESSTYPE VARCHAR(7),
    S_OFFACCTTYPISTCODE VARCHAR(12),
    S_ADJPERFLAG CHAR(1),
    S_ACCTNO VARCHAR(36),
    S_FUNDORIT CHAR(1),
    F_AMT DECIMAL(24,2),
    I_ATTACHNUM INTEGER,
    S_CORRECTFLAG CHAR(1),
    S_OFYEAR CHAR(4) NOT NULL,
    S_IFSECRET CHAR(1) NOT NULL,
    S_AMTSRLNO VARCHAR(36),
    I_MSGSRLNO BIGINT(19),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TN_OFFACCTREG IS '解挂登记簿';
COMMENT ON COLUMN TN_OFFACCTREG.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TN_OFFACCTREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_OFFACCTREG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TN_OFFACCTREG.S_ACCTSRLNO IS '会计流水号';
COMMENT ON COLUMN TN_OFFACCTREG.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TN_OFFACCTREG.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TN_OFFACCTREG.S_REMARK IS '备注';
COMMENT ON COLUMN TN_OFFACCTREG.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TN_OFFACCTREG.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TN_OFFACCTREG.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TN_OFFACCTREG.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TN_OFFACCTREG.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TN_OFFACCTREG.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TN_OFFACCTREG.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TN_OFFACCTREG.S_BRIEF IS '摘要';
COMMENT ON COLUMN TN_OFFACCTREG.S_PAYTRANSNO IS '支付交易序号';
COMMENT ON COLUMN TN_OFFACCTREG.S_OFFACCTBUSINESSTYPE IS '解挂后业务种类';
COMMENT ON COLUMN TN_OFFACCTREG.S_OFFACCTTYPISTCODE IS '解挂录入员代码';
COMMENT ON COLUMN TN_OFFACCTREG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TN_OFFACCTREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_OFFACCTREG.S_FUNDORIT IS '资金方向';
COMMENT ON COLUMN TN_OFFACCTREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_OFFACCTREG.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TN_OFFACCTREG.S_CORRECTFLAG IS '冲正标识';
COMMENT ON COLUMN TN_OFFACCTREG.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TN_OFFACCTREG.S_IFSECRET IS '是否涉密';
COMMENT ON COLUMN TN_OFFACCTREG.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TN_OFFACCTREG.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TN_OFFACCTREG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110719450 ON TN_OFFACCTREG(S_TRANSSERNO);

CREATE TABLE TN_ONACCTREG(
    S_TRANSSERNO VARCHAR(36) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_ACCTSRLNO VARCHAR(30),
    S_DEBTCREDTFLAG CHAR(1),
    S_VOUNO VARCHAR(42),
    S_ACCTNAME VARCHAR(60),
    S_ACCTNO VARCHAR(36),
    S_AMTSRLNO VARCHAR(36),
    F_AMT DECIMAL(24,2),
    S_OPPACCTNO VARCHAR(36),
    S_BRIEF VARCHAR(512),
    S_TYPISTCODE VARCHAR(12),
    S_TYPISTNAME VARCHAR(60),
    S_BIZKNDCODE VARCHAR(7),
    S_REMARK VARCHAR(512),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    S_MSGKINDCODE VARCHAR(32),
    S_ONACCTPROCFLAG VARCHAR(2),
    S_PAYTRANSNO VARCHAR(36),
    D_OFFACCTDATE DATE,
    S_OFFACCTSRLNO VARCHAR(30),
    S_FUNDORIT CHAR(1),
    I_ATTACHNUM INTEGER,
    S_CORRECTFLAG CHAR(1),
    S_OFYEAR CHAR(4) NOT NULL,
    S_IFSECRET CHAR(1) NOT NULL,
    S_ADJPERFLAG CHAR(1),
    S_BEFONACCTPRCSTATE VARCHAR(10),
    S_BEFONACCTSTATE VARCHAR(10),
    I_MSGSRLNO BIGINT(19),
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_TRANSSERNO)
);

COMMENT ON TABLE TN_ONACCTREG IS '挂账登记簿';
COMMENT ON COLUMN TN_ONACCTREG.S_TRANSSERNO IS '交易流水号';
COMMENT ON COLUMN TN_ONACCTREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_ONACCTREG.S_ACCTSRLNO IS '会计流水号';
COMMENT ON COLUMN TN_ONACCTREG.S_DEBTCREDTFLAG IS '借贷标志';
COMMENT ON COLUMN TN_ONACCTREG.S_VOUNO IS '凭证号';
COMMENT ON COLUMN TN_ONACCTREG.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TN_ONACCTREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_ONACCTREG.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TN_ONACCTREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_ONACCTREG.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TN_ONACCTREG.S_BRIEF IS '摘要';
COMMENT ON COLUMN TN_ONACCTREG.S_TYPISTCODE IS '录入员代码';
COMMENT ON COLUMN TN_ONACCTREG.S_TYPISTNAME IS '录入员名称';
COMMENT ON COLUMN TN_ONACCTREG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TN_ONACCTREG.S_REMARK IS '备注';
COMMENT ON COLUMN TN_ONACCTREG.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TN_ONACCTREG.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TN_ONACCTREG.S_MSGKINDCODE IS '报文种类代码';
COMMENT ON COLUMN TN_ONACCTREG.S_ONACCTPROCFLAG IS '挂账处理标志';
COMMENT ON COLUMN TN_ONACCTREG.S_PAYTRANSNO IS '支付交易序号';
COMMENT ON COLUMN TN_ONACCTREG.D_OFFACCTDATE IS '解挂日期';
COMMENT ON COLUMN TN_ONACCTREG.S_OFFACCTSRLNO IS '解挂流水号';
COMMENT ON COLUMN TN_ONACCTREG.S_FUNDORIT IS '资金方向';
COMMENT ON COLUMN TN_ONACCTREG.I_ATTACHNUM IS '附件数';
COMMENT ON COLUMN TN_ONACCTREG.S_CORRECTFLAG IS '冲正标识';
COMMENT ON COLUMN TN_ONACCTREG.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TN_ONACCTREG.S_IFSECRET IS '是否涉密';
COMMENT ON COLUMN TN_ONACCTREG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TN_ONACCTREG.S_BEFONACCTPRCSTATE IS '挂账前流程处理状态';
COMMENT ON COLUMN TN_ONACCTREG.S_BEFONACCTSTATE IS '挂账前处理状态';
COMMENT ON COLUMN TN_ONACCTREG.I_MSGSRLNO IS '报文流水号';
COMMENT ON COLUMN TN_ONACCTREG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110719790 ON TN_ONACCTREG(S_TRANSSERNO);

CREATE TABLE TN_OUTTABLEREG(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30),
    D_ACCTDATE DATE NOT NULL,
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ACCTNAME VARCHAR(60),
    S_BRIEF VARCHAR(512),
    S_ACCFLAG CHAR(1) NOT NULL,
    S_OPPACCTNO VARCHAR(36),
    S_VOUCHKNDCODE VARCHAR(36) NOT NULL,
    F_AMT DECIMAL(24,2) NOT NULL,
    S_OPERCODE VARCHAR(12),
    S_OPERNAME VARCHAR(60),
    S_ACCTANTCODE VARCHAR(12),
    S_ACCTANTNAME VARCHAR(60),
    I_ATTCHCOUNT INTEGER,
    S_STATSRLNO VARCHAR(30),
    S_ENDSRLNO VARCHAR(30),
    I_CANCELNUM INTEGER,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_SRLNO)
);

COMMENT ON TABLE TN_OUTTABLEREG IS '表外登记薄';
COMMENT ON COLUMN TN_OUTTABLEREG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TN_OUTTABLEREG.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TN_OUTTABLEREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_OUTTABLEREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_OUTTABLEREG.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TN_OUTTABLEREG.S_BRIEF IS '摘要';
COMMENT ON COLUMN TN_OUTTABLEREG.S_ACCFLAG IS '记账标志';
COMMENT ON COLUMN TN_OUTTABLEREG.S_OPPACCTNO IS '对方账号';
COMMENT ON COLUMN TN_OUTTABLEREG.S_VOUCHKNDCODE IS '凭证种类代码';
COMMENT ON COLUMN TN_OUTTABLEREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_OUTTABLEREG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TN_OUTTABLEREG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TN_OUTTABLEREG.S_ACCTANTCODE IS '复核员代码';
COMMENT ON COLUMN TN_OUTTABLEREG.S_ACCTANTNAME IS '复核员名称';
COMMENT ON COLUMN TN_OUTTABLEREG.I_ATTCHCOUNT IS '附件张数';
COMMENT ON COLUMN TN_OUTTABLEREG.S_STATSRLNO IS '起始流水号';
COMMENT ON COLUMN TN_OUTTABLEREG.S_ENDSRLNO IS '截止流水号';
COMMENT ON COLUMN TN_OUTTABLEREG.I_CANCELNUM IS '作废张数';
COMMENT ON COLUMN TN_OUTTABLEREG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110644470 ON TN_OUTTABLEREG(S_SRLNO);

CREATE TABLE TN_TREASURYBILLPAYREG(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BDGESBTCODE VARCHAR(30) NOT NULL,
    S_BDGESBTKINDCODE VARCHAR(30),
    S_BDGESBTPROPCODE VARCHAR(36),
    S_BRHTREASCODE 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_TREASURYBILLPAYREG IS '国债兑付登记簿';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_BDGESBTCODE IS '预算科目代码（项目代码）';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_BDGESBTKINDCODE IS '预算科目种类代码';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_BDGESBTPROPCODE IS '预算科目属性代码';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_BRHTREASCODE IS '分库代码';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_PAYTRANSNO IS '支付交易序号（报单号）';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.I_SUBMITUNTACCNO IS '报送单位记账序号（报表序号 、上报序号）';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.I_PAYINPROCENO IS '报解批次';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.S_IFSECRET IS '是否涉密';
COMMENT ON COLUMN TN_TREASURYBILLPAYREG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110720000 ON TN_TREASURYBILLPAYREG(S_SRLNO);
CREATE INDEX IX_TREASURYBILLPAYREG_ACCDATE ON TN_TREASURYBILLPAYREG(D_ACCTDATE);
CREATE INDEX IX_TREASURYBILLPAYREG_BIZKNDCODE ON TN_TREASURYBILLPAYREG(S_BIZKNDCODE);

CREATE TABLE TN_TREASURYBILLSELLREG(
    S_SRLNO VARCHAR(36) NOT NULL,
    S_AMTSRLNO VARCHAR(36) NOT NULL,
    S_DETAILTRANSNO VARCHAR(30) NOT NULL,
    D_ACCTDATE DATE NOT NULL,
    S_BIZKNDCODE VARCHAR(7) NOT NULL,
    S_BDGESBTCODE VARCHAR(30) NOT NULL,
    S_BDGESBTKINDCODE VARCHAR(30),
    S_BDGESBTPROPCODE VARCHAR(36),
    S_PROXYBANKCODE VARCHAR(36) 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_TREASURYBILLSELLREG IS '国债发行登记簿';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_SRLNO IS '流水号';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_AMTSRLNO IS '资金交易流水号';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_DETAILTRANSNO IS '明细交易流水号';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.D_ACCTDATE IS '账务日期';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_BIZKNDCODE IS '业务种类代码';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_BDGESBTCODE IS '预算科目代码（项目代码）';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_BDGESBTKINDCODE IS '预算科目种类代码';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_BDGESBTPROPCODE IS '预算科目属性代码';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_PROXYBANKCODE IS '代理银行代码';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.F_AMT IS '金额';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_ACCTNO IS '账号';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.I_PAYINPROCENO IS '报解批次';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_CERTPROCSTATE IS '凭证处理状态';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_ADJPERFLAG IS '调整期标志';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.S_IFSECRET IS '是否涉密';
COMMENT ON COLUMN TN_TREASURYBILLSELLREG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110720260 ON TN_TREASURYBILLSELLREG(S_SRLNO);
CREATE INDEX IX_TREASURYBILLSELLREG_ACCDATE ON TN_TREASURYBILLSELLREG(D_ACCTDATE);
CREATE INDEX IX_TREASURYBILLSELLREG_BIZKNDCODE ON TN_TREASURYBILLSELLREG(S_BIZKNDCODE);

CREATE TABLE TP_ACCT(
    S_ACCTNO VARCHAR(36) NOT NULL,
    S_ACCTNAME VARCHAR(60),
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_BALNCPROP CHAR(1) NOT NULL,
    S_BALNCCTRLFLAG CHAR(1) NOT NULL,
    S_LASTYEARACTFLAG CHAR(1),
    S_ACCTPROP CHAR(1) NOT NULL,
    S_OLDACCTNO VARCHAR(36),
    S_OLDACCTNAME VARCHAR(60),
    S_BEARFLAG CHAR(1) NOT NULL,
    S_TABOUTSIFLAG 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,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ACCTNO,S_OFYEAR)
);

COMMENT ON TABLE TP_ACCT IS '会计账户表';
COMMENT ON COLUMN TP_ACCT.S_ACCTNO IS '账号';
COMMENT ON COLUMN TP_ACCT.S_ACCTNAME IS '户名';
COMMENT ON COLUMN TP_ACCT.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TP_ACCT.S_BALNCPROP IS '余额性质';
COMMENT ON COLUMN TP_ACCT.S_BALNCCTRLFLAG IS '余额控制标志';
COMMENT ON COLUMN TP_ACCT.S_LASTYEARACTFLAG IS '上年户标志';
COMMENT ON COLUMN TP_ACCT.S_ACCTPROP IS '账户性质';
COMMENT ON COLUMN TP_ACCT.S_OLDACCTNO IS '原总库账号';
COMMENT ON COLUMN TP_ACCT.S_OLDACCTNAME IS '原总库账户名';
COMMENT ON COLUMN TP_ACCT.S_BEARFLAG IS '计息标志';
COMMENT ON COLUMN TP_ACCT.S_TABOUTSIFLAG IS '表内表外标志';
COMMENT ON COLUMN TP_ACCT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_ACCT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_ACCT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_ACCT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_ACCT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_ACCT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_ACCT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_ACCT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_ACCT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_ACCT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_ACCT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_ACCT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_ACCT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_ACCT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110720560 ON TP_ACCT(S_ACCTNO,S_OFYEAR);

CREATE TABLE TP_ACCTCAYREL(
    S_CURRYEARACT VARCHAR(36) NOT NULL,
    S_CURRYEARACTNAME VARCHAR(60),
    S_LASTYEARACT VARCHAR(36) NOT NULL,
    S_LASTYEARACTNAME VARCHAR(60),
    S_TRANTYPE 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,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_CURRYEARACT,S_LASTYEARACT,S_OFYEAR)
);

COMMENT ON TABLE TP_ACCTCAYREL IS '账户结转关系表';
COMMENT ON COLUMN TP_ACCTCAYREL.S_CURRYEARACT IS '本年户';
COMMENT ON COLUMN TP_ACCTCAYREL.S_CURRYEARACTNAME IS '本年户名称';
COMMENT ON COLUMN TP_ACCTCAYREL.S_LASTYEARACT IS '上年户';
COMMENT ON COLUMN TP_ACCTCAYREL.S_LASTYEARACTNAME IS '上年户名称';
COMMENT ON COLUMN TP_ACCTCAYREL.S_TRANTYPE IS '结转类型';
COMMENT ON COLUMN TP_ACCTCAYREL.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_ACCTCAYREL.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_ACCTCAYREL.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_ACCTCAYREL.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_ACCTCAYREL.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_ACCTCAYREL.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_ACCTCAYREL.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_ACCTCAYREL.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_ACCTCAYREL.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_ACCTCAYREL.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_ACCTCAYREL.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_ACCTCAYREL.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_ACCTCAYREL.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_ACCTCAYREL.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110720760 ON TP_ACCTCAYREL(S_CURRYEARACT,S_LASTYEARACT,S_OFYEAR);

CREATE TABLE TP_ACCTSBT(
    S_ACCTSBTCODE VARCHAR(36) NOT NULL,
    S_ACCTSBTNAME VARCHAR(60),
    S_ACCTSBTKND CHAR(1) NOT NULL,
    S_ACCTSBTLVL CHAR(1) NOT NULL,
    S_OFSUPACCTSBTCODE VARCHAR(36) NOT NULL,
    S_PRINTNO VARCHAR(36),
    S_EFFECTTYPE CHAR(1) NOT NULL,
    D_ADJUSTDATE DATE,
    D_EFFECTDATE DATE,
    D_INVALIDATE DATE,
    S_SBTBALNCPROP CHAR(1),
    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_BLANCETABLEFLAG CHAR(1),
    S_REPERTORYTABLEFLAG CHAR(1),
    S_MOTHACCTTABLEFLAG CHAR(1),
    S_MOTHACCTTABLEBIGTYPE CHAR(4),
    I_MOTHACCTNO INTEGER,
    S_OFYEAR CHAR(4) NOT NULL,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_ACCTSBTCODE,S_OFYEAR)
);

COMMENT ON TABLE TP_ACCTSBT IS '会计科目表';
COMMENT ON COLUMN TP_ACCTSBT.S_ACCTSBTCODE IS '会计科目代码';
COMMENT ON COLUMN TP_ACCTSBT.S_ACCTSBTNAME IS '会计科目名称';
COMMENT ON COLUMN TP_ACCTSBT.S_ACCTSBTKND IS '会计科目类别';
COMMENT ON COLUMN TP_ACCTSBT.S_ACCTSBTLVL IS '会计科目级次';
COMMENT ON COLUMN TP_ACCTSBT.S_OFSUPACCTSBTCODE IS '所属上级会计科目代码';
COMMENT ON COLUMN TP_ACCTSBT.S_PRINTNO IS '打印序号';
COMMENT ON COLUMN TP_ACCTSBT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_ACCTSBT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_ACCTSBT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_ACCTSBT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_ACCTSBT.S_SBTBALNCPROP IS '科目余额性质';
COMMENT ON COLUMN TP_ACCTSBT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_ACCTSBT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_ACCTSBT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_ACCTSBT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_ACCTSBT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_ACCTSBT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_ACCTSBT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_ACCTSBT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_ACCTSBT.S_BLANCETABLEFLAG IS '平衡表标志';
COMMENT ON COLUMN TP_ACCTSBT.S_REPERTORYTABLEFLAG IS '库存表标志';
COMMENT ON COLUMN TP_ACCTSBT.S_MOTHACCTTABLEFLAG IS '月计表标志';
COMMENT ON COLUMN TP_ACCTSBT.S_MOTHACCTTABLEBIGTYPE IS '月计表大类号';
COMMENT ON COLUMN TP_ACCTSBT.I_MOTHACCTNO IS '月计表序号';
COMMENT ON COLUMN TP_ACCTSBT.S_OFYEAR IS '所属年度';
COMMENT ON COLUMN TP_ACCTSBT.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110721000 ON TP_ACCTSBT(S_ACCTSBTCODE,S_OFYEAR);

CREATE TABLE TP_BACKUPCOLCONFIG(
    S_TABLENAME VARCHAR(128) NOT NULL,
    S_TABLECNNAME VARCHAR(120),
    S_CLOUMNCODE VARCHAR(64) NOT NULL,
    I_ORDERNO INTEGER 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),
    S_OPERNAME VARCHAR(60),
    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_TABLENAME,S_CLOUMNCODE)
);

COMMENT ON TABLE TP_BACKUPCOLCONFIG IS '字段备份配置表';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_TABLENAME IS '表名';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_TABLECNNAME IS '表中文名';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_CLOUMNCODE IS '字段代码';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.I_ORDERNO IS '顺序号';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BACKUPCOLCONFIG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110739080 ON TP_BACKUPCOLCONFIG(S_TABLENAME,S_CLOUMNCODE);

CREATE TABLE TP_BACKUPCONFIG(
    S_DBCODE VARCHAR(60) NOT NULL,
    S_SCHEMA VARCHAR(60) NOT NULL,
    S_TABLENAME VARCHAR(128) NOT NULL,
    S_TABLECNNAME VARCHAR(120),
    S_ISBACKUP CHAR(1) NOT NULL,
    S_BACKTYPE CHAR(1),
    S_COLUMNNAME VARCHAR(120),
    S_ORDERBY VARCHAR(120),
    I_MAXDATANUM BIGINT(19),
    S_OTHERWHERE VARCHAR(1024),
    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_DBCODE,S_SCHEMA,S_TABLENAME)
);

COMMENT ON TABLE TP_BACKUPCONFIG IS '表备份配置表';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_DBCODE IS '数据库代码';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_SCHEMA IS '表schema';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_TABLENAME IS '表名';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_TABLECNNAME IS '表中文名';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_ISBACKUP IS '是否备份';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_BACKTYPE IS '备份方式';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_COLUMNNAME IS '列名';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_ORDERBY IS '排序列名';
COMMENT ON COLUMN TP_BACKUPCONFIG.I_MAXDATANUM IS '最大条数';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_OTHERWHERE IS '自定义条件';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BACKUPCONFIG.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BACKUPCONFIG.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BACKUPCONFIG.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BACKUPCONFIG.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BACKUPCONFIG.TS_SYSUPDATE IS '系统更新时间';


CREATE UNIQUE INDEX SQL221020110731930 ON TP_BACKUPCONFIG(S_TABLENAME,S_SCHEMA,S_DBCODE);

CREATE TABLE TP_BANK_CLASS(
    S_BANKSTATCODE VARCHAR(24) NOT NULL,
    S_BKCTGYCODE VARCHAR(10) 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_BANKSTATCODE,S_BKCTGYCODE)
);

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


CREATE UNIQUE INDEX SQL221020110739790 ON TP_BANK_CLASS(S_BANKSTATCODE,S_BKCTGYCODE);

CREATE TABLE TP_BDGESBTPROP(
    S_BDGESBTPROPCODE VARCHAR(36) NOT NULL,
    S_BDGESBTPROPNAME 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,
    TS_SYSUPDATE TIMESTAMP,
    PRIMARY KEY (S_BDGESBTPROPCODE)
);

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


CREATE UNIQUE INDEX SQL221020110721400 ON TP_BDGESBTPROP(S_BDGESBTPROPCODE);

CREATE TABLE TP_BDGETUNIT(
    S_BDGETUNCODE VARCHAR(36) NOT NULL,
    S_BDGETUNNAME VARCHAR(60),
    S_CONTADDRES VARCHAR(100),
    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_FLAG CHAR(1),
    S_BANKSECRETFLAG 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,
    S_ISOPENVOUCHER CHAR(1),
    PRIMARY KEY (S_BDGETUNCODE)
);

COMMENT ON TABLE TP_BDGETUNIT IS '预算单位表';
COMMENT ON COLUMN TP_BDGETUNIT.S_BDGETUNCODE IS '预算单位代码';
COMMENT ON COLUMN TP_BDGETUNIT.S_BDGETUNNAME IS '预算单位名称';
COMMENT ON COLUMN TP_BDGETUNIT.S_CONTADDRES IS '通讯地址';
COMMENT ON COLUMN TP_BDGETUNIT.S_POSTCODE IS '邮政编码';
COMMENT ON COLUMN TP_BDGETUNIT.S_LINKMAN IS '联系人';
COMMENT ON COLUMN TP_BDGETUNIT.S_LINKPHONE IS '联系电话';
COMMENT ON COLUMN TP_BDGETUNIT.S_UNITCHRG IS '单位负责人';
COMMENT ON COLUMN TP_BDGETUNIT.S_CRDNTNAME IS '证件名称';
COMMENT ON COLUMN TP_BDGETUNIT.S_CRDNTNO IS '证件号码';
COMMENT ON COLUMN TP_BDGETUNIT.S_FLAG IS '标志';
COMMENT ON COLUMN TP_BDGETUNIT.S_BANKSECRETFLAG IS '行号及涉密标志';
COMMENT ON COLUMN TP_BDGETUNIT.S_EFFECTTYPE IS '生效方式';
COMMENT ON COLUMN TP_BDGETUNIT.D_ADJUSTDATE IS '调整日期';
COMMENT ON COLUMN TP_BDGETUNIT.D_EFFECTDATE IS '生效日期';
COMMENT ON COLUMN TP_BDGETUNIT.D_INVALIDATE IS '失效日期';
COMMENT ON COLUMN TP_BDGETUNIT.S_INSTCODE IS '机构代码';
COMMENT ON COLUMN TP_BDGETUNIT.S_OPERCODE IS '操作员代码';
COMMENT ON COLUMN TP_BDGETUNIT.S_OPERNAME IS '操作员名称';
COMMENT ON COLUMN TP_BDGETUNIT.S_LASTDESC IS '上次处理描述';
COMMENT ON COLUMN TP_BDGETUNIT.S_OPERTYPE IS '操作类别';
COMMENT ON COLUMN TP_BDGETUNIT.S_APROVERCODE IS '审批人代码';
COMMENT ON COLUMN TP_BDGETUNIT.S_APROVERNAME IS '审批人名称';
COMMENT ON COLUMN TP_BDGETUNIT.S_PARAMSTATE IS '参数状态';
COMMENT ON COLUMN TP_BDGETUNIT.TS_SYSUPDATE IS '系统更新时间';
COMMENT ON COLUMN TP_BDGETUNIT.S_ISOPENVOUCHER IS '开通财政无纸化标志';


CREATE UNIQUE INDEX SQL221020110721650 ON TP_BDGETUNIT(S_BDGETUNCODE);

