CREATE TABLE UC_DEMENSION 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   DEM_NAME_            VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   IS_DEFAULT_          INTEGER              DEFAULT NULL,
   DEM_DESC_            VARCHAR2(255)        DEFAULT NULL,
   ORGAN_ID_            VARCHAR2(64)         DEFAULT NULL,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_DEMENSION PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_DEMENSION IS
'维度管理';

COMMENT ON COLUMN UC_DEMENSION.DEM_NAME_ IS
'维度名称';

COMMENT ON COLUMN UC_DEMENSION.CODE_ IS
'维度代码';

COMMENT ON COLUMN UC_DEMENSION.IS_DEFAULT_ IS
'是否默认(1:默认,0:非默认)';

COMMENT ON COLUMN UC_DEMENSION.DEM_DESC_ IS
'描述';

COMMENT ON COLUMN UC_DEMENSION.ORGAN_ID_ IS
'机构id';

COMMENT ON COLUMN UC_DEMENSION.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_DEMENSION.VERSION_ IS
'版本号';

CREATE TABLE UC_ELECTRONIC_SEAL 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64),
   FILE_ID_             VARCHAR2(64),
   PASSWORD_            VARCHAR2(64),
   IS_USE_              INTEGER,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ELECTRONIC_SEAL PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ELECTRONIC_SEAL IS
'电子签章表';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.ID_ IS
'主键ID';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.USER_ID_ IS
'用户ID';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.FILE_ID_ IS
'签章图片ID';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.PASSWORD_ IS
'使用密码';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.IS_USE_ IS
'当前是否使用';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.CREATE_TIME_ IS
'创建时间';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.UPDATE_TIME_ IS
'更新时间';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.CREATE_BY_ IS
'创建人';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.UPDATE_BY_ IS
'更新人';

COMMENT ON COLUMN UC_ELECTRONIC_SEAL.TENANT_ID_ IS
'租户ID';

CREATE TABLE UC_HOLIDAY 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(128)        DEFAULT NULL,
   KEY_                 VARCHAR2(128)        DEFAULT NULL,
   DESC_                CLOB,
   IS_DELE_             SMALLINT             DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   VERSION_             INTEGER              DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_HOLIDAY PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_HOLIDAY IS
'法定节假日';

COMMENT ON COLUMN UC_HOLIDAY.ID_ IS
'主键';

COMMENT ON COLUMN UC_HOLIDAY.NAME_ IS
'节日名称';

COMMENT ON COLUMN UC_HOLIDAY.KEY_ IS
'节日KEY';

COMMENT ON COLUMN UC_HOLIDAY.DESC_ IS
'描述';

COMMENT ON COLUMN UC_HOLIDAY.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_HOLIDAY.CREATE_TIME_ IS
'创建时间';

COMMENT ON COLUMN UC_HOLIDAY.UPDATE_TIME_ IS
'更新时间';

COMMENT ON COLUMN UC_HOLIDAY.CREATE_BY_ IS
'创建人ID';

COMMENT ON COLUMN UC_HOLIDAY.UPDATE_BY_ IS
'更新人ID';

COMMENT ON COLUMN UC_HOLIDAY.CREATE_ORG_ID_ IS
'创建组织ID';

COMMENT ON COLUMN UC_HOLIDAY.VERSION_ IS
'版本';

COMMENT ON COLUMN UC_HOLIDAY.TENANT_ID_ IS
'租户ID';

CREATE TABLE UC_HOLIDAY_TIME 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   START_TIME_          TIMESTAMP                 DEFAULT NULL,
   END_TIME_            TIMESTAMP                 DEFAULT NULL,
   HOLIDAY_ID_          VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   TYPE_                SMALLINT,
   CONSTRAINT PK_UC_HOLIDAY_TIME PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_HOLIDAY_TIME IS
'假期时间';

COMMENT ON COLUMN UC_HOLIDAY_TIME.ID_ IS
'主键';

COMMENT ON COLUMN UC_HOLIDAY_TIME.START_TIME_ IS
'假期开始时间';

COMMENT ON COLUMN UC_HOLIDAY_TIME.END_TIME_ IS
'假期结束时间';

COMMENT ON COLUMN UC_HOLIDAY_TIME.HOLIDAY_ID_ IS
'假期ID';

COMMENT ON COLUMN UC_HOLIDAY_TIME.TENANT_ID_ IS
'租户ID';

COMMENT ON COLUMN UC_HOLIDAY_TIME.TYPE_ IS
'类型：0假期 1补班';

CREATE TABLE UC_LOGIN_LOG 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         DEFAULT NULL,
   ACCOUNT_             VARCHAR2(64)         DEFAULT NULL,
   IP_                  VARCHAR2(20)         DEFAULT NULL,
   LOGIN_TYPE_          VARCHAR2(20)         DEFAULT NULL,
   PC_SUM_              INTEGER              DEFAULT 0,
   MOBILE_SUM_          INTEGER              DEFAULT 0,
   LOGIN_SUM_           INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_TIME_         TIMESTAMP,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   IS_DELE_             CHAR(1)              DEFAULT NULL,
   VERSION_             INTEGER              DEFAULT NULL,
   CONSTRAINT PK_UC_LOGIN_LOG PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_LOGIN_LOG IS
'用户登录日志表';

COMMENT ON COLUMN UC_LOGIN_LOG.ID_ IS
'主键，用户id';

