-- ----------------------------
-- Table structure for COF_DICT_ENTRY
-- ----------------------------

DROP TABLE IF EXISTS "COF_DICT_ENTRY";
CREATE TABLE "COF_DICT_ENTRY" (
    "ID" VARCHAR2(64 CHAR) NOT NULL,
    "CODE" VARCHAR2(64 CHAR),
    "DICT_TYPE_ID" VARCHAR2(64 CHAR),
    "NAME" VARCHAR2(512 CHAR),
    "DESCRIPTION" VARCHAR2(256 CHAR),
    "CREATE_TIME" TIMESTAMP,
    "UPDATE_TIME" TIMESTAMP,
    "TENANT_ID" VARCHAR2(64 CHAR),
    "PARENT_ID" VARCHAR2(64 CHAR),
    "LOCALE" VARCHAR2(64 CHAR),
    "STATUS" VARCHAR2(64 CHAR),
    "SORT_NO" NUMBER(10,0),
    "IS_LEAF" NUMBER(3,0),
    "TREE_LEVEL" NUMBER(10,0),
    "SEQ" VARCHAR2(256 CHAR),
    "IS_FIXED" NUMBER(3,0)
)
;
COMMENT ON COLUMN "COF_DICT_ENTRY"."ID" IS '字典项ID';
COMMENT ON COLUMN "COF_DICT_ENTRY"."CODE" IS '字典项编码';
COMMENT ON COLUMN "COF_DICT_ENTRY"."DICT_TYPE_ID" IS '字典类型ID';
COMMENT ON COLUMN "COF_DICT_ENTRY"."NAME" IS '字典项名称';
COMMENT ON COLUMN "COF_DICT_ENTRY"."DESCRIPTION" IS '描述';
COMMENT ON COLUMN "COF_DICT_ENTRY"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "COF_DICT_ENTRY"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "COF_DICT_ENTRY"."TENANT_ID" IS '租户ID';
COMMENT ON COLUMN "COF_DICT_ENTRY"."PARENT_ID" IS '父字典项ID';
COMMENT ON COLUMN "COF_DICT_ENTRY"."LOCALE" IS '默认语言';
COMMENT ON COLUMN "COF_DICT_ENTRY"."STATUS" IS '状态 ';
COMMENT ON COLUMN "COF_DICT_ENTRY"."SORT_NO" IS '排序字段';
COMMENT ON COLUMN "COF_DICT_ENTRY"."IS_LEAF" IS '是否叶节点';
COMMENT ON COLUMN "COF_DICT_ENTRY"."TREE_LEVEL" IS '层级';
COMMENT ON COLUMN "COF_DICT_ENTRY"."SEQ" IS '序列码';
COMMENT ON COLUMN "COF_DICT_ENTRY"."IS_FIXED" IS '是否固定，如果是，则数据不能修改，不能删除';


DROP TABLE IF EXISTS "COF_DICT_TYPE";
CREATE TABLE "COF_DICT_TYPE" (
    "ID" VARCHAR2(64 CHAR) NOT NULL,
    "CODE" VARCHAR2(64 CHAR),
    "NAME" VARCHAR2(128 CHAR),
    "DESCRIPTION" VARCHAR2(256 CHAR),
    "CREATE_TIME" TIMESTAMP,
    "UPDATE_TIME" TIMESTAMP,
    "TENANT_ID" VARCHAR2(64 CHAR),
    "PARENT_ID" VARCHAR2(64 CHAR),
    "LOCALE" VARCHAR2(64 CHAR),
    "SORT_NO" NUMBER(10,0),
    "IS_LEAF" NUMBER(3,0),
    "TREE_LEVEL" NUMBER(10,0),
    "SEQ" VARCHAR2(256 CHAR),
    "IS_FIXED" NUMBER(3,0)
)
;
COMMENT ON COLUMN "COF_DICT_TYPE"."ID" IS '字典类型ID';
COMMENT ON COLUMN "COF_DICT_TYPE"."CODE" IS '字典类型编码';
COMMENT ON COLUMN "COF_DICT_TYPE"."NAME" IS '字典类型名称';
COMMENT ON COLUMN "COF_DICT_TYPE"."DESCRIPTION" IS '描述';
COMMENT ON COLUMN "COF_DICT_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "COF_DICT_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "COF_DICT_TYPE"."TENANT_ID" IS '租户ID';
COMMENT ON COLUMN "COF_DICT_TYPE"."PARENT_ID" IS '父字典类型ID';
COMMENT ON COLUMN "COF_DICT_TYPE"."LOCALE" IS '默认语言';
COMMENT ON COLUMN "COF_DICT_TYPE"."SORT_NO" IS '排序字段';
COMMENT ON COLUMN "COF_DICT_TYPE"."IS_LEAF" IS '是否叶节点';
COMMENT ON COLUMN "COF_DICT_TYPE"."TREE_LEVEL" IS '层级';
COMMENT ON COLUMN "COF_DICT_TYPE"."SEQ" IS '序列码';
COMMENT ON COLUMN "COF_DICT_TYPE"."IS_FIXED" IS '是否固定，如果是，则数据不能修改，不能删除';

-- ----------------------------
-- Table structure for CL_DATA_CLASSIF
-- ----------------------------

DROP TABLE IF EXISTS "CL_DATA_CLASSIF";
CREATE TABLE "CL_DATA_CLASSIF"
(
    "RESOURCE_ID"   NUMBER(24, 0) NOT NULL,
    "CLASSIF_SID"   NUMBER(24, 0) NOT NULL,
    "RESOURCE_TYPE" CHAR(1 CHAR),
    "CREATE_BY"     VARCHAR2(255 CHAR),
    "CREATE_TIME"   TIMESTAMP,
    "UPDATE_BY"     VARCHAR2(255 CHAR),
    "UPDATE_TIME"   TIMESTAMP
)
;
COMMENT ON COLUMN "CL_DATA_CLASSIF"."RESOURCE_ID" IS '资源注册后，关联数据资源';
COMMENT ON COLUMN "CL_DATA_CLASSIF"."RESOURCE_TYPE" IS '目录级、数据级、数据项级';

-- ----------------------------
-- Table structure for CL_DATA_LEVEL
-- ----------------------------

DROP TABLE IF EXISTS "CL_DATA_LEVEL";
CREATE TABLE "CL_DATA_LEVEL"
(
    "RESOURCE_SID"  NUMBER(24, 0) NOT NULL,
    "LEVEL_SID"     NUMBER(24, 0) NOT NULL,
    "RESOURCE_TYPE" CHAR(1 CHAR),
    "CREATE_BY"     VARCHAR2(255 CHAR),
    "CREATE_TIME"   TIMESTAMP,
    "UPDATE_BY"     VARCHAR2(255 CHAR),
    "UPDATE_TIME"   TIMESTAMP
)
;
COMMENT ON COLUMN "CL_DATA_LEVEL"."RESOURCE_SID" IS '资源注册后，关联数据资源';
COMMENT ON COLUMN "CL_DATA_LEVEL"."RESOURCE_TYPE" IS '0目录级、1数据级、2数据项级';

-- ----------------------------
-- Table structure for CL_LEVEL_INFO
-- ----------------------------

DROP TABLE IF EXISTS "CL_LEVEL_INFO";
CREATE TABLE "CL_LEVEL_INFO"
(
    "SID"         NUMBER(24, 0) NOT NULL,
    "LEVEL_CODE"  NUMBER(24, 0),
    "LEVEL_NAME"  VARCHAR2(64 CHAR),
    "LEVEL_DESC"  VARCHAR2(128 CHAR),
    "UPPER_LEVEL" NUMBER(24, 0),
    "LEVEL_NUM"   NUMBER(24, 0),
    "CREATE_BY"   VARCHAR2(255 CHAR),
    "CREATE_TIME" TIMESTAMP,
    "UPDATE_BY"   VARCHAR2(255 CHAR),
    "UPDATE_TIME" TIMESTAMP
)
;
COMMENT ON COLUMN "CL_LEVEL_INFO"."UPPER_LEVEL" IS '第一级时为空';
COMMENT ON COLUMN "CL_LEVEL_INFO"."LEVEL_NUM" IS '1/2';

-- ----------------------------
-- Table structure for CL_RESOUCE_COUNT
-- ----------------------------

DROP TABLE IF EXISTS "CL_RESOUCE_COUNT";
CREATE TABLE "CL_RESOUCE_COUNT"
(
    "SID"          NUMBER(24, 0) NOT NULL,
    "TOTAL_NUM"    NUMBER(10, 0),
    "BATCH_NUMBER" NUMBER(24, 0)
)
;

-- ----------------------------
-- Table structure for CL_RESOUCE_COUNT_TEMP
-- ----------------------------

DROP TABLE IF EXISTS "CL_RESOUCE_COUNT_TEMP";
CREATE TABLE "CL_RESOUCE_COUNT_TEMP"
(
    "SID"          NUMBER(24, 0) NOT NULL,
    "TOTAL_NUM"    NUMBER(10, 0),
    "BATCH_NUMBER" NUMBER(24, 0)
)
;
COMMENT ON COLUMN "CL_RESOUCE_COUNT_TEMP"."BATCH_NUMBER" IS '批次号';

-- ----------------------------
-- Table structure for CL_ROLE_CLASSIF
-- ----------------------------

DROP TABLE IF EXISTS "CL_ROLE_CLASSIF";
CREATE TABLE "CL_ROLE_CLASSIF"
(
    "ROLE_SID"    VARCHAR2(65 CHAR) NOT NULL,
    "CLASSIF_SID" NUMBER(24, 0)     NOT NULL,
    "CREATE_BY"   VARCHAR2(255 CHAR),
    "CREATE_TIME" TIMESTAMP,
    "UPDATE_BY"   VARCHAR2(255 CHAR),
    "UPDATE_TIME" TIMESTAMP
)
;

-- ----------------------------
-- Table structure for CL_ROLE_LEVEL
-- ----------------------------

