-- 分派控制调整主表
CREATE TABLE BS_PLAN_ASSIGN_STEER_MODIFY (
                                             ID NUMBER(19) NOT NULL,
                                             PLATING_ID NUMBER(19),
                                             PASM_MEMO VARCHAR2(2000),
                                             CREATE_MAN NUMBER(19),
                                             CREATE_TIME DATE,
                                             APPROVAL_STATUS NUMBER(3) DEFAULT -1,
                                             STATUS NUMBER(1,0) DEFAULT 0,
                                             IS_DELETED NUMBER(1) DEFAULT 0,
                                             CREATE_BY NUMBER(19),
                                             CREATE_DATE DATE,
                                             UPDATE_BY NUMBER(19),
                                             UPDATE_DATE DATE,
                                             PRIMARY KEY (ID)
);

-- 分派控制调整明细表
CREATE TABLE BS_PLAN_ASSIGN_STEER_MODIFYD (
                                              ID NUMBER(19) NOT NULL,
                                              PASM_ID NUMBER(19),
                                              OEM_ID NUMBER(19),
                                              PLATING_ID NUMBER(19),
                                              ASSIGN_SCALE NUMBER(10,2),
                                              PAS_ID NUMBER(19),
                                              IS_DELETED NUMBER(1) DEFAULT 0,
                                              STATUS NUMBER(1,0) DEFAULT 0,
                                              CREATE_BY NUMBER(19),
                                              CREATE_DATE DATE,
                                              UPDATE_BY NUMBER(19),
                                              UPDATE_DATE DATE,
                                              PRIMARY KEY (ID)
);

-- 创建序列
CREATE SEQUENCE SEQ_ASSIGN_STEER_MODIFY MINVALUE 1 MAXVALUE 9999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE;
CREATE SEQUENCE SEQ_ASSIGN_STEER_MODIFYD MINVALUE 1 MAXVALUE 9999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE;

-- 创建索引
CREATE INDEX IDX_MODIFY_PLATING_ID ON BS_PLAN_ASSIGN_STEER_MODIFY(PLATING_ID);
CREATE INDEX IDX_MODIFY_APPROVAL_STATUS ON BS_PLAN_ASSIGN_STEER_MODIFY(APPROVAL_STATUS);
CREATE INDEX IDX_MODIFYD_PASM_ID ON BS_PLAN_ASSIGN_STEER_MODIFYD(PASM_ID);
