CREATE TABLE CU_MEMBER_PERFORMANCE_SUMMARY
(
    "PK_ID" NUMBER(20,0) NOT NULL ENABLE,
    "SUMMARY_DATE" DATE NOT NULL ENABLE,
    "RETAIL_REGISTER_AMOUNT" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_REGISTER_PV" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_UPGRADE_AMOUNT" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_UPGRADE_PV" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_REPURCHASE_AMOUNT" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_REPURCHASE_PV" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_DISCOUNT_AMOUNT" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "RETAIL_DISCOUNT_PV" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "TOTAL_AMOUNT" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "TOTAL_PV" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "DIVIDEND_PV" NUMBER(17,6) DEFAULT 0 NOT NULL ENABLE,
    "DEL_FLAG" NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE,
    "PK_COUNTRY" NUMBER(4,0) DEFAULT 1 NOT NULL ENABLE,
    "CREATION_TIME" DATE DEFAULT sysdate NOT NULL ENABLE,
    "MODIFIED_TIME" DATE,
    "PK_CREATOR" NUMBER(20,0) NOT NULL ENABLE,
    "PK_MODIFIED" NUMBER(20,0)
);

COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."SUMMARY_DATE" IS '统计日期';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_REGISTER_AMOUNT" IS '精品专区销售金额';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_REGISTER_PV" IS '精品专区销售业绩';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_UPGRADE_AMOUNT" IS '甄选专区销售金额';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_UPGRADE_PV" IS '甄选专区销售业绩';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_REPURCHASE_AMOUNT" IS '商城专区销售金额';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_REPURCHASE_PV" IS '商城专区销售业绩';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_DISCOUNT_AMOUNT" IS '五折专区销售金额';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."RETAIL_DISCOUNT_PV" IS '五折专区销售业绩';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."TOTAL_AMOUNT" IS '当期销售金额合计';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."TOTAL_PV" IS '当期销售业绩合计';
COMMENT ON COLUMN CU_MEMBER_PERFORMANCE_SUMMARY."DIVIDEND_PV" IS '当日分红合计(分红：所有专区PV值的1.5%每天进行记录)';

COMMENT ON TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" IS '销售业绩统计表';

ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" RENAME COLUMN "DIVIDEND_PV" TO "TOTAL_DV_SOURCE";
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_REGISTER_DV_SOURCE" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_REGISTER_DV_UL" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_UPGRADE_DV_SOURCE" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_UPGRADE_DV_UL" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_REPURCHASE_DV_SOURCE" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_REPURCHASE_DV_UL" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_DISCOUNT_DV_SOURCE" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "RETAIL_DISCOUNT_DV_UL" NUMBER(20) DEFAULT 0 NOT NULL;
ALTER TABLE "CU_MEMBER_PERFORMANCE_SUMMARY" ADD "TOTAL_DV_UL" NUMBER(20) DEFAULT 0 NOT NULL;

COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_REGISTER_DV_SOURCE" IS '精品专区销售分红(原值)';
COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_REGISTER_DV_UL" IS '精品专区销售分红(上限)';

COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_UPGRADE_DV_SOURCE" IS '甄选专区销售分红(原值)';
COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_UPGRADE_DV_UL" IS '甄选专区销售分红(上限)';

COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_REPURCHASE_DV_SOURCE" IS '商城专区销售分红(原值)';
COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_REPURCHASE_DV_UL" IS '商城专区销售分红(上限)';

COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_DISCOUNT_DV_SOURCE" IS '五折专区销售分红(原值)';
COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."RETAIL_DISCOUNT_DV_UL" IS '五折专区销售分红(上限)';

COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."TOTAL_DV_SOURCE" IS '当日分红合计(分红：所有专区PV值的1.5%每天进行记录)(原值)';
COMMENT ON COLUMN "CU_MEMBER_PERFORMANCE_SUMMARY"."TOTAL_DV_UL" IS '当日分红合计(分红：所有专区PV值的1.5%每天进行记录)(上限)';


CREATE SEQUENCE C_M_PERFORMANCE_SUMMARY_SEQ
    START WITH 1
    INCREMENT BY 1;