DROP TABLE IF EXISTS "CL_ROLE_LEVEL";
CREATE TABLE "CL_ROLE_LEVEL"
(
    "ROLE_SID"    VARCHAR2(65 CHAR) NOT NULL,
    "LEVEL_SID"   NUMBER(24, 0)     NOT NULL,
    "CREATE_BY"   VARCHAR2(255 CHAR),
    "CREATE_TIME" TIMESTAMP,
    "UPDATE_BY"   VARCHAR2(255 CHAR),
    "UPDATE_TIME" TIMESTAMP
)
;


-- ----------------------------
-- Table structure for DS_DATA_CONFIG_MGR
-- ----------------------------
DROP TABLE IF EXISTS "DS_DATA_CONFIG_MGR";
CREATE TABLE "DS_DATA_CONFIG_MGR"
(
    "SID"                NUMBER(24, 0)     NOT NULL,
    "CONFIGCODE"         VARCHAR2(50 CHAR) NOT NULL,
    "CONFIGNAME"         VARCHAR2(50 CHAR) NOT NULL,
    "CONFIGTYPE"         VARCHAR2(25 CHAR) NOT NULL,
    "USERKEYTABFILE"     VARCHAR2(255 CHAR),
    "KRB5FILE"           VARCHAR2(255 CHAR),
    "HIVECLIENTPROPFILE" VARCHAR2(255 CHAR),
    "HDFSSITEFILE"       VARCHAR2(255 CHAR),
    "CORESITEFILE"       VARCHAR2(255 CHAR),
    "HBASESITEFILE"      VARCHAR2(255 CHAR),
    "DESCRIPTION"        VARCHAR2(500 CHAR),
    "CREATE_BY"          VARCHAR2(255 CHAR),
    "CREATE_TIME"        TIMESTAMP,
    "UPDATE_BY"          VARCHAR2(255 CHAR),
    "UPDATE_TIME"        TIMESTAMP,
    "PATH_TYPE"          VARCHAR2(255 CHAR) DEFAULT ' LOCAL ',
    "SFTP_PATH"          VARCHAR2(255 CHAR)
)
;
COMMENT ON COLUMN "DS_DATA_CONFIG_MGR"."PATH_TYPE" IS ' LOCAL/SFTP';
COMMENT ON COLUMN "DS_DATA_CONFIG_MGR"."SFTP_PATH" IS 'SFTP的路径';

-- ----------------------------
-- Table structure for DS_DATA_SOURCE
-- ----------------------------

DROP TABLE IF EXISTS "DS_DATA_SOURCE";
CREATE TABLE "DS_DATA_SOURCE"
(
    "SID"                  NUMBER(24, 0) NOT NULL,
    "DATA_SOURCE_NAME"     VARCHAR2(300 CHAR),
    "URL"                  VARCHAR2(1000 CHAR),
    "DRIVER"               VARCHAR2(100 CHAR),
    "USER_NAME"            VARCHAR2(60 CHAR),
    "PWD"                  VARCHAR2(255 CHAR),
    "SOURCE"               VARCHAR2(10 CHAR),
    "CREATE_BY"            VARCHAR2(255 CHAR),
    "CREATE_TIME"          TIMESTAMP,
    "UPDATE_BY"            VARCHAR2(255 CHAR),
    "UPDATE_TIME"          TIMESTAMP,
    "DATA_SOURCE_CODE"     VARCHAR2(255 CHAR),
    "METACUBE_DEFINE_NAME" VARCHAR2(255 CHAR),
    "DATASOURCE_TYPE"      VARCHAR2(50 CHAR),
    "CONFIGMGR_SID"        VARCHAR2(65 CHAR)
)
;
COMMENT ON COLUMN "DS_DATA_SOURCE"."DATA_SOURCE_NAME" IS '数据源名称';
COMMENT ON COLUMN "DS_DATA_SOURCE"."SOURCE" IS '数据源来源：1：元数据:2：自建:3：同步';


-- ----------------------------
-- Table structure for DS_HBASE_MAPPPING
-- ----------------------------

DROP TABLE IF EXISTS "DS_HBASE_MAPPPING";
CREATE TABLE "DS_HBASE_MAPPPING"
(
    "SID"              NUMBER(24, 0)      NOT NULL,
    "HIVE_DS_ID"       VARCHAR2(100 CHAR),
    "HIVE_DS_NAME"     VARCHAR2(100 CHAR),
    "HIVE_DB_NAME"     VARCHAR2(100 CHAR),
    "HIVE_TABLE"       VARCHAR2(100 CHAR),
    "HBASE_DS_ID"      VARCHAR2(100 CHAR),
    "HBASE_DS_NAME"    VARCHAR2(100 CHAR),
    "HBASE_NAMESPACE"  VARCHAR2(100 CHAR),
    "HBASE_TABLE"      VARCHAR2(100 CHAR) NOT NULL,
    "STORAGE_TYPE"     VARCHAR2(20 CHAR) DEFAULT ' string ',
    "COLUMN_MAPPINGS"  CLOB,
    "SERDE_PROPERTIES" CLOB,
    "TBL_PROPERTIES"   VARCHAR2(1024 CHAR),
    "CREATE_TIME"      TIMESTAMP,
    "CREATE_BY"        VARCHAR2(255 CHAR),
    "UPDATE_TIME"      TIMESTAMP,
    "UPDATE_BY"        VARCHAR2(255 CHAR)
)
;

-- -- ----------------------------
-- Table structure for PO_FEEDBACK
-- ----------------------------

DROP TABLE IF EXISTS "PO_FEEDBACK";
CREATE TABLE "PO_FEEDBACK"
(
    "SID"         NUMBER(24, 0)     NOT NULL,
    "OPTIONID"    NUMBER(24, 0)     NOT NULL,
    "USERNAME"    VARCHAR2(32 CHAR) NOT NULL,
    "FEEDBACK"    CLOB              NOT NULL,
    "CREATE_BY"   VARCHAR2(255 CHAR),
    "UPDATE_BY"   VARCHAR2(255 CHAR),
    "CREATE_TIME" TIMESTAMP,
    "UPDATE_TIME" TIMESTAMP
)
;
COMMENT ON COLUMN "PO_FEEDBACK"."CREATE_BY" IS '创建时的userid';
COMMENT ON COLUMN "PO_FEEDBACK"."UPDATE_BY" IS '最后一次修改者的userid';
COMMENT ON COLUMN "PO_FEEDBACK"."UPDATE_TIME" IS '最后一次修改该记录的时间';

-- ----------------------------
-- Table structure for PO_FILES
-- ----------------------------

DROP TABLE IF EXISTS "PO_FILES";
CREATE TABLE "PO_FILES"
(
    "SID"            NUMBER(24, 0)     NOT NULL,
    "RELID"          NUMBER(24, 0),
    "FILENAME"       VARCHAR2(64 CHAR) NOT NULL,
    "ACTUALFILENAME" VARCHAR2(64 CHAR) NOT NULL,
    "FILEPATH"       VARCHAR2(255 CHAR),
    "CREATE_BY"      VARCHAR2(255 CHAR),
    "UPDATE_BY"      VARCHAR2(255 CHAR),
    "CREATE_TIME"    TIMESTAMP,
    "UPDATE_TIME"    TIMESTAMP
)
;
COMMENT ON COLUMN "PO_FILES"."RELID" IS '附件所关联的对象ID';
COMMENT ON COLUMN "PO_FILES"."FILEPATH" IS '可以使用 http://ip:port/files/文件名称 访问上传路径下的文件';
COMMENT ON COLUMN "PO_FILES"."CREATE_BY" IS '创建时的userid';
COMMENT ON COLUMN "PO_FILES"."UPDATE_BY" IS '最后一次修改者的userid';
COMMENT ON COLUMN "PO_FILES"."UPDATE_TIME" IS '最后一次修改该记录的时间';

-- ----------------------------
-- Table structure for PO_OPTIONS
-- ----------------------------

DROP TABLE IF EXISTS "PO_OPTIONS";
CREATE TABLE "PO_OPTIONS"
(
    "SID"          NUMBER(24, 0)     NOT NULL,
    "TITLE"        VARCHAR2(32 CHAR) NOT NULL,
    "SOURCE"       VARCHAR2(32 CHAR) NOT NULL,
    "DATARESOURCE" VARCHAR2(32 CHAR),
    "FIELD"        VARCHAR2(32 CHAR),
    "DESCRIPTION"  CLOB              NOT NULL,
    "STATUS"       CHAR(1 CHAR)      NOT NULL,
    "USERNAME"     VARCHAR2(32 CHAR) NOT NULL,
    "CREATE_BY"    VARCHAR2(255 CHAR),
    "UPDATE_BY"    VARCHAR2(255 CHAR),
    "CREATE_TIME"  TIMESTAMP,
    "UPDATE_TIME"  TIMESTAMP,
    "CONTACTINFO"  VARCHAR2(255 CHAR)
)
;
COMMENT ON COLUMN "PO_OPTIONS"."SOURCE" IS '来源于静态参数 存静态参数的ID 有   质量检核  隐患  用户反馈 其他途径';
COMMENT ON COLUMN "PO_OPTIONS"."STATUS" IS '0  未反馈 1  已反馈 9  已关闭';
COMMENT ON COLUMN "PO_OPTIONS"."CREATE_BY" IS '创建时的userid';
COMMENT ON COLUMN "PO_OPTIONS"."UPDATE_BY" IS '最后一次修改者的userid';
COMMENT ON COLUMN "PO_OPTIONS"."UPDATE_TIME" IS '最后一次修改该记录的时间';


