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 (1584363919958806529, 0, 'FMS', '柔性线生产Fms', 'FMS', '', 'iconfont saber-shikuang', 5, 0, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                       is_deleted, belong_application, keep_alive)
VALUES (1584366536134955010, 1584363919958806529, 'cps_workorder', '工单', 'cps_workorder', '/fms/work-order/index',
        'iconfont saber-gongdan1', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                       is_deleted, belong_application, keep_alive)
VALUES (1584367046896324609, 1584363919958806529, 'fms_live', '调度实况', 'fms_live', '/fms/live/index',
        'iconfont saber-shikuang1', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                       is_deleted, belong_application, keep_alive)
VALUES (1585097946642714625, 1584363919958806529, 'production_statistics', '生产统计', 'production_statistics',
        '/fms/production-statistics/index', '', 3, 1, 0, 2, '', 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 (1585098719174791169, 1584363919958806529, 'equipment_analysis', '设备分析', 'equipment_analysis',
        '/fms/equipment-analysis/index', '', 4, 1, 0, 1, '', 0, 'CPS', 1);

-- ----------------------------
-- Primary Key structure for table BLADE_FMS_REAL_TIME_TRAY
-- ----------------------------
ALTER TABLE "BLADE_FMS_REAL_TIME_TRAY"
    ADD CONSTRAINT "SYS_C0049436" PRIMARY KEY ("ID");
-- ----------------------------
-- 工单表
-- ----------------------------
CREATE TABLE "BLADE_FMS_ORDER"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "CODE" NVARCHAR2(50),
    "ORDER_CODE" NVARCHAR2(50),
    "ORDER_TYPE" NUMBER (11, 0),
    "ORDER_STATUS" NUMBER (11, 0),
    "ASSIGN_NUM" NUMBER (11, 0),
    "PLAN_START_TIME" DATE,
    "PLAN_END_TIME"   DATE,
    "START_TIME"      DATE,
    "END_TIME"        DATE,
    "PRIORITY" NUMBER (11, 0),
    "QUALIFY_NUM" NUMBER (11, 0),
    "UNQUALIFY_NUM" NUMBER (11, 0),
    "ONLINE_NUMBER" NUMBER (11, 0),
    "OFFLINE_NUMBER" NUMBER (11, 0),
    "PRODUCT_ID" NUMBER (20, 0),
    "PRODUCT_NAME" NVARCHAR2(255),
    "CRAFT_ID" NUMBER (20, 0),
    "CRAFT_NAME" NVARCHAR2(255),
    "CRAFT_VERSION_ID" NUMBER (20, 0),
    "CRAFT_VERSION_NAME" NVARCHAR2(255),
    "TENANT_ID" NVARCHAR2(12),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME"     DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME"     DATE,
    "REMARK" NVARCHAR2(255),
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "PRODUCT_CODE" NVARCHAR2(128),
    "START_UP_TIME"   DATE
) 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_FMS_ORDER"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CODE" IS '工单编号';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."ORDER_CODE" IS '订单编号';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."ORDER_TYPE" IS '工单类型  1.来料  2.生产';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."ORDER_STATUS" IS '工单状态 待发布 0 待加工 1 加工中 2 暂停中 3 暂停 4 已完成 5';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."ASSIGN_NUM" IS '工单数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."PLAN_START_TIME" IS '开始时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."PLAN_END_TIME" IS '结束时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."START_TIME" IS '实际开始时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."END_TIME" IS '实际完成时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."PRIORITY" IS '优先级（1，2，3，4）';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."QUALIFY_NUM" IS '合格数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."UNQUALIFY_NUM" IS '不合格数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."ONLINE_NUMBER" IS '上线数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."OFFLINE_NUMBER" IS '下线数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."PRODUCT_ID" IS '产品ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."PRODUCT_NAME" IS '产品名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CRAFT_ID" IS '工艺路线ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CRAFT_NAME" IS '产品路线名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CRAFT_VERSION_ID" IS '工艺路线版本';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CRAFT_VERSION_NAME" IS '工艺路线名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."IS_DELETED" IS '删除标识';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."PRODUCT_CODE" IS '工单id';
COMMENT
ON COLUMN "BLADE_FMS_ORDER"."START_UP_TIME" IS '工单启动时间';

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


