CREATE TABLE "BLADE_DEVICE_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."CODE" IS '类型编码（唯一）';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."NAME" IS '类型名称';
COMMENT
ON COLUMN "BLADE_DEVICE_TYPE"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_DEVICE_TYPE" IS '机器类型';

ALTER TABLE "BLADE_DEVICE_TYPE"
    ADD CONSTRAINT "1655780193PrimaryId" PRIMARY KEY ("ID");
ALTER TABLE "BLADE_DEVICE_TYPE"
    ADD CONSTRAINT "SYS_C0023596" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
CREATE
    UNIQUE INDEX "1654843160UniqueCode"
    ON "BLADE_DEVICE_TYPE" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


CREATE TABLE "BLADE_EMPLOYEE"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(32),
    "EMAIL" NVARCHAR2(45),
    "TEL" NVARCHAR2(32),
    "HIRE_DATE"   DATE,
    "JOB_NUMBER" NVARCHAR2(32),
    "PIN_CODE" NVARCHAR2(128),
    "ORGANIZATION_ID" NVARCHAR2(1000),
    "DEPT_ID" NVARCHAR2(1000),
    "POST_ID" NVARCHAR2(1000),
    "USER_ID" NVARCHAR2(32),
    "ROLE_ID" NVARCHAR2(1000),
    "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),
    "AVATAR" NVARCHAR2(1000)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."CODE" IS '员工编号';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."NAME" IS '姓名';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."EMAIL" IS '邮箱';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."TEL" IS '电话';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."HIRE_DATE" IS '入职日期';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."JOB_NUMBER" IS '工卡号';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."PIN_CODE" IS 'PIN码';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."ORGANIZATION_ID" IS '组织ID';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."DEPT_ID" IS '数据权限';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."POST_ID" IS '岗位ID';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."USER_ID" IS '账号ID';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."ROLE_ID" IS '角色ID';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."STATUS" IS '数据状态';
COMMENT
ON COLUMN "BLADE_EMPLOYEE"."AVATAR" IS '员工头像';
COMMENT
ON TABLE "BLADE_EMPLOYEE" IS '员工';

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