-- ----------------------------
-- Table structure for DS_RESOURCE_INFO
-- ----------------------------
DROP TABLE IF EXISTS "DS_RESOURCE_INFO";
CREATE TABLE "DS_RESOURCE_INFO" (
    "TABLE_TAG" VARCHAR2(255 CHAR),
    "SID" NUMBER(38,0) NOT NULL,
    "RESOURCE_CODE" VARCHAR2(64 CHAR),
    "RESOURCE_NAME" CLOB,
    "DIRECTORY_CODE" VARCHAR2(64 CHAR),
    "DIRECTORY_NAME" CLOB,
    "AUTHORITY_UNIT" VARCHAR2(128 CHAR),
    "SOURCE_TYPE" NUMBER(38,0),
    "OBTAIN_WAY" NUMBER(38,0),
    "APP_SYSTEM" VARCHAR2(128 CHAR),
    "MANAGE_UNIT" VARCHAR2(128 CHAR),
    "DATA_LOCATION" VARCHAR2(32 CHAR),
    "STORAGE_CENTER" VARCHAR2(32 CHAR),
    "STATUS" CHAR(1 CHAR),
    "DESCRIPTION" CLOB,
    "STORAGE_SCALE" VARCHAR2(128 CHAR),
    "STORAGE_CYCLE" VARCHAR2(128 CHAR),
    "UPDATE_CYCLE" VARCHAR2(128 CHAR),
    "UPDATE_SCALE" VARCHAR2(128 CHAR),
    "DATA_UPDATE_TIME" TIMESTAMP(6),
    "REGISTER_TIME" TIMESTAMP(6),
    "META_DIR_CODE" VARCHAR2(128 CHAR),
    "SCHEMA_CODE" VARCHAR2(128 CHAR),
    "TABLE_CODE" VARCHAR2(128 CHAR),
    "CREATE_BY" VARCHAR2(255 CHAR),
    "CREATE_TIME" TIMESTAMP(6),
    "UPDATE_BY" VARCHAR2(255 CHAR),
    "UPDATE_TIME" TIMESTAMP(6),
    "DATA_SOURCE_NAME" VARCHAR2(300 CHAR),
    "RESOURCE_TYPE" VARCHAR2(20 CHAR),
    "INIT_SOLR" CHAR(1 CHAR),
    "DATA_ORGANIZATION" NUMBER(38,0),
    "LABEL_1" NUMBER(38,0),
    "LABEL_2" NUMBER(38,0),
    "LABEL_3" NUMBER(38,0),
    "LABEL_4" NUMBER(38,0),
    "LABEL_5" NUMBER(38,0),
    "INSTANCE_ID" VARCHAR2(128 CHAR),
    "ISPEAT" VARCHAR2(64 CHAR),
    "TABLEDESC" CLOB,
    "DATAMODE" VARCHAR2(255 CHAR),
    "WHYREPEAT" VARCHAR2(500 CHAR),
    "DIFFERSERV" VARCHAR2(255 CHAR),
    "TABLE_RECORD" VARCHAR2(255 CHAR),
    "MAPPING_NUMBER" VARCHAR2(200 CHAR),
    "MAPPING_FIELD" VARCHAR2(200 CHAR),
    "DATA_TABLE_NUM" VARCHAR2(255 CHAR),
    "DEPLOY_TYPE" VARCHAR2(300 CHAR),
    "LAST_UPDATE_TIME" VARCHAR2(100 CHAR),
    "FUNCTION_TEMPLATE" VARCHAR2(255 CHAR),
    "SUB_FUNCTION_TEMPLATE" VARCHAR2(255 CHAR),
    "IS_ACCESS" VARCHAR2(255 CHAR),
    "MAINDATAID" VARCHAR2(100 CHAR),
    "WHY_NEGATIVELIST" VARCHAR2(255 CHAR),
    "IS_NEGATIVELIST" VARCHAR2(255 CHAR),
    "ID" VARCHAR2(100 CHAR),
    "MAINTABLEID" VARCHAR2(100 CHAR),
    "BUSI_TYPE_NUM" VARCHAR2(100 CHAR),
    "TOPIC_NUM" VARCHAR2(100 CHAR),
    "TABLE_NAMESPACE" VARCHAR2(255 CHAR),
    "TABLE_NAME" VARCHAR2(512 CHAR),
    "PRINCIPAL" VARCHAR2(255 CHAR)
)
;

-- ----------------------------
-- Table structure for DS_RESOURCE_ITEM
-- ----------------------------

DROP TABLE IF EXISTS "DS_RESOURCE_ITEM";
CREATE TABLE "DS_RESOURCE_ITEM" (
    "SID" NUMBER(38,0) NOT NULL,
    "RESOURCE_SID" NUMBER(38,0),
    "ITEM_CODE" VARCHAR2(200 CHAR),
    "ITEM_NAME" CLOB,
    "IS_QUERY" CHAR(1 CHAR),
    "QUERY_MATCH_TYPE" VARCHAR2(128 CHAR),
    "IS_SUBSCRIBE" CHAR(1 CHAR),
    "SUBSCRIBE_MATCH_TYPE" VARCHAR2(128 CHAR),
    "CREATE_BY" VARCHAR2(255 CHAR),
    "CREATE_TIME" TIMESTAMP(6),
    "UPDATE_BY" VARCHAR2(255 CHAR),
    "UPDATE_TIME" TIMESTAMP(6),
    "INSTANCE_ID" VARCHAR2(255 CHAR),
    "SYNCDATE" TIMESTAMP(6),
    "SEQ" NUMBER(38,0),
    "ITEM_TYPE" VARCHAR2(500 CHAR),
    "INSTANCE_CODE" VARCHAR2(255 CHAR),
    "INSTANCE_NAME" CLOB,
    "COMMENTS" CLOB,
    "IS_PK" VARCHAR2(255 CHAR),
    "IS_UNIQUE" VARCHAR2(255 CHAR),
    "IS_FK" VARCHAR2(255 CHAR),
    "IS_NULLABLE" VARCHAR2(255 CHAR),
    "COLLENGTHS" VARCHAR2(255 CHAR),
    "SCALES" VARCHAR2(255 CHAR),
    "INITIAL_VALUE" VARCHAR2(255 CHAR),
    "IS_SHARE" VARCHAR2(255 CHAR),
    "IS_MASKING" VARCHAR2(255 CHAR),
    "DATA_TYPE" VARCHAR2(500 CHAR),
    "WHY_SHARE" CLOB,
    "DESEN_RULE" VARCHAR2(500 CHAR),
    "STD_CODE" VARCHAR2(255 CHAR),
    "STORAGE_FORMAT" VARCHAR2(255 CHAR),
    "IS_BASE" VARCHAR2(255 CHAR),
    "SOURCE_SYSTEM" VARCHAR2(255 CHAR),
    "OWN_USER" VARCHAR2(255 CHAR),
    "SOURCE_TB_EN" VARCHAR2(255 CHAR),
    "SOURCE_TB_CN" VARCHAR2(255 CHAR),
    "SOURCE_TB_DESC" CLOB,
    "SOURCE_COL_EN" VARCHAR2(255 CHAR),
    "SOURCE_COL_CN" VARCHAR2(255 CHAR),
    "SOURCE_COL_DESC" CLOB,
    "REB_DEPT" VARCHAR2(255 CHAR),
    "BUS_DEPT_IS_CFM" VARCHAR2(255 CHAR),
    "DATA_IS_CFM" VARCHAR2(255 CHAR),
    "LATEST_VER_NO" VARCHAR2(255 CHAR),
    "LATEST_REVISION_NO" VARCHAR2(255 CHAR),
    "CONSTRAINTS_KEY" VARCHAR2(255 CHAR),
    "STATUS" VARCHAR2(10 CHAR),
    "ID" VARCHAR2(100 CHAR),
    "MAINTABLEID" VARCHAR2(100 CHAR),
    "MAINDATAID" VARCHAR2(100 CHAR),
    "SOURCE_COL_TYPE" VARCHAR2(100 CHAR),
    "PRINCIPAL" VARCHAR2(255 CHAR)
)
;



--------------------------------------------------------
--  DDL for Table CK_ALARM_CONFIG
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_ALARM_CONFIG";
CREATE TABLE "CK_ALARM_CONFIG"
(	"SID" NUMBER(38,0),
     "ALARM_NAME" VARCHAR2(255 CHAR),
     "THRESHOLD_TYPE" CHAR(1 CHAR),
	"THRESHOLD_RELATION" VARCHAR2(64 CHAR),
	"THRESHOLD_VALUE" VARCHAR2(10 CHAR),
	"ALARM_LEVEL" CHAR(1 CHAR),
	"STATE" CHAR(1 CHAR),
	"DELETED" CHAR(1 CHAR),
	"CREATE_BY" VARCHAR2(255 CHAR),
	"CREATE_TIME" TIMESTAMP (6),
	"UPDATE_BY" VARCHAR2(255 CHAR),
	"UPDATE_TIME" TIMESTAMP (6),
	"REMARK" VARCHAR2(255 CHAR),
	"MESSAGETYPE" NUMBER(10,0),
	"STANDBY" VARCHAR2(255 CHAR)
   ) ;
--------------------------------------------------------
--  DDL for Table CK_ALARM_RECORD
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_ALARM_RECORD";
CREATE TABLE "CK_ALARM_RECORD"
(	"SID" NUMBER(38,0),
     "RELATION_ID" NUMBER(38,0),
     "RELATION_TABLE" VARCHAR2(10 CHAR),
     "ALARM_SID" NUMBER(38,0),
     "CHECK_LOG_SID" NUMBER(38,0),
     "CONTENT" VARCHAR2(1000 CHAR),
     "MESSAGE_SEND_RESULT" VARCHAR2(255 CHAR),
     "RECEIVED_BY" VARCHAR2(255 CHAR),
     "RECEIPT_TIME" TIMESTAMP (6),
     "STATE" CHAR(1 CHAR),
	"DELETED" CHAR(1 CHAR),
	"CREATE_BY" VARCHAR2(255 CHAR),
	"CREATE_TIME" TIMESTAMP (6),
	"UPDATE_BY" VARCHAR2(255 CHAR),
	"UPDATE_TIME" TIMESTAMP (6)
   ) ;