COMMENT ON COLUMN UC_LOGIN_LOG.NAME_ IS
'用户名';

COMMENT ON COLUMN UC_LOGIN_LOG.ACCOUNT_ IS
'用户账号';

COMMENT ON COLUMN UC_LOGIN_LOG.IP_ IS
'登录IP';

COMMENT ON COLUMN UC_LOGIN_LOG.LOGIN_TYPE_ IS
'登录类型（pc：电脑端登录，mobile：移动端登录）';

COMMENT ON COLUMN UC_LOGIN_LOG.PC_SUM_ IS
'PC端登录次数';

COMMENT ON COLUMN UC_LOGIN_LOG.MOBILE_SUM_ IS
'移动端登录次数';

COMMENT ON COLUMN UC_LOGIN_LOG.LOGIN_SUM_ IS
'登录次数';

COMMENT ON COLUMN UC_LOGIN_LOG.CREATE_BY_ IS
'创建人';

COMMENT ON COLUMN UC_LOGIN_LOG.CREATE_ORG_ID_ IS
'创建人所属部门id';

COMMENT ON COLUMN UC_LOGIN_LOG.UPDATE_BY_ IS
'更新人id';

COMMENT ON COLUMN UC_LOGIN_LOG.TENANT_ID_ IS
'租户id';

COMMENT ON COLUMN UC_LOGIN_LOG.VERSION_ IS
'版本号';

CREATE TABLE UC_MATRIX 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   CODE_                VARCHAR2(255)        DEFAULT NULL,
   NAME_                VARCHAR2(255)        DEFAULT NULL,
   TYPE_ID_             VARCHAR2(64)         DEFAULT NULL,
   TYPE_NAME_           VARCHAR2(255)        DEFAULT NULL,
   STATUS_              INTEGER              DEFAULT NULL,
   MANAGER_ID_          VARCHAR2(64)         DEFAULT NULL,
   MANAGER_NAME_        VARCHAR2(255)        DEFAULT NULL,
   IS_DELE_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_MATRIX PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_MATRIX IS
'矩阵管理';

COMMENT ON COLUMN UC_MATRIX.ID_ IS
'主键';

COMMENT ON COLUMN UC_MATRIX.CODE_ IS
'编码/别名';

COMMENT ON COLUMN UC_MATRIX.NAME_ IS
'名称';

COMMENT ON COLUMN UC_MATRIX.TYPE_ID_ IS
'分类ID';

COMMENT ON COLUMN UC_MATRIX.TYPE_NAME_ IS
'分类名称';

COMMENT ON COLUMN UC_MATRIX.STATUS_ IS
'状态：0待发布、1已发布';

COMMENT ON COLUMN UC_MATRIX.MANAGER_ID_ IS
'管理员ID';

COMMENT ON COLUMN UC_MATRIX.MANAGER_NAME_ IS
'管理员名称';

COMMENT ON COLUMN UC_MATRIX.IS_DELE_ IS
'是否删除：0未除、1已删';

COMMENT ON COLUMN UC_MATRIX.CREATE_BY_ IS
'创建人';

COMMENT ON COLUMN UC_MATRIX.CREATE_TIME_ IS
'创建时间';

COMMENT ON COLUMN UC_MATRIX.CREATE_ORG_ID_ IS
'创建人部门id';

COMMENT ON COLUMN UC_MATRIX.UPDATE_BY_ IS
'更新人';

COMMENT ON COLUMN UC_MATRIX.UPDATE_TIME_ IS
'更新时间';

COMMENT ON COLUMN UC_MATRIX.TENANT_ID_ IS
'租户id';

CREATE TABLE UC_MATRIX_COL_DEF 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   MATRIX_ID_           VARCHAR2(255)        DEFAULT NULL,
   CODE_                VARCHAR2(20)         DEFAULT NULL,
   NAME_                VARCHAR2(128)        DEFAULT NULL,
   STATUS_              INTEGER              DEFAULT NULL,
   COL_TYPE_            INTEGER              DEFAULT NULL,
   SELECT_TYPE_         INTEGER              DEFAULT NULL,
   CTRL_TYPE_           VARCHAR2(20)         DEFAULT NULL,
   QUERY_ALIAS_         VARCHAR2(255)        DEFAULT NULL,
   COL_CONFIG_          VARCHAR2(255)        DEFAULT NULL,
   IS_DELE_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   SN_                  INTEGER              DEFAULT NULL,
   BIND_KEY_            VARCHAR2(255)        DEFAULT NULL,
   BIND_VALUE_          VARCHAR2(255)        DEFAULT NULL,
   CONSTRAINT PK_UC_MATRIX_COL_DEF PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_MATRIX_COL_DEF IS
'矩阵列定义';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.ID_ IS
'主键';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.MATRIX_ID_ IS
'所属矩阵ID';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.CODE_ IS
'列字段名';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.NAME_ IS
'列中文名';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.STATUS_ IS
'列状态：0未创建列、1已创建列';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.COL_TYPE_ IS
'列类型：1条件列、2角色列';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.SELECT_TYPE_ IS
'选择类型：1单选、2多选';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.CTRL_TYPE_ IS
'控件类型';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.QUERY_ALIAS_ IS
'关联查询alias';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.COL_CONFIG_ IS
'列配置信息';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.IS_DELE_ IS
'是否删除：0未删、1已删';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.CREATE_BY_ IS
'创建人';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.CREATE_TIME_ IS
'创建时间';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.CREATE_ORG_ID_ IS
'创建人部门id';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.UPDATE_BY_ IS
'更新人';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.UPDATE_TIME_ IS
'更新时间';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.TENANT_ID_ IS
'租户id';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.SN_ IS
'排序';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.BIND_KEY_ IS
'条件列的回填key的绑定值';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.BIND_VALUE_ IS
'条件列的回填value的绑定值';

