CREATE TABLE `mes_approve`
(
    `id`          bigint                                                       NOT NULL AUTO_INCREMENT COMMENT 'ID',

    `title`       varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NOT NULL COMMENT '签名事项',
    `status`      tinyint                                                               DEFAULT '0' COMMENT '状态',
    `user_id`     bigint                                                                DEFAULT NULL COMMENT '用户id',
    `name`        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NOT NULL COMMENT '用户名称',

    `remark`      varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci         DEFAULT '' COMMENT '备注',
    `is_enable`   bit(1)                                                       NOT NULL DEFAULT 1 COMMENT '是否启用',
    `creator`     varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci          DEFAULT '' COMMENT '创建者',
    `create_time` datetime                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`     varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci          DEFAULT '' COMMENT '更新者',
    `update_time` datetime                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`     bit(1)                                                       NOT NULL DEFAULT 0 COMMENT '是否删除',
    `tenant_id`   bigint                                                                DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE

) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='签名记录表';

CREATE TABLE `mes_record_template`
(
    `id`                             bigint                                                       NOT NULL AUTO_INCREMENT COMMENT '组织id',
    `name`                           varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '名称',
    `organization_id`                bigint                                                       NOT NULL DEFAULT '0' COMMENT '组织id',
    `machine_id`                     bigint                                                                DEFAULT NULL COMMENT '对应机台id',
    `work_team_id`                   bigint                                                                DEFAULT NULL COMMENT '班组id',
    `start_time`                     datetime                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
    `end_time`                       datetime                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '结束时间',
    `group_manager_approve_id1`      bigint                                                                DEFAULT NULL COMMENT '组长上午审批id',
    `group_manager_approve_id2`      bigint                                                                DEFAULT NULL COMMENT '组长下午审批id',
    `production_manager_approve_id1` bigint                                                                DEFAULT NULL COMMENT '主管上午审批id',
    `production_manager_approve_id2` bigint                                                                DEFAULT NULL COMMENT '主管下午审批id',

    `process_instance_id`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci          DEFAULT NULL COMMENT '流程实例的编号',

    `status`                         tinyint                                                      NOT NULL COMMENT '状态',
    `record_type`                    tinyint                                                      NOT NULL COMMENT '记录类型（工序类型）',

    `remark`                         varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci         DEFAULT '' COMMENT '备注',
    `is_enable`                      bit(1)                                                       NOT NULL DEFAULT 1 COMMENT '是否启用',
    `creator`                        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci          DEFAULT '' COMMENT '创建者',
    `create_time`                    datetime                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`                        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci          DEFAULT '' COMMENT '更新者',
    `update_time`                    datetime                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`                        bit(1)                                                       NOT NULL DEFAULT 0 COMMENT '是否删除',
    `tenant_id`                      bigint                                                       NOT NULL DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='记录表模板';


CREATE TABLE `mes_record_dajiang`
(
    `id`                 bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',
    `start_time`         datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',

    `density`            decimal(24, 6)                                                DEFAULT NULL COMMENT '浓度%',
    `electric_current`   decimal(24, 6)                                                DEFAULT NULL COMMENT '电流A',
    `beating_degree_in`  decimal(24, 6)                                                DEFAULT NULL COMMENT '进浆叩解度︒SR',
    `beating_degree_out` decimal(24, 6)                                                DEFAULT NULL COMMENT '出浆叩解度︒SR',
    `wet_weight`         decimal(24, 6)                                                DEFAULT NULL COMMENT '湿重',
    `density5`           decimal(24, 6)                                                DEFAULT NULL COMMENT '5浆罐浓度%',
    `jiang_weight`       decimal(24, 6)                                                DEFAULT NULL COMMENT '产浆量T',

    `remark`             varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`          bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`            bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='打浆记录表';


CREATE TABLE `mes_record_suijiang`
(
    `id`                 bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '组织id',
    `start_time`         datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',
    `suijiang_time`      datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '碎浆时间',
    `suijiang_cost_time` decimal(24, 6)                                                DEFAULT NULL COMMENT '碎浆时间',

    `ratio_id`           bigint                                                        DEFAULT NULL COMMENT '原料配比id',
    `ratio`              varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '原料配比',
    `water_usage`        decimal(24, 6)                                                DEFAULT NULL COMMENT '用水量kg',
    `density_out`        decimal(24, 6)                                                DEFAULT NULL COMMENT '放浆浓度%',
    `add_item_usage`     decimal(24, 6)                                                DEFAULT NULL COMMENT '加药量kg',

    `slag_yield`         decimal(24, 6)                                                DEFAULT NULL COMMENT '出渣率%',
    `density`            decimal(24, 6)                                                DEFAULT NULL COMMENT '浓度%',

    `remark`             varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`          bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`            bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='碎浆记录表';

CREATE TABLE `mes_record_chengxing`
(
    `id`             bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`      bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',
    `start_time`     datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`       datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',

    `xijiang`        int      NOT NULL COMMENT '吸浆时间(S)',
    `tuoshui`        int      NOT NULL COMMENT '脱水时间(S)',
    `ximu`           int      NOT NULL COMMENT '洗模时间(S)',
    `product_id`     bigint   NOT NULL COMMENT '产品id',
    `appearance`     varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '产品外观',
    `product_weight` decimal(24, 6)                                                DEFAULT NULL COMMENT '湿重(g)',

    `remark`         varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`      bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`    datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`    datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`        bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`      bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='成型记录表';

CREATE TABLE `mes_record_ganzao`
(
    `id`             bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`      bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',
    `start_time`     datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`       datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',

    `speed`          int      NOT NULL COMMENT '速度(赫兹)',
    `temperature`    int      NOT NULL COMMENT '温度℃',
    `product_id`     bigint   NOT NULL COMMENT '产品id',
    `appearance`     varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '产品外观',
    `product_weight` decimal(24, 6)                                                DEFAULT NULL COMMENT '产品重量(g)',

    `remark`         varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`      bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`    datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`        varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`    datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`        bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`      bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='干燥记录表';



CREATE TABLE `mes_record_jiashi`
(
    `id`                 bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',
    `start_time`         datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',

    `machine_start_time` int      NOT NULL COMMENT '开机时间(S)',
    `machine_end_time`   int      NOT NULL COMMENT '停机时间(S)',
    `wet_time`           int      NOT NULL COMMENT '加湿时间(S)',
    `product_id`         bigint   NOT NULL COMMENT '产品id',
    `weight_in`          decimal(24, 6)                                                DEFAULT NULL COMMENT '产品进入水分',
    `weight_out`         decimal(24, 6)                                                DEFAULT NULL COMMENT '产品取出水分',
    `product_number`     bigint   NOT NULL COMMENT '产量',
    `product_weight`     decimal(24, 6)                                                DEFAULT NULL COMMENT '单重(g)',

    `remark`             varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`          bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`            bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='加湿记录表';

CREATE TABLE `mes_record_reya`
(
    `id`                    bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`             bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',
    `start_time`            datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`              datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',
    `machine_id`            bigint   NOT NULL COMMENT '机台',
    `reya_time`             int      NOT NULL COMMENT '热压时间(S)',
    `temperature_mold_up`   decimal(24, 6)                                                DEFAULT NULL COMMENT '上模温度℃',
    `temperature_mold_down` decimal(24, 6)                                                DEFAULT NULL COMMENT '下模温度℃',
    `main_stress`           decimal(24, 6)                                                DEFAULT NULL COMMENT '主缸压力KG',

    `product_id`            bigint   NOT NULL COMMENT '产品id',
    `appearance`            varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '外观',
    `wet_degree`            decimal(24, 6)                                                DEFAULT NULL COMMENT '湿度',
    `product_weight`        decimal(24, 6)                                                DEFAULT NULL COMMENT '单重(g)',

    `remark`                varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`             bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`               varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`               varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`               bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`             bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='热压记录表';

CREATE TABLE `mes_record_qiebian`
(
    `id`                    bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`             bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',
    `start_time`            datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '开机时间',
    `end_time`              datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '停机时间',
    `machine_id`            bigint   NOT NULL COMMENT '机台',

    `product_weight_before` decimal(24, 6)                                                DEFAULT NULL COMMENT '切边前单重g',

    `product_id`            bigint   NOT NULL COMMENT '产品id',
    `appearance`            varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '外观',
    `wet_degree`            decimal(24, 6)                                                DEFAULT NULL COMMENT '湿度',
    `product_weight`        decimal(24, 6)                                                DEFAULT NULL COMMENT '单重(g)',
    `cut_time`              int      NOT NULL COMMENT '切边时间(S)',

    `remark`                varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`             bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`               varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`               varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`           datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`               bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`             bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='切边记录表';

CREATE TABLE `mes_record_pinjian`
(
    `id`                 bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',

    `product_id`         bigint   NOT NULL COMMENT '产品id',
    `appearance`         varchar(56) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '外观',
    `product_weight`     decimal(24, 6)                                                DEFAULT NULL COMMENT '单重(g)',
    `waterproof`         varchar(56) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '防水',
    `qualified_number`   bigint   NOT NULL COMMENT '合格品量',
    `unqualified_number` bigint   NOT NULL COMMENT '废品量',
    `total_number`       bigint   NOT NULL COMMENT '总产量',
    `qualified_rate`     decimal(24, 6)                                                DEFAULT NULL COMMENT '合格率%',
    `unqualified_reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '废品原因',

    `remark`             varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`          bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`            varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`        datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`            bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`          bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='检验记录表';

CREATE TABLE `mes_record_dabao`
(
    `id`                         bigint   NOT NULL AUTO_INCREMENT COMMENT 'id',
    `record_id`                  bigint   NOT NULL                                             DEFAULT '0' COMMENT '记录id',

    `product_id`                 bigint   NOT NULL COMMENT '产品id',
    `total_number`               bigint   NOT NULL COMMENT '产量',
    `package_item_usage`         decimal(24, 6)                                                DEFAULT NULL COMMENT '包装材料用量',
    `package_size`               bigint   NOT NULL COMMENT '每包产品数',
    `package_item_specification` varchar(56) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '包装材料规格',

    `remark`                     varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
    `is_enable`                  bit(1)   NOT NULL                                             DEFAULT 1 COMMENT '是否启用',
    `creator`                    varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '创建者',
    `create_time`                datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater`                    varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  DEFAULT '' COMMENT '更新者',
    `update_time`                datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted`                    bit(1)   NOT NULL                                             DEFAULT 0 COMMENT '是否删除',
    `tenant_id`                  bigint   NOT NULL                                             DEFAULT '0' COMMENT '租户编号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='打包记录表';

-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('成型记录', '', 2, 0, 2800,
        'record-template', '', 'mes/record/index', 0, 'RecordTemplate');

-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('碎浆记录', '', 2, 0, 2800,
        'record-suijiang', '', 'mes/record/SuijiangIndex', 0, 'RecordSuijiang');
-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('热压记录', '', 2, 0, 2800,
        'record-reya', '', 'mes/record/ReyaIndex', 0, 'RecordReya');

-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('切边记录', '', 2, 0, 2800,
        'record-qiebian', '', 'mes/record/QieBianIndex', 0, 'RecordQiebian');

-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('打包记录', '', 2, 0, 2800,
        'record-dabao', '', 'mes/record/DabaoIndex', 0, 'RecordDabao');
-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('打浆记录', '', 2, 0, 2800,
        'record-dajiang', '', 'mes/record/DajiangIndex', 0, 'RecordDajiang');
-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('干燥记录', '', 2, 0, 2800,
        'record-ganzao', '', 'mes/record/GanzaoIndex', 0, 'RecordGanzao');
-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('加湿记录', '', 2, 0, 2800,
        'record-jiashi', '', 'mes/record/JiashiIndex', 0, 'RecordJiashi');
-- 菜单 SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id,
                        path, icon, component, status, component_name)
VALUES ('品检记录', '', 2, 0, 2800,
        'record-pinjian', '', 'mes/record/PinjianIndex', 0, 'RecordPinjian');