--------------------------------------------------------
--  DDL for Table CK_CALENDAR
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_CALENDAR";
CREATE TABLE "CK_CALENDAR"
(	"CK_ID" VARCHAR2(255 CHAR),
     "CK_NAME" VARCHAR2(255 CHAR),
     "CK_DESC" VARCHAR2(255 CHAR),
     "CK_YEAR" NUMBER(10,0),
     "CK_DATELIST" CLOB,
     "CREATE_BY" VARCHAR2(255 CHAR),
     "CREATE_TIME" TIMESTAMP (6),
     "UPDATE_BY" VARCHAR2(255 CHAR),
     "UPDATE_TIME" TIMESTAMP (6)
) ;
--------------------------------------------------------
--  DDL for Table CK_CHECK_LOG
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_CHECK_LOG";
CREATE TABLE "CK_CHECK_LOG"
(	"SID" NUMBER(38,0),
     "METHOD_CONFIG_ID" NUMBER(38,0),
     "CHECK_TIME" TIMESTAMP (6),
     "CHECK_END_TIME" TIMESTAMP (6),
     "CHECK_DURATION" VARCHAR2(10 CHAR),
     "JOB_ID" NUMBER(38,0),
     "JOB_LOG_ID" NUMBER(38,0),
     "CHECK_STATUS" VARCHAR2(10 CHAR),
     "RESULT_ID" VARCHAR2(64 CHAR),
     "ERROR_REMARK" CLOB
) ;
--------------------------------------------------------
--  DDL for Table CK_CHECK_LOG_LATEST
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_CHECK_LOG_LATEST";
CREATE TABLE "CK_CHECK_LOG_LATEST"
(	"METHOD_CONFIG_ID" NUMBER(38,0),
     "LOG_SID" NUMBER(38,0)
)  ;
--------------------------------------------------------
--  DDL for Table CK_CHECK_RESULT
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_CHECK_RESULT";
CREATE TABLE "CK_CHECK_RESULT"
(	"SID" NUMBER(38,0),
     "INDEX_SID" NUMBER(38,0),
     "CHECK_FREQUENCY" VARCHAR2(5 CHAR),
     "CHECK_TIME" TIMESTAMP,
     "CHECK_END_TIME" TIMESTAMP,
     "CHECK_DURATION" VARCHAR2(10 CHAR),
     "ERROR_NUM" NUMBER(38,0),
     "SUM_NUM" NUMBER(38,0),
     "RESOURCE_SID" NUMBER(38,0),
     "ITEM_SID" NUMBER(38,0),
     "ERROR_KEYWORD" CLOB,
     "ERROR_VALUE" CLOB,
     "ERROR_REMARK" CLOB,
     "SOURCE_DATE" TIMESTAMP (6),
     "ERROR_SOURCE1" VARCHAR2(200 CHAR),
     "ERROR_SOURCE2" VARCHAR2(100 CHAR),
     "ERROR_SOURCE3" VARCHAR2(50 CHAR),
     "METHOD_CONFIG_ID" NUMBER(38,0),
     "JOB_ID" NUMBER(38,0),
     "JOB_LOG_ID" NUMBER(38,0),
     "CHECK_RESULT_URL" VARCHAR2(200 CHAR),
     "CHECK_STATUS" VARCHAR2(10 CHAR),
     "CHECK_RESULT_PATH" VARCHAR2(200 CHAR),
     "CHECK_RESULT" CLOB
) ;
--------------------------------------------------------
--  DDL for Table CK_CHECK_RESULT_LATEST
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_CHECK_RESULT_LATEST";
CREATE TABLE "CK_CHECK_RESULT_LATEST"
(	"METHOD_CONFIG_ID" NUMBER(38,0),
     "JOB_ID" NUMBER(38,0),
     "MAX_JOB_LOG_ID" NUMBER(38,0),
     "MAX_CHECK_TIME" TIMESTAMP (6)
) ;

--------------------------------------------------------
--  DDL for Table CK_FREQUENCY
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_FREQUENCY";
CREATE TABLE "CK_FREQUENCY"
(	"NAME" VARCHAR2(128 CHAR),
     "TYPE" CHAR(1 CHAR),
	"INTERVALNUM" NUMBER(10,0),
	"CREATE_BY" VARCHAR2(255 CHAR),
	"CREATE_TIME" TIMESTAMP (6),
	"UPDATE_BY" VARCHAR2(255 CHAR),
	"UPDATE_TIME" TIMESTAMP (6),
	"EXPRESSION" VARCHAR2(255 CHAR),
	"DESCRIPTION" VARCHAR2(255 CHAR)
   ) ;
--------------------------------------------------------
--  DDL for Table CK_GENERAL_CONFIG
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_GENERAL_CONFIG";
CREATE TABLE "CK_GENERAL_CONFIG"
(
    "SID" NUMBER(38,0),
    "CONFIG_TYPE" CHAR(1 CHAR),
	"CONFIG_NAME" VARCHAR2(255 CHAR),
	"STATE" CHAR(1 CHAR),
	"DELETED" CHAR(1 CHAR),
	"CREATE_BY" VARCHAR2(255 CHAR),
	"CREATE_TIME" TIMESTAMP (6),
	"UPDATE_BY" VARCHAR2(255 CHAR),
	"UPDATE_TIME" TIMESTAMP (6),
	"REMARK" VARCHAR2(255 CHAR),
	"STANDBY" VARCHAR2(500 CHAR),
	"SCHEDULE_ID" NUMBER(38,0),
	"SCHEDULE_NAME" VARCHAR2(128 CHAR),
	"PRINCIPAL" VARCHAR2(255 CHAR),
	"ALARM_ID"      NUMBER(38,0),
    "CHECK_CONFIG"  VARCHAR2(255 CHAR)
) ;

--------------------------------------------------------
--  DDL for Table CK_GENERAL_CONFIG_DETAIL
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_GENERAL_CONFIG_DETAIL";
CREATE TABLE "CK_GENERAL_CONFIG_DETAIL"
(
     "SID" NUMBER(38,0),
     "CONFIG_ID" NUMBER(38,0),
     "RESOURCE_NAME" CLOB,
     "RESOURCE_ID" NUMBER(38,0),
     "DATA_SOURCE_NAME" VARCHAR2(64 CHAR),
     "INSTANCE_CODE" VARCHAR2(255 CHAR),
     "ITEM_CODE" VARCHAR2(200 CHAR),
     "ITEM_NAME" CLOB,
     "TABLE_CODE" VARCHAR2(128 CHAR),
     "EXT_CONDITION" VARCHAR2(500 CHAR),
     "UP_THRESHOLD" VARCHAR2(20 CHAR),
     "DOWN_THRESHOLD" VARCHAR2(20 CHAR),
     "PERIOD" NUMBER(10,0),
     "PERIOD_TYPE" CHAR(1 CHAR),
	 "ITEM_ID" NUMBER(38,0),
	 "DATA_SOURCE_SID" NUMBER(38,0),
	 "SCHEMA_CODE" VARCHAR2(255 CHAR)
);

--------------------------------------------------------
--  DDL for Table CK_GENERAL_RESULT
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_GENERAL_RESULT";
CREATE TABLE "CK_GENERAL_RESULT"
(
     "SID" NUMBER(38,0),
     "CONFIG_ID" NUMBER(38,0),
     "AVERAGE_VALUE" VARCHAR2(20 CHAR),
     "UP_THRESHOLD" VARCHAR2(20 CHAR),
     "DOWN_THRESHOLD" VARCHAR2(20 CHAR),
     "CREATE_TIME" TIMESTAMP (6),
     "JOB_ID" NUMBER(38,0),
     "JOB_LOG_ID" NUMBER(38,0),
     "COUNT_OUT_OF_RANGE" NUMBER(20,0),
     "LOG_MESSAGE" CLOB
);

--------------------------------------------------------
--  DDL for Table CK_GENERAL_RESULT_DETAIL
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_GENERAL_RESULT_DETAIL";
CREATE TABLE "CK_GENERAL_RESULT_DETAIL"
(
     "SID" NUMBER(38,0),
     "RESULT_SID" NUMBER(38,0),
     "DATA_SOURCE_NAME" VARCHAR2(64 CHAR),
     "TABLE_CODE" VARCHAR2(128 CHAR),
     "RESOURCE_ID" NUMBER(38,0),
     "RESOURCE_NAME" CLOB,
     "ITEM_CODE" VARCHAR2(200 CHAR),
     "ITEM_NAME" CLOB,
     "ACTUAL_VALUE" VARCHAR2(20 CHAR),
     "LINE_NUM" VARCHAR2(20 CHAR),
     "INSTANCE_CODE" VARCHAR2(255 CHAR),
     "EXT_CONDITION" VARCHAR2(500 CHAR),
     "ITEM_ID" NUMBER(38,0),
     "DATA_SOURCE_SID" NUMBER(38,0),
     "SCHEMA_CODE" VARCHAR2(255 CHAR)
);

--------------------------------------------------------
--  DDL for Table CK_GROUP
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_GROUP";
CREATE TABLE "CK_GROUP"
(
     "SID" NUMBER(38,0),
     "GROUP_NAME" VARCHAR2(128 CHAR),
     "UPPER_GROUP" NUMBER(38,0),
     "DESCRIPTION" CLOB,
     "CREATE_BY" VARCHAR2(255 CHAR),
     "CREATE_TIME" TIMESTAMP (6),
     "UPDATE_BY" VARCHAR2(255 CHAR),
     "UPDATE_TIME" TIMESTAMP (6),
     "UPPER_NAME" VARCHAR2(128 CHAR)
);

--------------------------------------------------------
--  DDL for Table CK_GROUP_RELATION
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_GROUP_RELATION";
CREATE TABLE "CK_GROUP_RELATION"
(
     "CONFIGSID" NUMBER(38,0),
     "CONFIGTYPE" NUMBER(10,0),
     "GROUPSID" NUMBER(38,0),
     "CREATE_BY" VARCHAR2(255 CHAR),
     "CREATE_TIME" TIMESTAMP (6),
     "UPDATE_BY" VARCHAR2(255 CHAR),
     "UPDATE_TIME" TIMESTAMP (6)
);