CREATE TABLE UC_OPERATE_LOG 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   REQ_IP_              VARCHAR2(255)        DEFAULT NULL,
   REQ_TYPE_            VARCHAR2(64)         DEFAULT NULL,
   REQ_URL_             VARCHAR2(200)        DEFAULT NULL,
   REQ_PARAM_           CLOB,
   START_TIME_          TIMESTAMP,
   END_TIME_            TIMESTAMP,
   OPERATOR_NAME_       VARCHAR2(64)         DEFAULT NULL,
   NOTE_                VARCHAR2(2000)       DEFAULT NULL,
   SUCCESS_             INTEGER              DEFAULT NULL,
   FAIL_REASON_         VARCHAR2(2000)       DEFAULT NULL,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   CONSTRAINT PK_UC_OPERATE_LOG PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_OPERATE_LOG IS
'操作日志';

COMMENT ON COLUMN UC_OPERATE_LOG.REQ_IP_ IS
'请求ip地址';

COMMENT ON COLUMN UC_OPERATE_LOG.REQ_TYPE_ IS
'请求方式';

COMMENT ON COLUMN UC_OPERATE_LOG.REQ_URL_ IS
'请求地址';

COMMENT ON COLUMN UC_OPERATE_LOG.OPERATOR_NAME_ IS
'操作人';

COMMENT ON COLUMN UC_OPERATE_LOG.NOTE_ IS
'说明';

COMMENT ON COLUMN UC_OPERATE_LOG.SUCCESS_ IS
'是否成功';

COMMENT ON COLUMN UC_OPERATE_LOG.FAIL_REASON_ IS
'失败原因';

COMMENT ON COLUMN UC_OPERATE_LOG.IS_DELE_ IS
'是否已删，1已删除，0未删除';

CREATE TABLE UC_ORG 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         DEFAULT NULL,
   PARENT_ID_           VARCHAR2(64)         DEFAULT NULL,
   ORDER_NO_            INTEGER              DEFAULT NULL,
   CODE_                VARCHAR2(64)         NOT NULL,
   GRADE_               VARCHAR2(64)         DEFAULT NULL,
   PATH_                VARCHAR2(512)        DEFAULT NULL,
   PATH_NAME_           VARCHAR2(512)        DEFAULT NULL,
   DEM_ID_              VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   LIMIT_NUM_           INTEGER              DEFAULT 0 NOT NULL,
   NOW_NUM_             INTEGER              DEFAULT NULL,
   EXCEED_LIMIT_NUM_    INTEGER              DEFAULT 0 NOT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG IS
'组织架构';

COMMENT ON COLUMN UC_ORG.NAME_ IS
'名称';

COMMENT ON COLUMN UC_ORG.PARENT_ID_ IS
'父组织id';

COMMENT ON COLUMN UC_ORG.ORDER_NO_ IS
'排序号';

COMMENT ON COLUMN UC_ORG.CODE_ IS
'组织代码';

COMMENT ON COLUMN UC_ORG.GRADE_ IS
'级别';

COMMENT ON COLUMN UC_ORG.PATH_ IS
'组织id路径，包含层级关系';

COMMENT ON COLUMN UC_ORG.PATH_NAME_ IS
'组织名路径，包含层级关系';

COMMENT ON COLUMN UC_ORG.DEM_ID_ IS
'维度id';

COMMENT ON COLUMN UC_ORG.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG.VERSION_ IS
'版本号';

COMMENT ON COLUMN UC_ORG.LIMIT_NUM_ IS
'组织限编用户数量(0:不受限制)';

COMMENT ON COLUMN UC_ORG.NOW_NUM_ IS
'组织现编用户数量';

COMMENT ON COLUMN UC_ORG.EXCEED_LIMIT_NUM_ IS
'是否允许超过限编(0:允许；1:不允许)';

CREATE TABLE UC_ORGAN 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   NAME_                VARCHAR2(255)        DEFAULT NULL,
   DESC_                VARCHAR2(512)        DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CONSTRAINT PK_UC_ORGAN PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORGAN IS
'机构管理';

COMMENT ON COLUMN UC_ORGAN.CODE_ IS
'机构编码';

COMMENT ON COLUMN UC_ORGAN.NAME_ IS
'机构名称';

COMMENT ON COLUMN UC_ORGAN.DESC_ IS
'机构描述';

COMMENT ON COLUMN UC_ORGAN.CREATE_BY_ IS
'创建人';

COMMENT ON COLUMN UC_ORGAN.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORGAN.VERSION_ IS
'版本号';

CREATE TABLE UC_ORG_AUTH 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   DEM_ID_              VARCHAR2(64)         DEFAULT NULL,
   ORG_PERMS_           VARCHAR2(255)        DEFAULT NULL,
   USER_PERMS_          VARCHAR2(255)        DEFAULT NULL,
   POS_PERMS_           VARCHAR2(255)        DEFAULT NULL,
   ORGAUTH_PERMS_       VARCHAR2(255)        DEFAULT NULL,
   LAYOUT_PERMS_        VARCHAR2(255)        DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG_AUTH PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG_AUTH IS
