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);

DROP TABLE IF EXISTS "blade_workbench";
CREATE TABLE "blade_workbench"
(
    "id"           BIGINT NOT NULL,
    "status"       TINYINT,
    "is_deleted"   INT,
    "create_user"  VARCHAR(255),
    "create_dept"  BIGINT,
    "create_time"  TIMESTAMP(0),
    "update_user"  BIGINT,
    "update_time"  TIMESTAMP(0),
    "tenant_id"    VARCHAR(12) DEFAULT '0',
    "name"         VARCHAR(128),
    "sort"         INT,
    "picture_link" VARCHAR(255),
    "is_system"    INT         DEFAULT 0,
    "user_name"    VARCHAR(255),
    NOT            CLUSTER PRIMARY KEY("id")
) STORAGE(ON "MAIN", CLUSTERBTR);

COMMENT
ON TABLE "blade_workbench" IS '工作台';
COMMENT
ON COLUMN "blade_workbench"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "blade_workbench"."create_time" IS '创建时间';
COMMENT
ON COLUMN "blade_workbench"."create_user" IS '创建人';
COMMENT
ON COLUMN "blade_workbench"."id" IS '主键';
COMMENT
ON COLUMN "blade_workbench"."is_deleted" IS '删除';
COMMENT
ON COLUMN "blade_workbench"."is_system" IS '是否自动生成';
COMMENT
ON COLUMN "blade_workbench"."name" IS '工作台名称';
COMMENT
ON COLUMN "blade_workbench"."picture_link" IS '图片展示';
COMMENT
ON COLUMN "blade_workbench"."sort" IS '排序';
COMMENT
ON COLUMN "blade_workbench"."status" IS '状态';
COMMENT
ON COLUMN "blade_workbench"."tenant_id" IS '租户';
COMMENT
ON COLUMN "blade_workbench"."update_time" IS '更新时间';
COMMENT
ON COLUMN "blade_workbench"."update_user" IS '更新人';
COMMENT
ON COLUMN "blade_workbench"."user_name" IS '创建人姓名';


DROP TABLE IF EXISTS "blade_workbench_card";
CREATE TABLE "blade_workbench_card"
(
    "id"           BIGINT NOT NULL,
    "status"       INT,
    "is_deleted"   INT,
    "create_user"  BIGINT,
    "create_dept"  BIGINT,
    "create_time"  TIMESTAMP(0),
    "update_user"  BIGINT,
    "update_time"  TIMESTAMP(0),
    "tenant_id"    VARCHAR(12),
    "workbench_id" BIGINT,
    "card_length"  VARCHAR(64),
    "card_wide"    VARCHAR(64),
    "x_coordinate" VARCHAR(64),
    "y_coordinate" VARCHAR(64),
    "card_key"     VARCHAR(64),
    "api_resource" TEXT,
    "text_content" TEXT,
    NOT            CLUSTER PRIMARY KEY("id"),
    CHECK ("status" >= 0)
) STORAGE(ON "MAIN", CLUSTERBTR);

COMMENT
ON TABLE "blade_workbench_card" IS '工作台卡片';
COMMENT
ON COLUMN "blade_workbench_card"."api_resource" IS '接口api';
COMMENT
ON COLUMN "blade_workbench_card"."card_key" IS '卡片key';
COMMENT
ON COLUMN "blade_workbench_card"."card_length" IS '长';
COMMENT
ON COLUMN "blade_workbench_card"."card_wide" 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"."create_user" IS '创建人';
COMMENT
ON COLUMN "blade_workbench_card"."id" IS '主键';
COMMENT
ON COLUMN "blade_workbench_card"."status" IS '状态';
COMMENT
ON COLUMN "blade_workbench_card"."tenant_id" IS '所属租户';
COMMENT
ON COLUMN "blade_workbench_card"."text_content" IS '文本内容';
COMMENT
ON COLUMN "blade_workbench_card"."update_time" IS '更新时间';
COMMENT
ON COLUMN "blade_workbench_card"."update_user" IS '更新人';
COMMENT
ON COLUMN "blade_workbench_card"."workbench_id" IS '工作台id';
COMMENT
ON COLUMN "blade_workbench_card"."x_coordinate" IS 'x轴坐标';
COMMENT
ON COLUMN "blade_workbench_card"."y_coordinate" IS 'y轴坐标';