--------------------------------------------------------
--  DDL for Table CK_INDEX_INFO
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_INDEX_INFO";
CREATE TABLE "CK_INDEX_INFO"
(
     "SID" NUMBER(38,0),
     "INDEX_CODE" VARCHAR2(128 CHAR),
     "INDEX_NAME" VARCHAR2(128 CHAR),
     "CHECK_TYPE" CHAR(1 CHAR),
	 "INDEX_LEVEL" VARCHAR2(2 CHAR),
	 "PARENT_SID" VARCHAR2(40 CHAR),
	 "INDEX_WEIGHT" NUMBER(38,0),
	 "REMARK" CLOB,
	 "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6),
	 "ALARM_ID" NUMBER(38,0),
	 "ALARM_NAME" VARCHAR2(128 CHAR)
);

--------------------------------------------------------
--  DDL for Table CK_INDEX_WEIGHT_INFO
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_INDEX_WEIGHT_INFO";
CREATE TABLE "CK_INDEX_WEIGHT_INFO"
(
     "SID" NUMBER(38,0),
     "INDEX_SID" NUMBER(38,0),
     "INDEX_NAME" VARCHAR2(128 CHAR),
     "START_VALUE" NUMBER(38,0),
     "END_VALUE" NUMBER(38,0),
     "SCORE" NUMBER(38,0),
     "CREATE_BY" VARCHAR2(255 CHAR),
     "CREATE_TIME" TIMESTAMP (6),
     "UPDATE_BY" VARCHAR2(255 CHAR),
     "UPDATE_TIME" TIMESTAMP (6)
);

--------------------------------------------------------
--  DDL for Table CK_KNOWLEDGE_INFO
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_KNOWLEDGE_INFO";
CREATE TABLE "CK_KNOWLEDGE_INFO"
(
     "SID" NUMBER(38,0),
     "TITLE" VARCHAR2(255 CHAR),
     "CONTENT" CLOB,
     "TARGET" VARCHAR2(255 CHAR),
     "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6),
	 "PREVIEW" CLOB,
	 "READNUM" NUMBER(38,0)
);

--------------------------------------------------------
--  DDL for Table CK_KNOWLEDGE_LOG
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_KNOWLEDGE_LOG";
CREATE TABLE "CK_KNOWLEDGE_LOG"
(
     "SID" NUMBER(38,0),
     "KNOWLEDGE_SID" NUMBER(38,0),
     "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6)
);

--------------------------------------------------------
--  DDL for Table CK_METHOD_CONFIG
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_METHOD_CONFIG";
CREATE TABLE "CK_METHOD_CONFIG"
(
     "SID" NUMBER(38,0),
     "NAME" VARCHAR2(500 CHAR),
     "CODE" VARCHAR2(255 CHAR),
     "CHECK_METHOD" CHAR(1 CHAR),
	 "RESOURCE_ID" NUMBER(38,0),
	 "RESOURCE_NAME" CLOB,
	 "ITEM_ID" NUMBER(38,0),
	 "ITEM_CODE" VARCHAR2(255 CHAR),
	 "ITEM_NAME" CLOB,
	 "TABLE_CODE" VARCHAR2(128 CHAR),
	 "INSTANCE_CODE" VARCHAR2(255 CHAR),
	 "FULLSQL" CLOB,
	 "WHERESQL" CLOB,
	 "NUMSQL" CLOB,
	 "CHECK_TYPE" CHAR(1 CHAR),
	 "INDEX_ID" NUMBER(38,0),
	 "INDEX_CODE" VARCHAR2(128 CHAR),
	 "INDEX_NAME" VARCHAR2(128 CHAR),
	 "SCHEDULE_ID" NUMBER(38,0),
	 "SCHEDULE_NAME" VARCHAR2(128 CHAR),
	 "CONFIG_TYPE" CHAR(1 CHAR),
	 "CHECK_TPL" NUMBER(38,0) NULL DEFAULT -1,
     "CHECK_CONFIG" CLOB,
	 "IS_ALARM" CHAR(1 CHAR) DEFAULT 0,
	 "ALARM_ID" NUMBER(38,0),
	 "ALARM_NAME" VARCHAR2(128 CHAR),
	 "ALARM_CONFIG" CLOB,
	 "ALARM_TIME" TIMESTAMP,
	 "STATE" CHAR(1 CHAR),
	 "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6),
	 "REMARK" VARCHAR2(255 CHAR),
	 "STANDBY" VARCHAR2(500 CHAR),
	 "SHOW_FIELD" CLOB,
	 "DATA_SOURCE_NAME" VARCHAR2(255 CHAR),
	 "DATA_SOURCE_SID" NUMBER(38,0),
	 "RESOURCE_TYPE" VARCHAR2(255 CHAR),
	 "SCHEMA_CODE" VARCHAR2(255 CHAR),
	 "PRINCIPAL" VARCHAR2(255 CHAR),
	 "SINK_MODE" VARCHAR2(64 CHAR),
	 "DATA_FROM" VARCHAR2(64 CHAR)
);
COMMENT ON COLUMN "CK_METHOD_CONFIG"."SINK_MODE" IS '结果输出方式';
COMMENT ON COLUMN "CK_METHOD_CONFIG"."DATA_FROM" IS '检核规则创建来源, 默认为NULL';

--------------------------------------------------------
--  DDL for Table CK_METHOD_CONFIG_COURSE
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_METHOD_CONFIG_COURSE";
CREATE TABLE "CK_METHOD_CONFIG_COURSE"
(
     "SID" NUMBER(38,0),
     "METHOD_CONFIG_ID" NUMBER(38,0),
     "OPT" CHAR(2 CHAR),
	 "TABLE_CODE" VARCHAR2(128 CHAR),
	 "ITEM_CODE" VARCHAR2(128 CHAR),
	 "INSTANCE_CODE" VARCHAR2(255 CHAR),
	 "WILDCARD" CHAR(1 CHAR),
	 "ACTUAL_VALUE" VARCHAR2(128 CHAR),
	 "STARTTIME" VARCHAR2(20 CHAR),
	 "ENDTIME" VARCHAR2(20 CHAR),
	 "DICT_ID" VARCHAR2(20 CHAR),
	 "ITEM_ID" NUMBER(38,0),
	 "ITEM_NAME" VARCHAR2(128 CHAR)
) ;

--------------------------------------------------------
--  DDL for Table CK_METHOD_ITEM
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_METHOD_ITEM";
CREATE TABLE "CK_METHOD_ITEM"
(
     "SID" NUMBER(38,0),
     "CONFIG_SID" NUMBER(38,0),
     "INDEX_SID" NUMBER(38,0),
     "PARENT_SID" NUMBER(38,0),
     "OPT" VARCHAR2(10 CHAR),
     "RULE_SID" NUMBER(38,0),
     "EXPRESSION" VARCHAR2(200 CHAR),
     "IDENTIFIER" VARCHAR2(200 CHAR),
     "CHECK_MODE" CHAR(1 CHAR),
	 "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6),
	 "REMARK" VARCHAR2(255 CHAR),
	 "STANDBY" VARCHAR2(500 CHAR)
);


DROP TABLE IF EXISTS "CK_RESULT_DETAIL";
CREATE TABLE "CK_RESULT_DETAIL"
(
     "SID" NUMBER(38,0),
     "RESULTID" NUMBER(38,0),
     "CHECK_COLUMN" VARCHAR2(1000 CHAR),
     "COLUMN1" VARCHAR2(500 CHAR),
     "COLUMN2" VARCHAR2(500 CHAR),
     "COLUMN3" VARCHAR2(500 CHAR),
     "COLUMN4" VARCHAR2(500 CHAR),
     "COLUMN5" VARCHAR2(500 CHAR),
     "COLUMN6" VARCHAR2(500 CHAR),
     "COLUMN7" VARCHAR2(500 CHAR),
     "COLUMN8" VARCHAR2(500 CHAR),
     "COLUMN9" VARCHAR2(500 CHAR),
     "COLUMN10" VARCHAR2(500 CHAR),
     "COLUMN11" VARCHAR2(500 CHAR),
     "COLUMN12" VARCHAR2(500 CHAR),
     "COLUMN13" VARCHAR2(500 CHAR),
     "COLUMN14" VARCHAR2(500 CHAR),
     "COLUMN15" VARCHAR2(500 CHAR),
     "COLUMN16" VARCHAR2(500 CHAR),
     "COLUMN17" VARCHAR2(500 CHAR),
     "COLUMN18" VARCHAR2(500 CHAR),
     "COLUMN19" VARCHAR2(500 CHAR),
     "COLUMN20" VARCHAR2(500 CHAR),
     "COLUMN21" VARCHAR2(500 CHAR),
     "COLUMN22" VARCHAR2(500 CHAR),
     "COLUMN23" VARCHAR2(500 CHAR),
     "COLUMN24" VARCHAR2(500 CHAR),
     "COLUMN25" VARCHAR2(500 CHAR),
     "COLUMN26" VARCHAR2(500 CHAR),
     "COLUMN27" VARCHAR2(500 CHAR),
     "COLUMN28" VARCHAR2(500 CHAR),
     "COLUMN29" VARCHAR2(500 CHAR),
     "COLUMN30" VARCHAR2(500 CHAR),
     "COLUMN31" VARCHAR2(500 CHAR),
     "COLUMN32" VARCHAR2(500 CHAR),
     "COLUMN33" VARCHAR2(500 CHAR),
     "COLUMN34" VARCHAR2(500 CHAR),
     "CREATE_BY" VARCHAR2(255 CHAR),
     "CREATE_TIME" TIMESTAMP (6),
     "UPDATE_BY" VARCHAR2(255 CHAR),
     "UPDATE_TIME" TIMESTAMP (6),
     "TYPE" CHAR(1 CHAR)
) ;
--------------------------------------------------------
--  DDL for Table CK_RESULT_OPTIONS
--------------------------------------------------------

DROP TABLE IF EXISTS "CK_RESULT_OPTIONS";
CREATE TABLE "CK_RESULT_OPTIONS"
(
     "SID" NUMBER(38,0),
     "CHECK_METHOD" CHAR(1 CHAR),
	 "RESULT_SID" NUMBER(38,0),
	 "OPTION_SID" NUMBER(38,0),
	 "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6),
	 "REMARK" VARCHAR2(255 CHAR),
	 "STANDBY" VARCHAR2(500 CHAR)
) ;