-- ----------------------------
-- 工单工序表
-- ----------------------------
CREATE TABLE "BLADE_FMS_ORDER_PROCESS"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "ORDER_ID" NUMBER (20, 0),
    "PROCESS_NAME" NVARCHAR2(50),
    "PROCESS_CODE" NVARCHAR2(50),
    "PROCESS_STATUS" NUMBER (11, 0),
    "WORK_STATION_ID" NVARCHAR2(255),
    "WORK_STATION_NAME" NVARCHAR2(255),
    "PROCESS_TYPE" NUMBER (11, 0),
    "PROCESS_TYPE_NAME" NVARCHAR2(11),
    "SORT" NUMBER (11, 0),
    "PROGRAM_ID" NUMBER (20, 0),
    "PROGRAM_NAME" NVARCHAR2(255),
    "QUALIFY_NUM" NUMBER (11, 0),
    "UNQUALIFY_NUM" NUMBER (11, 0),
    "ONLINE_NUMBER" NUMBER (11, 0),
    "OFFLINE_NUMBER" NUMBER (11, 0),
    "STANDARD_TIME" NUMBER (11, 0),
    "PREPARE_TIME" NUMBER (11, 0),
    "DISASSEMBLY_TIME" NUMBER (11, 0),
    "TRANSPORT_TIME" NUMBER (11, 0),
    "TENANT_ID" NVARCHAR2(12),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "REMARK" NVARCHAR2(255),
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "INPUT_NUM" NUMBER,
    "START_TIME"  TIMESTAMP,
    "END_TIME"    TIMESTAMP,
    "DISTRIBUTED_NUM" NUMBER,
    "PART_NUMBER" VARCHAR2 (20 BYTE),
    "CUR_TRAY_CODE" VARCHAR2 (20 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_FMS_ORDER_PROCESS"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."ORDER_ID" IS '所属工单ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROCESS_NAME" IS '工单工序名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROCESS_CODE" IS '工单工序编号';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROCESS_STATUS" IS '工单工序状态';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."WORK_STATION_ID" IS '工单派发工位ID列表';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."WORK_STATION_NAME" IS '工单派发工位名字列表';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROCESS_TYPE" IS '工序工种';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROCESS_TYPE_NAME" IS '工序工种名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."SORT" IS '顺序';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROGRAM_ID" IS '程序ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PROGRAM_NAME" IS '程序名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."QUALIFY_NUM" IS '合格数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."UNQUALIFY_NUM" IS '不合格数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."ONLINE_NUMBER" IS '上线数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."OFFLINE_NUMBER" IS '下线数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."STANDARD_TIME" IS '标准工时';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PREPARE_TIME" IS '准备工时';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."DISASSEMBLY_TIME" IS '拆卸工时';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."TRANSPORT_TIME" IS '运输工时';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."IS_DELETED" IS '删除标识';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."INPUT_NUM" IS '投产数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."START_TIME" IS '实际开始时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."END_TIME" IS '实际完成时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."DISTRIBUTED_NUM" IS '待派发数量';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."PART_NUMBER" IS '零件号';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS"."CUR_TRAY_CODE" IS '当前托盘号';

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

-- ----------------------------
-- 工单工序夹具信息表
-- ----------------------------
CREATE TABLE "FMS_ORDER_PROCESS_FIXTURE"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "ORDER_ID" NUMBER (20, 0),
    "ORDER_PROCESS_ID" NUMBER (20, 0),
    "FIXTURE_ID" NVARCHAR2(255),
    "FIXTURE_CODE" NVARCHAR2(255),
    "FIXTURE_NAME" NVARCHAR2(255),
    "TRAY_CODE" NVARCHAR2(255),
    "FIXTURE_GROUP_NAME" NVARCHAR2(255),
    "TENANT_ID" NVARCHAR2(12),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "REMARK" NVARCHAR2(255),
    "STATUS" NUMBER (11, 0),
    "IS_DELETED" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "TRAY_ID" VARCHAR2 (255 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 "FMS_ORDER_PROCESS_FIXTURE"."ID" IS '主键';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."ORDER_ID" IS '工单ID';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."ORDER_PROCESS_ID" IS '工单工序ID';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."FIXTURE_ID" IS '夹具ID';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."FIXTURE_CODE" IS '夹具编号';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."FIXTURE_NAME" IS '夹具名称';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."TRAY_CODE" IS '托盘号';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."FIXTURE_GROUP_NAME" IS '夹具组名称';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."REMARK" IS '备注';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."STATUS" IS '记录状态';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."IS_DELETED" IS '删除标识';
COMMENT
ON COLUMN "FMS_ORDER_PROCESS_FIXTURE"."TRAY_ID" IS '托盘id';

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

-- ----------------------------
-- 工单工序刀具信息表
-- ----------------------------
CREATE TABLE "BLADE_FMS_ORDER_PROCESS_TOOL"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "ORDER_PROCESS_ID" NUMBER (20, 0),
    "TOOL_ID" NVARCHAR2(255),
    "TOOL_CODE" NVARCHAR2(255),
    "TOOL_MODEL_NAME" NVARCHAR2(255),
    "TOOL_CATEGORY_NAME" NVARCHAR2(255),
    "TENANT_ID" NVARCHAR2(12),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "REMARK" NVARCHAR2(255),
    "STATUS" NUMBER (11, 0),
    "IS_DELETED" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0)
) 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_FMS_ORDER_PROCESS_TOOL"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."ORDER_PROCESS_ID" IS '工单工序ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."TOOL_ID" IS '刀具ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."TOOL_CODE" IS '刀具编号';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."TOOL_MODEL_NAME" IS '刀具型号名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."TOOL_CATEGORY_NAME" IS '刀具类型名称';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."TENANT_ID" IS '租户ID';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."STATUS" IS '记录状态';
COMMENT
ON COLUMN "BLADE_FMS_ORDER_PROCESS_TOOL"."IS_DELETED" IS '1	删除标识';

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

