--单位退回、整体状态
alter table UR_TASK_DW  add    IS_REGAIN            VARCHAR2(1)                    default '0';
alter table UR_TASK_DW  add    IS_A_RETURN          VARCHAR2(1)                    default '0';
alter table UR_TASK_DW  add    A_RETURN_DW_ID       VARCHAR2(36);
alter table UR_TASK_DW  add    A_RETURN_USER_ID     VARCHAR2(36);
alter table UR_TASK_DW  add    A_RETURN_REASON      VARCHAR2(1000);
alter table UR_TASK_DW  add    A_RETURN_TIME        VARCHAR2(20);
alter table UR_TASK_DW  add    CRT_DW_ID            VARCHAR2(36);
alter table UR_TASK_DW  add    CRT_USER_ID          VARCHAR2(36);
alter table UR_TASK_DW  add    XMQBH                VARCHAR2(1000);

alter table UR_TASK_DW_B  add    IS_REGAIN            VARCHAR2(1)                    default '0';
alter table UR_TASK_DW_B  add    IS_A_RETURN          VARCHAR2(1)                    default '0';
alter table UR_TASK_DW_B  add    A_RETURN_DW_ID       VARCHAR2(36);
alter table UR_TASK_DW_B  add    A_RETURN_USER_ID     VARCHAR2(36);
alter table UR_TASK_DW_B  add    A_RETURN_REASON      VARCHAR2(1000);
alter table UR_TASK_DW_B  add    A_RETURN_TIME        VARCHAR2(20);
alter table UR_TASK_DW_B  add    CRT_DW_ID            VARCHAR2(36);
alter table UR_TASK_DW_B  add    CRT_USER_ID          VARCHAR2(36);
alter table UR_TASK_DW_B  add    XMQBH                VARCHAR2(1000);


create table UR_TASK_DW_TOTAL  (
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                   default '*'  not null,
   RPT_STATUS           VARCHAR2(1)                    default '0',
   CUR_DW_ID            VARCHAR2(36),
   CUR_MAN_DW_ID        VARCHAR2(36),
   L_DO_USER_ID         VARCHAR2(36),
   L_DO_DATE            VARCHAR2(10),
   RPT_USER_ID          VARCHAR2(36),
   RPT_DATE             VARCHAR2(10),
   RPT_DW_ID            VARCHAR2(36),
   L_ADT_USER_ID        VARCHAR2(36),
   L_ADT_DATE           VARCHAR2(10),
   L_ADT_NODE           VARCHAR2(10),
   CUR_ADT_NODE         VARCHAR2(10),
   LOG_NO               INTEGER                        default 0,
   TRANS_DW_LOG_NO      INTEGER                        default 0,
   IS_RETURN            VARCHAR2(1)                    default '0',
   IS_REGAIN            VARCHAR2(1)                    default '0',
   IS_A_RETURN          VARCHAR2(1)                    default '0',
   A_RETURN_DW_ID       VARCHAR2(36),
   A_RETURN_USER_ID     VARCHAR2(36),
   A_RETURN_REASON      VARCHAR2(1000),
   A_RETURN_TIME        VARCHAR2(20),
   constraint PK_UR_TASK_DW_TOTAL primary key (TASK_ID, PERD_CODE, DW_ID, TRUNC_ID,PROJ_ID)
);

create index IDX_UR_TASK_DW_TOTAL_DW on UR_TASK_DW_TOTAL (
   DW_ID ASC
);