--------------------------------------------------------
--  DDL for Table CK_RULE_INFO
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_RULE_INFO";
CREATE TABLE "CK_RULE_INFO"
(
     "SID" NUMBER(38,0),
     "RULE_CODE" VARCHAR2(30 CHAR),
     "RULE_NAME" VARCHAR2(50 CHAR),
     "RULE_OPTION" VARCHAR2(20 CHAR),
     "RULE_VALUE" CLOB,
     "RULE_VALUE_TYPE" CHAR(1 CHAR),
	 "EXPRESSION" CLOB,
	 "REMARK" CLOB,
	 "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6)
) ;

--------------------------------------------------------
--  DDL for Table CK_SCHEDULE_CONFIG
--------------------------------------------------------
DROP TABLE IF EXISTS "CK_SCHEDULE_CONFIG";
CREATE TABLE "CK_SCHEDULE_CONFIG"
(
     "SID" NUMBER(38,0),
     "NAME" VARCHAR2(128 CHAR),
     "JOB_ID" NUMBER(10,0),
     "JOB_GROUP" NUMBER(10,0),
     "TYPE" CHAR(1 CHAR),
	 "INTERVALNUM" NUMBER(10,0),
	 "STARTTIME" VARCHAR2(20 CHAR),
	 "JOB_HANDLER" VARCHAR2(255 CHAR),
	 "STATE" CHAR(1 CHAR),
	 "DELETED" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP (6),
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP (6),
	 "REMARK" VARCHAR2(255 CHAR),
	 "STANDBY" VARCHAR2(500 CHAR),
	 "CALENDAR" VARCHAR2(255 CHAR),
	 "FREQUENCY_NAME" VARCHAR2(255 CHAR),
	 "EXPRESSION" VARCHAR2(255 CHAR)
) ;

--------------------------------------------------------
--  DDL for Table CL_CLASSIF_INFO
--------------------------------------------------------
DROP TABLE IF EXISTS "CL_CLASSIF_INFO";
CREATE TABLE "CL_CLASSIF_INFO"
(
     "SID" NUMBER(24,0),
     "CLASSIF_NAME" VARCHAR2(128 CHAR),
     "UPPER_CLASSIF" NUMBER(24,0),
     "SEQ" VARCHAR2(1024 CHAR),
     "IS_LEAF" CHAR(1 CHAR),
	 "DISPLAY_ORDER" NUMBER(24,0),
	 "DESCRIPTION" CLOB,
	 "LEVEL_NUM" NUMBER(24,0),
	 "CLASSIF_FULL_NAME" VARCHAR2(500 CHAR),
	 "CLASSIF_TYPE" VARCHAR2(5 CHAR),
	 "RESOURCE_MAPPING" VARCHAR2(128 CHAR),
	 "IS_AUTH" CHAR(1 CHAR),
	 "CREATE_BY" VARCHAR2(255 CHAR),
	 "CREATE_TIME" TIMESTAMP,
	 "UPDATE_BY" VARCHAR2(255 CHAR),
	 "UPDATE_TIME" TIMESTAMP,
	 "CLASSIFTEMPLATE" VARCHAR2(255 CHAR),
	 "SHOW_SCHEMA" VARCHAR2(10 CHAR),
	 "ABBR_NAME" VARCHAR2(128 CHAR)
);
COMMENT ON COLUMN "CL_CLASSIF_INFO"."UPPER_CLASSIF" IS '父节点id，一级节点为空';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."SEQ" IS '.11.22.33.';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."IS_LEAF" IS 'Y/N';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."DISPLAY_ORDER" IS '1、2、3...99';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."LEVEL_NUM" IS '1、2、3';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."CLASSIF_FULL_NAME" IS '一级名称-二级名称-叶子名称';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."RESOURCE_MAPPING" IS '自动映射数据资源';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."IS_AUTH" IS '确定该分类是否需要做鉴权 0:不需要 1:需要';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."SHOW_SCHEMA" IS '是否展示SCHEMA节点 0:否,1:是';
COMMENT ON COLUMN "CL_CLASSIF_INFO"."ABBR_NAME" IS '简称';

--------------------------------------------------------
--  DDL for Index SYS_C0097980
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097980" ON "CK_ALARM_CONFIG" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0097982
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097982" ON "CK_ALARM_RECORD" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0097987
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097987" ON "CK_CALENDAR" ("CK_ID");
--------------------------------------------------------
--  DDL for Index SYS_C0097989
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097989" ON "CK_CHECK_LOG" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0097991
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097991" ON "CK_CHECK_LOG_LATEST" ("METHOD_CONFIG_ID");
--------------------------------------------------------
--  DDL for Index SYS_C0097994
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097994" ON "CK_CHECK_RESULT" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0097996
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0097996" ON "CK_CHECK_RESULT_LATEST" ("METHOD_CONFIG_ID");
--------------------------------------------------------
--  DDL for Index SYS_C0098002
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098002" ON "CK_FREQUENCY" ("NAME");
--------------------------------------------------------
--  DDL for Index SYS_C0098008
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098008" ON "CK_GENERAL_CONFIG" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098011
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098011" ON "CK_GENERAL_CONFIG_DETAIL" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098014
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098014" ON "CK_GENERAL_RESULT" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098017
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098017" ON "CK_GENERAL_RESULT_DETAIL" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098019
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098019" ON "CK_GROUP" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098023
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098023" ON "CK_INDEX_INFO" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098025
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098025" ON "CK_INDEX_WEIGHT_INFO" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098027
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098027" ON "CK_KNOWLEDGE_INFO" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098038
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098038" ON "CK_METHOD_CONFIG" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098040
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098040" ON "CK_METHOD_CONFIG_COURSE" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098047
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098047" ON "CK_METHOD_ITEM" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098058
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098058" ON "CK_RESULT_DETAIL" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098045
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098045" ON "CK_RESULT_OPTIONS" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098050
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098050" ON "CK_RULE_INFO" ("SID");
--------------------------------------------------------
--  DDL for Index SYS_C0098056
--------------------------------------------------------

CREATE UNIQUE INDEX "SYS_C0098056" ON "CK_SCHEDULE_CONFIG" ("SID");

--------------------------------------------------------
--  Constraints for Table CK_ALARM_CONFIG
--------------------------------------------------------
ALTER TABLE "CK_ALARM_CONFIG" ALTER COLUMN DELETED SET DEFAULT 0;

ALTER TABLE "CK_ALARM_CONFIG" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_ALARM_CONFIG" MODIFY ("DELETED" NOT NULL ENABLE);

ALTER TABLE "CK_ALARM_CONFIG" MODIFY ("CREATE_BY" NOT NULL ENABLE);

ALTER TABLE "CK_ALARM_CONFIG" MODIFY ("CREATE_TIME" NOT NULL ENABLE);

ALTER TABLE "CK_ALARM_CONFIG" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_ALARM_RECORD
--------------------------------------------------------

ALTER TABLE "CK_ALARM_RECORD" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_ALARM_RECORD" ADD PRIMARY KEY ("SID")
;
--------------------------------------------------------
--  Constraints for Table CK_CALENDAR
--------------------------------------------------------

ALTER TABLE "CK_CALENDAR" MODIFY ("CK_ID" NOT NULL ENABLE);

ALTER TABLE "CK_CALENDAR" MODIFY ("CK_NAME" NOT NULL ENABLE);

ALTER TABLE "CK_CALENDAR" MODIFY ("CK_YEAR" NOT NULL ENABLE);

ALTER TABLE "CK_CALENDAR" MODIFY ("CK_DATELIST" NOT NULL ENABLE);

ALTER TABLE "CK_CALENDAR" ADD PRIMARY KEY ("CK_ID")
;
--------------------------------------------------------
--  Constraints for Table CK_CHECK_LOG
--------------------------------------------------------

ALTER TABLE "CK_CHECK_LOG" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_CHECK_LOG" ADD PRIMARY KEY ("SID")
;
--------------------------------------------------------
--  Constraints for Table CK_CHECK_LOG_LATEST
--------------------------------------------------------

ALTER TABLE "CK_CHECK_LOG_LATEST" MODIFY ("METHOD_CONFIG_ID" NOT NULL ENABLE);

ALTER TABLE "CK_CHECK_LOG_LATEST" ADD PRIMARY KEY ("METHOD_CONFIG_ID")
;
--------------------------------------------------------
--  Constraints for Table CK_CHECK_RESULT
--------------------------------------------------------

ALTER TABLE "CK_CHECK_RESULT" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_CHECK_RESULT" MODIFY ("METHOD_CONFIG_ID" NOT NULL ENABLE);

ALTER TABLE "CK_CHECK_RESULT" ADD PRIMARY KEY ("SID")
;
--------------------------------------------------------
--  Constraints for Table CK_CHECK_RESULT_LATEST
--------------------------------------------------------

ALTER TABLE "CK_CHECK_RESULT_LATEST" MODIFY ("METHOD_CONFIG_ID" NOT NULL ENABLE);

ALTER TABLE "CK_CHECK_RESULT_LATEST" ADD PRIMARY KEY ("METHOD_CONFIG_ID");
--------------------------------------------------------
--  Constraints for Table CK_FREQUENCY
--------------------------------------------------------

ALTER TABLE "CK_FREQUENCY" MODIFY ("NAME" NOT NULL ENABLE);

ALTER TABLE "CK_FREQUENCY" ADD PRIMARY KEY ("NAME");
--------------------------------------------------------
--  Constraints for Table CK_GENERAL_CONFIG
--------------------------------------------------------