-- ----------------------------
-- 工单工序开报工表
-- ----------------------------
CREATE TABLE "BLADE_FMS_WORK_STATION_RECORD"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "ORDER_ID" NUMBER (20, 0),
    "ORDER_PROCESS_ID" NUMBER (20, 0),
    "WORK_STATION_ID" NUMBER (20, 0),
    "WORK_STATION_NAME" NVARCHAR2(50),
    "START_TIME"  DATE,
    "END_TIME"    DATE,
    "QUALIFY_NUM" NUMBER (11, 0),
    "UNQUALIFY_NUM" NUMBER (11, 0),
    "WORK_TIME" NUMBER (11, 0),
    "TRAY_CODE" NVARCHAR2(255),
    "PART_CODE" NVARCHAR2(255),
    "CREATE_USER" NUMBER (20, 0),
    "CREATE_TIME" DATE,
    "UPDATE_USER" NUMBER (20, 0),
    "UPDATE_TIME" DATE,
    "REMARK" NVARCHAR2(255),
    "STATUS" NUMBER (11, 0),
    "IS_DELETED" NUMBER (20, 0),
    "CREATE_DEPT" NUMBER (20, 0),
    "RECORD_STATUS" NUMBER,
    "WORK_BENCH_NUMBER" NVARCHAR2(255)
) 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_FMS_WORK_STATION_RECORD"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."ORDER_ID" IS '工单ID';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."ORDER_PROCESS_ID" IS '工单工序ID';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."WORK_STATION_ID" IS '开工工位ID';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."WORK_STATION_NAME" IS '工位名称';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."START_TIME" IS '开工时间';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."END_TIME" IS '结束时间';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."QUALIFY_NUM" IS '报工合格数量';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."UNQUALIFY_NUM" IS '报工不合格数量';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."WORK_TIME" IS '报工工时';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."TRAY_CODE" IS '托盘号';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."PART_CODE" IS '零件号';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."REMARK" IS '备注';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."STATUS" IS '记录状态';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."IS_DELETED" IS '删除标识';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."RECORD_STATUS" IS '1-加工中 2-完成';
COMMENT
ON COLUMN "BLADE_FMS_WORK_STATION_RECORD"."WORK_BENCH_NUMBER" IS '工作台编号';

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

CREATE TABLE "BLADE_FMS_ABNORMAL"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (4, 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),
    "REPORT_STATE" NUMBER (4, 0),
    "CONTENT" NCLOB,
    "TYPE" NUMBER (4, 0)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."REPORT_STATE" IS '提报状态 1-待提报,2-已取消,3-已提报';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."CONTENT" IS '内容';
COMMENT
ON COLUMN "BLADE_FMS_ABNORMAL"."TYPE" IS '异常类型';

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