'分级组织管理';

COMMENT ON COLUMN UC_ORG_AUTH.USER_ID_ IS
'分级组织管理员id';

COMMENT ON COLUMN UC_ORG_AUTH.ORG_ID_ IS
'对应管理组织id';

COMMENT ON COLUMN UC_ORG_AUTH.DEM_ID_ IS
'对应维度id';

COMMENT ON COLUMN UC_ORG_AUTH.ORG_PERMS_ IS
'组织管理权限';

COMMENT ON COLUMN UC_ORG_AUTH.USER_PERMS_ IS
'用户管理权限';

COMMENT ON COLUMN UC_ORG_AUTH.POS_PERMS_ IS
'岗位管理权限';

COMMENT ON COLUMN UC_ORG_AUTH.ORGAUTH_PERMS_ IS
'分级管理员权限';

COMMENT ON COLUMN UC_ORG_AUTH.LAYOUT_PERMS_ IS
'首页布局管理权限';

COMMENT ON COLUMN UC_ORG_AUTH.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG_AUTH.VERSION_ IS
'版本号';

CREATE TABLE UC_ORG_JOB 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         NOT NULL,
   CODE_                VARCHAR2(64)         NOT NULL,
   JOB_LEVEL_           VARCHAR2(64)         DEFAULT NULL,
   DESCRIPTION_         VARCHAR2(512)        DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG_JOB PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG_JOB IS
'职务定义';

COMMENT ON COLUMN UC_ORG_JOB.NAME_ IS
'名称';

COMMENT ON COLUMN UC_ORG_JOB.CODE_ IS
'编码';

COMMENT ON COLUMN UC_ORG_JOB.JOB_LEVEL_ IS
'职务级别';

COMMENT ON COLUMN UC_ORG_JOB.DESCRIPTION_ IS
'描述';

COMMENT ON COLUMN UC_ORG_JOB.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG_JOB.VERSION_ IS
'版本号';

CREATE TABLE UC_ORG_PARAMS 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   VALUE_               VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG_PARAMS PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG_PARAMS IS
'组织参数';

COMMENT ON COLUMN UC_ORG_PARAMS.ORG_ID_ IS
'组织id';

COMMENT ON COLUMN UC_ORG_PARAMS.CODE_ IS
'参数代码';

COMMENT ON COLUMN UC_ORG_PARAMS.VALUE_ IS
'值';

COMMENT ON COLUMN UC_ORG_PARAMS.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG_PARAMS.VERSION_ IS
'版本号';

CREATE TABLE UC_ORG_POST 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   JOB_ID_              VARCHAR2(64)         DEFAULT NULL,
   POS_NAME_            VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   IS_CHARGE_           INTEGER              DEFAULT 0 NOT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   PARENT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG_POST PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG_POST IS
'部门岗位';

COMMENT ON COLUMN UC_ORG_POST.ORG_ID_ IS
'组织id';

COMMENT ON COLUMN UC_ORG_POST.JOB_ID_ IS
'职务id';

COMMENT ON COLUMN UC_ORG_POST.POS_NAME_ IS
'岗位名称';

COMMENT ON COLUMN UC_ORG_POST.CODE_ IS
'岗位编码';

COMMENT ON COLUMN UC_ORG_POST.IS_CHARGE_ IS
'是否主岗位：1主岗位，0 非主岗位';

COMMENT ON COLUMN UC_ORG_POST.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG_POST.VERSION_ IS
'版本号';

CREATE TABLE UC_ORG_ROLE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   ROLE_ID_             VARCHAR2(64)         DEFAULT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   IS_INHERIT_          INTEGER              DEFAULT 0,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG_ROLE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG_ROLE IS
'组织角色管理';

COMMENT ON COLUMN UC_ORG_ROLE.ROLE_ID_ IS
'角色id';

COMMENT ON COLUMN UC_ORG_ROLE.ORG_ID_ IS
'组织id';

COMMENT ON COLUMN UC_ORG_ROLE.IS_INHERIT_ IS
'子组织是否可以继承,0:不可1:可以';

COMMENT ON COLUMN UC_ORG_ROLE.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG_ROLE.VERSION_ IS
'版本号';

CREATE TABLE UC_ORG_USER 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   IS_MASTER_           INTEGER              DEFAULT 0 NOT NULL,
   POS_ID_              VARCHAR2(64)         DEFAULT NULL,
   IS_CHARGE_           INTEGER              DEFAULT 0,
   START_DATE_          TIMESTAMP,
   END_DATE_            TIMESTAMP,
   IS_REL_ACTIVE_       INTEGER              NOT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ORG_USER PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ORG_USER IS
'用户组织关系';

COMMENT ON COLUMN UC_ORG_USER.ORG_ID_ IS
'组织编号';

COMMENT ON COLUMN UC_ORG_USER.USER_ID_ IS
'用户编号';

COMMENT ON COLUMN UC_ORG_USER.IS_MASTER_ IS
'0:非主部门，1：主部门';

COMMENT ON COLUMN UC_ORG_USER.POS_ID_ IS
'岗位id';

COMMENT ON COLUMN UC_ORG_USER.IS_CHARGE_ IS
'2组织主负责人，1组织负责人，0 不是负责人';

COMMENT ON COLUMN UC_ORG_USER.IS_REL_ACTIVE_ IS
'是否有效，0:无效，1：有效';