CREATE TABLE "BLADE_EMPLOYEE_POST"
(
    "ID" NUMBER (20) NOT NULL,
    "EMPLOYEE_ID" NUMBER (20) DEFAULT 0,
    "POST_ID" NUMBER (20) DEFAULT 0
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_EMPLOYEE_POST"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_POST"."EMPLOYEE_ID" IS '员工ID';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_POST"."POST_ID" IS '岗位ID';
COMMENT
ON TABLE "BLADE_EMPLOYEE_POST" IS '员工岗位表';
-- ----------------------------
-- Primary Key structure for table BLADE_EMPLOYEE_POST
-- ----------------------------
ALTER TABLE "BLADE_EMPLOYEE_POST"
    ADD CONSTRAINT "1655780210PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_MAINTAIN_ITEM"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REQUIREMENT" NVARCHAR2(350),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."CODE" IS '保养编码';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."NAME" IS '保养项';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."REQUIREMENT" IS '保养要求';
COMMENT
ON COLUMN "BLADE_MAINTAIN_ITEM"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_MAINTAIN_ITEM" IS '保养项信息';

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

-- ----------------------------
-- Indexes structure for table BLADE_MAINTAIN_ITEM
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843165UniqueCode"
    ON "BLADE_MAINTAIN_ITEM" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_MAINTAIN_PROJECT"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "DEVICE_TYPE_ID" NUMBER (20),
    "DEVICE_TYPE_NAME" NVARCHAR2(64),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "INTERVAL_TIME" NUMBER (11),
    "PRE_WARNING_DAYS" NUMBER (11),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."DEVICE_TYPE_ID" IS '机器类型Id';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."DEVICE_TYPE_NAME" IS '机器类型名称';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."CODE" IS '保养项目编码';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."NAME" IS '保养项目名称';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."INTERVAL_TIME" IS '周期（天）';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."PRE_WARNING_DAYS" IS '保养预警提示（天）';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_MAINTAIN_PROJECT" IS '保养项目';

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

-- ----------------------------
-- Indexes structure for table BLADE_MAINTAIN_PROJECT
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843167UniqueCode"
    ON "BLADE_MAINTAIN_PROJECT" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_MAINTAIN_PROJECT_ITEM"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "PROJECT_ID" NUMBER (20),
    "ITEM_ID" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."PROJECT_ID" IS '保养项目Id';
COMMENT
ON COLUMN "BLADE_MAINTAIN_PROJECT_ITEM"."ITEM_ID" IS '保养项Id';
COMMENT
ON TABLE "BLADE_MAINTAIN_PROJECT_ITEM" IS '保养项目保养项';
-- ----------------------------
-- Primary Key structure for table BLADE_MAINTAIN_PROJECT_ITEM
-- ----------------------------
ALTER TABLE "BLADE_MAINTAIN_PROJECT_ITEM"
    ADD CONSTRAINT "1655780226PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_MALFUNCTION_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."CODE" IS '故障类型编号';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."NAME" IS '故障类型';
COMMENT
ON COLUMN "BLADE_MALFUNCTION_TYPE"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_MALFUNCTION_TYPE" IS '故障类型信息';

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

-- ----------------------------
-- Indexes structure for table BLADE_MALFUNCTION_TYPE
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843169UniqueCode"
    ON "BLADE_MALFUNCTION_TYPE" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_MATERIAL"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "BAR_CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "TYPE_ID" NUMBER (20),
    "UNIT" NVARCHAR2(48),
    "STUFF" NVARCHAR2(48),
    "STANDARD_MODEL" NVARCHAR2(48),
    "REMARK" NVARCHAR2(255),
    "LOWER_LIMIT" NUMBER,
    "UPPER_LIMIT" NUMBER,
    "IS_MUST_CHECK" NUMBER (11),
    "PROPERTY" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MATERIAL"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_MATERIAL"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_MATERIAL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MATERIAL"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MATERIAL"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MATERIAL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MATERIAL"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MATERIAL"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_MATERIAL"."CODE" IS '物料编码';
COMMENT
ON COLUMN "BLADE_MATERIAL"."BAR_CODE" IS '物料条码';
COMMENT
ON COLUMN "BLADE_MATERIAL"."NAME" IS '物料名称';
COMMENT
ON COLUMN "BLADE_MATERIAL"."TYPE_ID" IS '物料类型id';
COMMENT
ON COLUMN "BLADE_MATERIAL"."UNIT" IS '计量单位';
COMMENT
ON COLUMN "BLADE_MATERIAL"."STUFF" IS '材质';
COMMENT
ON COLUMN "BLADE_MATERIAL"."STANDARD_MODEL" IS '规格';
COMMENT
ON COLUMN "BLADE_MATERIAL"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_MATERIAL"."LOWER_LIMIT" IS '额定库存';
COMMENT
ON COLUMN "BLADE_MATERIAL"."UPPER_LIMIT" IS '安全库存';
COMMENT
ON COLUMN "BLADE_MATERIAL"."IS_MUST_CHECK" IS '是否必检：0-非必检，1-必检';
COMMENT
ON COLUMN "BLADE_MATERIAL"."PROPERTY" IS '物料性质：1-原材料、2-半成品、3-成品、4-备品备件、5-辅助用品、9-其它';
COMMENT
ON TABLE "BLADE_MATERIAL" IS '物料';

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

-- ----------------------------
-- Indexes structure for table BLADE_MATERIAL
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843170UniqueCode"
    ON "BLADE_MATERIAL" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_MATERIAL_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."CODE" IS '物料类型编码';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."NAME" IS '物料类型名称';
COMMENT
ON COLUMN "BLADE_MATERIAL_TYPE"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_MATERIAL_TYPE" IS '物料类型';

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

-- ----------------------------
-- Indexes structure for table BLADE_MATERIAL_TYPE
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843171UniqueCode"
    ON "BLADE_MATERIAL_TYPE" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_NOTICE"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "TITLE" NVARCHAR2(255),
    "CATEGORY" NUMBER (11),
    "RELEASE_TIME" DATE,
    "CONTENT" NCLOB,
    "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)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_NOTICE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_NOTICE"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_NOTICE"."TITLE" IS '标题';
COMMENT
ON COLUMN "BLADE_NOTICE"."CATEGORY" IS '类型';
COMMENT
ON COLUMN "BLADE_NOTICE"."RELEASE_TIME" IS '发布时间';
COMMENT
ON COLUMN "BLADE_NOTICE"."CONTENT" IS '内容';
COMMENT
ON COLUMN "BLADE_NOTICE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_NOTICE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_NOTICE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_NOTICE"."UPDATE_USER" IS '修改人';
COMMENT
ON COLUMN "BLADE_NOTICE"."UPDATE_TIME" IS '修改时间';
COMMENT
ON COLUMN "BLADE_NOTICE"."STATUS" IS '状态';
COMMENT
ON TABLE "BLADE_NOTICE" IS '通知公告表';

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



CREATE TABLE "BLADE_NOTIFY_HISTORY"
(
    "ID" NVARCHAR2(64) NOT NULL,
    "STATE" NVARCHAR2(255) NOT NULL,
    "NOTIFY_TYPE" NVARCHAR2(32) NOT NULL,
    "NOTIFIER_ID" NVARCHAR2(32) NOT NULL,
    "NOTIFY_TIME" DATE,
    "PROVIDER" NVARCHAR2(32) NOT NULL,
    "TEMPLATE_ID" NVARCHAR2(32),
    "TEMPLATE" NCLOB,
    "RETRY_TIMES" NUMBER (11),
    "ERROR_TYPE" NCLOB,
    "CONTEXT_DATA" NCLOB,
    "ERROR_STACK" NCLOB,
    "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),
    "TRANCE_ID" NVARCHAR2(32)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."STATE" IS '通知状态';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."NOTIFY_TYPE" IS '通知类型';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."NOTIFIER_ID" IS '通知ID';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."NOTIFY_TIME" IS '通知时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."PROVIDER" IS '提供商';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."TEMPLATE_ID" IS '模板id';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."TEMPLATE" IS '模板内容';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."RETRY_TIMES" IS '重试次数';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."ERROR_TYPE" IS '错误类型';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."CONTEXT_DATA" IS '通知数据';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."ERROR_STACK" IS '错误栈';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."UPDATE_USER" IS '修改人';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."UPDATE_TIME" IS '修改时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_NOTIFY_HISTORY"."TRANCE_ID" IS '追溯ID';

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

-- ----------------------------
-- Indexes structure for table BLADE_NOTIFY_HISTORY
-- ----------------------------
CREATE
    INDEX "1654843173NormalNotifier_id"
    ON "BLADE_NOTIFY_HISTORY" ("NOTIFIER_ID" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_NOTIFY_NOTIFICATIONS"
(
    "ID" NVARCHAR2(64) NOT NULL,
    "SUBSCRIBE_ID" NVARCHAR2(64) NOT NULL,
    "SUBSCRIBER" NVARCHAR2(64) NOT NULL,
    "BUSINESSKEY" NVARCHAR2(32) NOT NULL,
    "BUSINESSNAME" NVARCHAR2(64),
    "MESSAGE" NCLOB,
    "NOTIFY_TIME" NUMBER (20) NOT NULL,
    "STATE" NVARCHAR2(32),
    "DESCRIPTION" NCLOB,
    "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)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."SUBSCRIBE_ID" IS '订阅追溯Id';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."SUBSCRIBER" IS '订阅得用户ID';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."BUSINESSKEY" IS '主题标识,如:device_alarm';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."BUSINESSNAME" IS '主题名称';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."MESSAGE" IS '通知消息内容';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."NOTIFY_TIME" IS '通知时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."STATE" IS '通知状态';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."UPDATE_USER" IS '修改人';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."UPDATE_TIME" IS '修改时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_NOTIFICATIONS"."STATUS" IS '状态';

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

-- ----------------------------
-- Indexes structure for table BLADE_NOTIFY_NOTIFICATIONS
-- ----------------------------
CREATE
    INDEX "1654843174NormalSubscriber"
    ON "BLADE_NOTIFY_NOTIFICATIONS" ("SUBSCRIBER" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_NOTIFY_SUBSCRIBERS"
(
    "ID" NVARCHAR2(64) NOT NULL,
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "SUBSCRIBER" NVARCHAR2(32) NOT NULL,
    "BUSINESS_KEY" NVARCHAR2(32) NOT NULL,
    "BUSINESS_NAME" NVARCHAR2(64),
    "NOTIFY_TYPE" NVARCHAR2(255),
    "DESCRIPTION" 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)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."SUBSCRIBER" IS '订阅者ID';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."BUSINESS_KEY" IS '业务主题,如:device_alarm';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."BUSINESS_NAME" IS '主题名称,如:设备告警';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."NOTIFY_TYPE" IS '订阅通知类型';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."DESCRIPTION" IS '描述';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."UPDATE_USER" IS '修改人';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."UPDATE_TIME" IS '修改时间';
COMMENT
ON COLUMN "BLADE_NOTIFY_SUBSCRIBERS"."STATUS" IS '状态';
-- ----------------------------
-- Primary Key structure for table BLADE_NOTIFY_SUBSCRIBERS
-- ----------------------------
ALTER TABLE "BLADE_NOTIFY_SUBSCRIBERS"
    ADD CONSTRAINT "1655780243PrimaryId" PRIMARY KEY ("ID");


-- ----------------------------
-- Indexes structure for table BLADE_NOTIFY_SUBSCRIBERS
-- ----------------------------
CREATE
    INDEX "1654843175NormalSubscriber"
    ON "BLADE_NOTIFY_SUBSCRIBERS" ("SUBSCRIBER" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_PROCESS"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(32),
    "TYPE" NUMBER (11),
    "DESCRIPTION" NVARCHAR2(255),
    "IS_IMPORT" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "STATUS" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_PROCESS"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_PROCESS"."CODE" IS '工序编号';
COMMENT
ON COLUMN "BLADE_PROCESS"."NAME" IS '工序名称';
COMMENT
ON COLUMN "BLADE_PROCESS"."TYPE" IS '工序类型';
COMMENT
ON COLUMN "BLADE_PROCESS"."DESCRIPTION" IS '工序描述';
COMMENT
ON COLUMN "BLADE_PROCESS"."IS_IMPORT" IS '是否导入';
COMMENT
ON COLUMN "BLADE_PROCESS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_PROCESS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_PROCESS"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_PROCESS"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_PROCESS"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_PROCESS"."STATUS" IS '业务状态';
COMMENT
ON TABLE "BLADE_PROCESS" IS '生产工序信息；';

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

-- ----------------------------
-- Indexes structure for table BLADE_PROCESS
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843178UniqueCode"
    ON "BLADE_PROCESS" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_PROCESS_ASSOCIATION"
(
    "ID" NUMBER (20) NOT NULL,
    "TYPE" NUMBER (4),
    "BIZ_ID" NUMBER (20),
    "PROCESS_ID" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_PROCESS_ASSOCIATION"."ID" IS '主键id';
COMMENT
ON COLUMN "BLADE_PROCESS_ASSOCIATION"."TYPE" IS '业务类型：1、工位，2、库区，3、供应商';
COMMENT
ON COLUMN "BLADE_PROCESS_ASSOCIATION"."BIZ_ID" IS '业务id';
COMMENT
ON COLUMN "BLADE_PROCESS_ASSOCIATION"."PROCESS_ID" IS '工序id';
COMMENT
ON TABLE "BLADE_PROCESS_ASSOCIATION" IS '工序关系表';
-- ----------------------------
-- Primary Key structure for table BLADE_PROCESS_ASSOCIATION
-- ----------------------------
ALTER TABLE "BLADE_PROCESS_ASSOCIATION"
    ADD CONSTRAINT "1655780252PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_PRODUCT"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "CODE" NVARCHAR2(128) NOT NULL,
    "NAME" NVARCHAR2(255),
    "PARENT_ID" NUMBER (20),
    "TYPE_ID" NUMBER (20) NOT NULL,
    "UNIT" NVARCHAR2(10),
    "STANDARD_MODEL" NVARCHAR2(255),
    "DESCRIPTION" NVARCHAR2(255),
    "DOCUMENTS" NCLOB,
    "EXTEND_FIELD" NCLOB,
    "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)
) 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_PRODUCT"."ID" IS '产品ID';
COMMENT
ON COLUMN "BLADE_PRODUCT"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_PRODUCT"."CODE" IS '产品编号';
COMMENT
ON COLUMN "BLADE_PRODUCT"."NAME" IS '产品名称';
COMMENT
ON COLUMN "BLADE_PRODUCT"."PARENT_ID" IS '上级产品ID';
COMMENT
ON COLUMN "BLADE_PRODUCT"."TYPE_ID" IS '产品类型';
COMMENT
ON COLUMN "BLADE_PRODUCT"."UNIT" IS '计量单位';
COMMENT
ON COLUMN "BLADE_PRODUCT"."STANDARD_MODEL" IS '规格型号';
COMMENT
ON COLUMN "BLADE_PRODUCT"."DESCRIPTION" IS '产品描述';
COMMENT
ON COLUMN "BLADE_PRODUCT"."DOCUMENTS" IS '产品文档';
COMMENT
ON COLUMN "BLADE_PRODUCT"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_PRODUCT"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_PRODUCT"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_PRODUCT"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_PRODUCT"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_PRODUCT"."STATUS" IS '状态：1启用 0停用';
COMMENT
ON TABLE "BLADE_PRODUCT" IS '产品信息';
COMMENT
ON COLUMN "BLADE_PRODUCT"."EXTEND_FIELD" IS '扩展字段';

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

-- ----------------------------
-- Indexes structure for table BLADE_PRODUCT
-- ----------------------------
CREATE
    INDEX "1654843179NormalType_id"
    ON "BLADE_PRODUCT" ("TYPE_ID" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    );
CREATE
    UNIQUE INDEX "1654843180UniqueCode"
    ON "BLADE_PRODUCT" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    );


-- 产品类型表
CREATE TABLE "BLADE_PRODUCT_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4) DEFAULT 1,
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."STATUS" IS '状态: 1为启动，0为停用';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."NAME" IS '名称';
COMMENT
ON COLUMN "BLADE_PRODUCT_TYPE"."REMARK" IS '备注/说明';
COMMENT
ON TABLE "BLADE_PRODUCT_TYPE" IS '产品类型';

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

-- ----------------------------
-- Indexes structure for table BLADE_PRODUCT_TYPE
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843181UniqueName"
    ON "BLADE_PRODUCT_TYPE" ("IS_DELETED" ASC, "NAME" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );

CREATE TABLE "BLADE_PRODUCTION_CALENDAR"
(
    "ID" NUMBER (20, 0) NOT NULL ENABLE,
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(50),
    "YEAR" NUMBER (11, 0),
    "TENANT_ID" NVARCHAR2(12),
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "STATUS" NUMBER (4, 0),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    CONSTRAINT "1655780256PrimaryId" PRIMARY KEY ("ID")
        USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
        STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
        PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
        TABLESPACE "USERS" ENABLE,
    CONSTRAINT "SYS_C0023714" CHECK ("ID" IS NOT NULL) ENABLE
) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE
(
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
    TABLESPACE "USERS";

CREATE INDEX "INDEX1657856130001" ON "BLADE_PRODUCTION_CALENDAR" ("CODE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS";

CREATE TABLE "BLADE_PRODUCTION_CALENDAR_DAY"
(
    "ID" NUMBER (20, 0) NOT NULL ENABLE,
    "CALENDAR_ID" NUMBER (20, 0),
    "CALENDAR_DATE" DATE,
    "START_TIME"    DATE,
    "END_TIME"      DATE,
    "WEEK" NUMBER (11, 0),
    "MONTH" NUMBER (11, 0),
    "YEAR" NUMBER (11, 0),
    "MODEL_ID" NUMBER (20, 0),
    "IS_DELETED" NUMBER (11, 0),
    "IS_HIGH_PRIORITY" NUMBER (4, 0),
    "IS_OFF_DAY" NUMBER (4, 0),
    "OFF_ID" NUMBER (20, 0),
    CONSTRAINT "1655780257PrimaryId" PRIMARY KEY ("ID")
        USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
        STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
        PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
        TABLESPACE "USERS" ENABLE,
    CONSTRAINT "SYS_C0023715" CHECK ("ID" IS NOT NULL) ENABLE
) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE
(
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
    TABLESPACE "USERS";

CREATE INDEX "1654843182NormalCalendar_date" ON "BLADE_PRODUCTION_CALENDAR_DAY" ("CALENDAR_DATE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS";

CREATE INDEX "1654843183NormalCalendar_id" ON "BLADE_PRODUCTION_CALENDAR_DAY" ("CALENDAR_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS";

CREATE INDEX "INDEX1657856130002" ON "BLADE_PRODUCTION_CALENDAR_DAY" ("MODEL_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS";


CREATE TABLE "PROD_CALENDAR_DAYTIME"
(
    "ID" NUMBER (20) NOT NULL,
    "CALENDAR_ID" NUMBER (20),
    "CALENDAR_DAY_ID" NUMBER (20),
    "CALENDAR_DATE" DATE,
    "START_TIME"    DATE,
    "END_TIME"      DATE,
    "SHIFT_INDEX" NUMBER (4),
    "SHIFT_TYPE" NUMBER (4),
    "WEEK" NUMBER (11),
    "MONTH" NUMBER (11),
    "YEAR" NUMBER (11),
    "CREATE_TIME"   DATE,
    "CREATE_USER" NUMBER (20),
    "IS_HIGH_PRIORITY" NUMBER (4),
    "IS_UNDEFINED" NUMBER (4)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."CALENDAR_ID" IS '生产日历id';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."CALENDAR_DAY_ID" IS '生产日历具体id';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."CALENDAR_DATE" IS '生产日历日期';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."START_TIME" IS '班次开始时间';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."END_TIME" IS '班次结束时间';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."SHIFT_INDEX" IS '班次序号';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."SHIFT_TYPE" IS '班次类型(1-工作时段,2-休息时段,0-工厂日内未定义时段,3-工厂日外未定义时段)';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."WEEK" IS '属于当年的第几周';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."MONTH" IS '属于当年第几月';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."YEAR" IS '年';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."CREATE_TIME" IS '本条记录创建时间';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."IS_HIGH_PRIORITY" IS '是否高优先级(0:否,1:是)';
COMMENT
ON COLUMN "PROD_CALENDAR_DAYTIME"."IS_UNDEFINED" IS '是否未定义工厂日(0:否,1:是)';
COMMENT
ON TABLE "PROD_CALENDAR_DAYTIME" IS '生产日历日时间段定义';

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

-- ----------------------------
-- Indexes structure for table PROD_CALENDAR_DAYTIME
-- ----------------------------
CREATE
    INDEX "1654843184NormalCalendar_date"
    ON "PROD_CALENDAR_DAYTIME" ("CALENDAR_DATE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );
CREATE
    INDEX "1654843185NormalCalendar_id"
    ON "PROD_CALENDAR_DAYTIME" ("CALENDAR_ID" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );
CREATE
    INDEX "1654843186NormalCalendar_id"
    ON "PROD_CALENDAR_DAYTIME" ("CALENDAR_ID" ASC, "START_TIME" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "PROD_CAPACITY_GROUP"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "NAME" NVARCHAR2(45),
    "FULL_NAME" NVARCHAR2(45),
    "SORT" NUMBER (11),
    "REMARK" NVARCHAR2(255),
    "CALENDAR_CODE" NVARCHAR2(128),
    "IS_DELETED" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CAPACITY_GROUP"."ID" IS '主键';
COMMENT
ON COLUMN "PROD_CAPACITY_GROUP"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "PROD_CAPACITY_GROUP"."NAME" IS '组名';
COMMENT
ON COLUMN "PROD_CAPACITY_GROUP"."FULL_NAME" IS '组完整名称';
COMMENT
ON COLUMN "PROD_CAPACITY_GROUP"."SORT" IS '排序';
COMMENT
ON COLUMN "PROD_CAPACITY_GROUP"."REMARK" IS '备注';
COMMENT
ON TABLE "PROD_CAPACITY_GROUP" IS '组';

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



CREATE TABLE "BLADE_REGION"
(
    "CODE" NVARCHAR2(12) NOT NULL,
    "PARENT_CODE" NVARCHAR2(12),
    "ANCESTORS" NVARCHAR2(255),
    "NAME" NVARCHAR2(32),
    "PROVINCE_CODE" NVARCHAR2(12),
    "PROVINCE_NAME" NVARCHAR2(32),
    "CITY_CODE" NVARCHAR2(12),
    "CITY_NAME" NVARCHAR2(32),
    "DISTRICT_CODE" NVARCHAR2(12),
    "DISTRICT_NAME" NVARCHAR2(32),
    "TOWN_CODE" NVARCHAR2(12),
    "TOWN_NAME" NVARCHAR2(32),
    "VILLAGE_CODE" NVARCHAR2(12),
    "VILLAGE_NAME" NVARCHAR2(32),
    "REGION_LEVEL" NUMBER (11),
    "SORT" NUMBER (11),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_REGION"."CODE" IS '区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."PARENT_CODE" IS '父区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."ANCESTORS" IS '祖区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."NAME" IS '区划名称';
COMMENT
ON COLUMN "BLADE_REGION"."PROVINCE_CODE" IS '省级区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."PROVINCE_NAME" IS '省级名称';
COMMENT
ON COLUMN "BLADE_REGION"."CITY_CODE" IS '市级区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."CITY_NAME" IS '市级名称';
COMMENT
ON COLUMN "BLADE_REGION"."DISTRICT_CODE" IS '区级区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."DISTRICT_NAME" IS '区级名称';
COMMENT
ON COLUMN "BLADE_REGION"."TOWN_CODE" IS '镇级区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."TOWN_NAME" IS '镇级名称';
COMMENT
ON COLUMN "BLADE_REGION"."VILLAGE_CODE" IS '村级区划编号';
COMMENT
ON COLUMN "BLADE_REGION"."VILLAGE_NAME" IS '村级名称';
COMMENT
ON COLUMN "BLADE_REGION"."REGION_LEVEL" IS '层级';
COMMENT
ON COLUMN "BLADE_REGION"."SORT" IS '排序';
COMMENT
ON COLUMN "BLADE_REGION"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_REGION" IS '行政区划表';


-- ----------------------------
-- Primary Key structure for table BLADE_REGION
-- ----------------------------
ALTER TABLE "BLADE_REGION"
    ADD CONSTRAINT "1655780258PrimaryCode" PRIMARY KEY ("CODE");


CREATE TABLE "BLADE_SHIFT_DETAIL"
(
    "ID" NUMBER (20, 0) NOT NULL ENABLE,
    "MODEL_ID" NUMBER (20, 0),
    "SHIFT_INDEX" NUMBER (4, 0),
    "SHIFT_START_TIME" NUMBER (11, 0),
    "SHIFT_END_TIME" NUMBER (11, 0),
    "REST_NUMBER" NUMBER (4, 0),
    "INDEX_NAME" NVARCHAR2(50),
    CONSTRAINT "1655780270PrimaryId" PRIMARY KEY ("ID")
        USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
        STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
        PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
        TABLESPACE "USERS" ENABLE,
    CONSTRAINT "SYS_C0023730" CHECK ("ID" IS NOT NULL) ENABLE
) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE
(
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
    TABLESPACE "USERS"
;

CREATE INDEX "INDEX1657856130003" ON "BLADE_SHIFT_DETAIL" ("MODEL_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS";

CREATE TABLE "BLADE_SHIFT_MODEL"
(
    "ID" NUMBER (20) NOT NULL,
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(50),
    "SHIFT_NUMBER" NUMBER (4),
    "COLOUR" NVARCHAR2(30),
    "START_TIME" NUMBER (11),
    "END_TIME" NUMBER (11),
    "TENANT_ID" NVARCHAR2(12),
    "IS_DELETED" NUMBER (11),
    "IS_DEFAULT" NUMBER (4),
    "CREATE_USER" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "CREATE_DEPT" NUMBER (20),
    "STATUS" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."CODE" IS '班次编号';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."NAME" IS '班次名称';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."SHIFT_NUMBER" IS '班次数量';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."COLOUR" IS '班次颜色';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."START_TIME" IS '班次日开始时间的偏移量(以当日0点为基准的偏移量的分钟数）';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."END_TIME" IS '班次日结束时间的偏移量(以当日0点为基准的偏移量的分钟数）';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."TENANT_ID" IS '租户id';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."IS_DEFAULT" IS '是否是默认班次(0-默认,1-非默认)默认班次不可编辑,不可删除';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."CREATE_TIME" IS '创建日期';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."UPDATE_TIME" IS '更新日期';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_SHIFT_MODEL"."STATUS" IS '业务状态';

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



CREATE TABLE "BLADE_SHIFT_REST_TIME"
(
    "ID" NUMBER (20) NOT NULL,
    "MODEL_ID" NUMBER (20),
    "REST_INDEX" NUMBER (11),
    "SHIFT_ID" NUMBER (20),
    "REST_START_TIME" NUMBER (11),
    "REST_END_TIME" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_SHIFT_REST_TIME"."MODEL_ID" IS '模型Id';
COMMENT
ON COLUMN "BLADE_SHIFT_REST_TIME"."REST_INDEX" IS '休息时段序号';
COMMENT
ON COLUMN "BLADE_SHIFT_REST_TIME"."SHIFT_ID" IS '班次Id';
COMMENT
ON COLUMN "BLADE_SHIFT_REST_TIME"."REST_START_TIME" IS '休息时段开始时间的偏移量(以当日0点为基准的偏移量的分钟数）';
COMMENT
ON COLUMN "BLADE_SHIFT_REST_TIME"."REST_END_TIME" IS '休息时段结束时间的偏移量(以当日0点为基准的偏移量的分钟数）';

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


CREATE TABLE "BLADE_STOCK_IN_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."CODE" IS '入库类型编码';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."NAME" IS '入库类型名称';
COMMENT
ON COLUMN "BLADE_STOCK_IN_TYPE"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_STOCK_IN_TYPE" IS '入库类型';

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



CREATE TABLE "BLADE_STOCK_OUT_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."CODE" IS '出库类型编码';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."NAME" IS '出库类型名称';
COMMENT
ON COLUMN "BLADE_STOCK_OUT_TYPE"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_STOCK_OUT_TYPE" IS '出库类型';

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



CREATE TABLE "BLADE_SUPPLIER"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "ADDRESS" NVARCHAR2(128),
    "TEL" NVARCHAR2(64)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_SUPPLIER"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."CODE" IS '供应商编码';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."NAME" IS '供应商名称';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."ADDRESS" IS '供应商地址';
COMMENT
ON COLUMN "BLADE_SUPPLIER"."TEL" IS '联系方式';
COMMENT
ON TABLE "BLADE_SUPPLIER" IS '供应商';

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

-- ----------------------------
-- Indexes structure for table BLADE_SUPPLIER
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843190UniqueCode"
    ON "BLADE_SUPPLIER" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );

CREATE TABLE "BLADE_TOOL"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "TOOL_CATEGORY_ID" NUMBER (20, 0),
    "TOOL_MODEL_ID" NUMBER (20, 0),
    "TOOL_PREFIX_CODE" NVARCHAR2(45),
    "LIFE_COUNT_METHOD" NUMBER (11, 0),
    "INITIAL_LIFE" NUMBER (11, 0),
    "USED_LIFE" NUMBER (11, 0),
    "REMAIN_LIFE" NUMBER (11, 0),
    "WARNING_VALUE" NUMBER (11, 0),
    "LIFE_STATE" NUMBER (11, 0),
    "USE_STATE" NUMBER (11, 0),
    "WORKSTATION_ID" NUMBER (20, 0),
    "WORKSTATION_CODE" NVARCHAR2(45),
    "WORKSTATION_NAME" NVARCHAR2(45),
    "TOOL_POSITION" NUMBER (11, 0),
    "PARAMETER1" NVARCHAR2(45),
    "PARAMETER2" NVARCHAR2(45),
    "PARAMETER3" NVARCHAR2(45),
    "PARAMETER4" NVARCHAR2(45),
    "PARAMETER5" NVARCHAR2(45),
    "PARAMETER6" NVARCHAR2(45),
    "PARAMETER7" NVARCHAR2(45),
    "PARAMETER8" NVARCHAR2(45),
    "PARAMETER9" NVARCHAR2(45),
    "PARAMETER10" NVARCHAR2(45),
    "CODE" NVARCHAR2(255)
) 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_TOOL"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_TOOL"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_TOOL"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_TOOL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TOOL"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TOOL"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TOOL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TOOL"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_TOOL"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_TOOL"."TOOL_CATEGORY_ID" IS '刀具类型ID';
COMMENT
ON COLUMN "BLADE_TOOL"."TOOL_MODEL_ID" IS '刀具型号ID';
COMMENT
ON COLUMN "BLADE_TOOL"."TOOL_PREFIX_CODE" IS '刀具前缀编号';
COMMENT
ON COLUMN "BLADE_TOOL"."LIFE_COUNT_METHOD" IS '寿命计数方式(1.按次数 2.按时间)';
COMMENT
ON COLUMN "BLADE_TOOL"."INITIAL_LIFE" IS '初始寿命';
COMMENT
ON COLUMN "BLADE_TOOL"."USED_LIFE" IS '已用寿命';
COMMENT
ON COLUMN "BLADE_TOOL"."REMAIN_LIFE" IS '剩余寿命';
COMMENT
ON COLUMN "BLADE_TOOL"."WARNING_VALUE" IS '预警值';
COMMENT
ON COLUMN "BLADE_TOOL"."LIFE_STATE" IS '寿命状态(1.正常 2.警告 3.报警)';
COMMENT
ON COLUMN "BLADE_TOOL"."USE_STATE" IS '使用状态(2.新增 1.已装刀 0.已卸刀)';
COMMENT
ON COLUMN "BLADE_TOOL"."WORKSTATION_ID" IS '工位ID';
COMMENT
ON COLUMN "BLADE_TOOL"."WORKSTATION_CODE" IS '工位编号';
COMMENT
ON COLUMN "BLADE_TOOL"."WORKSTATION_NAME" IS '工位名称';
COMMENT
ON COLUMN "BLADE_TOOL"."TOOL_POSITION" IS '机床刀位';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER1" IS '参数1';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER2" IS '参数2';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER3" IS '参数3';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER4" IS '参数4';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER5" IS '参数5';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER6" IS '参数6';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER7" IS '参数7';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER8" IS '参数8';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER9" IS '参数9';
COMMENT
ON COLUMN "BLADE_TOOL"."PARAMETER10" IS '参数10';
COMMENT
ON COLUMN "BLADE_TOOL"."CODE" IS '刀具编号';
COMMENT
ON TABLE "BLADE_TOOL" IS '刀具管理';

-- ----------------------------
-- Primary Key structure for table BLADE_TOOL
-- ----------------------------
ALTER TABLE "BLADE_TOOL"
    ADD CONSTRAINT "SYS_C0049449" PRIMARY KEY ("ID");

CREATE TABLE "BLADE_TOOL_CATEGORY"
(
    "ID" NUMBER (19, 0) NOT NULL,
    "STATUS" NUMBER (10, 0),
    "IS_DELETED" NUMBER (19, 0) DEFAULT 0,
    "CREATE_USER" NUMBER (19, 0),
    "CREATE_DEPT" NUMBER (19, 0),
    "CREATE_TIME" TIMESTAMP(6),
    "UPDATE_USER" NUMBER (19, 0),
    "UPDATE_TIME" TIMESTAMP(6),
    "TENANT_ID" NVARCHAR2(12) DEFAULT '000000',
    "PARENT_ID" NUMBER (19, 0) DEFAULT 0,
    "NAME" NVARCHAR2(45),
    "SORT" NUMBER (10, 0),
    "TOOL_PREFIX_CODE" NVARCHAR2(45),
    "CODE_LENGTH" VARCHAR2 (45 BYTE)
) 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_TOOL_CATEGORY"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."IS_DELETED" IS '删除状态：0-未删除';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."PARENT_ID" IS '父主键';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."NAME" IS '组名';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."SORT" IS '顺序';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."TOOL_PREFIX_CODE" IS '编码规则前缀';
COMMENT
ON COLUMN "BLADE_TOOL_CATEGORY"."CODE_LENGTH" IS '编码长度';
COMMENT
ON TABLE "BLADE_TOOL_CATEGORY" IS '刀具类型';

-- ----------------------------
-- Primary Key structure for table BLADE_TOOL_CATEGORY
-- ----------------------------
ALTER TABLE "BLADE_TOOL_CATEGORY"
    ADD CONSTRAINT "SYS_C0049450" PRIMARY KEY ("ID");

CREATE TABLE "BLADE_TOOL_MODEL"
(
    "ID" NUMBER (19, 0) NOT NULL,
    "STATUS" NUMBER (10, 0),
    "IS_DELETED" NUMBER (19, 0) DEFAULT 0,
    "CREATE_USER" NUMBER (19, 0),
    "CREATE_DEPT" NUMBER (19, 0),
    "CREATE_TIME" TIMESTAMP(6),
    "UPDATE_USER" NUMBER (19, 0),
    "UPDATE_TIME" TIMESTAMP(6),
    "TENANT_ID" NVARCHAR2(12) DEFAULT '000000',
    "TOOL_CATEGORY_ID" NUMBER (19, 0),
    "TOOL_PREFIX_CODE" NVARCHAR2(45),
    "LIFE_COUNT_METHOD" NUMBER (10, 0),
    "INITIAL_LIFE" NUMBER (10, 0),
    "WARNING_VALUE" NUMBER (10, 0),
    "PARAMETER1" NVARCHAR2(255),
    "PARAMETER2" NVARCHAR2(255),
    "PARAMETER3" NVARCHAR2(255),
    "PARAMETER4" NVARCHAR2(255),
    "PARAMETER5" NVARCHAR2(255),
    "PARAMETER6" NVARCHAR2(255),
    "PARAMETER7" NVARCHAR2(255),
    "PARAMETER8" NVARCHAR2(255),
    "PARAMETER9" NVARCHAR2(255),
    "PARAMETER10" NVARCHAR2(255),
    "MODEL" NVARCHAR2(255)
) 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_TOOL_MODEL"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."TOOL_CATEGORY_ID" IS '刀具类型ID';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."TOOL_PREFIX_CODE" IS '刀具前缀编号';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."LIFE_COUNT_METHOD" IS '寿命计数方式(1.按次数 2.按时间)';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."INITIAL_LIFE" IS '初始寿命';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."WARNING_VALUE" IS '预警值';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER1" IS '参数1';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER2" IS '参数2';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER3" IS '参数3';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER4" IS '参数4';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER5" IS '参数5';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER6" IS '参数6';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER7" IS '参数7';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER8" IS '参数8';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER9" IS '参数9';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."PARAMETER10" IS '参数10';
COMMENT
ON COLUMN "BLADE_TOOL_MODEL"."MODEL" IS '刀具型号';
COMMENT
ON TABLE "BLADE_TOOL_MODEL" IS '刀具型号';

-- ----------------------------
-- Primary Key structure for table BLADE_TOOL_MODEL
-- ----------------------------
ALTER TABLE "BLADE_TOOL_MODEL"
    ADD CONSTRAINT "SYS_C0049451" PRIMARY KEY ("ID");

CREATE TABLE "BLADE_WORKSTATION"
(
    "ID" NUMBER (20, 0) NOT NULL ENABLE,
    "TENANT_ID" NVARCHAR2(6),
    "CODE" NVARCHAR2(128) NOT NULL ENABLE,
    "NAME" NVARCHAR2(32) NOT NULL ENABLE,
    "AVATAR" NVARCHAR2(1000),
    "TYPE" NUMBER (11, 0) DEFAULT 1 NOT NULL ENABLE,
    "CALENDAR_CODE" NVARCHAR2(128) DEFAULT '#default#' NOT NULL ENABLE,
    "STANDARD_EFFICIENCY" NUMBER,
    "PRODUCTION_CAPACITY_GROUP" NUMBER (20, 0),
    "CALENDAR_CODE_WAITING" NVARCHAR2(32),
    "STATUS" NUMBER (11, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "SUPPORT_CNC_RW" NUMBER (4, 0),
    "DEVICE_TYPE" NUMBER (11, 0),
    "PROPERTIES" NUMBER (11, 0),
    "TRANSMISSION_METHOD" NUMBER (11, 0) DEFAULT 1,
    CONSTRAINT "1655780312PrimaryId" PRIMARY KEY ("ID")
        USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING
        TABLESPACE "USERS" ENABLE,
    CONSTRAINT "SYS_C0023781" CHECK ("ID" IS NOT NULL) ENABLE,
    CONSTRAINT "SYS_C0023782" CHECK ("CODE" IS NOT NULL) ENABLE,
    CONSTRAINT "SYS_C0023783" CHECK ("NAME" IS NOT NULL) ENABLE,
    CONSTRAINT "SYS_C0023784" CHECK ("TYPE" IS NOT NULL) ENABLE,
    CONSTRAINT "SYS_C0023785" CHECK ("CALENDAR_CODE" IS NOT NULL) ENABLE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;

COMMENT
ON TABLE BLADE_WORKSTATION IS '工位';
COMMENT
ON COLUMN BLADE_WORKSTATION.avatar IS '头像';
COMMENT
ON COLUMN BLADE_WORKSTATION.calendar_code IS '生产日历';
COMMENT
ON COLUMN BLADE_WORKSTATION.calendar_code_waiting IS '生产日历等待更新';
COMMENT
ON COLUMN BLADE_WORKSTATION.code IS '工位编号';
COMMENT
ON COLUMN BLADE_WORKSTATION.create_dept IS '创建单位';
COMMENT
ON COLUMN BLADE_WORKSTATION.create_time IS '创建时间';
COMMENT
ON COLUMN BLADE_WORKSTATION.create_user IS '创建人';
COMMENT
ON COLUMN BLADE_WORKSTATION.name IS '工位名称';
COMMENT
ON COLUMN BLADE_WORKSTATION.production_capacity_group IS '产能组';
COMMENT
ON COLUMN BLADE_WORKSTATION.standard_efficiency IS '标准效率';
COMMENT
ON COLUMN BLADE_WORKSTATION.status IS '业务状态';
COMMENT
ON COLUMN BLADE_WORKSTATION.tenant_id IS '所属租户';
COMMENT
ON COLUMN BLADE_WORKSTATION.type IS '工位类型：机器、人, 来自字典 workstation_type';
COMMENT
ON COLUMN BLADE_WORKSTATION.update_time IS '更新时间';
COMMENT
ON COLUMN BLADE_WORKSTATION.update_user IS '更新人';
COMMENT
ON COLUMN BLADE_WORKSTATION.support_cnc_rw IS '是否支持文件写入(1 支持 0 不支持)';
COMMENT
ON COLUMN BLADE_WORKSTATION.device_type IS '加工设备类型';
COMMENT
ON COLUMN BLADE_WORKSTATION.properties IS '加工属性';
COMMENT
ON COLUMN BLADE_WORKSTATION.transmission_method IS '程序传输方式：1 FTP 2 串口';

CREATE UNIQUE INDEX "1654843203UniqueCode" ON "BLADE_WORKSTATION" ("IS_DELETED", "CODE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING
    STORAGE ( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS"
;

CREATE INDEX "INDEX1657856130000" ON "BLADE_WORKSTATION" ("CALENDAR_CODE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING
    STORAGE ( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS";



CREATE TABLE "BLADE_WORKSTATION_OF_MACHINE"
(
    "ID" NUMBER (20) NOT NULL,
    "WORKSTATION_ID" NUMBER (20) NOT NULL,
    "MACHINE_ID" NUMBER (20) NOT NULL
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON TABLE "BLADE_WORKSTATION_OF_MACHINE" IS '机器工位';

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


CREATE TABLE "WS_OF_WORKSTATION_GROUP"
(
    "ID" NUMBER (20) NOT NULL,
    "WORKSTATION_ID" NUMBER (20) NOT NULL,
    "WORKSTATION_GROUP_ID" NUMBER (20) NOT NULL
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON TABLE "WS_OF_WORKSTATION_GROUP" IS '工位-工位组对应表';

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



CREATE TABLE "BLADE_WORKSTATION_WCS"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12),
    "WORKSTATION_ID" NUMBER (20),
    "DATA_ITEM" NVARCHAR2(255),
    "DATA_TYPE" NUMBER (11),
    "DMP_VARIABLES_ID" NUMBER (20),
    "STATUS" NUMBER (11),
    "COLLECT_ITEM" NVARCHAR2(255),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "IS_DELETED" NUMBER (11),
    "DATA_ITEM_CRC" NVARCHAR2(8),
    "COLLECT_SETTING_ITEM" NVARCHAR2(255),
    "BIG_SCREEN" NUMBER (4) DEFAULT 1,
    "REAL_TIME_DATA" NUMBER (4) DEFAULT 1,
    "PROCESS_PARAMETER" NUMBER (4) DEFAULT 1
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."ID" IS '主键id';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."WORKSTATION_ID" IS '工位id';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."DATA_ITEM" IS '工位变量名称';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."DATA_TYPE" IS '采集用途';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."DMP_VARIABLES_ID" IS '采集项id';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."DATA_ITEM_CRC" IS '校验值';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."COLLECT_SETTING_ITEM" IS '采集项';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."BIG_SCREEN" IS '大屏';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."REAL_TIME_DATA" IS '实时数据';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WCS"."PROCESS_PARAMETER" IS '过程参数';
COMMENT
ON TABLE "BLADE_WORKSTATION_WCS" IS '工况参数';

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

CREATE TABLE "BLADE_GALLERY"
(
    "ID" NUMBER (20) NOT NULL,
    "NAME" NVARCHAR2(64),
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_GALLERY"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_GALLERY"."NAME" IS '图库名称';
COMMENT
ON COLUMN "BLADE_GALLERY"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_GALLERY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_GALLERY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_GALLERY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_GALLERY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_GALLERY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_GALLERY" IS '图库';

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



CREATE TABLE "BLADE_GALLERY_ITEM"
(
    "ID" NUMBER (20) NOT NULL,
    "GALLERY_ID" NUMBER (20),
    "NAME" NVARCHAR2(64),
    "ORIGINAL_NAME" NVARCHAR2(500),
    "THUMBNAIL" NCLOB,
    "LINK" NVARCHAR2(1000),
    "EXTENSION" NVARCHAR2(12),
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."GALLERY_ID" IS '图库类别ID';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."NAME" IS '名称';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."ORIGINAL_NAME" IS '文件原名';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."THUMBNAIL" IS '缩略图，base64存储';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."LINK" IS '文件地址';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."EXTENSION" IS '附件拓展名';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."STATUS" IS '数据状态，1启用/0停用';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_GALLERY_ITEM"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_GALLERY_ITEM" IS '图库';

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



CREATE TABLE "BLADE_CHECK_ITEM"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CHECK_PROJECT_ID" NUMBER (20),
    "NAME" NVARCHAR2(64),
    "VALUE_TYPE" NVARCHAR2(64),
    "REQUIREMENT" NVARCHAR2(255),
    "STANDARD_VALUE" NVARCHAR2(64)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."CHECK_PROJECT_ID" IS '点检项目Id';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."NAME" IS '点检项';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."VALUE_TYPE" IS '数值类型';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."REQUIREMENT" IS '点检要求';
COMMENT
ON COLUMN "BLADE_CHECK_ITEM"."STANDARD_VALUE" IS '标准数值';
COMMENT
ON TABLE "BLADE_CHECK_ITEM" IS '点检项';

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



CREATE TABLE "BLADE_CHECK_PROJECT"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(128),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."CODE" IS '点检项目编码';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."NAME" IS '点检项目名称';
COMMENT
ON COLUMN "BLADE_CHECK_PROJECT"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_CHECK_PROJECT" IS '点检项目信息';

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


-- ----------------------------
-- Indexes structure for table BLADE_CHECK_PROJECT
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843158UniqueCode"
    ON "BLADE_CHECK_PROJECT" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


CREATE TABLE "BLADE_MACHINE"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12),
    "EXTEND_ID" NVARCHAR2(36),
    "MACHINE_CODE" NVARCHAR2(64) NOT NULL,
    "MACHINE_NAME" NVARCHAR2(64) NOT NULL,
    "COLLECT_SWITCH" NUMBER (4) DEFAULT 0 NOT NULL,
    "COLLECT_DRIVER" NVARCHAR2(64),
    "TYPE_NAME" NVARCHAR2(64),
    "MACHINE_TYPE" NVARCHAR2(64),
    "MACHINE_MODEL" NVARCHAR2(64),
    "MACHINE_LIFE_STATUS" NUMBER (4),
    "MACHINE_USE_STATUS" NUMBER (4),
    "FACTORY_NO" NVARCHAR2(64),
    "ASSETS_CODE" NVARCHAR2(64),
    "BRAND" NVARCHAR2(64),
    "NAMEPLATE" NVARCHAR2(64),
    "AVATAR" NVARCHAR2(1000),
    "SERIAL_NO" NVARCHAR2(32),
    "FACTORY_FILE" NVARCHAR2(64),
    "MANUFACTURER" NVARCHAR2(64),
    "COUNTRY_OF_MANUFACTURE" NVARCHAR2(64),
    "SYSTEM_NAME" NVARCHAR2(32),
    "SOFTWARE_VERSION" NVARCHAR2(32),
    "NET_WEIGHT" NUMBER,
    "POWER" NUMBER,
    "VOLTAGE" NUMBER,
    "DIMENSIONS" NVARCHAR2(64),
    "PRODUCTION_TIME"           DATE,
    "DELIVERY_TIME"             DATE,
    "DEPRECIATION_YEAR" NUMBER (11),
    "TURN_TO_FIXED_ASSETS_TIME" DATE,
    "INVOICE_VALUE" NUMBER,
    "OVFA" NUMBER,
    "NET_ASSET_VALUE" NUMBER,
    "ORGANIZATION" NUMBER (20),
    "CUSTODIAN" NUMBER (20),
    "MANAGEMENT_CLASS" NUMBER (4),
    "ELABORATE_EQUIPMENT" NUMBER (4),
    "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),
    "PIN_CODE" NVARCHAR2(6),
    "SHORT_CODE" NVARCHAR2(12),
    "LAST_REPAIR_TIME"          DATE,
    "EMPLOYEE_ID" NUMBER (20),
    "PRODUCTION_LINE" NVARCHAR2(255),
    "ORGANIZATION_ID" NUMBER (20),
    "REMARK" NVARCHAR2(255),
    "MACHINE_TYPE_ID" NUMBER (20),
    "GROUP_ID" NUMBER (20),
    "LAST_MAINTAIN_TIME"        DATE,
    "NEXT_MAINTAIN_TIME"        DATE,
    "LAST_CHECK_TIME"           DATE,
    "INSTALLATION_LOCATION" NVARCHAR2(64),
    "MAINTENANCE_TIME"          DATE,
    "REPAIR_STATUS" NUMBER (4),
    "MAINTENANCE_STATUS" NUMBER (4),
    "EXTERNAL_KEY" NVARCHAR2(128)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MACHINE"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_MACHINE"."EXTEND_ID" IS '扩展id';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_CODE" IS '机器编号';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_NAME" IS '机器名称';
COMMENT
ON COLUMN "BLADE_MACHINE"."COLLECT_SWITCH" IS '采集开关：0关/1开';
COMMENT
ON COLUMN "BLADE_MACHINE"."COLLECT_DRIVER" IS '采集驱动';
COMMENT
ON COLUMN "BLADE_MACHINE"."TYPE_NAME" IS '设备类型';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_TYPE" IS '设备类型';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_MODEL" IS '机器规格';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_LIFE_STATUS" IS '生命状态 字典 machine_life_status';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_USE_STATUS" IS '使用状态 字典 machine_use_status';
COMMENT
ON COLUMN "BLADE_MACHINE"."FACTORY_NO" IS '出厂编号';
COMMENT
ON COLUMN "BLADE_MACHINE"."ASSETS_CODE" IS '资产编号';
COMMENT
ON COLUMN "BLADE_MACHINE"."BRAND" IS '品牌';
COMMENT
ON COLUMN "BLADE_MACHINE"."NAMEPLATE" IS '铭牌';
COMMENT
ON COLUMN "BLADE_MACHINE"."AVATAR" IS '头像';
COMMENT
ON COLUMN "BLADE_MACHINE"."SERIAL_NO" IS '序列号';
COMMENT
ON COLUMN "BLADE_MACHINE"."FACTORY_FILE" IS '出厂档案';
COMMENT
ON COLUMN "BLADE_MACHINE"."MANUFACTURER" IS '制造厂商';
COMMENT
ON COLUMN "BLADE_MACHINE"."COUNTRY_OF_MANUFACTURE" IS '产地国别';
COMMENT
ON COLUMN "BLADE_MACHINE"."SYSTEM_NAME" IS '系统名称';
COMMENT
ON COLUMN "BLADE_MACHINE"."SOFTWARE_VERSION" IS '软件版本';
COMMENT
ON COLUMN "BLADE_MACHINE"."NET_WEIGHT" IS '净重kg';
COMMENT
ON COLUMN "BLADE_MACHINE"."POWER" IS '功率kw';
COMMENT
ON COLUMN "BLADE_MACHINE"."VOLTAGE" IS '电压v';
COMMENT
ON COLUMN "BLADE_MACHINE"."DIMENSIONS" IS '轮廓尺寸(CM)';
COMMENT
ON COLUMN "BLADE_MACHINE"."PRODUCTION_TIME" IS '生产日期';
COMMENT
ON COLUMN "BLADE_MACHINE"."DELIVERY_TIME" IS '交付日期';
COMMENT
ON COLUMN "BLADE_MACHINE"."DEPRECIATION_YEAR" IS '折旧年限';
COMMENT
ON COLUMN "BLADE_MACHINE"."TURN_TO_FIXED_ASSETS_TIME" IS '转固日期';
COMMENT
ON COLUMN "BLADE_MACHINE"."INVOICE_VALUE" IS '发票金额';
COMMENT
ON COLUMN "BLADE_MACHINE"."OVFA" IS '资产原值';
COMMENT
ON COLUMN "BLADE_MACHINE"."NET_ASSET_VALUE" IS '资产净值';
COMMENT
ON COLUMN "BLADE_MACHINE"."ORGANIZATION" IS '使用部门';
COMMENT
ON COLUMN "BLADE_MACHINE"."CUSTODIAN" IS '保管人';
COMMENT
ON COLUMN "BLADE_MACHINE"."MANAGEMENT_CLASS" IS '管理等级，字典 machine_management_class';
COMMENT
ON COLUMN "BLADE_MACHINE"."ELABORATE_EQUIPMENT" IS '是否是特种设备，1是/0否';
COMMENT
ON COLUMN "BLADE_MACHINE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MACHINE"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "BLADE_MACHINE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MACHINE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MACHINE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_MACHINE"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_MACHINE"."PIN_CODE" IS 'PIN码';
COMMENT
ON COLUMN "BLADE_MACHINE"."SHORT_CODE" IS '短编码';
COMMENT
ON COLUMN "BLADE_MACHINE"."LAST_REPAIR_TIME" IS '维修日期';
COMMENT
ON COLUMN "BLADE_MACHINE"."EMPLOYEE_ID" IS '责任人';
COMMENT
ON COLUMN "BLADE_MACHINE"."PRODUCTION_LINE" IS '生产线';
COMMENT
ON COLUMN "BLADE_MACHINE"."ORGANIZATION_ID" IS '使用部门';
COMMENT
ON COLUMN "BLADE_MACHINE"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_MACHINE"."MACHINE_TYPE_ID" IS '机器类型id';
COMMENT
ON COLUMN "BLADE_MACHINE"."GROUP_ID" IS '所属机器组id';
COMMENT
ON COLUMN "BLADE_MACHINE"."LAST_MAINTAIN_TIME" IS '最后保养时间';
COMMENT
ON COLUMN "BLADE_MACHINE"."NEXT_MAINTAIN_TIME" IS '下次保养时间';
COMMENT
ON COLUMN "BLADE_MACHINE"."LAST_CHECK_TIME" IS '最后点检时间';
COMMENT
ON COLUMN "BLADE_MACHINE"."INSTALLATION_LOCATION" IS '安装位置';
COMMENT
ON COLUMN "BLADE_MACHINE"."MAINTENANCE_TIME" IS '保养日期';
COMMENT
ON COLUMN "BLADE_MACHINE"."REPAIR_STATUS" IS '维修状态';
COMMENT
ON COLUMN "BLADE_MACHINE"."MAINTENANCE_STATUS" IS '保养状态';
COMMENT
ON COLUMN "BLADE_MACHINE"."EXTERNAL_KEY" IS '设备外部标识（用户可更改，用于标识该设备,唯一标识，可使用该Key进行检索设备）';
COMMENT
ON TABLE "BLADE_MACHINE" IS '机器';

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


-- ----------------------------
-- Indexes structure for table BLADE_MACHINE
-- ----------------------------
CREATE
    INDEX "1654843163NormalEmployee_id"
    ON "BLADE_MACHINE" ("EMPLOYEE_ID" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_SHIFT_OFF_DAY"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11) DEFAULT 0,
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME"   DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME"   DATE,
    "START_OFF_DAY" DATE,
    "END_OFF_DAY"   DATE,
    "REMARK" NVARCHAR2(255),
    "YEAR" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."START_OFF_DAY" IS '休息日-开始';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."END_OFF_DAY" IS '休息日-结束';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."REMARK" IS '备注/说明';
COMMENT
ON COLUMN "BLADE_SHIFT_OFF_DAY"."YEAR" IS '年份';
COMMENT
ON TABLE "BLADE_SHIFT_OFF_DAY" IS '班次休息日';

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



CREATE TABLE "BLADE_FIXTURE"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "CODE" NVARCHAR2(128) NOT NULL,
    "NAME" NVARCHAR2(32) NOT NULL,
    "FIXTURE_STATUS" NUMBER (11),
    "DESCRIPTION" NVARCHAR2(255),
    "AVATAR" NVARCHAR2(255),
    "IN_USE" NUMBER (4) DEFAULT 0,
    "STATUS" NUMBER (11),
    "CREATE_DEPT" NUMBER (20),
    "IS_DELETED" NUMBER (11),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_FIXTURE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_FIXTURE"."CODE" IS '夹具编号';
COMMENT
ON COLUMN "BLADE_FIXTURE"."NAME" IS '夹具名称';
COMMENT
ON COLUMN "BLADE_FIXTURE"."FIXTURE_STATUS" IS '夹具状态';
COMMENT
ON COLUMN "BLADE_FIXTURE"."DESCRIPTION" IS '描述';
COMMENT
ON COLUMN "BLADE_FIXTURE"."AVATAR" IS '图像';
COMMENT
ON COLUMN "BLADE_FIXTURE"."IN_USE" IS '是否在使用';
COMMENT
ON COLUMN "BLADE_FIXTURE"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_FIXTURE"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "BLADE_FIXTURE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FIXTURE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FIXTURE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FIXTURE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FIXTURE"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_FIXTURE" IS '工装夹具';

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


-- ----------------------------
-- Indexes structure for table BLADE_FIXTURE
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843162UniqueCode"
    ON "BLADE_FIXTURE" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


CREATE TABLE "BLADE_WAREHOUSE_AREA"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "PARENT_ID" NUMBER (20) NOT NULL,
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CODE" NVARCHAR2(32),
    "NAME" NVARCHAR2(64),
    "REMARK" NVARCHAR2(255)
) 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_WAREHOUSE_AREA"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."PARENT_ID" IS '父级id';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."CODE" IS '库区编码';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."NAME" IS '库区名称';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_AREA"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_WAREHOUSE_AREA" IS '库区';

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


-- ----------------------------
-- Indexes structure for table BLADE_WAREHOUSE_AREA
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843198UniqueCode"
    ON "BLADE_WAREHOUSE_AREA" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    );


-- ----------------------------
-- Table structure for blade_warehouse_area_of_material_type
-- ----------------------------
CREATE TABLE "WH_AREA_OF_MATERIAL_TYPE"
(
    "ID" NUMBER (20) NOT NULL,
    "WAREHOUSE_AREA_ID" NUMBER (20),
    "MATERIAL_TYPE_ID" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "WH_AREA_OF_MATERIAL_TYPE"."ID" IS '主键';
COMMENT
ON COLUMN "WH_AREA_OF_MATERIAL_TYPE"."WAREHOUSE_AREA_ID" IS '库区id';
COMMENT
ON COLUMN "WH_AREA_OF_MATERIAL_TYPE"."MATERIAL_TYPE_ID" IS '物料类型id';
COMMENT
ON TABLE "WH_AREA_OF_MATERIAL_TYPE" IS '库区物料类型连接表';

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



CREATE TABLE "BLADE_CODE"
(
    "ID" NUMBER (20) NOT NULL,
    "DATASOURCE_ID" NUMBER (20),
    "SERVICE_NAME" NVARCHAR2(64),
    "CODE_NAME" NVARCHAR2(64),
    "TABLE_NAME" NVARCHAR2(64),
    "TABLE_PREFIX" NVARCHAR2(64),
    "PK_NAME" NVARCHAR2(32),
    "PACKAGE_NAME" NVARCHAR2(500),
    "BASE_MODE" NUMBER (11),
    "WRAP_MODE" NUMBER (11),
    "API_PATH" NCLOB,
    "WEB_PATH" NCLOB,
    "IS_DELETED" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_CODE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_CODE"."DATASOURCE_ID" IS '数据源主键';
COMMENT
ON COLUMN "BLADE_CODE"."SERVICE_NAME" IS '服务名称';
COMMENT
ON COLUMN "BLADE_CODE"."CODE_NAME" IS '模块名称';
COMMENT
ON COLUMN "BLADE_CODE"."TABLE_NAME" IS '表名';
COMMENT
ON COLUMN "BLADE_CODE"."TABLE_PREFIX" IS '表前缀';
COMMENT
ON COLUMN "BLADE_CODE"."PK_NAME" IS '主键名';
COMMENT
ON COLUMN "BLADE_CODE"."PACKAGE_NAME" IS '后端包名';
COMMENT
ON COLUMN "BLADE_CODE"."BASE_MODE" IS '基础业务模式';
COMMENT
ON COLUMN "BLADE_CODE"."WRAP_MODE" IS '包装器模式';
COMMENT
ON COLUMN "BLADE_CODE"."API_PATH" IS '后端路径';
COMMENT
ON COLUMN "BLADE_CODE"."WEB_PATH" IS '前端路径';
COMMENT
ON TABLE "BLADE_CODE" IS '代码生成表';
-- ----------------------------
-- Primary Key structure for table BLADE_CODE
-- ----------------------------
ALTER TABLE "BLADE_CODE"
    ADD CONSTRAINT "1655780186PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "DEVICE_TYPE_CHECK_PROJECT"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "DEVICE_TYPE_ID" NUMBER (20),
    "CHECK_PROJECT_ID" NUMBER (20),
    "INTERVAL_TIME" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."ID" IS '主键';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."STATUS" IS '状态';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."DEVICE_TYPE_ID" IS '设备类型id';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."CHECK_PROJECT_ID" IS '点检项目id';
COMMENT
ON COLUMN "DEVICE_TYPE_CHECK_PROJECT"."INTERVAL_TIME" IS '点检周期';
COMMENT
ON TABLE "DEVICE_TYPE_CHECK_PROJECT" IS '设备类型点检记录';

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


CREATE TABLE "BLADE_WAREHOUSE_GRID"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "STATION_ID" NUMBER (20) NOT NULL,
    "CODE" NVARCHAR2(32),
    "NAME" NVARCHAR2(32),
    "STATUS" NUMBER (11),
    "CREATE_DEPT" NUMBER (20),
    "IS_DELETED" NUMBER (11),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."ID" IS 'id';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."STATION_ID" IS '库位id';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."CODE" IS '货格编号';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."NAME" IS '货格名称';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_GRID"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_WAREHOUSE_GRID" IS '库区货格';

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


-- ----------------------------
-- Indexes structure for table BLADE_WAREHOUSE_GRID
-- ----------------------------
CREATE
    INDEX "1654843199NormalStation_id"
    ON "BLADE_WAREHOUSE_GRID" ("STATION_ID" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );
CREATE
    UNIQUE INDEX "1654843200UniqueCode"
    ON "BLADE_WAREHOUSE_GRID" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_WAREHOUSE_STATION"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "AREA_ID" NUMBER (20) NOT NULL,
    "WAREHOUSE_CODE" NVARCHAR2(32),
    "WAREHOUSE_NAME" NVARCHAR2(32),
    "STATUS" NUMBER (11),
    "CREATE_DEPT" NUMBER (20),
    "IS_DELETED" NUMBER (11),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "REMARK" NVARCHAR2(255),
    "AVATAR" NVARCHAR2(1000)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."ID" IS 'id';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."AREA_ID" IS '库区id';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."WAREHOUSE_CODE" IS '库位编号';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."WAREHOUSE_NAME" IS '库位名称';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_WAREHOUSE_STATION"."AVATAR" IS '头像';
COMMENT
ON TABLE "BLADE_WAREHOUSE_STATION" IS '库区库位';

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



-- ----------------------------
-- Indexes structure for table BLADE_WAREHOUSE_STATION
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843201UniqueWarehouse_code"
    ON "BLADE_WAREHOUSE_STATION" ("WAREHOUSE_CODE" ASC, "IS_DELETED" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );
CREATE
    UNIQUE INDEX "1654843202UniqueWarehouse_name"
    ON "BLADE_WAREHOUSE_STATION" ("WAREHOUSE_NAME" ASC, "IS_DELETED" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


CREATE TABLE "BLADE_TRAY"
(
    "ID" NUMBER (20) NOT NULL,
    "CODE" NVARCHAR2(255),
    "NAME" NVARCHAR2(255),
    "PICTURE" NVARCHAR2(255),
    "TRAY_STATUS" NUMBER (4) DEFAULT 1,
    "DESCRIPTION" NVARCHAR2(255),
    "IN_USE" NUMBER (4) DEFAULT 0,
    "CATEGORY" NUMBER (4),
    "STANDARD_MODEL" NVARCHAR2(255),
    "AVAILABILITY" NUMBER (4),
    "REMARK" NVARCHAR2(255),
    "STATUS" NUMBER (4) DEFAULT 1,
    "IS_DELETED" NUMBER (20),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_TRAY"."CODE" IS '编码';
COMMENT
ON COLUMN "BLADE_TRAY"."NAME" IS '名称';
COMMENT
ON COLUMN "BLADE_TRAY"."PICTURE" IS '图片';
COMMENT
ON COLUMN "BLADE_TRAY"."TRAY_STATUS" IS '托盘状态 1 - 空载 0 - 负载';
COMMENT
ON COLUMN "BLADE_TRAY"."DESCRIPTION" IS '托盘描述';
COMMENT
ON COLUMN "BLADE_TRAY"."IN_USE" IS '是否使用 默认为1';
COMMENT
ON COLUMN "BLADE_TRAY"."CATEGORY" IS '托盘类别';
COMMENT
ON COLUMN "BLADE_TRAY"."STANDARD_MODEL" IS '规格';
COMMENT
ON COLUMN "BLADE_TRAY"."AVAILABILITY" IS '可用状态 1-激活 0-冻结';
COMMENT
ON COLUMN "BLADE_TRAY"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_TRAY"."STATUS" IS '业务状态 1激活 0 冻结';
COMMENT
ON COLUMN "BLADE_TRAY"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_TRAY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TRAY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TRAY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TRAY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TRAY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_TRAY" IS '托盘';

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


-- ----------------------------
-- Indexes structure for table BLADE_TRAY
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843196UniqueCode"
    ON "BLADE_TRAY" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


-- 托盘面-托盘
CREATE TABLE "BLADE_TRAY_SURFACE"
(
    "ID" NUMBER (20) NOT NULL,
    "TRAY_ID" NUMBER (20),
    "NAME" NVARCHAR2(255),
    "CODE" NVARCHAR2(255),
    "PROGRAM_CODE" NVARCHAR2(255),
    "IN_USE" NUMBER (4) DEFAULT 0,
    "STATUS" NUMBER (4) DEFAULT 1,
    "IS_DELETED" NUMBER (20),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."TRAY_ID" IS '托盘id';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."NAME" IS '托盘面名称';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."CODE" IS '托盘面编号';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."PROGRAM_CODE" IS '偏移程序编号';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."IN_USE" IS '是否使用 默认为1';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."STATUS" IS '业务状态 1激活 0 冻结';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TRAY_SURFACE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_TRAY_SURFACE" IS '托盘面';

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


-- ----------------------------
-- Indexes structure for table BLADE_TRAY_SURFACE
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843197UniqueCode"
    ON "BLADE_TRAY_SURFACE" ("IS_DELETED" ASC, "CODE" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


-- 托盘面-夹具
CREATE TABLE "BLADE_TRAY_FIXTURE"
(
    "ID" NUMBER (20) NOT NULL,
    "TRAY_ID" NUMBER (20),
    "FACE_ID" NUMBER (20),
    "FIX_ID" NUMBER (20),
    "STATUS" NUMBER (4) DEFAULT 1,
    "IS_DELETED" NUMBER (20),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."TRAY_ID" IS '托盘id';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."FACE_ID" IS '托盘面id';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."FIX_ID" IS '夹具id';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."STATUS" IS '业务状态 1激活 0 冻结';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TRAY_FIXTURE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_TRAY_FIXTURE" IS '托盘面-夹具';
-- ----------------------------
-- Primary Key structure for table BLADE_TRAY_FIXTURE
-- ----------------------------
ALTER TABLE "BLADE_TRAY_FIXTURE"
    ADD CONSTRAINT "1655780289PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "BLADE_WORKSTATION_WORKBENCH"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (11),
    "CREATE_USER" NVARCHAR2(255),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "WORKSTATION_ID" NUMBER (20),
    "SORT" NUMBER (11),
    "NAME" NVARCHAR2(128),
    "WORKBENCH_DEFAULT" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."IS_DELETED" IS '删除';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."TENANT_ID" IS '租户';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."WORKSTATION_ID" IS '工位id';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."SORT" IS '排序';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."NAME" IS '工作台名称';
COMMENT
ON COLUMN "BLADE_WORKSTATION_WORKBENCH"."WORKBENCH_DEFAULT" IS '是否为默认工作台：是：1   否：0';
COMMENT
ON TABLE "BLADE_WORKSTATION_WORKBENCH" IS '工作台';

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


-- 工装附件
CREATE TABLE "BLADE_TOOL_APPENDIX"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "PARENT_ID" NUMBER (20),
    "FILE_LENGTH" NUMBER (20),
    "FILE_NAME" NVARCHAR2(255),
    "OBJECT_KEY" NVARCHAR2(255),
    "FILE_LINK" NVARCHAR2(255),
    "CONTENT_TYPE" NVARCHAR2(255),
    "STATUS" NUMBER (11),
    "CREATE_DEPT" NUMBER (20),
    "IS_DELETED" NUMBER (11),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."PARENT_ID" IS '父id';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."FILE_LENGTH" IS '文件大小';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."FILE_NAME" IS '文件名称';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."OBJECT_KEY" IS '文件key';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."FILE_LINK" IS '文件链接';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."CONTENT_TYPE" IS '文件mini类型';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TOOL_APPENDIX"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_TOOL_APPENDIX" IS '附件文件';

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


-- ----------------------------
-- Indexes structure for table BLADE_TOOL_APPENDIX
-- ----------------------------
CREATE
    UNIQUE INDEX "1654843192UniqueId"
    ON "BLADE_TOOL_APPENDIX" ("IS_DELETED" ASC, "ID" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );



CREATE TABLE "BLADE_TRAY_STORAGE"
(
    "ID" NUMBER (20) NOT NULL,
    "TRAY_ID" NUMBER (20),
    "WAREHOUSE_STATION_ID" NUMBER (20),
    "STATUS" NUMBER (4) DEFAULT 1,
    "IS_DELETED" NUMBER (20),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."TRAY_ID" IS '托盘id';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."WAREHOUSE_STATION_ID" IS '库位id';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."STATUS" IS '业务状态 1激活 0 冻结';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_TRAY_STORAGE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_TRAY_STORAGE" IS '托盘存放';

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



CREATE TABLE "PROD_CRAFT_VERSION"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "NAME" NVARCHAR2(32) NOT NULL,
    "DESCRIPTION" NVARCHAR2(255),
    "CRAFT_ID" NUMBER (20),
    "EDITION_STATUS" NUMBER (11) DEFAULT 0,
    "STATUS" NUMBER (11),
    "CREATE_DEPT" NUMBER (20),
    "IS_DELETED" NUMBER (20),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."NAME" IS '版本名称';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."DESCRIPTION" IS '版本描述';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."CRAFT_ID" IS '产品ID';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."EDITION_STATUS" IS '是否定版(0:否 1:是)';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."CREATE_DEPT" IS '创建单位';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "PROD_CRAFT_VERSION"."UPDATE_USER" IS '更新人';
COMMENT
ON TABLE "PROD_CRAFT_VERSION" IS '产品工艺版本';

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



-- ----------------------------
-- Table structure for PROD_CRAFT_PROCESS_REF_TOOL
-- ----------------------------
CREATE TABLE "PROD_CRAFT_PROCESS_REF_TOOL"
(
    "ID" NUMBER (20) NOT NULL,
    "TOOL_ID" NUMBER (20),
    "VERSION_PROCESS_ID" NUMBER (20),
    "TOOL_CODE" NVARCHAR2(128),
    "TOOL_MODEL_NAME" NVARCHAR2(64),
    "TOOL_CATEGORY_NAME" NVARCHAR2(45)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_TOOL"."ID" IS '主键';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_TOOL"."TOOL_ID" IS '刀具ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_TOOL"."VERSION_PROCESS_ID" IS '产品工艺工序ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_TOOL"."TOOL_CODE" IS '刀具编号';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_TOOL"."TOOL_MODEL_NAME" IS '刀具型号名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_TOOL"."TOOL_CATEGORY_NAME" IS '刀具类型名称';
COMMENT
ON TABLE "PROD_CRAFT_PROCESS_REF_TOOL" IS '产品工艺工序关联刀具';

-- ----------------------------
-- Primary Key structure for table BLADE_TOOL_MODEL
-- ----------------------------
ALTER TABLE "PROD_CRAFT_PROCESS_REF_TOOL"
    ADD CONSTRAINT "SYS_C0049452" PRIMARY KEY ("ID");

-- ----------------------------
-- Table structure for PROD_CRAFT_PROCESS_REF_FIXTURE
-- ----------------------------
CREATE TABLE "PROD_CRAFT_PROCESS_REF_FIXTURE"
(
    "ID" NUMBER (20) NOT NULL,
    "FIXTURE_ID" NUMBER (20),
    "VERSION_PROCESS_ID" NUMBER (20),
    "FIXTURE_GROUP_NAME" NVARCHAR2(45),
    "FIXTURE_CODE" NVARCHAR2(128),
    "FIXTURE_NAME" NVARCHAR2(32)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_FIXTURE"."ID" IS '主键';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_FIXTURE"."FIXTURE_ID" IS '夹具ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_FIXTURE"."VERSION_PROCESS_ID" IS '产品工艺工序ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_FIXTURE"."FIXTURE_GROUP_NAME" IS '夹具组名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_FIXTURE"."FIXTURE_CODE" IS '夹具编号';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_REF_FIXTURE"."FIXTURE_NAME" IS '夹具名称';
COMMENT
ON TABLE "PROD_CRAFT_PROCESS_REF_FIXTURE" IS '产品工艺工序关联夹具';


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



-- ----------------------------
-- Table structure for blade_production_craft_process_file
-- ----------------------------
CREATE TABLE "PROD_CRAFT_PROCESS_FILE"
(
    "ID" NUMBER (20) NOT NULL,
    "VERSION_PROCESS_ID" NUMBER (20),
    "FILE_NAME" NVARCHAR2(100),
    "OBJECT_KEY" NVARCHAR2(100),
    "CONTENT_TYPE" NVARCHAR2(100),
    "LINK" NVARCHAR2(100),
    "FILE_SIZE" NVARCHAR2(100),
    "UPLOAD_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."VERSION_PROCESS_ID" IS '产品工艺工序ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."FILE_NAME" IS '文件名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."OBJECT_KEY" IS '文件key';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."CONTENT_TYPE" IS '文件mini类型';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."LINK" IS '文件外链';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."FILE_SIZE" IS '文件大小';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS_FILE"."UPLOAD_TIME" IS '上传时间';
COMMENT
ON TABLE "PROD_CRAFT_PROCESS_FILE" IS '产品工艺工序文件';

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



-- ----------------------------
-- Table structure for blade_production_craft_process
-- ----------------------------
CREATE TABLE "PROD_CRAFT_PROCESS"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "VERSION_ID" NUMBER (20),
    "PROCESS_ID" NUMBER (20),
    "SORT" NUMBER (11),
    "PROGRAM_NAME" NVARCHAR2(255),
    "STANDARD_TIME" NUMBER (11),
    "PREPARE_TIME" NUMBER (11) DEFAULT 0,
    "DISASSEMBLY_TIME" NUMBER (11) DEFAULT 0,
    "TRANSPORT_TIME" NUMBER (11) DEFAULT 0,
    "SOURCE_ID" NVARCHAR2(50),
    "TARGET_ID" NVARCHAR2(255),
    "X_COORDINATE" NVARCHAR2(10),
    "Y_COORDINATE" NVARCHAR2(10),
    "IS_DELETED" NUMBER (20),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "STATUS" NUMBER (11),
    "PROCESS_NAME" NVARCHAR2(32),
    "PROCESS_CODE" NVARCHAR2(128),
    "PROCESS_DESC" NVARCHAR2(255),
    "PROCESS_TYPE" NUMBER (11),
    "PROCESS_TYPE_NAME" NVARCHAR2(32),
    "PROGRAM_ID" NUMBER (20),
    "MEA_METHOD" NVARCHAR2(20),
    "MEA_METHOD_VALUE" NUMBER (20),
    "HANDLER_METHOD" NUMBER (20),
    "MAIN_SEQUENCE_ID" NUMBER (20),
    "WHETHER_TEST" NUMBER (11),
    "WHETHER_PARALLEL" NUMBER (11),
    "BAG_ID" NUMBER (20),
    "BAG_NAME" NVARCHAR2(64),
    "HEIGHT" NUMBER (11)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."ID" IS '主键';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."VERSION_ID" IS '所属工艺版本';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROCESS_ID" IS '所属生产工序';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."SORT" IS '工序顺序';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROGRAM_NAME" IS '程序名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."STANDARD_TIME" IS '标准工时（秒）';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PREPARE_TIME" IS '准备工时';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."DISASSEMBLY_TIME" IS '拆卸工时';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."TRANSPORT_TIME" IS '运输工时';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."SOURCE_ID" IS '资源ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."TARGET_ID" IS '目标ID';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."X_COORDINATE" IS 'x坐标';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."Y_COORDINATE" IS 'y坐标';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROCESS_NAME" IS '工序名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROCESS_CODE" IS '工序编号';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROCESS_NAME" IS '工序描述';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROCESS_TYPE" IS '工种';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROCESS_TYPE_NAME" IS '工种名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."PROGRAM_ID" IS '程序id';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."MEA_METHOD" IS '测量方式';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."MEA_METHOD_VALUE" IS '测量方式维护的值';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."HANDLER_METHOD" IS '不合格品处理方式';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."MAIN_SEQUENCE_ID" IS '主序id（当主序id不为空时，代表工序是子序）';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."WHETHER_TEST" IS '是否质检：默认 0 否 1 是';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."WHETHER_PARALLEL" IS '是否并行：默认 0 否 1 是';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."BAG_ID" IS '工艺包id';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."BAG_NAME" IS '工艺包名称';
COMMENT
ON COLUMN "PROD_CRAFT_PROCESS"."HEIGHT" IS '主序的高度';
COMMENT
ON TABLE "PROD_CRAFT_PROCESS" IS '工艺版本的工序流程';


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



CREATE TABLE "BLADE_MATERIAL_STORAGE"
(
    "ID" NUMBER (20) NOT NULL,
    "MATERIAL_ID" NUMBER (20),
    "WAREHOUSE_STATION_ID" NUMBER (20),
    "STATUS" NUMBER (4) DEFAULT 1,
    "IS_DELETED" NUMBER (20),
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."MATERIAL_ID" IS '物料id';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."WAREHOUSE_STATION_ID" IS '库位id';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."STATUS" IS '业务状态 1激活 0 冻结';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_MATERIAL_STORAGE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_MATERIAL_STORAGE" IS '物料存放';

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



CREATE TABLE "BLADE_BOM_MATERIAL"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (20) DEFAULT 0,
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "VERSION_ID" NUMBER (20),
    "MATERIAL_ID" NUMBER (20),
    "PARENT_ID" NUMBER (20),
    "ALL_PATH" NVARCHAR2(255),
    "REMARK" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."VERSION_ID" IS 'bom版本id';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."MATERIAL_ID" IS '物料id';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."PARENT_ID" IS '父级Id';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."ALL_PATH" IS 'allPath';
COMMENT
ON COLUMN "BLADE_BOM_MATERIAL"."REMARK" IS '备注';
COMMENT
ON TABLE "BLADE_BOM_MATERIAL" IS 'bom物料';

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



CREATE TABLE "BLADE_BOM_PROCESS"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (20) DEFAULT 0,
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "BOM_MATERIAL_ID" NUMBER (20),
    "MOLECULE" NUMBER (11),
    "DENOMINATOR" NUMBER (11),
    "PROCESS_ID" NUMBER (20),
    "LOSS" NUMBER
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."BOM_MATERIAL_ID" IS 'bom物料Id';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."MOLECULE" IS '用量分子';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."DENOMINATOR" IS '用量分母';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."PROCESS_ID" IS '用料工序id';
COMMENT
ON COLUMN "BLADE_BOM_PROCESS"."LOSS" IS '固定损耗';
COMMENT
ON TABLE "BLADE_BOM_PROCESS" IS 'bom物料工序';

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



CREATE TABLE "BLADE_BOM_VERSION"
(
    "ID" NUMBER (20) NOT NULL,
    "STATUS" NUMBER (4),
    "IS_DELETED" NUMBER (20) DEFAULT 0,
    "CREATE_USER" NUMBER (20),
    "CREATE_DEPT" NUMBER (20),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "PRODUCT_ID" NUMBER (20),
    "VERSION" NVARCHAR2(32),
    "VERSION_STATUS" NUMBER (11) DEFAULT 0,
    "CRAFT_ID" NUMBER (20),
    "CRAFT_VERSION" NVARCHAR2(32),
    "REMARK" NVARCHAR2(255),
    "DESCRIPTION" NVARCHAR2(255)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."PRODUCT_ID" IS '产品id';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."VERSION" IS '版本';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."VERSION_STATUS" IS '版本状态(0：未定版，1：已定版)';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."CRAFT_ID" IS '工艺版本id';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."CRAFT_VERSION" IS '工艺版本';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_BOM_VERSION"."DESCRIPTION" IS '版本描述';
COMMENT
ON TABLE "BLADE_BOM_VERSION" IS 'bom版本';
-- ----------------------------
-- Primary Key structure for table BLADE_BOM_VERSION
-- ----------------------------
ALTER TABLE "BLADE_BOM_VERSION"
    ADD CONSTRAINT "1655780178PrimaryId" PRIMARY KEY ("ID");



-- ----------------------------
-- Table structure for blade_craft_routing
-- ----------------------------
CREATE TABLE "BLADE_CRAFT_ROUTING"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "NAME" NVARCHAR2(48),
    "DESCRIPTION" NVARCHAR2(128),
    "PRODUCT_ID" NUMBER (20, 0)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."NAME" IS '名称';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."DESCRIPTION" IS '描述';
COMMENT
ON COLUMN "BLADE_CRAFT_ROUTING"."PRODUCT_ID" IS '产品ID';
COMMENT
ON TABLE "BLADE_CRAFT_ROUTING" IS '工艺路线';

-- ----------------------------
-- Primary Key structure for table blade_craft_routing
-- ----------------------------
ALTER TABLE "BLADE_CRAFT_ROUTING"
    ADD CONSTRAINT "SYS_C0031762" PRIMARY KEY ("ID");

-- ----------------------------
-- Indexes structure for table blade_craft_routing
-- ----------------------------
CREATE UNIQUE INDEX "1656467664UniqueCode"
    ON "BLADE_CRAFT_ROUTING" ("IS_DELETED" ASC, "NAME" ASC) LOGGING
    TABLESPACE "USERS"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );


-- ----------------------------
-- TABLE STRUCTURE FOR BLADE_CRAFT_VERSION_LINE
-- ----------------------------
CREATE TABLE "BLADE_CRAFT_VERSION_LINE"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "TENANT_ID" NVARCHAR2(12),
    "CRAFT_ID" NUMBER (20, 0),
    "VERSION_ID" NUMBER (20, 0),
    "GROUP_ID" NUMBER (20, 0)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."CRAFT_ID" IS '工艺路线ID';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."VERSION_ID" IS '工艺路线版本ID';
COMMENT
ON COLUMN "BLADE_CRAFT_VERSION_LINE"."GROUP_ID" IS '产线ID';
COMMENT
ON TABLE "BLADE_CRAFT_VERSION_LINE" IS '工艺路线版本产线表';

-- ----------------------------
-- RECORDS OF BLADE_CRAFT_VERSION_LINE
-- ----------------------------

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE BLADE_CRAFT_VERSION_LINE
-- ----------------------------
ALTER TABLE "BLADE_CRAFT_VERSION_LINE"
    ADD CONSTRAINT "SYS_C0031815" PRIMARY KEY ("ID");


CREATE TABLE "BLADE_DNC_TRANSFER_DIRECTORY"
(
    "ID" NUMBER (20) NOT NULL,
    "GROUP_ALL_PATH" NVARCHAR2(500),
    "DEPT_ID" NUMBER (20),
    "GROUP_ID" NUMBER (20),
    "NAME" NVARCHAR2(100),
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "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),
    "RESOURCE_ID" NUMBER (20),
    "WORKSTATION_ID" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."GROUP_ALL_PATH" IS '工位文件组的all_path';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."DEPT_ID" IS '职权域id';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."GROUP_ID" IS '工位文件分组Id';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."NAME" IS '工位文件名称';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."RESOURCE_ID" IS '资源id';
COMMENT
ON COLUMN "BLADE_DNC_TRANSFER_DIRECTORY"."WORKSTATION_ID" IS '工位id';
COMMENT
ON TABLE "BLADE_DNC_TRANSFER_DIRECTORY" IS '工位目录表';
-- ----------------------------
-- Primary Key structure for table BLADE_DNC_TRANSFER_DIRECTORY
-- ----------------------------
ALTER TABLE "BLADE_DNC_TRANSFER_DIRECTORY"
    ADD CONSTRAINT "1655780208PrimaryId" PRIMARY KEY ("ID");



CREATE TABLE "DNC_TRANSFER_DIR_FILE"
(
    "ID" NUMBER (20) NOT NULL,
    "TRANSFER_DIRECTORY_ID" NUMBER (20) NOT NULL,
    "FILE_SOURCE" NUMBER (4),
    "FILE_TYPE" NUMBER (11),
    "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),
    "WORKSTATION_ID" NUMBER (20) NOT NULL,
    "COVER_TIME"    DATE,
    "CRAFT_FILE_ID" NUMBER (20),
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "VERSION" NUMBER (11),
    "STORAGE_SPACE" NUMBER (11),
    "WHETHER_ARCHIVE" NUMBER (11),
    "STORAGE_SPACE_ID" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."TRANSFER_DIRECTORY_ID" IS '工位目录Id';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."FILE_SOURCE" IS '文件来源 1 我的文档 2 本地文件 3 工艺管理';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."FILE_TYPE" IS '文件类别(1:加工文件,2:工艺文件)';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."ORIGINAL_FILENAME" IS '原始文件名称';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."FILENAME" IS '文件名称';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."CONTENT_MD5" IS '文件md5值';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."LAST_MODIFIED" IS '最后修改时间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."OBJECT_KEY" IS '文件的objectKey';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."LINK" IS '文件地址';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."IS_CURRENT" IS '是否为当前版本,1是0否';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."WORKSTATION_ID" IS '工位Id';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."COVER_TIME" IS '文件时间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."CRAFT_FILE_ID" IS '文档文件id';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."VERSION" IS '版本号';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."STORAGE_SPACE" IS '存储位置：1 常规空间 2 固定空间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."WHETHER_ARCHIVE" IS '文件是否归档：1 未归档 2 已归档';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_FILE"."STORAGE_SPACE_ID" IS '固定空间目录id';
COMMENT
ON TABLE "DNC_TRANSFER_DIR_FILE" IS '工位目录文件表';

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



CREATE TABLE "DNC_TRANSFER_DIR_GROUP"
(
    "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),
    "WORKSTATION_GROUP_ID" NUMBER (20)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."ID" IS '主键';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."PARENT_ID" IS '父主键';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."NAME" IS '工位文件组名';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."ALL_PATH" IS '全路径(包含自身)';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."STATUS" IS '状态';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "DNC_TRANSFER_DIR_GROUP"."WORKSTATION_GROUP_ID" IS '工位组id';
COMMENT
ON TABLE "DNC_TRANSFER_DIR_GROUP" IS '工位组目录表';

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


CREATE TABLE "BLADE_DNC_WS_RELATION_TD"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "TENANT_ID" NVARCHAR2(12),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "STATUS" NUMBER (11, 0),
    "TRANSFER_DIRECTOR_ID" NUMBER (20, 0),
    "WORKSTATION_ID" NUMBER (20, 0)
) TABLESPACE "SYSTEM" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT;
ALTER TABLE "BLADE_DNC_WS_RELATION_TD"
    ADD CONSTRAINT "SYS_C0022336" PRIMARY KEY ("ID");
ALTER TABLE "BLADE_DNC_WS_RELATION_TD"
    ADD CONSTRAINT "SYS_C0022335" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
CREATE UNIQUE INDEX "WORKSTATION_ID"
    ON "BLADE_DNC_WS_RELATION_TD" ("IS_DELETED" ASC, "WORKSTATION_ID" ASC) LOGGING
    TABLESPACE "SYSTEM"
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
    );

CREATE TABLE "BLADE_DNC_FIXED_SPACE"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "TENANT_ID" NVARCHAR2(12),
    "PARENT_ID" NUMBER (20, 0),
    "NAME" NVARCHAR2(45),
    "ALL_PATH" NVARCHAR2(500),
    "IS_DELETED" NUMBER (11, 0),
    "STATUS" NUMBER (11, 0),
    "CREATE_TIME" DATE,
    "CREATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "TD_ID" NUMBER (20, 0),
    "SPACE_LOCATION" NUMBER (11, 0)
) TABLESPACE "SYSTEM" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT;
ALTER TABLE "BLADE_DNC_FIXED_SPACE"
    ADD CONSTRAINT "SYS_C0022338" PRIMARY KEY ("ID");
ALTER TABLE "BLADE_DNC_FIXED_SPACE"
    ADD CONSTRAINT "SYS_C0022337" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- 菜单脚本

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 ('1469141105228611586', '1503998309035220994', 'shift_calendar', '班制日历', 'shift_calendar',
        '/console/base/shift-calendar', 'iconfont iconicon_work', '2', '1', '0', '1', NULL, '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 ('1470274120439566338', '1503966666579030018', 'organization', '员工-部门-岗位', 'organization',
        '/master/person/main/index', 'iconfont iconicon_group', '1', '1', '0', '1', NULL, '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 ('1471285883018977281', '1503992936900796418', 'workstation', '工位', 'workstation', '/console/workstation/index',
        'iconfont icon-wxbgongju', '1', '1', '0', '1', NULL, '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 ('1483632111746801666', '0', 'basic_data', '主数据', 'basic_data', '/console/basic-data', 'iconfont saber-zhushuju',
        '2', '0', '0', '1', NULL, '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 ('1483642077594710017', '1503992936900796418', 'machine_data', '机器管理数据', 'machine_data',
        '/console/basic-data/tpm-data', 'iconfont icon-rizhi', '3', '1', '0', '1', NULL, '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 ('1485491717025140738', '1503992936900796418', 'machine_ledger', '机器台账', 'machine_ledger',
        '/tpm/machine-management', 'iconfont iconicon_airplay', '2', '1', '0', '1', NULL, '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 ('1493759281711730689', '1504027069390331905', 'supplier', '供应商', 'supplier',
        '/console/basic-data/supplier-info', 'iconfont iconicon_community_line', '1', '1', '0', '1', NULL, '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 ('1503195854444433409', '1504027069390331905', 'gallery', '图库', 'gallery', '/console/basic-data/gallery',
        'iconfont iconicon_namecard', '4', '1', '0', '1', NULL, '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 ('1503215833683517442', '1503998309035220994', 'day_off', '休息日', 'day_off', '/master/time/day-off/index',
        'iconfont iconicon_more', '1', '1', '0', '1', NULL, '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 ('1503546274154123265', '1504003518490812418', 'area_location', '库区库位', 'area_location',
        '/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location', 'iconfont iconicon_work',
        '3', '1', '0', '1', NULL, '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 ('1503621096733990913', '1503992936900796418', 'work_condition', '工位采集模板', 'menu',
        '/console/basic-data/working-condition/index', 'iconfont icon-liuliangyunpingtaitubiao08', '4', '1', '0', '1',
        NULL, '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 ('1503966666579030018', '1483632111746801666', 'staff', '人', 'staff', '/console/basic-data/staff',
        'iconfont iconicon_principal', '1', '1', '0', '1', NULL, '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 ('1503992936900796418', '1483632111746801666', 'machine', '机', 'machine', '/console/basic-data/machine',
        'iconfont iconicon_setting', '2', '1', '0', '1', NULL, '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 ('1503996684083601409', '1483632111746801666', 'material', '料', 'material', '/console/basic-data/material',
        'iconfont iconicon_work', '3', '1', '0', '1', NULL, '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 ('1503998309035220994', '1483632111746801666', 'production_time', '时间', 'production_time',
        '/console/basic-data/production-time', 'iconfont iconicon_send', '4', '1', '0', '1', NULL, '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 ('1504003518490812418', '1483632111746801666', 'warehouse', '仓储', 'warehouse', '/console/basic-data/warehouse',
        'iconfont iconicon_cspace', '6', '1', '0', '1', NULL, '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 ('1504027069390331905', '1483632111746801666', 'other', '其他', 'other', '/console/basic-data/other',
        'iconfont iconicon_im_keyboard', '8', '1', '0', '1', NULL, '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 ('1497086897538789377', '1503996684083601409', 'materials', '物料信息', 'materials',
        '/console/basic-data/material-warehousing-data/material-info', 'iconfont iconicon_compile', '1', '1', '0', '1',
        NULL, '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 ('1519129245830651905', '1518929460899213313', 'tray_fixture', '托盘夹具', 'tray_fixture',
        '/console/tooling/tray-fixture', 'iconfont iconicon_savememo', '1', '1', '0', '1', NULL, '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 ('1522048292781465601', '1518929460899213313', 'tray_storage', '托盘存放', 'tray_storage',
        '/master/frock/tray-deposit/index', 'iconfont iconicon_setting', '2', '1', '0', '1', NULL, '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 ('1522390934839029761', '1504025044741070849', 'processes', '工序管理', 'processes',
        '/console/basic-data/work-process', 'iconfont iconicon_send', '2', '1', '0', '1', NULL, '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 ('1504025044741070849', '1483632111746801666', 'product_process', '产品工艺', 'product_process',
        '/console/basic-data/product-process', 'iconfont iconicon_namecard', '7', '1', '0', '1', NULL, '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 ('1522823470509395969', '1504025044741070849', 'product', '产品', 'product', '/console/basic-data/product',
        'iconfont iconicon_coinpurse_line', '55', '1', '0', '1', NULL, '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 ('1523489440260923394', '1504025044741070849', 'process_route', '工艺路线', 'process_route',
        '/console/product-process/process-route', 'iconfont iconicon_exchange', '2', '1', '0', '1', NULL, '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 ('1526736219864084482', '1523489440260923394', 'cancel_fixed', '取消定版', 'cancel_fixed', NULL,
        'iconfont iconicon_safety', '1', '2', '0', '1', NULL, '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 ('1527115790989488129', '1503996684083601409', 'material_storage', '物料存放', 'material_storage',
        '/console/basic-data/material-warehousing-data/material-storage', 'iconfont iconicon_send', '4', '1', '0', '1',
        NULL, '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 ('1526031760774340609', '1504025044741070849', 'bom_list', 'BOM 清单', 'menu', '/console/bom-list/index',
        'iconfont icon-caidan', '3', '1', '0', '1', NULL, '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 ('1526040185400328193', '1504003518490812418', 'issue_receipt_type', '出入库类型', 'issue_receipt_type',
        '/console/basic-data/material-warehousing-data/Material-warehousing-data', 'iconfont iconicon_more', '4', '1',
        '0', '1', NULL, '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 ('1535168094212694017', '1526031760774340609', 'fix_version', '定版', 'fix_version', NULL, NULL, '1', '2', '0',
        '1', NULL, '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 ('1535169198577131521', '1526031760774340609', 'cancel_version', '取消定版', 'cancel_version', NULL, NULL, '2', '2',
        '0', '1', NULL, '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 ('1535242977381232642', '1526031760774340609', 'delete_version', '删除版本', 'delete_version', NULL, NULL, '3', '2',
        '0', '1', NULL, '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 ('1535243543318671362', '1526031760774340609', 'add_process', '添加工序', 'add_process', NULL, NULL, '4', '2', '0',
        '1', NULL, '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 ('1535244130533814273', '1526031760774340609', 'add_material', '添加物料', 'add_material', NULL, NULL, '5', '2', '0',
        '1', NULL, '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 ('1535246268496392194', '1526031760774340609', 'add_version', '新增版本', 'add_version', NULL, NULL, '6', '2', '0',
        '1', NULL, '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 ('1541661765077213185', '1523489440260923394', 'craft_route_create', '新建工艺路线', 'craft_route_create', NULL, NULL,
        '10', '2', '0', '1', NULL, '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 ('1541662062897963010', '1523489440260923394', 'craft_route_edit', '编辑工艺路线', 'craft_route_edit', NULL, NULL,
        '11', '2', '0', '1', NULL, '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 ('1541662253902372865', '1523489440260923394', 'craft_route_delete', '删除工艺路线', 'craft_route_delete', NULL, NULL,
        '12', '2', '0', '1', NULL, '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 ('1541668488361975810', '1522823470509395969', 'view_craft', '查看工艺路线', 'view_craft', NULL, NULL, '10', '2', '0',
        '1', NULL, '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 ('1541668794567139329', '1522823470509395969', 'view_bom', '查看bom清单', 'view_bom', NULL, NULL, '11', '2', '0',
        '1', NULL, '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 ('1541668925542670337', '1522823470509395969', 'bind_craft', '绑定工艺路线', 'bind_craft', NULL, NULL, '12', '2', '0',
        '1', NULL, '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 ('1541669017884467201', '1522823470509395969', 'unbind_craft', '解绑工艺路线', 'unbind_craft', NULL, NULL, '13', '2',
        '0', '1', NULL, '0', 'CPS', 1);

INSERT INTO "BLADE_WAREHOUSE_AREA"
VALUES ('1', '0', '0', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-04-25 10:25:51', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201',
        TO_DATE('2022-04-25 10:25:56', 'SYYYY-MM-DD HH24:MI:SS'), '000000', '所有的', '所有的', NULL);



CREATE TABLE "BLADE_DNC_ART_BAG"
(
    "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,
    "NAME" NVARCHAR2(64),
    "CODE" NVARCHAR2(64),
    "CATALOGUE_ID" NUMBER (20)
) 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"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG"."NAME" IS '工艺包名称';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG"."CODE" IS '工艺包编码';
COMMENT
ON COLUMN "BLADE_DNC_ART_BAG"."CATALOGUE_ID" IS '工艺目录id';

CREATE TABLE "BLADE_DNC_ART_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,
    "FILE_ID" NUMBER (20),
    "ART_BAG_ID" NUMBER (20),
    "SOURCE_TYPE" NUMBER (11),
    "FILE_TYPE" NUMBER (11),
    "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),
    "DOCUMENT_OWNERSHIP" NUMBER (11),
    "IS_CURRENT" NUMBER (11),
    "LINK" NVARCHAR2(500),
    "STORAGE_SPACE" 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_FILE"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."FILE_ID" IS '文件id';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."ART_BAG_ID" IS '工艺包id';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."SOURCE_TYPE" IS '文件来源 1 我的文档 2 工位文件 3 本地上传 4 归档文件';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."FILE_TYPE" IS '文件类别(1:程序,2 文档)';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."ORIGINAL_FILENAME" IS '原始文件名称';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."FILENAME" IS '文件名称';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."CONTENT_MD5" IS '文件md5值';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."CONTENT_TYPE" IS '文件类型';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."OBJECT_KEY" IS '文件的objectKey';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."SUFFIX" IS '文件后缀';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."DOCUMENT_OWNERSHIP" IS '文件归属：1 工位 2 工厂';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."IS_CURRENT" IS '是否为当前版本,1是0否';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."LINK" IS '文件链接';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."STORAGE_SPACE" IS '存储位置：1 常规空间 2 固定空间';
COMMENT
ON COLUMN "BLADE_DNC_ART_FILE"."VERSION" IS '文件版本';
COMMENT
ON TABLE "BLADE_DNC_ART_FILE" IS '工艺包文件';

CREATE TABLE "BLADE_EMPLOYEE_ON_OFF_WORK"
(
    "ID" NUMBER (19, 0) NOT NULL,
    "ONLINE_TIME"  TIMESTAMP,
    "ON_EMPLOYEE_ID" NUMBER (19, 0),
    "ON_EMPLOYEE_CODE" NVARCHAR2(128),
    "ON_EMPLOYEE_NAME" NVARCHAR2(32),
    "ON_EMPLOYEE_AVATAR" NVARCHAR2(1000),
    "WORKSTATION_ID" NUMBER (19, 0),
    "WORKSTATION_CODE" NVARCHAR2(128),
    "WORKSTATION_NAME" NVARCHAR2(32),
    "WORKSTATION_AVATAR" NVARCHAR2(1000),
    "OFFLINE_TIME" TIMESTAMP,
    "OFF_EMPLOYEE_ID" NUMBER (19, 0),
    "OFF_EMPLOYEE_CODE" NVARCHAR2(128),
    "OFF_EMPLOYEE_NAME" NVARCHAR2(32),
    "OFF_EMPLOYEE_AVATAR" NVARCHAR2(1000),
    "ONLINE_TYPE" NUMBER (3, 0) DEFAULT 0,
    "TIME_TYPE" NUMBER (3, 0) DEFAULT 0,
    "STATUS" NUMBER (3, 0) DEFAULT 1,
    "IS_DELETED" NUMBER (20, 0),
    "CREATE_USER" NUMBER (19, 0),
    "CREATE_DEPT" NUMBER (19, 0),
    "CREATE_TIME"  TIMESTAMP,
    "UPDATE_USER" NUMBER (19, 0),
    "UPDATE_TIME"  TIMESTAMP
) 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_EMPLOYEE_ON_OFF_WORK"."ONLINE_TIME" IS '上线时间';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."ON_EMPLOYEE_ID" IS '上线员工id';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."ON_EMPLOYEE_CODE" IS '上线员工编号';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."ON_EMPLOYEE_NAME" IS '上线员工名称';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."ON_EMPLOYEE_AVATAR" IS '上线员工头像';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."WORKSTATION_ID" IS '工位id';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."WORKSTATION_CODE" IS '工位编号';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."WORKSTATION_NAME" IS '工位名称';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."WORKSTATION_AVATAR" IS '工位名称头像';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."OFFLINE_TIME" IS '下线时间';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."OFF_EMPLOYEE_ID" IS '下线员工id';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."OFF_EMPLOYEE_CODE" IS '下线员工编号';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."OFF_EMPLOYEE_NAME" IS '下线员工名称';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."OFF_EMPLOYEE_AVATAR" IS '下线员工头像';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."ONLINE_TYPE" IS '上下线类型 0-上线 1-下线';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."TIME_TYPE" IS '按时间/班次上下线 0-时间 1-班次';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."STATUS" IS '业务状态 1激活 0 冻结';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_EMPLOYEE_ON_OFF_WORK"."UPDATE_TIME" IS '更新时间';
COMMENT
ON TABLE "BLADE_EMPLOYEE_ON_OFF_WORK" IS '员工上下线表';


CREATE TABLE "BLADE_DNC_PROCESS_CATALOGUE"
(
    "ID" NUMBER (20) NOT NULL,
    "TENANT_ID" NVARCHAR2(12) DEFAULT 000000,
    "PARENT_ID" NUMBER (20) DEFAULT 0,
    "NAME" NVARCHAR2(64),
    "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_PROCESS_CATALOGUE"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."PARENT_ID" IS '父主键';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."NAME" IS '工艺目录名称';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."ALL_PATH" IS '全路径(包含自身)';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_DNC_PROCESS_CATALOGUE"."DEPT_ID" IS '职权域id';
COMMENT
ON TABLE "BLADE_DNC_PROCESS_CATALOGUE" IS '工艺目录表';


-- 数据标签关系表
ALTER TABLE BLADE_WORKSTATION_WCS
    ADD USAGE_ID NUMBER (20);
comment
on column BLADE_WORKSTATION_WCS.USAGE_ID is '数据标签ID';

-- 增加数据标签关系表
CREATE TABLE BLADE_WORKSTATION_WCS_USAGE
(
    ID NUMBER (20) NOT NULL ENABLE,
    COLLECT_TYPE NUMBER (11,0),
    USAGE_NAME VARCHAR2 (255),
    USAGE_CODE VARCHAR2 (50),
    PARAMETER VARCHAR2 (255),
    CREATE_TIME TIMESTAMP,
    CREATE_USER NUMBER (20),
    UPDATE_TIME TIMESTAMP,
    UPDATE_USER NUMBER (20)
) TABLESPACE "USERS" LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT;
-- 主键
ALTER TABLE "BLADE_WORKSTATION_WCS_USAGE"
    ADD PRIMARY KEY ("ID");

COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.ID IS '主键';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.COLLECT_TYPE IS '计算方法';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.USAGE_NAME IS '数据标签名称';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.USAGE_CODE IS '数据标签编号';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.PARAMETER IS '执行参数';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.CREATE_TIME IS '创建时间';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.CREATE_USER IS '创建人';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.UPDATE_TIME IS '更新时间';
COMMENT
ON COLUMN BLADE_WORKSTATION_WCS_USAGE.UPDATE_USER IS '更新人';

-- 增加数据标签初始化数据
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604657686328061954, 0, '无', '0', NULL, TO_DATE('2022-12-19 09:59:40', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604659202451517442, 1, '状态', '1', NULL, TO_DATE('2022-12-19 10:05:42', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604659243140460545, 2, '产量', '2', NULL, TO_DATE('2022-12-19 10:05:51', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604659295900610562, 3, '报警', '3', NULL, TO_DATE('2022-12-19 10:06:04', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604659380000600066, 5, '脉冲产量', '5', NULL, TO_DATE('2022-12-19 10:06:24', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604659442676084737, 6, '报警号', '6', NULL, TO_DATE('2022-12-19 10:06:39', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);
INSERT INTO "BLADE_WORKSTATION_WCS_USAGE" ("ID", "COLLECT_TYPE", "USAGE_NAME", "USAGE_CODE", "PARAMETER", "CREATE_TIME",
                                           "CREATE_USER", "UPDATE_TIME", "UPDATE_USER")
VALUES (1604659517745737729, 7, '报警信息', '7', NULL, TO_DATE('2022-12-19 10:06:57', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL,
        NULL);

--修改字典名称
INSERT INTO "BLADE_DICT" ("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED",
                          "IS_DELETED")
VALUES (1600787418029592578, 1473111864757952513, 'WORKSTATION_PARAM_TYPE', '8', '差值计算', 10, '', 0, 0);
INSERT INTO "BLADE_DICT" ("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED",
                          "IS_DELETED")
VALUES (1600787468336074754, 1473111864757952513, 'WORKSTATION_PARAM_TYPE', '9', '脉冲计算', 11, '', 0, 0);
-- 数据标签增加大屏接口
INSERT INTO BLADE_INTERFACE_CONFIG (ID, STATUS, IS_DELETED, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER,
                                    UPDATE_TIME, URL, URL_NAME, URL_TYPE, OWNING_CHART)
VALUES (1602849539512963073, 1, 0, 1123598821738675201, 1123598813738675201, null, 1123598821738675201, null,
        '/api/blade-visual/output/usage-type', '脉冲、计数显示用途统计', 0, '3');

INSERT INTO BLADE_INTERFACE_CONFIG_FIELD (ID, STATUS, IS_DELETED, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER,
                                          UPDATE_TIME, CONFIG_ID, LABEL, NAME, IS_REQUIRED, DATA_TYPE, DATA_SOURCE,
                                          IS_SINGLE_CHOICE, CHECKED_PARENT, RELATION_FIELD, METHOD)
VALUES (1602849545779253250, 1, 0, 1123598821738675201, 1123598813738675201, null, 1123598821738675201, null,
        1602849539512963073, '数据标签', 'usageCode', 1, 2, '/api/blade-cps/workstation-wcs-usage/visual-usage-code', 1,
        NULL, NULL, 'get');
INSERT INTO BLADE_INTERFACE_CONFIG_FIELD (ID, STATUS, IS_DELETED, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER,
                                          UPDATE_TIME, CONFIG_ID, LABEL, NAME, IS_REQUIRED, DATA_TYPE, DATA_SOURCE,
                                          IS_SINGLE_CHOICE, CHECKED_PARENT, RELATION_FIELD, METHOD)
VALUES (1602853136015396866, 1, 0, 1123598821738675201, 1123598813738675201, null, 1123598821738675201, null,
        1602849539512963073, '工位列表', 'workStationIdList', 1, 4, '/api/blade-visual/data-source/workstation', 0, NULL,
        NULL, 'get');
INSERT INTO BLADE_INTERFACE_CONFIG_FIELD (ID, STATUS, IS_DELETED, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER,
                                          UPDATE_TIME, CONFIG_ID, LABEL, NAME, IS_REQUIRED, DATA_TYPE, DATA_SOURCE,
                                          IS_SINGLE_CHOICE, CHECKED_PARENT, RELATION_FIELD, METHOD)
VALUES (1602853344312922113, 1, 0, 1123598821738675201, 1123598813738675201, null, 1123598821738675201, null,
        1602849539512963073, '查询策略', 'policy', 1, 2, '/api/blade-cps/workstation-wcs-usage/visual-usage-policy', 1,
        NULL, NULL, 'get');
INSERT INTO BLADE_INTERFACE_CONFIG_FIELD (ID, STATUS, IS_DELETED, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER,
                                          UPDATE_TIME, CONFIG_ID, LABEL, NAME, IS_REQUIRED, DATA_TYPE, DATA_SOURCE,
                                          IS_SINGLE_CHOICE, CHECKED_PARENT, RELATION_FIELD, METHOD)
VALUES (1602853823713480706, 1, 0, 1123598821738675201, 1123598813738675201, null, 1123598821738675201, null,
        1602849539512963073, '近n小时/天', 'timeLevel', 0, 2, '/api/blade-visual/data-source/time-level', 1, NULL, NULL,
        'get');
-- 接口权限
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 (1605015416735895553, 1510094368595181569, 'visual_output.get_count_pulse_output', '设备 脉冲 计数 相关数据标签统计',
        '/blade-visual/output/usage-type', NULL, NULL, 'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-12-20 09:41:10', '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 (1605015071330766850, 1475761204784312321, 'workstation_wcs_usage.list', '获取所有数据数据标签数据',
        '/blade-cps/workstation-wcs-usage/list', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-12-20 09:41:10', '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 (1605015071339155458, 1475761204784312321, 'workstation_wcs_usage.params_config', '获取计算方式的参数配置',
        '/blade-cps/workstation-wcs-usage/params-config/*', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-12-20 09:41:10', '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 (1605015071347544065, 1475761204784312321, 'workstation_wcs_usage.remove', '删除数据标签',
        '/blade-cps/workstation-wcs-usage', NULL, NULL, 'DELETE', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-12-20 09:41:10', '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 (1605015071355932674, 1475761204784312321, 'workstation_wcs_usage.save', '保存数据标签',
        '/blade-cps/workstation-wcs-usage', NULL, NULL, 'PUT', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-12-20 09:41:10', '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 (1605015071368515585, 1475761204784312321, 'workstation_wcs_usage.update', '更新数据标签',
        '/blade-cps/workstation-wcs-usage', NULL, NULL, 'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-12-20 09:41:10', 'SYYYY-MM-DD HH24:MI:SS'), 1, 0);

CREATE TABLE "BLADE_FMS_REAL_TIME_TRAY"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "TENANT_ID" NVARCHAR2(6),
    "TRAY_CODE" NVARCHAR2(128),
    "FIXTURE_ID" NUMBER (20, 0),
    "CURRENT_POSITION" NVARCHAR2(128),
    "CURRENT_STATION" NVARCHAR2(128),
    "CURRENT_TYPE" NUMBER (11),
    "TARGET_POSITION" NVARCHAR2(128),
    "TARGET_STATION" NVARCHAR2(128),
    "TRAY_STATE" NUMBER (11, 0),
    "SCHE_STATE" NUMBER (11, 0),
    "ARRIVE_TIME"             DATE,
    "STATUS" NUMBER (11, 0),
    "ORDER_ID" NUMBER (20, 0),
    "ORDER_CODE" NVARCHAR2(128),
    "ORDER_PROCESS_ID" NUMBER (20, 0),
    "PROCESS_CODE" NVARCHAR2(128),
    "PROGRAM_NO" NVARCHAR2(128),
    "PROGRAM_OFFSET" NVARCHAR2(128),
    "WILL_ORDER_ID" NUMBER (20, 0),
    "WILL_ORDER_CODE" NVARCHAR2(128),
    "WILL_ORDER_PROCESS_ID" NUMBER (20, 0),
    "WILL_PROCESS_CODE" NVARCHAR2(128),
    "WILL_PROGRAM_NO" NVARCHAR2(128),
    "WILL_PROGRAM_OFFSET" NVARCHAR2(128),
    "PART_TYPE" NUMBER (4, 0),
    "PART_TYPE_TIME"          DATE,
    "COMPONENTS_NUMBER" NUMBER (20, 0),
    "LAST_LOAD_COMPLETE_TIME" DATE,
    "LAST_CNC_COMPLETE_TIME"  DATE,
    "IS_DELETED" NUMBER (11, 0),
    "CREATE_TIME"             DATE,
    "CREATE_USER" NUMBER (20, 0),
    "UPDATE_TIME"             DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "IS_FIRST_EMPTY_RETURN" NUMBER (11, 0)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."TRAY_CODE" IS '托盘号';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."FIXTURE_ID" IS '夹具id';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."CURRENT_POSITION" IS '当前位置';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."CURRENT_STATION" IS '当前工作台 1,2';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."CURRENT_TYPE" IS '当前位置类型 1-库位,2-位置';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."TARGET_POSITION" IS '目标位置';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."TARGET_STATION" IS '目标工作台 1,2';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."TRAY_STATE" IS '1-满托,2-空托';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."SCHE_STATE" IS '调度状态 1-将要去,2-到达';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."ARRIVE_TIME" IS '到达时间 异常不更新';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."STATUS" IS '业务状态';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."ORDER_ID" IS '工单ID';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."ORDER_CODE" IS '工单号';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."ORDER_PROCESS_ID" IS '工单工序ID';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."PROCESS_CODE" IS '工序号';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."PROGRAM_NO" IS '程序号';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."PROGRAM_OFFSET" IS '程序偏移';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."WILL_ORDER_ID" IS '将要去的工单ID';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."WILL_ORDER_CODE" IS '将要去的工单';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."WILL_ORDER_PROCESS_ID" IS '将要去的工单工序ID';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."WILL_PROCESS_CODE" IS '将要去的工序';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."WILL_PROGRAM_NO" IS '将要去的程序号';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."WILL_PROGRAM_OFFSET" IS '将要去的程序偏移';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."PART_TYPE" IS '产品状态 1-待加工,2-加工中,3-加工完成,4-半成品,5-不合格品';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."PART_TYPE_TIME" IS '状态改变时间';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."COMPONENTS_NUMBER" IS '当前工件号';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."LAST_LOAD_COMPLETE_TIME" IS '上一次装料完成时间';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."LAST_CNC_COMPLETE_TIME" IS '上一次加工完成时间';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."IS_DELETED" IS '删除标记：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_FMS_REAL_TIME_TRAY"."IS_FIRST_EMPTY_RETURN" IS '是否首序空托返回';
COMMENT
ON TABLE "BLADE_FMS_REAL_TIME_TRAY" IS '托盘实时数据';

CREATE TABLE "BLADE_ANDON_RECORD" (
                                      "ID" NUMBER(20,0) VISIBLE NOT NULL,
                                      "STATUS" NUMBER(4,0) VISIBLE,
                                      "IS_DELETED" NUMBER(11,0) VISIBLE,
                                      "CREATE_USER" NUMBER(20,0) VISIBLE,
                                      "CREATE_DEPT" NUMBER(20,0) VISIBLE,
                                      "CREATE_TIME" DATE VISIBLE,
                                      "UPDATE_USER" NUMBER(20,0) VISIBLE,
                                      "UPDATE_TIME" DATE VISIBLE,
                                      "TYPE_ID" NUMBER(20,0) VISIBLE,
                                      "TYPE_CODE" NVARCHAR2(64) VISIBLE,
                                      "TYPE_NAME" NVARCHAR2(64) VISIBLE,
                                      "REASON_ID" NUMBER(20,0) VISIBLE,
                                      "REASON_CODE" NVARCHAR2(64) VISIBLE,
                                      "REASON_NAME" NVARCHAR2(64) VISIBLE,
                                      "WORKSTATION_ID" NUMBER(20,0) VISIBLE,
                                      "WORKSTATION_NAME" NVARCHAR2(64) VISIBLE,
                                      "WORKSTATION_CODE" NVARCHAR2(64) VISIBLE,
                                      "CALL_EMP_ID" NUMBER(20,0) VISIBLE,
                                      "CALL_EMP_CODE" NVARCHAR2(64) VISIBLE,
                                      "CALL_EMP_NAME" NVARCHAR2(64) VISIBLE,
                                      "HAND_EMP_ID" NUMBER(20,0) VISIBLE,
                                      "HAND_EMP_CODE" NVARCHAR2(64) VISIBLE,
                                      "HAND_EMP_NAME" NVARCHAR2(64) VISIBLE,
                                      "COMPLETE_EMP_ID" NUMBER(20,0) VISIBLE,
                                      "COMPLETE_EMP_CODE" NVARCHAR2(64) VISIBLE,
                                      "COMPLETE_EMP_NAME" NVARCHAR2(64) VISIBLE,
                                      "CALL_TIME" DATE VISIBLE,
                                      "RESPONSE_TIME" DATE VISIBLE,
                                      "END_TIME" DATE VISIBLE,
                                      "REMARK" NVARCHAR2(140) VISIBLE,
                                      "CUR_STATUS" NUMBER(4,0) VISIBLE,
                                      "SHIFT_INDEX" NUMBER(4,0) VISIBLE,
                                      "INDEX_NAME" NVARCHAR2(32) VISIBLE
)
    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_ANDON_RECORD"."ID" IS '主键';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."STATUS" IS '状态';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CREATE_DEPT" IS '创建部门';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."UPDATE_USER" IS '更新人';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."TYPE_ID" IS '安灯类型id';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."TYPE_CODE" IS '安灯类型编号';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."TYPE_NAME" IS '安灯类型名称';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."REASON_ID" IS '安灯原因id';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."REASON_CODE" IS '安灯原因编号';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."REASON_NAME" IS '安灯原因名称';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."WORKSTATION_ID" IS '工位id';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."WORKSTATION_NAME" IS '工位名称';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."WORKSTATION_CODE" IS '工位编号';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CALL_EMP_ID" IS '呼叫人员id';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CALL_EMP_CODE" IS '呼叫人员编号';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CALL_EMP_NAME" IS '呼叫人员名称';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."HAND_EMP_ID" IS '处理人员id';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."HAND_EMP_CODE" IS '处理人员编号';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."HAND_EMP_NAME" IS '处理人员名称';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."COMPLETE_EMP_ID" IS '完成人员id';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."COMPLETE_EMP_CODE" IS '完成人员编号';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."COMPLETE_EMP_NAME" IS '完成人员名称';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CALL_TIME" IS '呼叫时间(开始时间)';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."RESPONSE_TIME" IS '响应时间';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."END_TIME" IS '结束时间';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."REMARK" IS '备注';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."CUR_STATUS" IS '当前状态 0-当前无状态 1-已发起，待接收 2-已接收，待完成 3-完成';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."SHIFT_INDEX" IS '所在班次';
COMMENT ON COLUMN "BLADE_ANDON_RECORD"."INDEX_NAME" IS '班次名称';
COMMENT ON TABLE "BLADE_ANDON_RECORD" IS '安灯原因表';

-- ----------------------------
-- Primary Key structure for table BLADE_ANDON_RECORD
-- ----------------------------
ALTER TABLE "BLADE_ANDON_RECORD" ADD CONSTRAINT "SYS_C0011768" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BLADE_ANDON_RECORD
-- ----------------------------
ALTER TABLE "BLADE_ANDON_RECORD" ADD CONSTRAINT "SYS_C0011762" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;


CREATE TABLE "BLADE_DEVICE_ANDON_TYPE" (
                                           "ID" NUMBER(20,0) VISIBLE NOT NULL,
                                           "STATUS" NUMBER(4,0) VISIBLE,
                                           "IS_DELETED" NUMBER(11,0) VISIBLE,
                                           "CREATE_USER" NUMBER(20,0) VISIBLE,
                                           "CREATE_DEPT" NUMBER(20,0) VISIBLE,
                                           "CREATE_TIME" DATE VISIBLE,
                                           "UPDATE_USER" NUMBER(20,0) VISIBLE,
                                           "UPDATE_TIME" DATE VISIBLE,
                                           "ANDON_TYPE_ID" NUMBER(20,0) VISIBLE,
                                           "DEVICE_TYPE_ID" NUMBER(20,0) VISIBLE
)
    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_DEVICE_ANDON_TYPE"."ID" IS '主键';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."STATUS" IS '状态';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."CREATE_DEPT" IS '创建部门';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."UPDATE_USER" IS '更新人';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."ANDON_TYPE_ID" IS '安灯类型id';
COMMENT ON COLUMN "BLADE_DEVICE_ANDON_TYPE"."DEVICE_TYPE_ID" IS '机器类型id';
COMMENT ON TABLE "BLADE_DEVICE_ANDON_TYPE" IS '机器类型安灯类型关联表';
-- ----------------------------
-- Primary Key structure for table BLADE_DEVICE_ANDON_TYPE
-- ----------------------------
ALTER TABLE "BLADE_DEVICE_ANDON_TYPE" ADD CONSTRAINT "SYS_C0011769" PRIMARY KEY ("ID");