CREATE TABLE "BLADE_FMS_INSTRUCTION_RECORD"
(
    "ID" NUMBER (20, 0) NOT NULL,
    "STATUS" NUMBER (4, 0),
    "IS_DELETED" NUMBER (20, 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),
    "ORDER_CODE" NVARCHAR2(64),
    "PROCESS_CODE" NVARCHAR2(64),
    "STATE" NUMBER (4, 0),
    "START_POSITION" NVARCHAR2(64),
    "START_BENCH" NVARCHAR2(64),
    "END_POSITION" NVARCHAR2(64),
    "END_BENCH" NVARCHAR2(64),
    "TRAY_CODE" NVARCHAR2(64),
    "PROGRAM_NO" NVARCHAR2(64),
    "PROGRAM_OFFSET" NVARCHAR2(64),
    "SIGNAL_STATE" NUMBER (4, 0),
    "ABNORMAL_REASON" NVARCHAR2(256),
    "LOG" NCLOB,
    "LAST_LOAD" NUMBER (4, 0),
    "CHANGE_MODEL" NUMBER (4, 0)
) TABLESPACE "USERS" LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."ID" IS '主键';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."STATUS" IS '状态';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."IS_DELETED" IS '删除状态：0-未删除，1-已删除';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."CREATE_USER" IS '创建人';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."CREATE_DEPT" IS '创建部门';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."CREATE_TIME" IS '创建时间';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."UPDATE_USER" IS '更新人';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."UPDATE_TIME" IS '更新时间';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."TENANT_ID" IS '所属租户';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."ORDER_CODE" IS '工单号';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."PROCESS_CODE" IS '工序号';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."STATE" IS '状态 0-已生成,1-执行中,2-执行完成,3-执行异常';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."START_POSITION" IS '起始位置 起始设备编号';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."START_BENCH" IS '起始工作台编号';
COMMENT
ON COLUMN "BLADE_FMS_INSTRUCTION_RECORD"."END_POSITION" IS '目标位置 目标设备编号';

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

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 (1589806703919927297, 1584366536134955010, 'fms_order_process.detail', '工单工序信息详情',
        '/blade-fms/order/process/get/*', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:27:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:27: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 (1589806703928315905, 1584366536134955010, 'fms_order_process.list', '工单工序信息列表', '/blade-fms/order/process/list',
        NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:27:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:27: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 (1589806703932510210, 1584366536134955010, 'fms_order_process.remove', '工单工序信息删除',
        '/blade-fms/order/process/remove', NULL, NULL, 'DELETE', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:27:10', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:27: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 (1589806703936704513, 1584366536134955010, 'fms_order_process.update', '工单工序信息修改',
        '/blade-fms/order/process/update', NULL, NULL, 'PUT', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:27:10', 1123598821738675201,
                TO_DATE('2022-11-08 10:27: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 (1589806703940898818, 1584366536134955010, 'fms_order_process.workstation_list', '根据工单ID获取每道工序的工位列表数据',
        '/blade-fms/order/process/workstation-list', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:27:10', 1123598821738675201,
                TO_DATE('2022-11-08 10:27: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 (1589806649947623425, 1584366536134955010, 'fms_order.count', '工单基础状态信息统计值', '/blade-fms/order/count', NULL,
        NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649951817729, 1584366536134955010, 'fms_order.detail', '工单基础状态信息详情', '/blade-fms/order/get/*', NULL,
        NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649951817730, 1584366536134955010, 'fms_order.get_fms_online', '获取柔性线当前运行状态',
        '/blade-fms/order/fms-running-status', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649951817731, 1584366536134955010, 'fms_order.get_production_craft', '根据产品ID查询工艺路线列表数据',
        '/blade-fms/order/get-production-craft/*', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649951817732, 1584366536134955010, 'fms_order.list_craft', '获取所有的工艺路线列表', '/blade-fms/order/list-craft',
        NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649951817733, 1584366536134955010, 'fms_order.order_statistics', '查看工单统计信息',
        '/blade-fms/order/statistics', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649956012033, 1584366536134955010, 'fms_order.page', '工单基础状态信息分页', '/blade-fms/order/page', NULL, NULL,
        'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649956012034, 1584366536134955010, 'fms_order.pause', '工单暂停', '/blade-fms/order/pause', NULL, NULL,
        'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649956012035, 1584366536134955010, 'fms_order.production_statistics', '查看产量统计信息',
        '/blade-fms/order/production-statistics', NULL, NULL, 'GET', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649956012036, 1584366536134955010, 'fms_order.publish', '工单发布', '/blade-fms/order/publish', NULL, NULL,
        'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649956012037, 1584366536134955010, 'fms_order.remove', '工单基础状态信息删除', '/blade-fms/order/remove', NULL,
        NULL, 'DELETE', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649956012038, 1584366536134955010, 'fms_order.save', '保存工单基础信息', '/blade-fms/order/save', NULL, NULL,
        'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649960206337, 1584366536134955010, 'fms_order.save_workstation', '保存指派工位信息',
        '/blade-fms/order/save-workstation', NULL, NULL, 'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649960206338, 1584366536134955010, 'fms_order.shut_down_order', '停止计划工单（产线）',
        '/blade-fms/order/shut-down-order', NULL, NULL, 'PUT', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649960206339, 1584366536134955010, 'fms_order.start', '工单启动', '/blade-fms/order/start', NULL, NULL,
        'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', '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 (1589806649960206340, 1584366536134955010, 'fms_order.switch_state', '手自动切换', '/blade-fms/order/switch', NULL,
        NULL, 'POST', 1123598821738675201, 1123598813738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1123598821738675201,
        TO_DATE('2022-11-08 10:26:57', 'SYYYY-MM-DD HH24:MI:SS'), 1, 0);
INSERT INTO blade_param (id, param_name, param_key, param_value, remark, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (1564441155800182785, '是否自动', 'system.automatic', 'false', NULL, NULL, NULL, '2022-08-30 10:33:32', 1123598821738675201, '2023-01-05 15:31:38', 1, 0);
