CREATE TABLE "T_ONLINE_PAYMENT_SEP_ACC" (
                                                      "PK_ID" NUMBER(20,0),
                                                      "PK_PAYMENT" NUMBER(20,0),
                                                      "VERSION" VARCHAR2(255),
                                                      "REQ_CONTENT" VARCHAR2(1024),
                                                      "REQ_CONTENT_SEP_ACC" VARCHAR2(1024),
                                                      "RESP_CONTENT" VARCHAR2(2048),
                                                      "DEL_FLAG" NUMBER(1),
                                                      "PK_COUNTRY" NUMBER(4,0) DEFAULT 1 NOT NULL ENABLE,
                                                      "CREATION_TIME" DATE,
                                                      "MODIFIED_TIME" DATE,
                                                      "PK_CREATOR" NUMBER(20,0),
                                                      "PK_MODIFIED" NUMBER(20,0),
                                                      PRIMARY KEY ("PK_ID")
)
;

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."PK_PAYMENT" IS '在线支付信息ID';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."VERSION" IS '版本号';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."REQ_CONTENT" IS '支付请求信息';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."REQ_CONTENT_SEP_ACC" IS '分账请求信息';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."RESP_CONTENT" IS '支付响应信息';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."DEL_FLAG" IS '逻辑删除 (0=未删除,1已删除)';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."CREATION_TIME" IS '创建时间';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."MODIFIED_TIME" IS '修改时间';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."PK_CREATOR" IS '创建者';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."PK_MODIFIED" IS '更新者';

COMMENT ON TABLE "T_ONLINE_PAYMENT_SEP_ACC" IS '支付请求主表';

CREATE SEQUENCE T_ONLINE_PAYMENT_SEP_ACC_SEQ
    START WITH 1
    INCREMENT BY 1;

CREATE TABLE "T_ONLINE_PAYMENT_SEP_ACC_D" (
                                                        "PK_ID" NUMBER(20,0),
                                                        "PK_SEP_ACC" NUMBER(20,0),
                                                        "ACCOUNT" VARCHAR2(255),
                                                        "PROPORTION" NUMBER(10, 2),
                                                        "DEL_FLAG" NUMBER(1),
                                                        "PK_COUNTRY" NUMBER(4,0) DEFAULT 1 NOT NULL ENABLE,
                                                        "CREATION_TIME" DATE,
                                                        "MODIFIED_TIME" DATE,
                                                        "PK_CREATOR" NUMBER(20,0),
                                                        "PK_MODIFIED" NUMBER(20,0),
                                                        PRIMARY KEY ("PK_ID")
)
;

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."PK_SEP_ACC" IS '支付请求主表ID';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."ACCOUNT" IS '分账账号';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."PROPORTION" IS '分账比例';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."DEL_FLAG" IS '逻辑删除 (0=未删除,1已删除)';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."CREATION_TIME" IS '创建时间';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."MODIFIED_TIME" IS '修改时间';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."PK_CREATOR" IS '创建者';

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."PK_MODIFIED" IS '更新者';

COMMENT ON TABLE "T_ONLINE_PAYMENT_SEP_ACC_D" IS '支付请求子表(分账)';

CREATE SEQUENCE T_ONLINE_PAYMENT_SEP_ACC_D_SEQ
    START WITH 1
    INCREMENT BY 1;


ALTER TABLE "T_ONLINE_PAYMENT_SEP_ACC"
    ADD ("TRADE_AMOUNT" NUMBER(16,2));
COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."TRADE_AMOUNT" IS '总金额';


ALTER TABLE "T_ONLINE_PAYMENT_SEP_ACC_D"
    ADD ("TRADE_AMOUNT" NUMBER(16,2));
COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."TRADE_AMOUNT" IS '分账金额';

ALTER TABLE "T_ONLINE_PAYMENT_SEP_ACC"
    ADD ("OUT_TRADE_NO" VARCHAR2(255));

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC"."OUT_TRADE_NO" IS '支付流水号';

ALTER TABLE "T_ONLINE_PAYMENT_SEP_ACC_D"
    ADD ("OUT_TRADE_NO" VARCHAR2(255));

COMMENT ON COLUMN "T_ONLINE_PAYMENT_SEP_ACC_D"."OUT_TRADE_NO" IS '支付流水号';
