CREATE TABLE "BLADE_DNC_ARCHIVE_DIRECTORY"
(
    "ID"          NUMBER(20) NOT NULL,
    "TENANT_ID"   NVARCHAR2(12) DEFAULT 000000,
    "PARENT_ID"   NUMBER(20) DEFAULT 0,
    "NAME"        NVARCHAR2(45),
    "ALL_PATH"    NVARCHAR2(500),
    "IS_DELETED"  NUMBER(11),
    "STATUS"      NUMBER(11),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER(20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER(20),
    "CREATE_DEPT" NUMBER(20),
    "DEPT_ID"     NUMBER(20)
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."PARENT_ID" IS '父主键';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."NAME" IS '工艺目录名称';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."ALL_PATH" IS '全路径(包含自身)';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_DNC_ARCHIVE_DIRECTORY"."DEPT_ID" IS '职权域id';
COMMENT
ON TABLE "BLADE_DNC_ARCHIVE_DIRECTORY" IS 'dnc 归档目录';

-- ----------------------------
-- Primary Key structure for table BLADE_DNC_ARCHIVE_DIRECTORY
-- ----------------------------
ALTER TABLE "BLADE_DNC_ARCHIVE_DIRECTORY"
    ADD CONSTRAINT "1655780199PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "DNC_ARCHIVE_DIRECTORY_FILE"
(
    "ID"                      NUMBER(20) NOT NULL,
    "REMARK"                  NVARCHAR2(255),
    "CREATE_USER"             NUMBER(20),
    "CREATE_DEPT"             NUMBER(20),
    "CREATE_TIME"             DATE,
    "UPDATE_USER"             NUMBER(20),
    "UPDATE_TIME"             DATE,
    "STATUS"                  NUMBER(11),
    "IS_DELETED"              NUMBER(11),
    "TENANT_ID"               NVARCHAR2(10) DEFAULT 000000,
    "ORIGINAL_FILENAME"       NVARCHAR2(100),
    "FILENAME"                NVARCHAR2(100),
    "CONTENT_LENGTH"          NUMBER(20),
    "CONTENT_MD5"             NVARCHAR2(100),
    "CONTENT_TYPE"            NVARCHAR2(100),
    "OBJECT_KEY"              NVARCHAR2(100),
    "SUFFIX"                  NVARCHAR2(50),
    "IS_CURRENT"              NUMBER(11),
    "LINK"                    NVARCHAR2(500),
    "BUSINESS_IDENTIFICATION" NVARCHAR2(50),
    "WORKSTATION_FILE_ID"     NUMBER(20),
    "WORKSTATION_ID"          NUMBER(20),
    "ARCHIVE_DIRECTORY_ID"    NUMBER(20),
    "VERSION"                 NUMBER(11)
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."REMARK" IS '备注';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."ORIGINAL_FILENAME" IS '原始文件名称';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."FILENAME" IS '文件名称';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."CONTENT_MD5" IS '文件md5值';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."CONTENT_TYPE" IS '文件类型';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."OBJECT_KEY" IS '文件的objectKey';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."SUFFIX" IS '文件后缀';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."IS_CURRENT" IS '是否为当前版本,1是0否';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."LINK" IS '文件链接';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."BUSINESS_IDENTIFICATION" IS '业务标识';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."WORKSTATION_FILE_ID" IS '工位文件id';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."WORKSTATION_ID" IS '工位id';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."ARCHIVE_DIRECTORY_ID" IS '归档目录id';
COMMENT
ON COLUMN "DNC_ARCHIVE_DIRECTORY_FILE"."VERSION" IS '文件版本';
COMMENT
ON TABLE "DNC_ARCHIVE_DIRECTORY_FILE" IS '归档目录文件';


-- ----------------------------
-- Primary Key structure for table DNC_ARCHIVE_DIRECTORY_FILE
-- ----------------------------
ALTER TABLE "DNC_ARCHIVE_DIRECTORY_FILE"
    ADD CONSTRAINT "1655780317PrimaryId" PRIMARY KEY ("ID");



-- ----------------------------
-- Primary Key structure for table BLADE_DNC_ART_BAG
-- ----------------------------
ALTER TABLE "BLADE_DNC_ART_BAG"
    ADD CONSTRAINT "1655780200PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_DNC_ART_BAG_LOG"
(
    "ID"             NUMBER(20) NOT NULL,
    "FILE_ID"        NUMBER(20),
    "FILE_NAME"      NVARCHAR2(255),
    "OBJECT_KEY"     NVARCHAR2(255),
    "SUFFIX"         NVARCHAR2(100),
    "OPERATOR_ID"    NUMBER(20),
    "OPERATOR_NAME"  NVARCHAR2(255),
    "OPERATION_TIME" DATE,
    "SOURCE_TYPE"    NUMBER(11),
    "REMARK"         NVARCHAR2(255),
    "CREATE_USER"    NUMBER(20),
    "CREATE_DEPT"    NUMBER(20),
    "CREATE_TIME"    DATE,
    "UPDATE_USER"    NUMBER(20),
    "UPDATE_TIME"    DATE,
    "STATUS"         NUMBER(11),
    "IS_DELETED"     NUMBER(11),
    "TENANT_ID"      NVARCHAR2(10) DEFAULT 000000,
    "LINK"           NVARCHAR2(200),
    "ART_BAG_ID"     NUMBER(20),
    "ART_FILE_ID"    NUMBER(20),
    "OPERATION_TYPE" NUMBER(11),
    "FILE_TYPE"      NUMBER(11),
    "FILE_BELONG"    NUMBER(11),
    "STORAGE"        NUMBER(11),
    "VERSION"        NUMBER(11)
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."FILE_ID" IS '文件id';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."FILE_NAME" IS '文件名称';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."OBJECT_KEY" IS '文件存储的key';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."SUFFIX" IS '文件后缀';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."OPERATOR_ID" IS '操作人员id';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."OPERATOR_NAME" IS '操作人员姓名';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."OPERATION_TIME" IS '操作时间';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."SOURCE_TYPE" IS '源类型：本地文件0 我的文档1 加工程序2 通用文件3 回传文件 4 非通用文件 5 产品 6';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."LINK" IS '文件链接';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."ART_BAG_ID" IS '工艺包id';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."ART_FILE_ID" IS '工位报文件id';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."OPERATION_TYPE" IS '操作类型：添加1 覆盖2 删除3';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."FILE_TYPE" IS '属性 程序1 文档2';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."FILE_BELONG" IS '文件归属 工厂1 工位2';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."STORAGE" IS '存储空间 固定空间1 常规空间2';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG_LOG"."VERSION" IS '版本';
COMMENT
ON TABLE "BLADE_DNC_ART_BAG_LOG" IS '工艺包操作历史';

-- ----------------------------
-- Primary Key structure for table BLADE_DNC_ART_BAG_LOG
-- ----------------------------
ALTER TABLE "BLADE_DNC_ART_BAG_LOG"
    ADD CONSTRAINT "1655780201PrimaryId" PRIMARY KEY ("ID");



-- ----------------------------
-- Primary Key structure for table BLADE_DNC_ART_FILE
-- ----------------------------
ALTER TABLE "BLADE_DNC_ART_FILE"
    ADD CONSTRAINT "1655780202PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_DNC_ART_PRODUCT"
(
    "ID"                NUMBER(20) NOT NULL,
    "REMARK"            NVARCHAR2(255),
    "CREATE_USER"       NUMBER(20),
    "CREATE_DEPT"       NUMBER(20),
    "CREATE_TIME"       DATE,
    "UPDATE_USER"       NUMBER(20),
    "UPDATE_TIME"       DATE,
    "STATUS"            NUMBER(11),
    "IS_DELETED"        NUMBER(11),
    "TENANT_ID"         NVARCHAR2(10) DEFAULT 000000,
    "PRODUCT_ID"        NUMBER(20),
    "ART_BAG_ID"        NUMBER(20),
    "PRODUCT_TYPE_ID"   NUMBER(20),
    "PRODUCT_TYPE_NAME" NVARCHAR2(50),
    "PRODUCT_NAME"      NVARCHAR2(50),
    "PRODUCT_CODE"      NVARCHAR2(50)
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."PRODUCT_ID" IS '产品id';
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."ART_BAG_ID" IS '工艺包id';
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."PRODUCT_TYPE_ID" IS '产品类型id';
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."PRODUCT_TYPE_NAME" IS '产品类型名称';
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."PRODUCT_NAME" IS '产品名称';
COMMENT
ON COLUMN "BLADE_DNC_ART_PRODUCT"."PRODUCT_CODE" IS '产品编码';
COMMENT
ON TABLE "BLADE_DNC_ART_PRODUCT" IS '工艺包关联产品';

-- ----------------------------
-- Primary Key structure for table BLADE_DNC_ART_PRODUCT
-- ----------------------------
ALTER TABLE "BLADE_DNC_ART_PRODUCT"
    ADD CONSTRAINT "1655780203PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_DNC_CRAFT_FILE"
(
    "ID"             NUMBER(20) NOT NULL,
    "TENANT_ID"      NVARCHAR2(12) DEFAULT 000000,
    "DISPLAY_NAME"   NVARCHAR2(100),
    "PID"            NUMBER(20),
    "ALL_PATH"       NVARCHAR2(500),
    "CONTENT_LENGTH" NUMBER(20),
    "CONTENT_TYPE"   NVARCHAR2(100),
    "SUFFIX"         NVARCHAR2(10),
    "FILE_TYPE"      NUMBER(11),
    "OBJECT_KEY"     NVARCHAR2(100),
    "CONTENT_MD5"    NVARCHAR2(100),
    "IS_LOCKED"      NUMBER(4),
    "OWNER"          NUMBER(20),
    "CREATE_USER"    NUMBER(20),
    "CREATE_TIME"    DATE,
    "UPDATE_USER"    NUMBER(20),
    "UPDATE_TIME"    DATE,
    "IS_DELETED"     NUMBER(11),
    "CREATE_DEPT"    NUMBER(20),
    "STATUS"         NUMBER(11),
    "LINK"           NVARCHAR2(255),
    "IS_CURRENT"     NUMBER(4) DEFAULT 0 NOT NULL,
    "COVER_TIME"     DATE,
    "VERSION"        NUMBER(11)
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."TENANT_ID" IS '租户id';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."DISPLAY_NAME" IS '文件显示名称';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."PID" IS '上级id';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."ALL_PATH" IS '全路径';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."CONTENT_TYPE" IS '文件mini类型';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."SUFFIX" IS '后缀名';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."FILE_TYPE" IS '文件类型，1 文件夹 2 文件 3 资源文件';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."OBJECT_KEY" IS '文件key';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."CONTENT_MD5" IS '文件md5';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."IS_LOCKED" IS '是否上锁';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."OWNER" IS '拥有者';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."CREATE_DEPT" IS '部门';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."LINK" IS '文件外连接';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."IS_CURRENT" IS '是否为当前版本,1是0否';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."COVER_TIME" IS '覆盖时间';
COMMENT
ON COLUMN "BLADE_DNC_CRAFT_FILE"."VERSION" IS '版本';

-- ----------------------------
-- Primary Key structure for table BLADE_DNC_CRAFT_FILE
-- ----------------------------
ALTER TABLE "BLADE_DNC_CRAFT_FILE"
    ADD CONSTRAINT "1655780204PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_DNC_FACTORY_FILE"
(
    "ID"                NUMBER(20) NOT NULL,
    "ORIGINAL_FILENAME" NVARCHAR2(100),
    "FILENAME"          NVARCHAR2(100),
    "CONTENT_LENGTH"    NUMBER(20),
    "CONTENT_MD5"       NVARCHAR2(100),
    "LAST_MODIFIED"     DATE,
    "CONTENT_TYPE"      NVARCHAR2(100),
    "OBJECT_KEY"        NVARCHAR2(100),
    "SUFFIX"            NVARCHAR2(50),
    "CREATE_USER"       NUMBER(20),
    "CREATE_TIME"       DATE,
    "UPDATE_USER"       NUMBER(20),
    "UPDATE_TIME"       DATE,
    "IS_DELETED"        NUMBER(11),
    "CREATE_DEPT"       NUMBER(20),
    "STATUS"            NUMBER(11),
    "LINK"              NVARCHAR2(255),
    "IS_CURRENT"        NUMBER(11),
    "VERSION"           NUMBER(11),
    "WHETHER_ARCHIVE"   NUMBER(11) DEFAULT 1
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."ORIGINAL_FILENAME" IS '原始文件名称';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."FILENAME" IS '文件名称';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."CONTENT_MD5" IS '文件md5值';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."LAST_MODIFIED" IS '最后修改时间';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."OBJECT_KEY" IS '文件的objectKey';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."LINK" IS '文件地址';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."IS_CURRENT" IS '是否为当前版本,1是0否';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."VERSION" IS '文件版本';
COMMENT
ON COLUMN "BLADE_DNC_FACTORY_FILE"."WHETHER_ARCHIVE" IS '文件是否归档：1 未归档 2 已归档';

-- ----------------------------
-- Primary Key structure for table BLADE_DNC_FACTORY_FILE
-- ----------------------------
ALTER TABLE "BLADE_DNC_FACTORY_FILE"
    ADD CONSTRAINT "1655780205PrimaryId" PRIMARY KEY ("ID");


CREATE TABLE "BLADE_DNC_OPERATION_LOG"
(
    "ID"                 NUMBER(20) NOT NULL,
    "FILE_ID"            NUMBER(20),
    "FILE_NAME"          NVARCHAR2(255),
    "OBJECT_KEY"         NVARCHAR2(255),
    "SUFFIX"             NVARCHAR2(100),
    "OPERATOR_ID"        NUMBER(20),
    "OPERATOR_NAME"      NVARCHAR2(255),
    "OPERATION_TYPE"     NUMBER(11),
    "OPERATION_RESPONSE" NUMBER(11),
    "OPERATION_TIME"     DATE,
    "SOURCE_TYPE"        NUMBER(11),
    "SOURCE_PATH_ID"     NVARCHAR2(255),
    "SOURCE_PATH_NAME"   NVARCHAR2(255),
    "TARGET_TYPE"        NUMBER(11),
    "TARGET_PATH_ID"     NVARCHAR2(255),
    "TARGET_PATH_NAME"   NVARCHAR2(255),
    "REMARK"             NVARCHAR2(255),
    "CREATE_USER"        NUMBER(20),
    "CREATE_DEPT"        NUMBER(20),
    "CREATE_TIME"        DATE,
    "UPDATE_USER"        NUMBER(20),
    "UPDATE_TIME"        DATE,
    "STATUS"             NUMBER(11),
    "IS_DELETED"         NUMBER(11),
    "TENANT_ID"          NVARCHAR2(10) DEFAULT 000000,
    "LINK"               NVARCHAR2(200),
    "WORKSTATION_ID"     NUMBER(20),
    "FILE_TYPE"          NUMBER(11) DEFAULT 0,
    "VERSION"            NUMBER(11),
    "STORAGE_SPACE"      NUMBER(11),
    "FILE_LOCATION"      NVARCHAR2(255)
) TABLESPACE "USERS"
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."FILE_ID" IS '文件id';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."FILE_NAME" IS '文件名称';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."OBJECT_KEY" IS '文件存储的key';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."SUFFIX" IS '文件后缀';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."OPERATOR_ID" IS '操作人员id';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."OPERATOR_NAME" IS '操作人员姓名';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."OPERATION_TYPE" IS '操作类型：上传1 下载2 删除3 更新4 5移动 6复制';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."OPERATION_RESPONSE" IS '操作结果';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."OPERATION_TIME" IS '操作时间';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."SOURCE_TYPE" IS '源类型：本地文件0 我的文档1 工位文件-加工程序2 工位文件-工位文件3 FTP 4';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."SOURCE_PATH_ID" IS '源全路径id';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."SOURCE_PATH_NAME" IS '源全路径名称';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."TARGET_TYPE" IS '源类型：本地文件0 我的文档1 工位文件-加工程序2 工位文件-工位文件3 FTP 4';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."TARGET_PATH_ID" IS '目标全路径id：格式，/1/123/456';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."TARGET_PATH_NAME" IS '目标全路径名称:格式，/我的文档/文件夹1/文件夹2';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."LINK" IS '文件链接';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."WORKSTATION_ID" IS '工位id';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."FILE_TYPE" IS '文件类型 1:代表文件夹 0:代表文件';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."VERSION" IS '版本';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."STORAGE_SPACE" IS '存储位置：1 常规空间 2 固定空间';
COMMENT
ON COLUMN "BLADE_DNC_OPERATION_LOG"."FILE_LOCATION" IS '文件位置：1 内部存储 2 以太网';

-- ----------------------------
-- Primary Key structure for table BLADE_DNC_OPERATION_LOG
-- ----------------------------
ALTER TABLE "BLADE_DNC_OPERATION_LOG"
    ADD CONSTRAINT "1655780206PrimaryId" PRIMARY KEY ("ID");



-- ----------------------------
-- Primary Key structure for table BLADE_DNC_PROCESS_CATALOGUE
-- ----------------------------
ALTER TABLE "BLADE_DNC_PROCESS_CATALOGUE"
    ADD CONSTRAINT "1655780207PrimaryId" PRIMARY KEY ("ID");


-- 初始化菜单脚本
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481428245788037121, 0, 'dnc', '生产工艺', 'dnc', '/dnc', 'iconfont saber-shengchangongyi', 5, 0, 0, 1, '', 0,
        'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481428568128688130, 1481428245788037121, 'transfer', '文件传输', 'transfer', '/dnc/transport/index',
        'iconfont iconicon_exchange', 3, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481429369576296449, 1481428245788037121, 'station_file', '工位文件', 'station_file', '/dnc/station-file/index',
        'iconfont iconicon_doc', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481429815657304065, 1481428245788037121, 'my_documents', '我的文档', 'my_documents', '/dnc/document/index',
        'iconfont iconicon_subordinate', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1495960929735061505, 1481428245788037121, 'operation_log', '操作日志', 'operation_log', '/dnc/log/index',
        'iconfont icon-biaodan', 7, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1496427333921992705, 1498201919430000641, 'technology_files', '工艺文件', 'technology_files',
        '/dnc/craft/document/index', 'iconfont iconicon_dispose', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497029135171686401, 1481428245788037121, 'factory_file', '工厂文件', 'factory_file', '/dnc/factory-file/index',
        'iconfont iconicon_doc', 6, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497030448508932097, 1481428245788037121, 'archive', '文件归档', 'archive', '/dnc/archive',
        'iconfont iconicon_coinpurse_line', 5, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497129165478219777, 1497030448508932097, 'archived_files', '归档管理', 'archived_files', '/dnc/file/admin/index',
        'iconfont iconicon_dispose', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497132713708535809, 1497030448508932097, 'archive_catalog', '归档目录', 'archive_catalog',
        '/dnc/file/catalog/index', 'iconfont iconicon_addresslist', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1498201919430000641, 1481428245788037121, 'technology_file', '工艺管理', 'technology_file', '/dnc/process',
        'iconfont iconicon_coinpurse_line', 4, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1498202645019426818, 1498201919430000641, 'technology_catalog', '工艺目录', 'technology_catalog',
        '/dnc/craft/catalog/index', 'iconfont iconicon_addresslist', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1551739877858926594, 1481428245788037121, 'dnc_app_setting', 'dnc应用设置', 'dnc_app_setting', '/dnc/setting/index',
        '', 8, 1, 0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552474588642234369, 1551739877858926594, 'ftp_directory_root_add', '创建FTP目录', 'ftp_directory_root_add', '', '',
        1, 2, 0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552475927401156610, 1551739877858926594, 'bind_workstation', '关联工位', 'bind_workstation', '', '', 2, 2, 0, 1,
        '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552476695336300545, 1551739877858926594, 'ftp_directory_add', '新增', 'ftp_directory_add', '', '', 4, 2, 0, 1,
        '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552476901159186434, 1551739877858926594, 'ftp_directory_rename', '重命名', 'ftp_directory_rename', '', '', 5, 2,
        0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552477030549270530, 1551739877858926594, 'ftp_directory_delete', '删除子目录', 'ftp_directory_delete', '', '', 6, 2,
        0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552477343062667265, 1551739877858926594, 'ftp_directory_root_delete', '删除根目录', 'ftp_directory_root_delete', '',
        '', 3, 2, 0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1585554742799319042, 0, 'hmi_dnc', '文件传输', 'hmi_dnc', '/dnc', '', 2, 1, 0, 1, '', 0, 'HMI', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1592786664948154369, 1551739877858926594, 'dnc_filedriectory_save', '文件配置设置', 'dnc_filedriectory_save', '', '',
        10, 2, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1592786889846734850, 1551739877858926594, 'dnc_filedriectory_switch', '文件配置开关', 'dnc_filedriectory_switch', '',
        '', 11, 2, 0, 1, '', 0, 'CPS', 1);


-- 初始化脚本

INSERT INTO "BLADE_DNC_ARCHIVE_DIRECTORY"
VALUES ('0', '000000', '-1', '默认目录', '0', '0', NULL, TO_DATE('2022-06-21 10:08:13', 'SYYYY-MM-DD HH24:MI:SS'), NULL,
        TO_DATE('2022-06-21 10:08:13', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL, NULL);

INSERT INTO "BLADE_DNC_PROCESS_CATALOGUE"
VALUES ('0', '000000', '-1', '默认目录', '0', '0', '1', TO_DATE('2022-06-21 10:08:13', 'SYYYY-MM-DD HH24:MI:SS'), NULL,
        TO_DATE('2022-06-21 10:08:13', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL, NULL);

INSERT INTO "BLADE_DNC_CRAFT_FILE"
VALUES ('0', '000000', '我的文档', '-1', '0', '0', NULL, NULL, '1', NULL, NULL, '0', NULL, NULL, NULL, NULL, NULL, '0',
        NULL, '1', NULL, '1', NULL, '1');


INSERT INTO blade_scope_api (id, menu_id, resource_code, scope_name, scope_path, scope_type, remark, http_method,
                             create_user, create_dept, create_time, update_user, update_time, status, is_deleted)
VALUES (1592793061815402498, 1592786664948154369, 'dnc_directory_settings.update_file_setting_data', '更新文件目录设置',
        '/blade-dnc/dnc-directory-settings/update-setting', NULL, NULL, 'POST', 1123598821738675201,
        1123598813738675201,
        TO_DATE('2022-11-16 16:13:53', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-16 16:13:53', 'SYYYY-MM-DD HH24:MI:SS'), 1, 0);
INSERT INTO blade_scope_api (id, menu_id, resource_code, scope_name, scope_path, scope_type, remark, http_method,
                             create_user, create_dept, create_time, update_user, update_time, status, is_deleted)
VALUES (1592793108263124993, 1592786889846734850, 'dnc_directory_settings.switch_state', '文件设置：开启、关闭',
        '/blade-dnc/dnc-directory-settings/change', NULL, NULL, 'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-16 16:14:04', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-16 16:14:04', 'SYYYY-MM-DD HH24:MI:SS'), 1, 0);