DROP TABLE IF EXISTS "blade_workbench_template";
CREATE TABLE "blade_workbench_template"
(
    "id"           BIGINT NOT NULL,
    "name"         VARCHAR(128),
    "sort"         INT,
    "picture_link" VARCHAR(255),
    NOT            CLUSTER PRIMARY KEY("ID")
) STORAGE(ON "MAIN", CLUSTERBTR);

COMMENT
ON TABLE "blade_workbench_template" IS '工作台模板';
COMMENT
ON COLUMN "blade_workbench_template"."id" IS '主键';
COMMENT
ON COLUMN "blade_workbench_template"."name" IS '工作台名称';
COMMENT
ON COLUMN "blade_workbench_template"."picture_link" IS '图片展示';
COMMENT
ON COLUMN "blade_workbench_template"."sort" IS '排序';


DROP TABLE IF EXISTS "blade_workbench_template_card";
CREATE TABLE "blade_workbench_template_card"
(
    "id"           BIGINT NOT NULL,
    "workbench_id" BIGINT,
    "card_length"  VARCHAR(255),
    "card_wide"    VARCHAR(255),
    "x_coordinate" VARCHAR(255),
    "y_coordinate" VARCHAR(255),
    "card_key"     VARCHAR(255),
    "api_resource" TEXT,
    NOT            CLUSTER PRIMARY KEY("ID")
) STORAGE(ON "MAIN", CLUSTERBTR);

COMMENT
ON TABLE "blade_workbench_template_card" IS '工作台模板卡片';
COMMENT
ON COLUMN "blade_workbench_template_card"."api_resource" IS '接口api';
COMMENT
ON COLUMN "blade_workbench_template_card"."card_key" IS '卡片key';
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"."id" IS '主键';
COMMENT
ON COLUMN "blade_workbench_template_card"."workbench_id" IS '工作台模板';
COMMENT
ON COLUMN "blade_workbench_template_card"."x_coordinate" IS 'x轴坐标';
COMMENT
ON COLUMN "blade_workbench_template_card"."y_coordinate" IS 'y轴坐标';


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

INSERT INTO blade_workbench_card(id, status, is_deleted, create_user, create_dept,
                                 create_time, update_user, update_time, tenant_id,
                                 workbench_id, card_length, card_wide, x_coordinate,
                                 y_coordinate, card_key, api_resource, text_content)
VALUES (1508346412835901442, 1, 0, 1123598821738675201, 1123598813738675201, '2022-03-28 15:33:03', 1123598821738675201,
        '2022-03-28 15:33:03', '000000', 1506904783898030081, '5', '3', '0', '0', 'Access', '', ''),
       (1508346412848484354, 1, 0, 1123598821738675201, 1123598813738675201, '2022-03-28 15:33:03', 1123598821738675201,
        '2022-03-28 15:33:03', '000000', 1506904783898030081, '5', '6', '3', '0', 'deskNotice', '', ''),
       (1508346412852678657, 1, 0, 1123598821738675201, 1123598813738675201, '2022-03-28 15:33:03', 1123598821738675201,
        '2022-03-28 15:33:03', '000000', 1506904783898030081, '5', '3', '9', '7', 'Entrance', '', ''),
       (1508346412856872961, 1, 0, 1123598821738675201, 1123598813738675201, '2022-03-28 15:33:03', 1123598821738675201,
        '2022-03-28 15:33:03', '000000', 1506904783898030081, '7', '3', '9', '0', 'Weather', '', ''),
       (1508346412861067266, 1, 0, 1123598821738675201, 1123598813738675201, '2022-03-28 15:33:03', 1123598821738675201,
        '2022-03-28 15:33:03', '000000', 1506904783898030081, '7', '9', '0', '5', 'Guide', '', '');
INSERT INTO blade_workbench(id, status, is_deleted, create_user, create_dept, create_time, update_user,
                            update_time, tenant_id, name, sort, picture_link, is_system, user_name)
VALUES (1506904783898030081, 1, 0, '1123598821738675201', 1123598813738675201, '2022-03-24 16:04:32', NULL, NULL,
        '000000', '欢迎使用', 1, NULL, 1, '系统创建');

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



