-- liquibase formatted sql

-- changeset zsh:20240904001
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_type';
CREATE TABLE sys_dict_type
(
    dict_id     INT AUTO_INCREMENT PRIMARY KEY,
    dict_name   VARCHAR(32) NOT NULL,
    dict_type   VARCHAR(32) NOT NULL,
    state       CHAR(1)     NOT NULL DEFAULT TRUE,
    description VARCHAR(32),
    create_time TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP,
    deleted     char(1)              DEFAULT 0
);
-- rollback DROP TABLE sys_dict_type;

-- changeset zsh:20240904002
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_data';
CREATE TABLE sys_dict_data
(
    dict_id         INT AUTO_INCREMENT PRIMARY KEY,
    dict_sort       INT         NOT NULL,
    dict_label      VARCHAR(32) NOT NULL,
    dict_value      VARCHAR(32) NOT NULL,
    dict_type       VARCHAR(32) NOT NULL,
    dict_type_value varchar(32),
    state           CHAR(1)     NOT NULL DEFAULT TRUE,
    description     VARCHAR(32),
    create_time     TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP,
    deleted         char(1)              DEFAULT 0
);
-- rollback DROP TABLE sys_dict_data;


-- changeset zsh:20240904003
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect');
INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
VALUES ('白玻', 'clearGlass', '1', '0', '0');
INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
VALUES ('单银', 'silver', '1', '1', '0');
INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
VALUES ('双银', 'doubleSilver', '1', '2', '0');
INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
VALUES ('三银', 'thirdSilver', '1', '3', '0');
INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
VALUES ('超白', 'ultraClear', '1', '4', '0');
INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
VALUES ('热反射', 'heatReflect', '1', '5', '0');
-- rollback DELETE FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect');

-- changeset zsh:20240904004
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_data WHERE dict_type in ('白玻', '单银', '双银');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (1, '白玻', 'clearGlass', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (2, '超白', 'ultraClear', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (3, '来料白玻', 'incomingClearGlass', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (4, '欧州茶', 'europeTeaColor', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (5, '水晶灰', 'cristalGrey', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (6, '灰玻', 'grayGlass', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (7, '灰镀膜', 'grayCoating', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (8, '磨砂', 'frosted', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (9, '福特蓝', 'fordBlue', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (10, '福特蓝镀膜', 'fordBlueCoating', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (11, '蓝星灰', 'blueAstralGrey', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (12, '蓝玻', 'blueGlass', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (13, '超白长虹', 'ultraClearChanghong', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (14, '金晶灰', 'jinjinGrey', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (15, '金晶灰茶', 'jinjinTeaGrey', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (16, '镀膜', 'coatingFilm', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (17, '长虹', 'clearGlassChanghong', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (18, '阳光膜', 'solorControl', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (19, '高反底透', 'arGlass', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (20, '高白', 'arClear', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (21, '黑玻', 'blackGlass', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (22, '玉砂', 'emery', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (23, '超白磨砂', 'ultraClearFrosted', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (24, '金茶玻', 'goldenTea', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (25, '蓝灰镀膜', 'blueGraycoatingFilm', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (26, '单项透视', 'onePoint', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (27, '超白镀膜', 'ultraClearCoatingFilm', '白玻', '0', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (1, 'F绿', 'fGreen', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (2, 'F绿lowe', 'fGreenLowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (3, 'F绿镀膜', 'fGreenCoating', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (4, 'Low-e', 'lowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (5, 'super52', 'super52', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (6, '中玻在线', 'zgOnlineGlass', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (7, '北玻60离线lowe', 'ng60OfflineLowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (8, '南玻在线lowe', 'csgOnlineLowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (9, '台玻81A', 'tg81a', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (10, '台玻lowe70', 'tgLowe70', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (11, '台玻LOWE78', 'tgLowe78', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (12, '河北金瑞lowe80', 'hbJinruiLowe80', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (13, '福特蓝lowe', 'fordBlueLowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (14, '福莱特FXB60', 'flatFxb60', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (15, '福莱特lowe60', 'flatLowe60', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (16, '福莱特lowe70', 'flatLowe70', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (17, '福莱特lowe80', 'flatLowe80', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (18, '耀皮在线LOWE', 'sypOnlineLowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (19, '超白Lowe', 'ultraClearLowe', '单银', '1', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (1, '双银lowe', 'doubleSilverLowe', '双银', '2', '1', '1', '0');
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
VALUES (2, '超白双银Lowe', 'ultraDoubleSilverLowe', '双银', '2', '1', '1', '0');
-- rollback DELETE FROM sys_dict_data WHERE dict_type in ('白玻', '单银', '双银');


-- changeset wangfei:20240918001
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_details';
CREATE TABLE raw_glass_storage_details
(
    id            bigint NOT NULL AUTO_INCREMENT,
    device_id     int NULL DEFAULT NULL COMMENT '设备id',
    slot_id       varchar(255) NULL DEFAULT NULL COMMENT '格子id',
    pattern_width double(8, 2
) NULL DEFAULT NULL COMMENT '原片宽',
    pattern_height double(8, 2) NULL DEFAULT NULL COMMENT '原片高',
    pattern_thickness double(8, 2) NULL DEFAULT NULL COMMENT '原片厚度',
    films_id varchar(255)  NULL DEFAULT NULL COMMENT '膜系',
    create_time datetime NOT NULL COMMENT '创建时间',
    remain_quantity varchar(255)  NULL DEFAULT NULL COMMENT '剩余数量',
    PRIMARY KEY (id) USING BTREE
);
-- rollback DROP TABLE raw_glass_storage_details;


-- changeset wangfei:20240918002
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_station';
CREATE TABLE raw_glass_storage_station
(
    id           bigint NOT NULL AUTO_INCREMENT,
    device_id    int NULL DEFAULT NULL COMMENT '设备id',
    slot         int NULL DEFAULT NULL COMMENT '栅格号',
    enable_state varchar(255) NULL DEFAULT NULL COMMENT '启用标记',
    start_slot   int NULL DEFAULT NULL COMMENT '开始工位',
    end_slot     int NULL DEFAULT NULL COMMENT '目标工位',
    PRIMARY KEY (id) USING BTREE
);
-- rollback DROP TABLE raw_glass_storage_station;


-- changeset wangfei:20240918003
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_task';
CREATE TABLE raw_glass_storage_task
(
    id               bigint NOT NULL AUTO_INCREMENT,
    enable_id        int NULL DEFAULT NULL COMMENT '任务ID',
    originate_slot   int NULL DEFAULT NULL COMMENT '起始格子',
    end_slot         int NULL DEFAULT NULL COMMENT '目标格子',
    pattern_quantity varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原片数量',
    enable_type      int NULL DEFAULT NULL COMMENT '任务类型',
    enable_state     int NULL DEFAULT NULL COMMENT '任务状态',
    create_time      datetime NULL DEFAULT NULL COMMENT '创建时间',
    PRIMARY KEY (id) USING BTREE
);
-- rollback DROP TABLE raw_glass_storage_task;



