CREATE TABLE `mes_product_process_line`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `name`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
    `product_id`  bigint   NOT NULL COMMENT '产品id',
    `bom_id`  bigint   NOT NULL COMMENT '产品bomId',
    `information`      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 b'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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='产品工艺';

CREATE TABLE `mes_energy_device`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `name`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
    `code`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '编码',
    `device_type`      varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '设备类型',
    `info`      varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '信息资料',
    `check_cron`      varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '抄表周期cron',
    `last_check_time` datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '最后抄表时间',
    `last_check_value`          decimal(24, 6)                                                DEFAULT NULL COMMENT '最后抄表值',
    `unit_name`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '单位',

    `is_enable`   bit(1)   NOT NULL                                             DEFAULT b'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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='能源设备';

CREATE TABLE `mes_energy_device_check_record`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `device_id`  bigint   NOT NULL COMMENT '能源设备Id',
    `device_type`      varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '设备类型',
    `last_check_time` datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '上次抄表时间',
    `last_check_value`          decimal(24, 6)                                                DEFAULT NULL COMMENT '上次抄表值',
    `check_value`          decimal(24, 6)                                                DEFAULT NULL COMMENT '抄表值',
    `check_time` datetime NOT NULL                                             DEFAULT CURRENT_TIMESTAMP COMMENT '抄表时间',
    `diff_value`          decimal(24, 6)                                                DEFAULT NULL COMMENT '差值',
    `unit_price`          decimal(24, 6)                                                DEFAULT NULL COMMENT '单价',
    `remark`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='抄表记录';


CREATE TABLE `mes_dv_subject`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `subject_code` varchar(64) NOT NULL COMMENT '项目编码',
    `subject_name` varchar(255) NOT NULL COMMENT '项目名称',
    `subject_type` varchar(64) DEFAULT '0' COMMENT '项目类型',
    `subject_content` varchar(500) NOT NULL COMMENT '项目内容',
    `subject_standard` varchar(255) DEFAULT NULL COMMENT '标准',
    `is_enable`   bit(1)   NOT NULL                                             DEFAULT b'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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='点检项目表';

CREATE TABLE `mes_dv_check`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `plan_code` varchar(64) NOT NULL COMMENT '计划编码',
    `plan_name` varchar(255) DEFAULT NULL COMMENT '计划名称',
    `plan_type` varchar(64) NOT NULL COMMENT '计划类型',
    `start_date` datetime DEFAULT NULL COMMENT '开始日期',
    `end_date` datetime DEFAULT NULL COMMENT '结束日期',
    `cycle_type` varchar(64) DEFAULT NULL COMMENT '频率',
    `cycle_count` int DEFAULT NULL COMMENT '次数',
    `status` varchar(64) DEFAULT NULL COMMENT '状态',
    `remark` varchar(500) DEFAULT '' COMMENT '备注',
    `is_enable`   bit(1)   NOT NULL                                             DEFAULT b'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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='点检计划表';

CREATE TABLE `mes_dv_check_subject`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `plan_id` bigint NOT NULL COMMENT '计划ID',
    `subject_id` bigint NOT NULL COMMENT '设备ID',
    `subject_code` varchar(64) NOT NULL COMMENT '项目编码',
    `subject_name` varchar(255) DEFAULT NULL COMMENT '项目名称',
    `subject_type` varchar(64) DEFAULT NULL COMMENT '项目类型',
    `subject_content` varchar(500) NOT NULL COMMENT '项目内容',
    `subject_standard` varchar(255) DEFAULT NULL COMMENT '标准',
    `remark` varchar(500) DEFAULT '' 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='点检计划项目表';


CREATE TABLE `mes_dv_check_device`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `plan_id` bigint NOT NULL COMMENT '计划ID',
    `machinery_id` bigint NOT NULL COMMENT '设备ID',
    `machinery_code` varchar(64) NOT NULL COMMENT '设备编码',
    `machinery_name` varchar(255) NOT NULL COMMENT '设备名称',
    `machinery_brand` varchar(255) DEFAULT NULL COMMENT '品牌',
    `machinery_spec` varchar(255) DEFAULT NULL COMMENT '规格型号',
    `remark` varchar(500) DEFAULT '' 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='点检计划设备表';


CREATE TABLE `mes_dv_check_record`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `plan_id` bigint DEFAULT NULL COMMENT '计划ID',
    `plan_code` varchar(64) DEFAULT NULL COMMENT '计划编码',
    `plan_name` varchar(255) DEFAULT NULL COMMENT '计划名称',
    `plan_type` varchar(64) DEFAULT NULL COMMENT '计划类型',
    `machinery_id` bigint NOT NULL COMMENT '设备ID',
    `machinery_code` varchar(64) NOT NULL COMMENT '设备编码',
    `machinery_name` varchar(255) NOT NULL COMMENT '设备名称',
    `machinery_brand` varchar(255) DEFAULT NULL COMMENT '品牌',
    `machinery_spec` varchar(255) DEFAULT NULL COMMENT '规格型号',
    `check_time` datetime NOT NULL COMMENT '点检时间',
    `status` varchar(64) DEFAULT 'PREPARE' COMMENT '状态',
    `is_enable`   bit(1)   NOT NULL                                             DEFAULT b'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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='设备点检记录表';