ALTER TABLE "CK_GENERAL_CONFIG" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG" MODIFY ("STATE" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG" MODIFY ("DELETED" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG" MODIFY ("CREATE_BY" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG" MODIFY ("CREATE_TIME" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_GENERAL_CONFIG_DETAIL
--------------------------------------------------------

ALTER TABLE "CK_GENERAL_CONFIG_DETAIL" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG_DETAIL" MODIFY ("CONFIG_ID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_CONFIG_DETAIL" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_GENERAL_RESULT
--------------------------------------------------------

ALTER TABLE "CK_GENERAL_RESULT" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_RESULT" MODIFY ("CONFIG_ID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_RESULT" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_GENERAL_RESULT_DETAIL
--------------------------------------------------------

ALTER TABLE "CK_GENERAL_RESULT_DETAIL" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_RESULT_DETAIL" MODIFY ("RESULT_SID" NOT NULL ENABLE);

ALTER TABLE "CK_GENERAL_RESULT_DETAIL" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_GROUP
--------------------------------------------------------

ALTER TABLE "CK_GROUP" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_GROUP" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_GROUP_RELATION
--------------------------------------------------------

ALTER TABLE "CK_GROUP_RELATION" MODIFY ("CONFIGSID" NOT NULL ENABLE);

ALTER TABLE "CK_GROUP_RELATION" MODIFY ("CONFIGTYPE" NOT NULL ENABLE);
--------------------------------------------------------
--  Constraints for Table CK_INDEX_INFO
--------------------------------------------------------

ALTER TABLE "CK_INDEX_INFO" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_INDEX_INFO" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_INDEX_WEIGHT_INFO
--------------------------------------------------------

ALTER TABLE "CK_INDEX_WEIGHT_INFO" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_INDEX_WEIGHT_INFO" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_KNOWLEDGE_INFO
--------------------------------------------------------

ALTER TABLE "CK_KNOWLEDGE_INFO" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_KNOWLEDGE_INFO" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_KNOWLEDGE_LOG
--------------------------------------------------------

ALTER TABLE "CK_KNOWLEDGE_LOG" MODIFY ("SID" NOT NULL ENABLE);
--------------------------------------------------------
--  Constraints for Table CK_METHOD_CONFIG
--------------------------------------------------------

ALTER TABLE "CK_METHOD_CONFIG" ALTER COLUMN DELETED SET DEFAULT 0;

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("NAME" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("TABLE_CODE" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("INSTANCE_CODE" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("STATE" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("DELETED" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("CREATE_BY" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" MODIFY ("CREATE_TIME" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_METHOD_CONFIG_COURSE
--------------------------------------------------------

ALTER TABLE "CK_METHOD_CONFIG_COURSE" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_CONFIG_COURSE" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_METHOD_ITEM
--------------------------------------------------------

ALTER TABLE "CK_METHOD_ITEM" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_METHOD_ITEM" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_RESULT_DETAIL
--------------------------------------------------------

ALTER TABLE "CK_RESULT_DETAIL" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_RESULT_DETAIL" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_RESULT_OPTIONS
--------------------------------------------------------

ALTER TABLE "CK_RESULT_OPTIONS" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_RESULT_OPTIONS" MODIFY ("CHECK_METHOD" NOT NULL ENABLE);

ALTER TABLE "CK_RESULT_OPTIONS" MODIFY ("RESULT_SID" NOT NULL ENABLE);

ALTER TABLE "CK_RESULT_OPTIONS" MODIFY ("OPTION_SID" NOT NULL ENABLE);

ALTER TABLE "CK_RESULT_OPTIONS" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_RULE_INFO
--------------------------------------------------------

ALTER TABLE "CK_RULE_INFO" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_RULE_INFO" MODIFY ("RULE_CODE" NOT NULL ENABLE);

ALTER TABLE "CK_RULE_INFO" ADD PRIMARY KEY ("SID");
--------------------------------------------------------
--  Constraints for Table CK_SCHEDULE_CONFIG
--------------------------------------------------------

ALTER TABLE "CK_SCHEDULE_CONFIG" MODIFY ("SID" NOT NULL ENABLE);

ALTER TABLE "CK_SCHEDULE_CONFIG" MODIFY ("STATE" NOT NULL ENABLE);

ALTER TABLE "CK_SCHEDULE_CONFIG" MODIFY ("DELETED" NOT NULL ENABLE);

ALTER TABLE "CK_SCHEDULE_CONFIG" MODIFY ("CREATE_BY" NOT NULL ENABLE);

ALTER TABLE "CK_SCHEDULE_CONFIG" MODIFY ("CREATE_TIME" NOT NULL ENABLE);

ALTER TABLE "CK_SCHEDULE_CONFIG" ADD PRIMARY KEY ("SID");

-- ----------------------------
-- Primary Key structure for table CL_CLASSIF_INFO
-- ----------------------------
ALTER TABLE "CL_CLASSIF_INFO"
    ADD CONSTRAINT "PRIMARY_111" PRIMARY KEY ("SID");

-- ----------------------------
-- Uniques structure for table CL_CLASSIF_INFO
-- ----------------------------
ALTER TABLE "CL_CLASSIF_INFO"
    ADD CONSTRAINT "IDEX_CLS_SEQ" UNIQUE ("SEQ");

-- ----------------------------
-- Checks structure for table CL_CLASSIF_INFO
-- ----------------------------
ALTER TABLE "CL_CLASSIF_INFO"
    ADD CONSTRAINT "SYS_C0097234" CHECK ("SID" IS NOT NULL);

-- ----------------------------
-- Indexes structure for table CL_CLASSIF_INFO
-- ----------------------------
CREATE INDEX "IDEX_CLS_UPPERCLASSIF"
    ON "CL_CLASSIF_INFO" ("UPPER_CLASSIF" ASC);

-- ----------------------------
-- Primary Key structure for table CL_DATA_CLASSIF
-- ----------------------------
ALTER TABLE "CL_DATA_CLASSIF"
    ADD CONSTRAINT "PRIMARY_112" PRIMARY KEY ("RESOURCE_ID", "CLASSIF_SID");

-- ----------------------------
-- Checks structure for table CL_DATA_CLASSIF
-- ----------------------------
ALTER TABLE "CL_DATA_CLASSIF"
    ADD CONSTRAINT "SYS_C0097237" CHECK ("RESOURCE_ID" IS NOT NULL);
ALTER TABLE "CL_DATA_CLASSIF"
    ADD CONSTRAINT "SYS_C0097238" CHECK ("CLASSIF_SID" IS NOT NULL);

-- ----------------------------
-- Indexes structure for table CL_DATA_CLASSIF
-- ----------------------------
CREATE INDEX "IDX_CDC_CLASSIF_SID"
    ON "CL_DATA_CLASSIF" ("CLASSIF_SID" ASC);


CREATE INDEX "IDX_CDC_RESOURCE_ID"
    ON "CL_DATA_CLASSIF" ("RESOURCE_ID" ASC);


-- ----------------------------
-- Primary Key structure for table CL_DATA_LEVEL
-- ----------------------------
ALTER TABLE "CL_DATA_LEVEL"
    ADD CONSTRAINT "PRIMARY_113" PRIMARY KEY ("RESOURCE_SID", "LEVEL_SID");

-- ----------------------------
-- Checks structure for table CL_DATA_LEVEL
-- ----------------------------
ALTER TABLE "CL_DATA_LEVEL"
    ADD CONSTRAINT "SYS_C0097240" CHECK ("RESOURCE_SID" IS NOT NULL);

ALTER TABLE "CL_DATA_LEVEL"
    ADD CONSTRAINT "SYS_C0097241" CHECK ("LEVEL_SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table CL_LEVEL_INFO
-- ----------------------------
ALTER TABLE "CL_LEVEL_INFO"
    ADD CONSTRAINT "PRIMARY_114" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table CL_LEVEL_INFO
-- ----------------------------
ALTER TABLE "CL_LEVEL_INFO"
    ADD CONSTRAINT "SYS_C0097243" CHECK ("SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table CL_RESOUCE_COUNT
-- ----------------------------
ALTER TABLE "CL_RESOUCE_COUNT"
    ADD CONSTRAINT "PRIMARY_115" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table CL_RESOUCE_COUNT
-- ----------------------------
ALTER TABLE "CL_RESOUCE_COUNT"
    ADD CONSTRAINT "SYS_C0097245" CHECK ("SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table CL_RESOUCE_COUNT_TEMP
-- ----------------------------
ALTER TABLE "CL_RESOUCE_COUNT_TEMP"
    ADD CONSTRAINT "PRIMARY_116" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table CL_RESOUCE_COUNT_TEMP
-- ----------------------------
ALTER TABLE "CL_RESOUCE_COUNT_TEMP"
    ADD CONSTRAINT "SYS_C0097247" CHECK ("SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table CL_ROLE_CLASSIF
-- ----------------------------
ALTER TABLE "CL_ROLE_CLASSIF"
    ADD CONSTRAINT "PRIMARY_117" PRIMARY KEY ("ROLE_SID", "CLASSIF_SID");

-- ----------------------------
-- Checks structure for table CL_ROLE_CLASSIF
-- ----------------------------
ALTER TABLE "CL_ROLE_CLASSIF"
    ADD CONSTRAINT "SYS_C0097249" CHECK ("ROLE_SID" IS NOT NULL);
ALTER TABLE "CL_ROLE_CLASSIF"
    ADD CONSTRAINT "SYS_C0097250" CHECK ("CLASSIF_SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table CL_ROLE_LEVEL
-- ----------------------------
ALTER TABLE "CL_ROLE_LEVEL"
    ADD CONSTRAINT "PRIMARY_118" PRIMARY KEY ("ROLE_SID", "LEVEL_SID");

-- ----------------------------
-- Checks structure for table CL_ROLE_LEVEL
-- ----------------------------
ALTER TABLE "CL_ROLE_LEVEL"
    ADD CONSTRAINT "SYS_C0097252" CHECK ("ROLE_SID" IS NOT NULL);

ALTER TABLE "CL_ROLE_LEVEL"
    ADD CONSTRAINT "SYS_C0097253" CHECK ("LEVEL_SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table DS_DATA_CONFIG_MGR
-- ----------------------------
ALTER TABLE "DS_DATA_CONFIG_MGR"
    ADD CONSTRAINT "PRIMARY_26" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table DS_DATA_CONFIG_MGR
-- ----------------------------
ALTER TABLE "DS_DATA_CONFIG_MGR"
    ADD CONSTRAINT "SYS_C0097329" CHECK ("SID" IS NOT NULL);

ALTER TABLE "DS_DATA_CONFIG_MGR"
    ADD CONSTRAINT "SYS_C0097330" CHECK ("CONFIGCODE" IS NOT NULL);

ALTER TABLE "DS_DATA_CONFIG_MGR"
    ADD CONSTRAINT "SYS_C0097331" CHECK ("CONFIGNAME" IS NOT NULL);

ALTER TABLE "DS_DATA_CONFIG_MGR"
    ADD CONSTRAINT "SYS_C0097332" CHECK ("CONFIGTYPE" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table DS_DATA_SOURCE
-- ----------------------------
ALTER TABLE "DS_DATA_SOURCE"
    ADD CONSTRAINT "PRIMARY_27" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table DS_DATA_SOURCE
-- ----------------------------
ALTER TABLE "DS_DATA_SOURCE"
    ADD CONSTRAINT "SYS_C0097334" CHECK ("SID" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table DS_HBASE_MAPPPING
-- ----------------------------
ALTER TABLE "DS_HBASE_MAPPPING"
    ADD CONSTRAINT "PRIMARY_30" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table DS_HBASE_MAPPPING
-- ----------------------------
ALTER TABLE "DS_HBASE_MAPPPING"
    ADD CONSTRAINT "SYS_C0097343" CHECK ("SID" IS NOT NULL);

ALTER TABLE "DS_HBASE_MAPPPING"
    ADD CONSTRAINT "SYS_C0097344" CHECK ("HBASE_TABLE" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table PO_FEEDBACK
-- ----------------------------
ALTER TABLE "PO_FEEDBACK"
    ADD CONSTRAINT "PRIMARY_87" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table PO_FEEDBACK
-- ----------------------------
ALTER TABLE "PO_FEEDBACK"
    ADD CONSTRAINT "SYS_C0097497" CHECK ("SID" IS NOT NULL) ;

ALTER TABLE "PO_FEEDBACK"
    ADD CONSTRAINT "SYS_C0097498" CHECK ("OPTIONID" IS NOT NULL) ;

ALTER TABLE "PO_FEEDBACK"
    ADD CONSTRAINT "SYS_C0097499" CHECK ("USERNAME" IS NOT NULL);

ALTER TABLE "PO_FEEDBACK"
    ADD CONSTRAINT "SYS_C0097500" CHECK ("FEEDBACK" IS NOT NULL);

-- ----------------------------
-- Primary Key structure for table PO_FILES
-- ----------------------------
ALTER TABLE "PO_FILES"
    ADD CONSTRAINT "PRIMARY_88" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table PO_FILES
-- ----------------------------
ALTER TABLE "PO_FILES"
    ADD CONSTRAINT "SYS_C0097502" CHECK ("SID" IS NOT NULL);

ALTER TABLE "PO_FILES"
    ADD CONSTRAINT "SYS_C0097503" CHECK ("FILENAME" IS NOT NULL) ;

ALTER TABLE "PO_FILES"
    ADD CONSTRAINT "SYS_C0097504" CHECK ("ACTUALFILENAME" IS NOT NULL) ;

-- ----------------------------
-- Primary Key structure for table PO_OPTIONS
-- ----------------------------
ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "PRIMARY_89" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table PO_OPTIONS
-- ----------------------------
ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "SYS_C0097506" CHECK ("SID" IS NOT NULL) ;

ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "SYS_C0097507" CHECK ("TITLE" IS NOT NULL) ;

ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "SYS_C0097508" CHECK ("SOURCE" IS NOT NULL);

ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "SYS_C0097509" CHECK ("DESCRIPTION" IS NOT NULL) ;

ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "SYS_C0097510" CHECK ("STATUS" IS NOT NULL) ;

ALTER TABLE "PO_OPTIONS"
    ADD CONSTRAINT "SYS_C0097511" CHECK ("USERNAME" IS NOT NULL) ;



-- ----------------------------
-- Primary Key structure for table DS_RESOURCE_INFO
-- ----------------------------
ALTER TABLE "DS_RESOURCE_INFO" ADD CONSTRAINT "SYS_C0097969" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table DS_RESOURCE_INFO
-- ----------------------------
ALTER TABLE "DS_RESOURCE_INFO" ADD CONSTRAINT "SYS_C0097968" CHECK ("SID" IS NOT NULL) ;

-- ----------------------------
-- Primary Key structure for table DS_RESOURCE_ITEM
-- ----------------------------
ALTER TABLE "DS_RESOURCE_ITEM" ADD CONSTRAINT "SYS_C0097973" PRIMARY KEY ("SID");

-- ----------------------------
-- Checks structure for table DS_RESOURCE_ITEM
-- ----------------------------
ALTER TABLE "DS_RESOURCE_ITEM" ADD CONSTRAINT "SYS_C0097972" CHECK ("SID" IS NOT NULL) ;




DROP TABLE IF EXISTS DQMS_OPERATION_LOG;
CREATE TABLE DQMS_OPERATION_LOG
(
    ID                   VARCHAR(64) NOT NULL ,
    OPERATOR_ID          VARCHAR(64) ,
    OPERATOR_NAME        VARCHAR(64) ,
    OPERATE_TYPE        INT ,
    OPERATE_DATE        DATE ,
    TARGET_TYPE          VARCHAR(64) ,
    TARGET_MODEL_ID       VARCHAR(64) ,
    TARGET_MODEL_NAME     VARCHAR(64) ,
    MESSAGE              TEXT ,
    TENANT_ID            VARCHAR(64) ,
    PRIMARY KEY (ID)
);

COMMENT ON TABLE DQMS_OPERATION_LOG IS '操作日志';
COMMENT ON COLUMN DQMS_OPERATION_LOG.ID IS '操作日志ID';
COMMENT ON COLUMN DQMS_OPERATION_LOG.OPERATOR_ID IS '操作者ID';
COMMENT ON COLUMN DQMS_OPERATION_LOG.OPERATOR_NAME IS '操作者名称';
COMMENT ON COLUMN DQMS_OPERATION_LOG.OPERATE_TYPE IS '操作类型';
COMMENT ON COLUMN DQMS_OPERATION_LOG.OPERATE_DATE IS '时间';
COMMENT ON COLUMN DQMS_OPERATION_LOG.TARGET_TYPE IS '目标类型';
COMMENT ON COLUMN DQMS_OPERATION_LOG.TARGET_MODEL_ID IS '目标ID';
COMMENT ON COLUMN DQMS_OPERATION_LOG.TARGET_MODEL_NAME IS '目标名称';
COMMENT ON COLUMN DQMS_OPERATION_LOG.MESSAGE IS '信息';
COMMENT ON COLUMN DQMS_OPERATION_LOG.TENANT_ID IS '租户ID';

CREATE INDEX DQMS_OPERATION_LOG_INDEX_OPERATOR ON DQMS_OPERATION_LOG(OPERATOR_NAME);
CREATE INDEX DQMS_OPERATION_LOG_INDEX_OPERATE_TYPE ON DQMS_OPERATION_LOG(OPERATE_TYPE);
CREATE INDEX DQMS_OPERATION_LOG_INDEX_TARGET ON DQMS_OPERATION_LOG(TARGET_TYPE, TARGET_MODEL_ID, TARGET_MODEL_NAME);


DROP TABLE IF EXISTS DQMS_OPERATION_LOG_DETAIL;
CREATE TABLE DQMS_OPERATION_LOG_DETAIL
(
    ID                   varchar(64) not null,
    OLD_DATA_JSON        CLOB,
    NEW_DATA_JSON        CLOB,
    primary key (ID)
);

COMMENT ON COLUMN DQMS_OPERATION_LOG_DETAIL.ID IS '日志详情ID';
COMMENT ON COLUMN DQMS_OPERATION_LOG_DETAIL.OLD_DATA_JSON IS '旧值';
COMMENT ON COLUMN DQMS_OPERATION_LOG_DETAIL.NEW_DATA_JSON IS '新值';

COMMENT ON TABLE DQMS_OPERATION_LOG_DETAIL IS '操作日志详情';

-----------------------------
-- 组织机构评分
-----------------------------
DROP TABLE IF EXISTS DQMS_RATING_RESULT;
CREATE TABLE DQMS_RATING_RESULT(
    ID  NUMBER(20,0) PRIMARY KEY,
    ORG_ID VARCHAR(64),
    ORG_NAME VARCHAR(50),
    ORG_LEVEL VARCHAR(2),
    PARENT_ORG_ID VARCHAR(64),
    SCORE NUMBER(20,0),
    START_DATE TIMESTAMP,
    END_DATE TIMESTAMP,
    RATING_CYCLE VARCHAR(50),
    RATING_POINT VARCHAR(50),
    CREATE_TIME TIMESTAMP,
    CREATE_USER VARCHAR(25),
    LAST_MODIFIER_TIME TIMESTAMP,
    LAST_MODIFIER_USER VARCHAR(25)
);

COMMENT ON COLUMN DQMS_RATING_RESULT.ORG_ID IS '组织ID';
COMMENT ON COLUMN DQMS_RATING_RESULT.ORG_NAME IS '组织名';
COMMENT ON COLUMN DQMS_RATING_RESULT.ORG_LEVEL IS '组织等级';
COMMENT ON COLUMN DQMS_RATING_RESULT.PARENT_ORG_ID IS '父组织ID';
COMMENT ON COLUMN DQMS_RATING_RESULT.SCORE IS '得分';
COMMENT ON COLUMN DQMS_RATING_RESULT.START_DATE IS '评估开始日期';
COMMENT ON COLUMN DQMS_RATING_RESULT.END_DATE IS '评估截至日期';
COMMENT ON COLUMN DQMS_RATING_RESULT.RATING_CYCLE IS '评分周期 年（year）、季度（quarter）、月（month）、周（week），默认月';
COMMENT ON COLUMN DQMS_RATING_RESULT.RATING_POINT IS '评分点 例如：2023-01';

--------------------------------------------------------
--  DDL for Index SYS_C0098278
--------------------------------------------------------