COMMENT ON COLUMN UC_ORG_USER.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ORG_USER.VERSION_ IS
'版本号';

CREATE TABLE UC_PARAMS 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   TYPE_                VARCHAR2(64)         DEFAULT NULL,
   CTL_TYPE_            VARCHAR2(64)         DEFAULT NULL,
   JSON_                VARCHAR2(512)        DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_TYPE_ID_      VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_PARAMS PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_PARAMS IS
'用户组织参数';

COMMENT ON COLUMN UC_PARAMS.NAME_ IS
'参数名称';

COMMENT ON COLUMN UC_PARAMS.CODE_ IS
'参数代码';

COMMENT ON COLUMN UC_PARAMS.TYPE_ IS
'类型';

COMMENT ON COLUMN UC_PARAMS.CTL_TYPE_ IS
'控件类型';

COMMENT ON COLUMN UC_PARAMS.JSON_ IS
'json值';

COMMENT ON COLUMN UC_PARAMS.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_PARAMS.VERSION_ IS
'版本号';

CREATE TABLE UC_PWD_STRATEGY 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   INIT_PWD_            VARCHAR2(64)         DEFAULT NULL,
   PWD_RULE_            SMALLINT             DEFAULT NULL,
   PWD_LENGTH_          SMALLINT             DEFAULT NULL,
   DURATION_            SMALLINT             DEFAULT NULL,
   ENABLE_              SMALLINT             DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_PWD_STRATEGY PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_PWD_STRATEGY IS
'密码策略';

COMMENT ON COLUMN UC_PWD_STRATEGY.PWD_RULE_ IS
'密码规则';

COMMENT ON COLUMN UC_PWD_STRATEGY.PWD_LENGTH_ IS
'密码长度';

COMMENT ON COLUMN UC_PWD_STRATEGY.DURATION_ IS
'密码时长（单位：天）';

COMMENT ON COLUMN UC_PWD_STRATEGY.ENABLE_ IS
'启用策略	0:停用，1:启用';

CREATE TABLE UC_REL_AUTH 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   REL_ID_              VARCHAR2(64)         DEFAULT NULL,
   TYPE_ID_             VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_REL_AUTH PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_REL_AUTH IS
'分级组织管理';

COMMENT ON COLUMN UC_REL_AUTH.USER_ID_ IS
'分级汇报线管理员id';

COMMENT ON COLUMN UC_REL_AUTH.REL_ID_ IS
'对应汇报线节点id';

COMMENT ON COLUMN UC_REL_AUTH.TYPE_ID_ IS
'对应汇报线分类id';

COMMENT ON COLUMN UC_REL_AUTH.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_REL_AUTH.VERSION_ IS
'版本号';

CREATE TABLE UC_REL_TYPE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   DESCRIPTION_         VARCHAR2(255)        DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CONSTRAINT PK_UC_REL_TYPE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_REL_TYPE IS
'分级组织类别';

COMMENT ON COLUMN UC_REL_TYPE.NAME_ IS
'汇报关系分类名称';

COMMENT ON COLUMN UC_REL_TYPE.CODE_ IS
'英文别名';

COMMENT ON COLUMN UC_REL_TYPE.DESCRIPTION_ IS
'描述';

COMMENT ON COLUMN UC_REL_TYPE.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_REL_TYPE.VERSION_ IS
'版本号';

CREATE TABLE UC_ROLE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   ENABLED_             INTEGER              DEFAULT NULL,
   DESCRIPTION_         VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_ROLE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_ROLE IS
'汇报关系分类管理';

COMMENT ON COLUMN UC_ROLE.NAME_ IS
'角色名称';

COMMENT ON COLUMN UC_ROLE.CODE_ IS
'英文别名';

COMMENT ON COLUMN UC_ROLE.ENABLED_ IS
'可用 0：禁用，1：启用';

COMMENT ON COLUMN UC_ROLE.DESCRIPTION_ IS
'描述';

COMMENT ON COLUMN UC_ROLE.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_ROLE.VERSION_ IS
'版本号';

CREATE TABLE UC_SHIFT_RULE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(128)        DEFAULT NULL,
   KEY_                 VARCHAR2(128)        DEFAULT NULL,
   DESC_                CLOB,
   RULE_                CLOB,
   HOLIDAY_ID_          VARCHAR2(64)         DEFAULT NULL,
   IS_DELE_             VARCHAR2(1)          DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   VERSION_             INTEGER              DEFAULT NULL,
   CONSTRAINT PK_UC_SHIFT_RULE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_SHIFT_RULE IS
'排班规则';

COMMENT ON COLUMN UC_SHIFT_RULE.ID_ IS
'主键';

COMMENT ON COLUMN UC_SHIFT_RULE.NAME_ IS
'名称';

COMMENT ON COLUMN UC_SHIFT_RULE.KEY_ IS
'KEY';

COMMENT ON COLUMN UC_SHIFT_RULE.DESC_ IS
'描述';

COMMENT ON COLUMN UC_SHIFT_RULE.RULE_ IS
'规则';

COMMENT ON COLUMN UC_SHIFT_RULE.HOLIDAY_ID_ IS
'节假日ID';

COMMENT ON COLUMN UC_SHIFT_RULE.IS_DELE_ IS
'是否删除 1删除 0未删除';

COMMENT ON COLUMN UC_SHIFT_RULE.CREATE_TIME_ IS
'创建时间';

