CREATE TABLE "BLADE_WORKBENCH_CARD"
(
    "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),
    "WORKBENCH_ID" NUMBER(20),
    "CARD_LENGTH"  NVARCHAR2(64),
    "CARD_WIDE"    NVARCHAR2(64),
    "X_COORDINATE" NVARCHAR2(64),
    "Y_COORDINATE" NVARCHAR2(64),
    "CARD_KEY"     NVARCHAR2(64),
    "API_RESOURCE" NCLOB,
    "TEXT_CONTENT" NCLOB
) 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_WORKBENCH_CARD"."ID" IS '主键';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."STATUS" IS '状态';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."CREATE_USER" IS '创建人';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."CREATE_DEPT" IS '创建部门';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."CREATE_TIME" IS '创建时间';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."UPDATE_USER" IS '更新人';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."UPDATE_TIME" IS '更新时间';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."TENANT_ID" IS '所属租户';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."WORKBENCH_ID" IS '工作台id';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."CARD_LENGTH" IS '长';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."CARD_WIDE" IS '宽';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."X_COORDINATE" IS 'x轴坐标';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."Y_COORDINATE" IS 'y轴坐标';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."CARD_KEY" IS '卡片key';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."API_RESOURCE" IS '接口api';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_CARD"."TEXT_CONTENT" IS '文本内容';
COMMENT
    ON TABLE "BLADE_WORKBENCH_CARD" IS '工作台卡片';

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



CREATE TABLE "BLADE_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) DEFAULT 000000,
    "NAME"         NVARCHAR2(128),
    "SORT"         NUMBER(11),
    "PICTURE_LINK" NVARCHAR2(255),
    "IS_SYSTEM"    NUMBER(11)    DEFAULT 0,
    "USER_NAME"    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_WORKBENCH"."ID" IS '主键';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."STATUS" IS '状态';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."IS_DELETED" IS '删除';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."CREATE_USER" IS '创建人';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."CREATE_DEPT" IS '创建部门';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."CREATE_TIME" IS '创建时间';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."UPDATE_USER" IS '更新人';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."UPDATE_TIME" IS '更新时间';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."TENANT_ID" IS '租户';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."NAME" IS '工作台名称';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."SORT" IS '排序';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."PICTURE_LINK" IS '图片展示';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."IS_SYSTEM" IS '是否自动生成';
COMMENT
    ON COLUMN "BLADE_WORKBENCH"."USER_NAME" IS '创建人姓名';
COMMENT
    ON TABLE "BLADE_WORKBENCH" IS '工作台';

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



CREATE TABLE "BLADE_WORKBENCH_TEMPLATE_CARD"
(
    "ID"           NUMBER(20) NOT NULL,
    "WORKBENCH_ID" NUMBER(20),
    "CARD_LENGTH"  NVARCHAR2(255),
    "CARD_WIDE"    NVARCHAR2(255),
    "X_COORDINATE" NVARCHAR2(255),
    "Y_COORDINATE" NVARCHAR2(255),
    "CARD_KEY"     NVARCHAR2(255),
    "API_RESOURCE" NCLOB
) 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_WORKBENCH_TEMPLATE_CARD"."ID" IS '主键';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."WORKBENCH_ID" IS '工作台模板';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."CARD_LENGTH" IS '长';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."CARD_WIDE" IS '宽';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."X_COORDINATE" IS 'x轴坐标';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."Y_COORDINATE" IS 'y轴坐标';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."CARD_KEY" IS '卡片key';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE_CARD"."API_RESOURCE" IS '接口api';
COMMENT
    ON TABLE "BLADE_WORKBENCH_TEMPLATE_CARD" IS '工作台模板卡片';

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



CREATE TABLE "BLADE_WORKBENCH_TEMPLATE"
(
    "ID"           NUMBER(20) NOT NULL,
    "NAME"         NVARCHAR2(128),
    "SORT"         NUMBER(11),
    "PICTURE_LINK" 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_WORKBENCH_TEMPLATE"."ID" IS '主键';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE"."NAME" IS '工作台名称';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE"."SORT" IS '排序';
COMMENT
    ON COLUMN "BLADE_WORKBENCH_TEMPLATE"."PICTURE_LINK" IS '图片展示';
COMMENT
    ON TABLE "BLADE_WORKBENCH_TEMPLATE" IS '工作台模板';

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


-- 初始化数据

INSERT INTO "BLADE_WORKBENCH_TEMPLATE_CARD"
VALUES ('1507258432602804225', '1506904783898030081', '5', '3', '0', '0', 'Access', NULL);
INSERT INTO "BLADE_WORKBENCH_TEMPLATE_CARD"
VALUES ('1507258432602804226', '1506904783898030081', '5', '6', '3', '0', 'deskNotice', NULL);
INSERT INTO "BLADE_WORKBENCH_TEMPLATE_CARD"
VALUES ('1507258432602804227', '1506904783898030081', '5', '3', '9', '7', 'Entrance', NULL);
INSERT INTO "BLADE_WORKBENCH_TEMPLATE_CARD"
VALUES ('1507258432602804228', '1506904783898030081', '7', '9', '0', '5', 'Guide', NULL);
INSERT INTO "BLADE_WORKBENCH_TEMPLATE_CARD"
VALUES ('1507258432665718785', '1506904783898030081', '7', '3', '9', '0', 'Weather', NULL);

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 ('1123598815738675201', '0', 'desk', '工作台', 'desk', '/console/desk', 'iconfont saber-gongzuotai', '1', '0', '0',
        '1', NULL, '0', 'CPS', 1);

INSERT INTO "BLADE_WORKBENCH_TEMPLATE"
VALUES ('1506904783898030081', '欢迎使用', '1', NULL);

INSERT INTO "BLADE_WORKBENCH_CARD"
VALUES ('1508346412835901442', '1', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '000000', '1506904783898030081', '5', '3', '0', '0',
        'Access', NULL, NULL);
INSERT INTO "BLADE_WORKBENCH_CARD"
VALUES ('1508346412848484354', '1', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '000000', '1506904783898030081', '5', '6', '3', '0',
        'deskNotice', NULL, NULL);
INSERT INTO "BLADE_WORKBENCH_CARD"
VALUES ('1508346412852678657', '1', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '000000', '1506904783898030081', '5', '3', '9', '7',
        'Entrance', NULL, NULL);
INSERT INTO "BLADE_WORKBENCH_CARD"
VALUES ('1508346412856872961', '1', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '000000', '1506904783898030081', '7', '3', '9', '0',
        'Weather', NULL, NULL);
INSERT INTO "BLADE_WORKBENCH_CARD"
VALUES ('1508346412861067266', '1', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201',
        TO_DATE('2022-03-28 15:33:03', 'SYYYY-MM-DD HH24:MI:SS'), '000000', '1506904783898030081', '7', '9', '0', '5',
        'Guide', NULL, NULL);

INSERT INTO "BLADE_WORKBENCH"
VALUES ('1506904783898030081', '1', '0', '1123598821738675201', '1123598813738675201',
        TO_DATE('2022-03-24 16:04:32', 'SYYYY-MM-DD HH24:MI:SS'), NULL, NULL, '000000', '欢迎使用', '1', NULL, '1', '系统创建');