CREATE TABLE `mes_dv_check_record_line`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `record_id` bigint NOT NULL COMMENT '计划ID',
    `subject_id` bigint NOT NULL COMMENT '项目ID',
    `subject_code` varchar(64) NOT NULL COMMENT '项目编码',
    `subject_name` varchar(255) DEFAULT NULL COMMENT '项目名称',
    `subject_type` varchar(64) DEFAULT NULL COMMENT '项目类型',
    `subject_content` varchar(500) NOT NULL COMMENT '项目内容',
    `subject_standard` varchar(255) DEFAULT NULL COMMENT '标准',
    `check_status` varchar(64) NOT NULL COMMENT '点检结果',
    `check_result` varchar(500) DEFAULT NULL 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='设备点检记录行表';



CREATE TABLE `mes_dv_maintain_record`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `plan_id` bigint DEFAULT NULL COMMENT '计划ID',
    `plan_code` varchar(64) DEFAULT NULL COMMENT '计划编码',
    `plan_name` varchar(255) DEFAULT NULL COMMENT '计划名称',
    `plan_type` varchar(64) DEFAULT NULL COMMENT '计划类型',
    `machinery_id` bigint NOT NULL COMMENT '设备ID',
    `machinery_code` varchar(64) NOT NULL COMMENT '设备编码',
    `machinery_name` varchar(255) NOT NULL COMMENT '设备名称',
    `machinery_brand` varchar(255) DEFAULT NULL COMMENT '品牌',
    `machinery_spec` varchar(255) DEFAULT NULL COMMENT '规格型号',
    `mainten_time` datetime NOT NULL COMMENT '保养时间',
    `status` varchar(64) DEFAULT 'PREPARE' COMMENT '状态',
    `remark` varchar(500) DEFAULT '' 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='设备保养记录表';

CREATE TABLE `mes_dv_maintain_record_line`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `record_id` bigint NOT NULL COMMENT '计划ID',
    `subject_id` bigint NOT NULL COMMENT '项目ID',
    `subject_code` varchar(64) NOT NULL COMMENT '项目编码',
    `subject_name` varchar(255) DEFAULT NULL COMMENT '项目名称',
    `subject_type` varchar(64) DEFAULT NULL COMMENT '项目类型',
    `subject_content` varchar(500) NOT NULL COMMENT '项目内容',
    `subject_standard` varchar(255) DEFAULT NULL COMMENT '标准',
    `maintain_status` varchar(64) NOT NULL COMMENT '保养结果',
    `maintain_result` varchar(500) DEFAULT NULL 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='设备保养记录行表';



CREATE TABLE `mes_dv_repair`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `repair_code` varchar(64) NOT NULL COMMENT '维修单编号',
    `repair_name` varchar(255) DEFAULT NULL COMMENT '维修单名称',
    `machinery_id` bigint NOT NULL COMMENT '设备ID',
    `machinery_code` varchar(64) NOT NULL COMMENT '设备编码',
    `machinery_name` varchar(255) NOT NULL COMMENT '设备名称',
    `machinery_brand` varchar(255) DEFAULT NULL COMMENT '品牌',
    `machinery_spec` varchar(255) DEFAULT NULL COMMENT '规格型号',
    `machinery_type_id` bigint NOT NULL COMMENT '设备类型ID',
    `require_date` datetime DEFAULT NULL COMMENT '报修日期',
    `finish_date` datetime DEFAULT NULL COMMENT '维修完成日期',
    `confirm_date` datetime DEFAULT NULL COMMENT '验收日期',
    `repair_result` varchar(64) DEFAULT NULL COMMENT '维修结果',
    `accepted_by` varchar(64) DEFAULT NULL COMMENT '维修人员',
    `confirm_by` varchar(64) DEFAULT NULL COMMENT '验收人员',
    `status` varchar(64) DEFAULT 'PREPARE' COMMENT '单据状态',
    `remark` varchar(500) DEFAULT '' 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='设备点检记录表';

CREATE TABLE `mes_dv_repair_line`
(
    `id`          bigint   NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `repair_id` bigint NOT NULL COMMENT '维修单ID',
    `subject_id` bigint NOT NULL COMMENT '项目ID',
    `subject_code` varchar(64) NOT NULL COMMENT '项目编码',
    `subject_name` varchar(255) DEFAULT NULL COMMENT '项目名称',
    `subject_type` varchar(64) DEFAULT NULL COMMENT '项目类型',
    `subject_content` varchar(500) NOT NULL COMMENT '项目内容',
    `subject_standard` varchar(255) DEFAULT NULL COMMENT '标准',
    `malfunction` varchar(500) DEFAULT NULL COMMENT '故障描述',
    `malfunction_url` varchar(255) DEFAULT NULL COMMENT '故障描述资源',
    `repair_des` varchar(500) DEFAULT NULL COMMENT '维修情况',
    `remark` varchar(500) DEFAULT '' 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 b'0' COMMENT '是否删除',
    `tenant_id`   bigint                                                        DEFAULT NULL COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = DYNAMIC COMMENT ='设备点检记录行表';