COMMENT ON COLUMN UC_SHIFT_RULE.UPDATE_TIME_ IS
'更新时间';

COMMENT ON COLUMN UC_SHIFT_RULE.CREATE_BY_ IS
'创建人';

COMMENT ON COLUMN UC_SHIFT_RULE.UPDATE_BY_ IS
'更新人';

COMMENT ON COLUMN UC_SHIFT_RULE.CREATE_ORG_ID_ IS
'创建人组织ID';

COMMENT ON COLUMN UC_SHIFT_RULE.TENANT_ID_ IS
'租户ID';

COMMENT ON COLUMN UC_SHIFT_RULE.VERSION_ IS
'版本';

CREATE TABLE UC_SHIFT_USER 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   SHIFT_ID_            VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   IS_DELE_             VARCHAR2(1)          DEFAULT NULL,
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_SHIFT_USER PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_SHIFT_USER IS
'排班用户表';

COMMENT ON COLUMN UC_SHIFT_USER.ID_ IS
'主键';

COMMENT ON COLUMN UC_SHIFT_USER.USER_ID_ IS
'用户ID';

COMMENT ON COLUMN UC_SHIFT_USER.SHIFT_ID_ IS
'排班ID';

COMMENT ON COLUMN UC_SHIFT_USER.TENANT_ID_ IS
'租户ID';

COMMENT ON COLUMN UC_SHIFT_USER.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_SHIFT_USER.VERSION_ IS
'版本';

COMMENT ON COLUMN UC_SHIFT_USER.CREATE_BY_ IS
'创建人ID';

COMMENT ON COLUMN UC_SHIFT_USER.UPDATE_BY_ IS
'更新人ID';

COMMENT ON COLUMN UC_SHIFT_USER.CREATE_TIME_ IS
'创建时间';

COMMENT ON COLUMN UC_SHIFT_USER.UPDATE_TIME_ IS
'更新时间';

COMMENT ON COLUMN UC_SHIFT_USER.CREATE_ORG_ID_ IS
'创建者所属组织ID';

CREATE TABLE UC_TENANT_AUTH 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   TYPE_ID_             VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   USER_NAME_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_AUTH PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_AUTH IS
'租户管理员';

CREATE TABLE UC_TENANT_IGNORE_MENU 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   MENU_CODE_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_IGNORE_MENU PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_IGNORE_MENU IS
'租户禁用菜单';

CREATE TABLE UC_TENANT_LOGS 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   TYPE_                VARCHAR2(64)         DEFAULT NULL,
   NAME_                VARCHAR2(300)        DEFAULT NULL,
   REQ_URL_             VARCHAR2(300)        DEFAULT NULL,
   IP_                  VARCHAR2(20)         DEFAULT NULL,
   PARAMS_              VARCHAR2(4000)       DEFAULT NULL,
   OPE_CONTENT_         CLOB,
   RESULT_              SMALLINT             DEFAULT NULL,
   REASON_              VARCHAR2(4000)       DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_LOGS PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_LOGS IS
'租户管理操作日志';

COMMENT ON COLUMN UC_TENANT_LOGS.RESULT_ IS
'操作结果（1:成功，0:失败）';

CREATE TABLE UC_TENANT_MAIL_SERVER 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   MAIL_TYPE_           VARCHAR2(64)         DEFAULT NULL,
   MAIL_HOST_           VARCHAR2(128)        DEFAULT NULL,
   MAIL_PASS_           VARCHAR2(128)        DEFAULT NULL,
   NICK_NAME_           VARCHAR2(128)        DEFAULT NULL,
   USER_NAME_           VARCHAR2(128)        DEFAULT NULL,
   MAIL_PORT_           INTEGER              DEFAULT NULL,
   USE_SSL_             SMALLINT             DEFAULT NULL,
   DESC_                VARCHAR2(300)        DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_MAIL_SERVER PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_MAIL_SERVER IS
'租户邮件服务器';

COMMENT ON COLUMN UC_TENANT_MAIL_SERVER.MAIL_PORT_ IS
'端口号';

COMMENT ON COLUMN UC_TENANT_MAIL_SERVER.USE_SSL_ IS
'是否使用SSL认证。0：否；1：是';

CREATE TABLE UC_TENANT_MANAGE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   TYPE_ID_             VARCHAR2(64)         DEFAULT NULL,
   NAME_                VARCHAR2(128)        DEFAULT NULL,
   CODE_                VARCHAR2(128)        DEFAULT NULL,
   STATUS_              VARCHAR2(20)         DEFAULT NULL,
   SHORTHAND_           VARCHAR2(64)         DEFAULT NULL,
   DOMAIN_              VARCHAR2(128)        DEFAULT NULL,
   MANAGE_LOGO_         VARCHAR2(1200)       DEFAULT NULL,
   FRONT_LOGO_          VARCHAR2(1200)       DEFAULT NULL,
   ICO_                 VARCHAR2(1200)       DEFAULT NULL,
   DESC_                VARCHAR2(300)        DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   NAME_FRONT_          VARCHAR2(128)        DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_MANAGE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_MANAGE IS
'租户管理';

COMMENT ON COLUMN UC_TENANT_MANAGE.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_TENANT_MANAGE.NAME_FRONT_ IS
'应用端租户名称';

CREATE TABLE UC_TENANT_PARAMS 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   VALUE_               VARCHAR2(600)        DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_PARAMS PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_PARAMS IS
'租户拓展参数';

