wangfei
2024-11-20 0aacd330fca570ab3350aef5bda901f23aee23b3
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/changelog.sql
@@ -153,56 +153,103 @@
-- rollback DELETE FROM sys_dict_data WHERE dict_type in ('白玻', '单银', '双银');
-- changeset wangfei:20240918001
-- changeset zsh:20240918001
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_details' and table_schema = 'hangzhoumes';
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 '剩余数量',
    id                bigint    NOT NULL AUTO_INCREMENT,
    device_id         int                DEFAULT NULL COMMENT '设备id',
    slot              int                DEFAULT NULL COMMENT '格子id',
    pattern_width     double(8, 2)       DEFAULT NULL COMMENT '原片宽',
    pattern_height    double(8, 2)       DEFAULT NULL COMMENT '原片高',
    pattern_thickness double(8, 2)       DEFAULT NULL COMMENT '原片厚度',
    films_id          varchar(64)        DEFAULT NULL COMMENT '膜系',
    create_time       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    update_time       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    remain_quantity   int                DEFAULT NULL COMMENT '剩余数量',
    state             int                DEFAULT NULL COMMENT '状态',
    shelf             int                DEFAULT NULL COMMENT '架子号',
    PRIMARY KEY (id) USING BTREE
);
-- rollback DROP TABLE raw_glass_storage_details;
-- changeset wangfei:20240918002
-- changeset zsh:20240918002
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_station' and table_schema = 'hangzhoumes';
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
    id           bigint NOT NULL,
    device_id    int DEFAULT NULL COMMENT '设备id',
    slot         int DEFAULT NULL COMMENT '栅格号',
    enable_state int DEFAULT NULL COMMENT '启用标记',
    shelf        int DEFAULT NULL COMMENT '架子号'
);
-- rollback DROP TABLE raw_glass_storage_station;
-- changeset wangfei:20240918003
-- changeset zsh:20240918003
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_task' and table_schema = 'hangzhoumes';
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 '创建时间',
    id               bigint    NOT NULL AUTO_INCREMENT,
    start_slot       int                DEFAULT NULL COMMENT '起始格子',
    end_slot         int                DEFAULT NULL COMMENT '目标格子',
    pattern_quantity int                DEFAULT NULL COMMENT '原片数量',
    task_type        int                DEFAULT NULL COMMENT '任务类型',
    task_state       int                DEFAULT NULL COMMENT '任务状态',
    shelf            int                DEFAULT NULL COMMENT '架子号',
    create_time      TIMESTAMP          DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    update_time      TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (id) USING BTREE
);
-- rollback DROP TABLE raw_glass_storage_task;
-- changeset zsh:20241015001
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 SELECT count(0) FROM information_schema.columns WHERE table_schema = 'hangzhoumes' AND table_name = 'engineering' AND column_name = 'station_cell';
ALTER TABLE engineering
    ADD COLUMN station_cell int;
-- changeset zsh:20241017001
-- preconditions onFail:CONTINUE onError:CONTINUE
-- precondition-sql-check expectedResult:0 select count(1) from raw_glass_storage_station;
INSERT INTO raw_glass_storage_station (id, device_id, slot, enable_state, shelf)
VALUES (1, 1, 1, 1, 1),
       (2, 1, 2, 1, 2),
       (3, 1, 3, 1, 3),
       (4, 2, 4, 1, 4),
       (5, 2, 5, 1, 5),
       (6, 2, 6, 1, 6),
       (7, 2, 7, 1, 7),
       (8, 2, 8, 1, 8),
       (9, 2, 9, 1, 9),
       (10, 2, 10, 1, 10),
       (11, 2, 11, 1, 11),
       (12, 3, 12, 1, 12),
       (13, 3, 13, 1, 13),
       (14, 3, 14, 1, 14),
       (15, 3, 15, 1, 15),
       (16, 3, 16, 1, 16),
       (17, 3, 17, 1, 17),
       (18, 3, 18, 1, 18),
       (19, 3, 19, 1, 19),
       (20, 3, 20, 1, 20),
       (21, 3, 21, 1, 21),
       (22, 3, 22, 1, 22),
       (23, 3, 23, 1, 23),
       (24, 3, 24, 1, 24),
       (25, 3, 25, 1, 25),
       (26, 4, 98, 1, NULL),
       (27, 4, 99, 1, NULL),
       (28, 5, 101, 1, NULL),
       (29, 5, 102, 1, NULL),
       (30, 6, 103, 1, NULL),
       (31, 6, 104, 1, NULL);