CREATE TABLE UC_TENANT_TYPE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   STATUS_              VARCHAR2(20)         DEFAULT NULL,
   IS_DEFAULT_          CHAR(1)              DEFAULT NULL,
   DESC_                VARCHAR2(300)        DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_TENANT_TYPE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_TENANT_TYPE IS
'租户类型';

CREATE TABLE UC_USER 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   FULLNAME_            VARCHAR2(255)        DEFAULT NULL,
   ACCOUNT_             VARCHAR2(255)        DEFAULT NULL,
   PASSWORD_            VARCHAR2(64)         DEFAULT NULL,
   EMAIL_               VARCHAR2(64)         DEFAULT NULL,
   MOBILE_              VARCHAR2(255)        DEFAULT NULL,
   WEIXIN_              VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   ADDRESS_             VARCHAR2(512)        DEFAULT NULL,
   PHOTO_               VARCHAR2(255)        DEFAULT NULL,
   SEX_                 VARCHAR2(64)         DEFAULT NULL,
   FROM_                VARCHAR2(64)         DEFAULT NULL,
   STATUS_              INTEGER              DEFAULT NULL,
   HAS_SYNC_TO_WX_      INTEGER              DEFAULT NULL,
   NOTIFY_TYPE_         VARCHAR2(64)         DEFAULT NULL,
   USER_NUMBER_         VARCHAR2(64)         DEFAULT NULL,
   ID_CARD_             VARCHAR2(38)         DEFAULT NULL,
   PHONE_               VARCHAR2(64)         DEFAULT NULL,
   BIRTHDAY_            TIMESTAMP,
   ENTRY_DATE_          TIMESTAMP,
   LEAVE_DATE_          TIMESTAMP,
   EDUCATION_           VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   PWD_CREATE_TIME_     TIMESTAMP,
   CLIENT_ID_           VARCHAR2(255),
   CLIENT_TOKEN_        VARCHAR2(255),
   CONSTRAINT PK_UC_USER PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER IS
'用户管理';

COMMENT ON COLUMN UC_USER.FULLNAME_ IS
'姓名';

COMMENT ON COLUMN UC_USER.ACCOUNT_ IS
'帐号';

COMMENT ON COLUMN UC_USER.PASSWORD_ IS
'密码';

COMMENT ON COLUMN UC_USER.EMAIL_ IS
'邮箱';

COMMENT ON COLUMN UC_USER.MOBILE_ IS
'手机号码';

COMMENT ON COLUMN UC_USER.WEIXIN_ IS
'微信号';

COMMENT ON COLUMN UC_USER.ADDRESS_ IS
'地址';

COMMENT ON COLUMN UC_USER.PHOTO_ IS
'头像';

COMMENT ON COLUMN UC_USER.SEX_ IS
'性别：男，女，未知';

COMMENT ON COLUMN UC_USER.FROM_ IS
'来源';

COMMENT ON COLUMN UC_USER.STATUS_ IS
'0:禁用，1正常';

COMMENT ON COLUMN UC_USER.HAS_SYNC_TO_WX_ IS
'微信同步关注状态: 0：未同步  1：已同步，尚未关注  2：已同步且已关注';

COMMENT ON COLUMN UC_USER.NOTIFY_TYPE_ IS
'自定义接收消息类型';

COMMENT ON COLUMN UC_USER.USER_NUMBER_ IS
'工号';

COMMENT ON COLUMN UC_USER.ID_CARD_ IS
'身份证号';

COMMENT ON COLUMN UC_USER.PHONE_ IS
'办公电话';

COMMENT ON COLUMN UC_USER.EDUCATION_ IS
'学历';

COMMENT ON COLUMN UC_USER.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_USER.VERSION_ IS
'版本号';

COMMENT ON COLUMN UC_USER.CLIENT_ID_ IS
'推送服务令牌（设备唯一标识）';

COMMENT ON COLUMN UC_USER.CLIENT_TOKEN_ IS
'设备令牌（iOS设备唯一标识）';

CREATE TABLE UC_USER_GROUP 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(255)        DEFAULT NULL,
   JSON_                VARCHAR2(2000)       DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   DESCRIPTION_         VARCHAR2(512)        DEFAULT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   ROLE_ID_             VARCHAR2(64)         DEFAULT NULL,
   POS_ID_              VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_USER_GROUP PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER_GROUP IS
'群组管理';

COMMENT ON COLUMN UC_USER_GROUP.NAME_ IS
'名称';

COMMENT ON COLUMN UC_USER_GROUP.JSON_ IS
'群里的人或组';

COMMENT ON COLUMN UC_USER_GROUP.CODE_ IS
'群组代码';

COMMENT ON COLUMN UC_USER_GROUP.DESCRIPTION_ IS
'描述';

COMMENT ON COLUMN UC_USER_GROUP.USER_ID_ IS
'用户id';

COMMENT ON COLUMN UC_USER_GROUP.ORG_ID_ IS
'组织id';

COMMENT ON COLUMN UC_USER_GROUP.ROLE_ID_ IS
'角色id';

COMMENT ON COLUMN UC_USER_GROUP.POS_ID_ IS
'岗位id';

COMMENT ON COLUMN UC_USER_GROUP.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_USER_GROUP.VERSION_ IS
'版本号';

CREATE TABLE UC_USER_PARAMS 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   CODE_                VARCHAR2(64)         DEFAULT NULL,
   VALUE_               VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_USER_PARAMS PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER_PARAMS IS
'用户数';

COMMENT ON COLUMN UC_USER_PARAMS.USER_ID_ IS
'用户id';

COMMENT ON COLUMN UC_USER_PARAMS.CODE_ IS
'参数代码';

COMMENT ON COLUMN UC_USER_PARAMS.VALUE_ IS
'参数值';

COMMENT ON COLUMN UC_USER_PARAMS.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_USER_PARAMS.VERSION_ IS
'版本号';

CREATE TABLE UC_USER_REL 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   NAME_                VARCHAR2(255)        DEFAULT NULL,
   LEVEL_               VARCHAR2(64)         DEFAULT NULL,
   PARENT_ID_           VARCHAR2(64)         DEFAULT NULL,
   TYPE_ID_             VARCHAR2(64)         DEFAULT NULL,
   GROUP_TYPE_          VARCHAR2(64)         DEFAULT NULL,
   PATH_                VARCHAR2(512)        DEFAULT NULL,
   VALUE_               VARCHAR2(64)         DEFAULT NULL,
   STATUS_              INTEGER              DEFAULT NULL,
   ALIAS_               VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_USER_REL PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER_REL IS
'用户关系表';

COMMENT ON COLUMN UC_USER_REL.NAME_ IS
'名称';

COMMENT ON COLUMN UC_USER_REL.LEVEL_ IS
'级别(用于区分有多个上级的情况)';

COMMENT ON COLUMN UC_USER_REL.PARENT_ID_ IS
'父id';

COMMENT ON COLUMN UC_USER_REL.TYPE_ID_ IS
'用户关系分类下的id';

COMMENT ON COLUMN UC_USER_REL.GROUP_TYPE_ IS
'群组id';

COMMENT ON COLUMN UC_USER_REL.PATH_ IS
'组织id路径，包含层级关系';

COMMENT ON COLUMN UC_USER_REL.VALUE_ IS
'值';

COMMENT ON COLUMN UC_USER_REL.STATUS_ IS
'状态（1：正常，0：失效）';

COMMENT ON COLUMN UC_USER_REL.ALIAS_ IS
'用户组别名';

COMMENT ON COLUMN UC_USER_REL.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_USER_REL.VERSION_ IS
'版本号';

CREATE TABLE UC_USER_ROLE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   ROLE_ID_             VARCHAR2(64)         DEFAULT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_USER_ROLE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER_ROLE IS
'用户角色管理';

COMMENT ON COLUMN UC_USER_ROLE.ROLE_ID_ IS
'角色id';

COMMENT ON COLUMN UC_USER_ROLE.USER_ID_ IS
'用户id';

COMMENT ON COLUMN UC_USER_ROLE.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_USER_ROLE.VERSION_ IS
'版本号';

CREATE TABLE UC_USER_UNDER 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   UNDER_USER_ID_       VARCHAR2(64)         DEFAULT NULL,
   UNDER_USER_NAME_     VARCHAR2(64)         DEFAULT NULL,
   ORG_ID_              VARCHAR2(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP,
   IS_DELE_             CHAR(1)              DEFAULT '0',
   VERSION_             INTEGER              DEFAULT NULL,
   CREATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR2(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP,
   UPDATE_BY_           VARCHAR2(64)         DEFAULT NULL,
   DIMEN_ID_            VARCHAR2(64)         DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_USER_UNDER PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER_UNDER IS
'下属管理';

COMMENT ON COLUMN UC_USER_UNDER.USER_ID_ IS
'用户id';

COMMENT ON COLUMN UC_USER_UNDER.UNDER_USER_ID_ IS
'下属用户id';

COMMENT ON COLUMN UC_USER_UNDER.UNDER_USER_NAME_ IS
'下属用户名';

COMMENT ON COLUMN UC_USER_UNDER.ORG_ID_ IS
'组织id';

COMMENT ON COLUMN UC_USER_UNDER.IS_DELE_ IS
'是否已删，1已删除，0未删除';

COMMENT ON COLUMN UC_USER_UNDER.VERSION_ IS
'版本号';

CREATE TABLE UC_USER_UNITE 
(
   ID_                  VARCHAR2(64)         NOT NULL,
   USER_ID_             VARCHAR2(64)         DEFAULT NULL,
   OPEN_ID_             VARCHAR2(1000)       DEFAULT NULL,
   WX_WORK_ID_          VARCHAR2(1000)       DEFAULT NULL,
   DINGTALK_ID_         VARCHAR2(1000)       DEFAULT NULL,
   TENANT_ID_           VARCHAR2(64)         DEFAULT NULL,
   CONSTRAINT PK_UC_USER_UNITE PRIMARY KEY (ID_)
);

COMMENT ON TABLE UC_USER_UNITE IS
'用户与外部通讯录关系表';

COMMENT ON COLUMN UC_USER_UNITE.ID_ IS
'主键';

COMMENT ON COLUMN UC_USER_UNITE.USER_ID_ IS
'用户id';

COMMENT ON COLUMN UC_USER_UNITE.OPEN_ID_ IS
'公众号openid';

COMMENT ON COLUMN UC_USER_UNITE.WX_WORK_ID_ IS
'企业微信userid';

COMMENT ON COLUMN UC_USER_UNITE.DINGTALK_ID_ IS
'阿里钉钉userid';

COMMENT ON COLUMN UC_USER_UNITE.TENANT_ID_ IS
'租户id';

