
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `ipl_device_list`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipl_device_list` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `device_name` varchar(100) DEFAULT NULL,
  `mac_address` varchar(100) DEFAULT NULL,
  `device_total_shot` int(20) DEFAULT NULL,
  `device_online_shot` int(20) DEFAULT NULL,
  `hr_arm_total_shot` int(20) DEFAULT NULL,
  `sr_arm_total_shot` int(20) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_app_comment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_app_comment` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `category` varchar(10) DEFAULT NULL COMMENT '问题分类',
  `content` varchar(500) DEFAULT NULL COMMENT '问题和意见',
  `contact` varchar(200) DEFAULT NULL COMMENT '联系方式',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `create_by_name` varchar(200) DEFAULT NULL COMMENT '提问人员姓名',
  `device_info` varchar(1000) DEFAULT NULL COMMENT '设备信息',
  `reply_date` date DEFAULT NULL COMMENT '回复时间',
  `reply_content` varchar(500) DEFAULT NULL COMMENT '回复意见',
  `reply_user_code` varchar(64) DEFAULT NULL COMMENT '回复人员',
  `reply_user_name` varchar(200) DEFAULT NULL COMMENT '回复人员姓名',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='APP意见反馈';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_app_upgrade`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_app_upgrade` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `app_code` varchar(64) DEFAULT NULL COMMENT '应用编号',
  `up_title` varchar(200) DEFAULT NULL COMMENT '升级标题',
  `up_content` varchar(1000) DEFAULT NULL COMMENT '升级内容',
  `up_version` decimal(10,0) DEFAULT NULL COMMENT '升级版本',
  `up_type` char(1) DEFAULT NULL COMMENT '升级类型',
  `up_date` date DEFAULT NULL COMMENT '发布时间',
  `apk_url` varchar(500) DEFAULT NULL COMMENT 'APK下载地址',
  `res_url` varchar(500) DEFAULT NULL COMMENT '资源下载地址',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='APP升级版本';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_gen_table`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_gen_table` (
  `table_name` varchar(64) NOT NULL COMMENT '表名',
  `class_name` varchar(100) NOT NULL COMMENT '实体类名称',
  `comments` varchar(500) NOT NULL COMMENT '表说明',
  `parent_table_name` varchar(64) DEFAULT NULL COMMENT '关联父表的表名',
  `parent_table_fk_name` varchar(64) DEFAULT NULL COMMENT '本表关联父表的外键名',
  `data_source_name` varchar(64) DEFAULT NULL COMMENT '数据源名称',
  `tpl_category` varchar(200) DEFAULT NULL COMMENT '使用的模板',
  `package_name` varchar(500) DEFAULT NULL COMMENT '生成包路径',
  `module_name` varchar(30) DEFAULT NULL COMMENT '生成模块名',
  `sub_module_name` varchar(30) DEFAULT NULL COMMENT '生成子模块名',
  `function_name` varchar(200) DEFAULT NULL COMMENT '生成功能名',
  `function_name_simple` varchar(50) DEFAULT NULL COMMENT '生成功能名（简写）',
  `function_author` varchar(50) DEFAULT NULL COMMENT '生成功能作者',
  `gen_base_dir` varchar(1000) DEFAULT NULL COMMENT '生成基础路径',
  `gen_front_dir` varchar(1000) DEFAULT NULL COMMENT '生成前端路径',
  `options` varchar(1000) DEFAULT NULL COMMENT '其它生成选项',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`table_name`) USING BTREE,
  KEY `idx_gen_table_ptn` (`parent_table_name`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='代码生成表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_gen_table_column`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_gen_table_column` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `table_name` varchar(64) NOT NULL COMMENT '表名',
  `column_name` varchar(64) NOT NULL COMMENT '列名',
  `column_sort` decimal(10,0) DEFAULT NULL COMMENT '列排序（升序）',
  `column_type` varchar(100) NOT NULL COMMENT '类型',
  `column_label` varchar(50) DEFAULT NULL COMMENT '列标签名',
  `comments` varchar(500) NOT NULL COMMENT '列备注说明',
  `attr_name` varchar(200) NOT NULL COMMENT '类的属性名',
  `attr_type` varchar(200) NOT NULL COMMENT '类的属性类型',
  `is_pk` char(1) DEFAULT NULL COMMENT '是否主键',
  `is_null` char(1) DEFAULT NULL COMMENT '是否可为空',
  `is_insert` char(1) DEFAULT NULL COMMENT '是否插入字段',
  `is_update` char(1) DEFAULT NULL COMMENT '是否更新字段',
  `is_list` char(1) DEFAULT NULL COMMENT '是否列表字段',
  `is_query` char(1) DEFAULT NULL COMMENT '是否查询字段',
  `query_type` varchar(200) DEFAULT NULL COMMENT '查询方式',
  `is_edit` char(1) DEFAULT NULL COMMENT '是否编辑字段',
  `show_type` varchar(200) DEFAULT NULL COMMENT '表单类型',
  `options` varchar(1000) DEFAULT NULL COMMENT '其它生成选项',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_gen_table_column_tn` (`table_name`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='代码生成表列';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_area`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_area` (
  `area_code` varchar(100) NOT NULL COMMENT '区域编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `area_name` varchar(100) NOT NULL COMMENT '区域名称',
  `area_type` char(1) DEFAULT NULL COMMENT '区域类型',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`area_code`) USING BTREE,
  KEY `idx_sys_area_pc` (`parent_code`) USING BTREE,
  KEY `idx_sys_area_ts` (`tree_sort`) USING BTREE,
  KEY `idx_sys_area_status` (`status`) USING BTREE,
  KEY `idx_sys_area_pcs` (`parent_codes`(333)) USING BTREE,
  KEY `idx_sys_area_tss` (`tree_sorts`(333)) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='行政区划';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_company`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_company` (
  `company_code` varchar(64) NOT NULL COMMENT '公司编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `view_code` varchar(100) NOT NULL COMMENT '公司代码',
  `company_name` varchar(200) NOT NULL COMMENT '公司名称',
  `full_name` varchar(200) NOT NULL COMMENT '公司全称',
  `area_code` varchar(100) DEFAULT NULL COMMENT '区域编码',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`company_code`) USING BTREE,
  KEY `idx_sys_company_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_company_pc` (`parent_code`) USING BTREE,
  KEY `idx_sys_company_ts` (`tree_sort`) USING BTREE,
  KEY `idx_sys_company_status` (`status`) USING BTREE,
  KEY `idx_sys_company_vc` (`view_code`) USING BTREE,
  KEY `idx_sys_company_pcs` (`parent_codes`(333)) USING BTREE,
  KEY `idx_sys_company_tss` (`tree_sorts`(333)) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='公司表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_company_office`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_company_office` (
  `company_code` varchar(64) NOT NULL COMMENT '公司编码',
  `office_code` varchar(64) NOT NULL COMMENT '机构编码',
  PRIMARY KEY (`company_code`,`office_code`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='公司部门关联表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_config`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_config` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `config_name` varchar(100) NOT NULL COMMENT '名称',
  `config_key` varchar(100) NOT NULL COMMENT '参数键',
  `config_value` varchar(1000) DEFAULT NULL COMMENT '参数值',
  `is_sys` char(1) NOT NULL COMMENT '系统内置（1是 0否）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_sys_config_key` (`config_key`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='参数配置表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_dict_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_dict_data` (
  `dict_code` varchar(64) NOT NULL COMMENT '字典编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `dict_label` varchar(100) NOT NULL COMMENT '字典标签',
  `dict_value` varchar(100) NOT NULL COMMENT '字典键值',
  `dict_icon` varchar(100) DEFAULT NULL COMMENT '字典图标',
  `dict_type` varchar(100) NOT NULL COMMENT '字典类型',
  `is_sys` char(1) NOT NULL COMMENT '系统内置（1是 0否）',
  `description` varchar(500) DEFAULT NULL COMMENT '字典描述',
  `css_style` varchar(500) DEFAULT NULL COMMENT 'css样式（如：color:red)',
  `css_class` varchar(500) DEFAULT NULL COMMENT 'css类名（如：red）',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`dict_code`) USING BTREE,
  KEY `idx_sys_dict_data_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_dict_data_dt` (`dict_type`) USING BTREE,
  KEY `idx_sys_dict_data_pc` (`parent_code`) USING BTREE,
  KEY `idx_sys_dict_data_status` (`status`) USING BTREE,
  KEY `idx_sys_dict_data_pcs` (`parent_codes`(333)) USING BTREE,
  KEY `idx_sys_dict_data_ts` (`tree_sort`) USING BTREE,
  KEY `idx_sys_dict_data_tss` (`tree_sorts`(333)) USING BTREE,
  KEY `idx_sys_dict_data_dv` (`dict_value`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='字典数据表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_dict_type`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_dict_type` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `dict_name` varchar(100) NOT NULL COMMENT '字典名称',
  `dict_type` varchar(100) NOT NULL COMMENT '字典类型',
  `is_sys` char(1) NOT NULL COMMENT '是否系统字典',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_dict_type_is` (`is_sys`) USING BTREE,
  KEY `idx_sys_dict_type_status` (`status`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='字典类型表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_employee`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_employee` (
  `emp_code` varchar(64) NOT NULL COMMENT '员工编码',
  `emp_name` varchar(100) NOT NULL COMMENT '员工姓名',
  `emp_name_en` varchar(100) DEFAULT NULL COMMENT '员工英文名',
  `emp_no` varchar(100) DEFAULT NULL COMMENT '员工工号',
  `office_code` varchar(64) NOT NULL COMMENT '机构编码',
  `office_name` varchar(100) NOT NULL COMMENT '机构名称',
  `company_code` varchar(64) DEFAULT NULL COMMENT '公司编码',
  `company_name` varchar(200) DEFAULT NULL COMMENT '公司名称',
  `status` char(1) NOT NULL COMMENT '状态（0在职 1删除 2离职）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  PRIMARY KEY (`emp_code`) USING BTREE,
  KEY `idx_sys_employee_cco` (`company_code`) USING BTREE,
  KEY `idx_sys_employee_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_employee_ud` (`update_date`) USING BTREE,
  KEY `idx_sys_employee_oc` (`office_code`) USING BTREE,
  KEY `idx_sys_employee_status` (`status`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='员工表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_employee_office`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_employee_office` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `emp_code` varchar(64) NOT NULL COMMENT '员工编码',
  `office_code` varchar(64) NOT NULL COMMENT '机构编码',
  `post_code` varchar(64) DEFAULT NULL COMMENT '岗位编码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='员工附属机构关系表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_employee_post`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_employee_post` (
  `emp_code` varchar(64) NOT NULL COMMENT '员工编码',
  `post_code` varchar(64) NOT NULL COMMENT '岗位编码',
  PRIMARY KEY (`emp_code`,`post_code`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='员工与岗位关联表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_file_entity`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_file_entity` (
  `file_id` varchar(64) NOT NULL COMMENT '文件编号',
  `file_md5` varchar(64) NOT NULL COMMENT '文件MD5',
  `file_path` varchar(1000) NOT NULL COMMENT '文件相对路径',
  `file_content_type` varchar(200) NOT NULL COMMENT '文件内容类型',
  `file_extension` varchar(100) NOT NULL COMMENT '文件后缀扩展名',
  `file_size` decimal(31,0) NOT NULL COMMENT '文件大小(单位B)',
  `file_meta` varchar(255) DEFAULT NULL COMMENT '文件信息(JSON格式)',
  `file_preview` char(1) DEFAULT NULL COMMENT '文件预览标记',
  PRIMARY KEY (`file_id`) USING BTREE,
  KEY `idx_sys_file_entity_md5` (`file_md5`) USING BTREE,
  KEY `idx_sys_file_entity_size` (`file_size`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='文件实体表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_file_upload`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_file_upload` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `file_id` varchar(64) NOT NULL COMMENT '文件编号',
  `file_name` varchar(500) NOT NULL COMMENT '文件名称',
  `file_type` varchar(20) NOT NULL COMMENT '文件分类（image、media、file）',
  `file_sort` decimal(10,0) DEFAULT NULL COMMENT '文件排序（升序）',
  `biz_key` varchar(64) DEFAULT NULL COMMENT '业务主键',
  `biz_type` varchar(64) DEFAULT NULL COMMENT '业务类型',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_file_biz_ft` (`file_type`) USING BTREE,
  KEY `idx_sys_file_biz_fi` (`file_id`) USING BTREE,
  KEY `idx_sys_file_biz_status` (`status`) USING BTREE,
  KEY `idx_sys_file_biz_cb` (`create_by`) USING BTREE,
  KEY `idx_sys_file_biz_ud` (`update_date`) USING BTREE,
  KEY `idx_sys_file_biz_bt` (`biz_type`) USING BTREE,
  KEY `idx_sys_file_biz_bk` (`biz_key`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='文件上传表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_health_check`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_health_check` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `server_name` varchar(50) DEFAULT NULL COMMENT '系统节点名称',
  `server_url` varchar(500) DEFAULT NULL COMMENT '系统节点地址',
  `lic_version` varchar(10) DEFAULT NULL COMMENT '系统许可版本',
  `heart_time` datetime DEFAULT NULL COMMENT '最后心跳时间',
  `timeout` decimal(10,0) DEFAULT NULL COMMENT '超时时间',
  `state` char(1) DEFAULT NULL COMMENT '服务状态',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='系统健康检查';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_job`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_job` (
  `job_name` varchar(64) NOT NULL COMMENT '任务名称',
  `job_group` varchar(64) NOT NULL COMMENT '任务组名',
  `description` varchar(100) NOT NULL COMMENT '任务描述',
  `invoke_target` varchar(1000) NOT NULL COMMENT '调用目标字符串',
  `cron_expression` varchar(255) NOT NULL COMMENT 'Cron执行表达式',
  `misfire_instruction` decimal(1,0) NOT NULL COMMENT '计划执行错误策略',
  `concurrent` char(1) NOT NULL COMMENT '是否并发执行',
  `instance_name` varchar(64) NOT NULL DEFAULT 'JeeSiteScheduler' COMMENT '集群的实例名字',
  `status` char(1) NOT NULL COMMENT '状态（0正常 1删除 2暂停）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`job_name`,`job_group`) USING BTREE,
  KEY `idx_sys_job_status` (`status`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='作业调度表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_job_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_job_log` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `job_name` varchar(64) NOT NULL COMMENT '任务名称',
  `job_group` varchar(64) NOT NULL COMMENT '任务组名',
  `job_type` varchar(50) DEFAULT NULL COMMENT '日志类型',
  `job_event` varchar(200) DEFAULT NULL COMMENT '日志事件',
  `job_message` varchar(500) DEFAULT NULL COMMENT '日志信息',
  `is_exception` char(1) DEFAULT NULL COMMENT '是否异常',
  `exception_info` text COMMENT '异常信息',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_job_log_jn` (`job_name`) USING BTREE,
  KEY `idx_sys_job_log_jg` (`job_group`) USING BTREE,
  KEY `idx_sys_job_log_t` (`job_type`) USING BTREE,
  KEY `idx_sys_job_log_e` (`job_event`) USING BTREE,
  KEY `idx_sys_job_log_ie` (`is_exception`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='作业调度日志表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_lang`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_lang` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `module_code` varchar(64) NOT NULL COMMENT '归属模块',
  `lang_code` varchar(500) NOT NULL COMMENT '语言编码',
  `lang_text` varchar(500) NOT NULL COMMENT '语言译文',
  `lang_type` varchar(50) NOT NULL COMMENT '语言类型',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_lang_code` (`lang_code`(333)) USING BTREE,
  KEY `idx_sys_lang_type` (`lang_type`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='国际化语言';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_log` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `log_type` varchar(50) NOT NULL COMMENT '日志类型',
  `log_title` varchar(500) NOT NULL COMMENT '日志标题',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_by_name` varchar(100) NOT NULL COMMENT '用户名称',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `request_uri` varchar(500) DEFAULT NULL COMMENT '请求URI',
  `request_method` varchar(10) DEFAULT NULL COMMENT '操作方式',
  `request_params` longtext COMMENT '操作提交的数据',
  `diff_modify_data` text COMMENT '新旧数据比较结果',
  `biz_key` varchar(64) DEFAULT NULL COMMENT '业务主键',
  `biz_type` varchar(64) DEFAULT NULL COMMENT '业务类型',
  `remote_addr` varchar(255) NOT NULL COMMENT '操作IP地址',
  `server_addr` varchar(255) NOT NULL COMMENT '请求服务器地址',
  `is_exception` char(1) DEFAULT NULL COMMENT '是否异常',
  `exception_info` text COMMENT '异常信息',
  `user_agent` varchar(500) DEFAULT NULL COMMENT '用户代理',
  `device_name` varchar(100) DEFAULT NULL COMMENT '设备名称/操作系统',
  `browser_name` varchar(100) DEFAULT NULL COMMENT '浏览器名称',
  `execute_time` decimal(19,0) DEFAULT NULL COMMENT '执行时间',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `idx_sys_log_cb` (`create_by`) USING BTREE,
  KEY `idx_sys_log_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_log_lt` (`log_type`) USING BTREE,
  KEY `idx_sys_log_bk` (`biz_key`) USING BTREE,
  KEY `idx_sys_log_bt` (`biz_type`) USING BTREE,
  KEY `idx_sys_log_ie` (`is_exception`) USING BTREE,
  KEY `idx_sys_log_cd` (`create_date`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='操作日志表'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = MyISAM,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = MyISAM,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = MyISAM,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = MyISAM,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = MyISAM,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = MyISAM,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = MyISAM,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = MyISAM,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = MyISAM,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = MyISAM,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = MyISAM) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_menu`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_menu` (
  `menu_code` varchar(64) NOT NULL COMMENT '菜单编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `menu_name` varchar(100) NOT NULL COMMENT '菜单名称',
  `menu_type` char(1) NOT NULL COMMENT '菜单类型（1菜单 2权限 3开发）',
  `menu_href` varchar(1000) DEFAULT NULL COMMENT '链接',
  `menu_target` varchar(20) DEFAULT NULL COMMENT '目标',
  `menu_icon` varchar(100) DEFAULT NULL COMMENT '图标',
  `menu_color` varchar(50) DEFAULT NULL COMMENT '颜色',
  `menu_title` varchar(100) DEFAULT NULL COMMENT '菜单标题',
  `permission` varchar(1000) DEFAULT NULL COMMENT '权限标识',
  `weight` decimal(4,0) DEFAULT NULL COMMENT '菜单权重',
  `is_show` char(1) NOT NULL COMMENT '是否显示（1显示 0隐藏）',
  `sys_code` varchar(64) NOT NULL COMMENT '归属系统（default:主导航菜单、mobileApp:APP菜单）',
  `module_codes` varchar(500) NOT NULL COMMENT '归属模块（多个用逗号隔开）',
  `component` varchar(500) DEFAULT NULL COMMENT '组件路径',
  `params` varchar(500) DEFAULT NULL COMMENT '组件参数',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`menu_code`) USING BTREE,
  KEY `idx_sys_menu_pc` (`parent_code`) USING BTREE,
  KEY `idx_sys_menu_ts` (`tree_sort`) USING BTREE,
  KEY `idx_sys_menu_status` (`status`) USING BTREE,
  KEY `idx_sys_menu_mt` (`menu_type`) USING BTREE,
  KEY `idx_sys_menu_pss` (`parent_codes`(333)) USING BTREE,
  KEY `idx_sys_menu_tss` (`tree_sorts`(333)) USING BTREE,
  KEY `idx_sys_menu_sc` (`sys_code`) USING BTREE,
  KEY `idx_sys_menu_is` (`is_show`) USING BTREE,
  KEY `idx_sys_menu_mcs` (`module_codes`(333)) USING BTREE,
  KEY `idx_sys_menu_wt` (`weight`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_module`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_module` (
  `module_code` varchar(64) NOT NULL COMMENT '模块编码',
  `module_name` varchar(100) NOT NULL COMMENT '模块名称',
  `description` varchar(500) DEFAULT NULL COMMENT '模块描述',
  `main_class_name` varchar(500) DEFAULT NULL COMMENT '主类全名',
  `current_version` varchar(50) DEFAULT NULL COMMENT '当前版本',
  `upgrade_info` varchar(300) DEFAULT NULL COMMENT '升级信息',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`module_code`) USING BTREE,
  KEY `idx_sys_module_status` (`status`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='模块表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_msg_inner`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_msg_inner` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `msg_title` varchar(200) NOT NULL COMMENT '消息标题',
  `content_level` char(1) NOT NULL COMMENT '内容级别（1普通 2一般 3紧急）',
  `content_type` char(1) DEFAULT NULL COMMENT '内容类型（1公告 2新闻 3会议 4其它）',
  `msg_content` text NOT NULL COMMENT '消息内容',
  `receive_type` char(1) NOT NULL COMMENT '接受者类型（0全部 1用户 2部门 3角色 4岗位）',
  `receive_codes` text COMMENT '接受者字符串',
  `receive_names` text COMMENT '接受者名称字符串',
  `send_user_code` varchar(64) DEFAULT NULL COMMENT '发送者用户编码',
  `send_user_name` varchar(100) DEFAULT NULL COMMENT '发送者用户姓名',
  `send_date` datetime DEFAULT NULL COMMENT '发送时间',
  `is_attac` char(1) DEFAULT NULL COMMENT '是否有附件',
  `notify_types` varchar(100) DEFAULT NULL COMMENT '通知类型（PC APP 短信 邮件 微信）多选',
  `status` char(1) NOT NULL COMMENT '状态（0正常 1删除 4审核 5驳回 9草稿）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_msg_inner_cb` (`create_by`) USING BTREE,
  KEY `idx_sys_msg_inner_status` (`status`) USING BTREE,
  KEY `idx_sys_msg_inner_cl` (`content_level`) USING BTREE,
  KEY `idx_sys_msg_inner_sc` (`send_user_code`) USING BTREE,
  KEY `idx_sys_msg_inner_sd` (`send_date`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='内部消息';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_msg_inner_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_msg_inner_record` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `msg_inner_id` varchar(64) NOT NULL COMMENT '所属消息',
  `receive_user_code` varchar(64) NOT NULL COMMENT '接受者用户编码',
  `receive_user_name` varchar(100) NOT NULL COMMENT '接受者用户姓名',
  `read_status` char(1) NOT NULL COMMENT '读取状态（0未送达 1已读 2未读）',
  `read_date` datetime DEFAULT NULL COMMENT '阅读时间',
  `is_star` char(1) DEFAULT NULL COMMENT '是否标星',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_msg_inner_r_mi` (`msg_inner_id`) USING BTREE,
  KEY `idx_sys_msg_inner_r_ruc` (`receive_user_code`) USING BTREE,
  KEY `idx_sys_msg_inner_r_stat` (`read_status`) USING BTREE,
  KEY `idx_sys_msg_inner_r_star` (`is_star`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='内部消息发送记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_msg_push`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_msg_push` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `msg_type` varchar(16) NOT NULL COMMENT '消息类型（PC APP 短信 邮件 微信）',
  `msg_title` varchar(200) NOT NULL COMMENT '消息标题',
  `msg_content` text NOT NULL COMMENT '消息内容',
  `biz_key` varchar(64) DEFAULT NULL COMMENT '业务主键',
  `biz_type` varchar(64) DEFAULT NULL COMMENT '业务类型',
  `receive_code` varchar(64) NOT NULL COMMENT '接受者账号',
  `receive_user_code` varchar(64) NOT NULL COMMENT '接受者用户编码',
  `receive_user_name` varchar(100) NOT NULL COMMENT '接受者用户姓名',
  `send_user_code` varchar(64) NOT NULL COMMENT '发送者用户编码',
  `send_user_name` varchar(100) NOT NULL COMMENT '发送者用户姓名',
  `send_date` datetime NOT NULL COMMENT '发送时间',
  `is_merge_push` char(1) DEFAULT NULL COMMENT '是否合并推送',
  `plan_push_date` datetime DEFAULT NULL COMMENT '计划推送时间',
  `push_number` int(11) DEFAULT NULL COMMENT '推送尝试次数',
  `push_return_code` varchar(200) DEFAULT NULL COMMENT '推送返回结果码',
  `push_return_msg_id` varchar(200) DEFAULT NULL COMMENT '推送返回消息编号',
  `push_return_content` text COMMENT '推送返回的内容信息',
  `push_status` char(1) DEFAULT NULL COMMENT '推送状态（0未推送 1成功  2失败）',
  `push_date` datetime DEFAULT NULL COMMENT '推送时间',
  `read_status` char(1) DEFAULT NULL COMMENT '读取状态（0未送达 1已读 2未读）',
  `read_date` datetime DEFAULT NULL COMMENT '读取时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_msg_push_type` (`msg_type`) USING BTREE,
  KEY `idx_sys_msg_push_rc` (`receive_code`) USING BTREE,
  KEY `idx_sys_msg_push_uc` (`receive_user_code`) USING BTREE,
  KEY `idx_sys_msg_push_suc` (`send_user_code`) USING BTREE,
  KEY `idx_sys_msg_push_pd` (`plan_push_date`) USING BTREE,
  KEY `idx_sys_msg_push_ps` (`push_status`) USING BTREE,
  KEY `idx_sys_msg_push_rs` (`read_status`) USING BTREE,
  KEY `idx_sys_msg_push_bk` (`biz_key`) USING BTREE,
  KEY `idx_sys_msg_push_bt` (`biz_type`) USING BTREE,
  KEY `idx_sys_msg_push_imp` (`is_merge_push`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消息推送表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_msg_pushed`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_msg_pushed` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `msg_type` varchar(16) NOT NULL COMMENT '消息类型（PC APP 短信 邮件 微信）',
  `msg_title` varchar(200) NOT NULL COMMENT '消息标题',
  `msg_content` text NOT NULL COMMENT '消息内容',
  `biz_key` varchar(64) DEFAULT NULL COMMENT '业务主键',
  `biz_type` varchar(64) DEFAULT NULL COMMENT '业务类型',
  `receive_code` varchar(64) NOT NULL COMMENT '接受者账号',
  `receive_user_code` varchar(64) NOT NULL COMMENT '接受者用户编码',
  `receive_user_name` varchar(100) NOT NULL COMMENT '接受者用户姓名',
  `send_user_code` varchar(64) NOT NULL COMMENT '发送者用户编码',
  `send_user_name` varchar(100) NOT NULL COMMENT '发送者用户姓名',
  `send_date` datetime NOT NULL COMMENT '发送时间',
  `is_merge_push` char(1) DEFAULT NULL COMMENT '是否合并推送',
  `plan_push_date` datetime DEFAULT NULL COMMENT '计划推送时间',
  `push_number` int(11) DEFAULT NULL COMMENT '推送尝试次数',
  `push_return_content` text COMMENT '推送返回的内容信息',
  `push_return_code` varchar(200) DEFAULT NULL COMMENT '推送返回结果码',
  `push_return_msg_id` varchar(200) DEFAULT NULL COMMENT '推送返回消息编号',
  `push_status` char(1) DEFAULT NULL COMMENT '推送状态（0未推送 1成功  2失败）',
  `push_date` datetime DEFAULT NULL COMMENT '推送时间',
  `read_status` char(1) DEFAULT NULL COMMENT '读取状态（0未送达 1已读 2未读）',
  `read_date` datetime DEFAULT NULL COMMENT '读取时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_msg_pushed_type` (`msg_type`) USING BTREE,
  KEY `idx_sys_msg_pushed_rc` (`receive_code`) USING BTREE,
  KEY `idx_sys_msg_pushed_uc` (`receive_user_code`) USING BTREE,
  KEY `idx_sys_msg_pushed_suc` (`send_user_code`) USING BTREE,
  KEY `idx_sys_msg_pushed_pd` (`plan_push_date`) USING BTREE,
  KEY `idx_sys_msg_pushed_ps` (`push_status`) USING BTREE,
  KEY `idx_sys_msg_pushed_rs` (`read_status`) USING BTREE,
  KEY `idx_sys_msg_pushed_bk` (`biz_key`) USING BTREE,
  KEY `idx_sys_msg_pushed_bt` (`biz_type`) USING BTREE,
  KEY `idx_sys_msg_pushed_imp` (`is_merge_push`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消息已推送表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_msg_template`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_msg_template` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `module_code` varchar(64) DEFAULT NULL COMMENT '归属模块',
  `tpl_key` varchar(100) NOT NULL COMMENT '模板键值',
  `tpl_name` varchar(100) NOT NULL COMMENT '模板名称',
  `tpl_type` varchar(16) NOT NULL COMMENT '模板类型',
  `tpl_content` text NOT NULL COMMENT '模板内容',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sys_msg_tpl_key` (`tpl_key`) USING BTREE,
  KEY `idx_sys_msg_tpl_type` (`tpl_type`) USING BTREE,
  KEY `idx_sys_msg_tpl_status` (`status`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消息模板';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_office`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_office` (
  `office_code` varchar(64) NOT NULL COMMENT '机构编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `view_code` varchar(100) NOT NULL COMMENT '机构代码',
  `office_name` varchar(100) NOT NULL COMMENT '机构名称',
  `full_name` varchar(200) NOT NULL COMMENT '机构全称',
  `office_type` char(1) NOT NULL COMMENT '机构类型',
  `leader` varchar(100) DEFAULT NULL COMMENT '负责人',
  `phone` varchar(100) DEFAULT NULL COMMENT '办公电话',
  `address` varchar(255) DEFAULT NULL COMMENT '联系地址',
  `zip_code` varchar(100) DEFAULT NULL COMMENT '邮政编码',
  `email` varchar(300) DEFAULT NULL COMMENT '电子邮箱',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`office_code`) USING BTREE,
  KEY `idx_sys_office_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_office_pc` (`parent_code`) USING BTREE,
  KEY `idx_sys_office_pcs` (`parent_codes`(333)) USING BTREE,
  KEY `idx_sys_office_status` (`status`) USING BTREE,
  KEY `idx_sys_office_ot` (`office_type`) USING BTREE,
  KEY `idx_sys_office_vc` (`view_code`) USING BTREE,
  KEY `idx_sys_office_ts` (`tree_sort`) USING BTREE,
  KEY `idx_sys_office_tss` (`tree_sorts`(333)) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='组织机构表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_post`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_post` (
  `post_code` varchar(64) NOT NULL COMMENT '岗位编码',
  `view_code` varchar(100) DEFAULT NULL COMMENT '岗位代码',
  `post_name` varchar(100) NOT NULL COMMENT '岗位名称',
  `post_type` varchar(100) DEFAULT NULL COMMENT '岗位分类（高管、中层、基层）',
  `post_sort` decimal(10,0) DEFAULT NULL COMMENT '岗位排序（升序）',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  PRIMARY KEY (`post_code`) USING BTREE,
  KEY `idx_sys_post_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_post_status` (`status`) USING BTREE,
  KEY `idx_sys_post_ps` (`post_sort`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='员工岗位表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_role` (
  `role_code` varchar(64) NOT NULL COMMENT '角色编码',
  `role_name` varchar(100) NOT NULL COMMENT '角色名称',
  `view_code` varchar(100) DEFAULT NULL COMMENT '角色代码',
  `role_type` varchar(100) DEFAULT NULL COMMENT '角色分类（高管、中层、基层、其它）',
  `role_sort` decimal(10,0) DEFAULT NULL COMMENT '角色排序（升序）',
  `is_sys` char(1) DEFAULT NULL COMMENT '系统内置（1是 0否）',
  `user_type` varchar(16) DEFAULT NULL COMMENT '用户类型（employee员工 member会员）',
  `data_scope` char(1) DEFAULT NULL COMMENT '数据范围设置（0未设置  1全部数据 2自定义数据）',
  `biz_scope` varchar(255) DEFAULT NULL COMMENT '适应业务范围（不同的功能，不同的数据权限支持）',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`role_code`) USING BTREE,
  KEY `idx_sys_role_cc` (`corp_code`) USING BTREE,
  KEY `idx_sys_role_is` (`is_sys`) USING BTREE,
  KEY `idx_sys_role_status` (`status`) USING BTREE,
  KEY `idx_sys_role_rs` (`role_sort`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_role_data_scope`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_role_data_scope` (
  `role_code` varchar(64) NOT NULL COMMENT '控制角色编码',
  `ctrl_type` varchar(20) NOT NULL COMMENT '控制类型',
  `ctrl_data` varchar(64) NOT NULL COMMENT '控制数据',
  `ctrl_permi` varchar(64) NOT NULL COMMENT '控制权限',
  PRIMARY KEY (`role_code`,`ctrl_type`,`ctrl_data`,`ctrl_permi`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色数据权限表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_role_menu`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_role_menu` (
  `role_code` varchar(64) NOT NULL COMMENT '角色编码',
  `menu_code` varchar(64) NOT NULL COMMENT '菜单编码',
  PRIMARY KEY (`role_code`,`menu_code`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色与菜单关联表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_user` (
  `user_code` varchar(100) NOT NULL COMMENT '用户编码',
  `login_code` varchar(100) NOT NULL COMMENT '登录账号',
  `user_name` varchar(100) NOT NULL COMMENT '用户昵称',
  `password` varchar(200) NOT NULL COMMENT '登录密码',
  `email` varchar(300) DEFAULT NULL COMMENT '电子邮箱',
  `mobile` varchar(100) DEFAULT NULL COMMENT '手机号码',
  `phone` varchar(100) DEFAULT NULL COMMENT '办公电话',
  `sex` char(1) DEFAULT NULL COMMENT '用户性别',
  `avatar` varchar(1000) DEFAULT NULL COMMENT '头像路径',
  `sign` varchar(200) DEFAULT NULL COMMENT '个性签名',
  `wx_openid` varchar(100) DEFAULT NULL COMMENT '绑定的微信号',
  `mobile_imei` varchar(100) DEFAULT NULL COMMENT '绑定的手机串号',
  `user_type` varchar(16) NOT NULL COMMENT '用户类型',
  `ref_code` varchar(64) DEFAULT NULL COMMENT '用户类型引用编号',
  `ref_name` varchar(100) DEFAULT NULL COMMENT '用户类型引用姓名',
  `mgr_type` char(1) NOT NULL COMMENT '管理员类型（0非管理员 1系统管理员  2二级管理员）',
  `pwd_security_level` decimal(1,0) DEFAULT NULL COMMENT '密码安全级别（0初始 1很弱 2弱 3安全 4很安全）',
  `pwd_update_date` datetime DEFAULT NULL COMMENT '密码最后更新时间',
  `pwd_update_record` varchar(1000) DEFAULT NULL COMMENT '密码修改记录',
  `pwd_question` varchar(200) DEFAULT NULL COMMENT '密保问题',
  `pwd_question_answer` varchar(200) DEFAULT NULL COMMENT '密保问题答案',
  `pwd_question_2` varchar(200) DEFAULT NULL COMMENT '密保问题2',
  `pwd_question_answer_2` varchar(200) DEFAULT NULL COMMENT '密保问题答案2',
  `pwd_question_3` varchar(200) DEFAULT NULL COMMENT '密保问题3',
  `pwd_question_answer_3` varchar(200) DEFAULT NULL COMMENT '密保问题答案3',
  `pwd_quest_update_date` datetime DEFAULT NULL COMMENT '密码问题修改时间',
  `last_login_ip` varchar(100) DEFAULT NULL COMMENT '最后登陆IP',
  `last_login_date` datetime DEFAULT NULL COMMENT '最后登陆时间',
  `freeze_date` datetime DEFAULT NULL COMMENT '冻结时间',
  `freeze_cause` varchar(200) DEFAULT NULL COMMENT '冻结原因',
  `user_weight` decimal(8,0) DEFAULT '0' COMMENT '用户权重（降序）',
  `status` char(1) NOT NULL COMMENT '状态（0正常 1删除 2停用 3冻结）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `corp_code` varchar(64) NOT NULL DEFAULT '0' COMMENT '租户代码',
  `corp_name` varchar(100) NOT NULL DEFAULT 'JeeSite' COMMENT '租户名称',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`user_code`) USING BTREE,
  KEY `idx_sys_user_lc` (`login_code`) USING BTREE,
  KEY `idx_sys_user_email` (`email`) USING BTREE,
  KEY `idx_sys_user_mobile` (`mobile`) USING BTREE,
  KEY `idx_sys_user_wo` (`wx_openid`) USING BTREE,
  KEY `idx_sys_user_imei` (`mobile_imei`) USING BTREE,
  KEY `idx_sys_user_rt` (`user_type`) USING BTREE,
  KEY `idx_sys_user_rc` (`ref_code`) USING BTREE,
  KEY `idx_sys_user_mt` (`mgr_type`) USING BTREE,
  KEY `idx_sys_user_us` (`user_weight`) USING BTREE,
  KEY `idx_sys_user_ud` (`update_date`) USING BTREE,
  KEY `idx_sys_user_status` (`status`) USING BTREE,
  KEY `idx_sys_user_cc` (`corp_code`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_user_data_scope`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_user_data_scope` (
  `user_code` varchar(100) NOT NULL COMMENT '控制用户编码',
  `ctrl_type` varchar(20) NOT NULL COMMENT '控制类型',
  `ctrl_data` varchar(64) NOT NULL COMMENT '控制数据',
  `ctrl_permi` varchar(64) NOT NULL COMMENT '控制权限',
  PRIMARY KEY (`user_code`,`ctrl_type`,`ctrl_data`,`ctrl_permi`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户数据权限表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_sys_user_role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `js_sys_user_role` (
  `user_code` varchar(100) NOT NULL COMMENT '用户编码',
  `role_code` varchar(64) NOT NULL COMMENT '角色编码',
  PRIMARY KEY (`user_code`,`role_code`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户与角色关联表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_abnormal_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_abnormal_record` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT NULL COMMENT '产品二维码',
  `content` varchar(100) DEFAULT NULL COMMENT '结果',
  `param` char(1) DEFAULT NULL COMMENT '参数',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_app`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_app` (
  `id` varchar(64) NOT NULL,
  `ver` int(11) unsigned DEFAULT NULL COMMENT '版本号',
  `content` text COMMENT '修攺内容',
  `state` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='安卓版本管理表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_apply`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_apply` (
  `id` varchar(64) NOT NULL,
  `approval_id` varchar(64) DEFAULT '' COMMENT '流程id',
  `bus_type` char(1) DEFAULT '' COMMENT '1=返工不合格评审单 4=返修不合格评审单 2=来料入库不合格评审单 3=返修让步接收申请单 5=报废申请单6=来料报废',
  `bus_id` varchar(64) DEFAULT '' COMMENT '业务id',
  `node` varchar(100) DEFAULT '' COMMENT '审批节点',
  `state` char(1) DEFAULT '0' COMMENT '状态 0=待审核 1=同意 2=拒绝 3=已流转',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_date` datetime DEFAULT NULL,
  `apply_by` varchar(100) DEFAULT '' COMMENT '审核人',
  `apply_date` datetime DEFAULT NULL COMMENT '审核时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='审核表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_approval`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_approval` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `nodes` text COMMENT '审核节点',
  `user_code` varchar(100) DEFAULT '' COMMENT '超时通知人员',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='审批流程';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_approval_node`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_approval_node` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(200) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `users` text COMMENT '审核人员多个逗号隔开',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='审批节点';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_batch_sn`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_batch_sn` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `line_sn` varchar(100) DEFAULT '' COMMENT '产线编号',
  `nums` int(11) DEFAULT '0' COMMENT '绑定数量',
  `is_js` char(1) DEFAULT '1' COMMENT '是否用完2是1否',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='托盘批次码';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_check`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_check` (
  `id` varchar(64) NOT NULL,
  `title` varchar(200) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='质量检查类型';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_check_form`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_check_form` (
  `id` varchar(64) NOT NULL,
  `items_id` varchar(64) DEFAULT '' COMMENT '清单id',
  `check_id` varchar(64) DEFAULT '' COMMENT '检查类型id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='检查类型与检查清单关系表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_check_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_check_items` (
  `id` varchar(64) NOT NULL,
  `position` varchar(200) DEFAULT '' COMMENT '检查位置',
  `title` varchar(200) DEFAULT '' COMMENT '检查项目',
  `standard` varchar(3000) DEFAULT '' COMMENT '标准要求',
  `way` varchar(200) DEFAULT '' COMMENT '检查方式',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `oprno` varchar(100) DEFAULT '' COMMENT '工序号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='检查清单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_check_items_fail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_check_items_fail` (
  `id` varchar(64) NOT NULL,
  `item_id` varchar(64) DEFAULT '' COMMENT '清单id',
  `title` varchar(255) DEFAULT '' COMMENT '描述',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='检查清单失效类型';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_customer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_customer` (
  `id` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL COMMENT '客户名称',
  `description` varchar(500) DEFAULT NULL COMMENT '客户介绍',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1停用）',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='客户表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device` (
  `tree_code` varchar(64) NOT NULL,
  `parent_code` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) CHARACTER SET utf8 NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '全节点名',
  `tree_name` varchar(200) CHARACTER SET utf8 NOT NULL COMMENT '节点名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `sn` varchar(255) DEFAULT '' COMMENT '唯一编号',
  `ip` varchar(255) DEFAULT '' COMMENT 'IP地址',
  `spec` varchar(255) DEFAULT '' COMMENT '规格型号',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `online` tinyint(2) DEFAULT '0' COMMENT '在线状态0在线1离线',
  `company` varchar(255) DEFAULT '' COMMENT '制造商',
  `outdate` date DEFAULT NULL COMMENT '出场日期',
  `gw` varchar(255) DEFAULT NULL COMMENT '工位',
  `bc` varchar(10) DEFAULT NULL COMMENT '班次 A白班/B夜班',
  `cate_id` varchar(64) DEFAULT '' COMMENT '分类',
  `work_status` char(1) DEFAULT '1' COMMENT '设备工作状态 （1自动，2手动，3故障，4维修，5质量报警，6物流堵料）',
  `work_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '设备工作时间',
  `postion` varchar(50) DEFAULT NULL COMMENT '工位地图位置',
  `device_code` varchar(255) DEFAULT '' COMMENT '设备识别码',
  `device_type` varchar(10) DEFAULT NULL COMMENT '设备类型 A自动工位/M手动工位',
  `work_type` char(1) DEFAULT '0' COMMENT '工作类型 0单机/1联机',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `interval` int(10) unsigned DEFAULT '0' COMMENT '生产时间（秒）',
  `product_sn` varchar(50) DEFAULT '' COMMENT '当前加工工件',
  `product_cate` varchar(10) DEFAULT NULL COMMENT '类型',
  `line_sn` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`tree_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device2`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device2` (
  `tree_code` varchar(64) NOT NULL,
  `parent_code` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) CHARACTER SET utf8 NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '全节点名',
  `tree_name` varchar(200) CHARACTER SET utf8 NOT NULL COMMENT '节点名称',
  `remarks` varchar(255) DEFAULT '' COMMENT '备注',
  `sn` varchar(255) DEFAULT '' COMMENT '唯一编号',
  `ip` varchar(255) DEFAULT '' COMMENT 'IP地址',
  `spec` varchar(255) DEFAULT '' COMMENT '规格型号',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `online` tinyint(2) DEFAULT '0' COMMENT '在线状态0在线1离线',
  `company` varchar(255) DEFAULT '' COMMENT '制造商',
  `outdate` date DEFAULT NULL COMMENT '出场日期',
  `gw` varchar(255) DEFAULT NULL COMMENT '工位',
  `bc` varchar(10) DEFAULT NULL COMMENT '班次 A白班/B夜班',
  `cate_id` varchar(64) DEFAULT '' COMMENT '分类',
  `work_status` char(1) DEFAULT '1' COMMENT '设备工作状态 （1自动，2手动，3故障，4维修，5质量报警，6物流堵料）',
  `work_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '设备工作时间',
  `postion` varchar(50) DEFAULT NULL COMMENT '工位地图位置',
  `device_type` varchar(10) DEFAULT NULL COMMENT '设备类型 A自动工位/M手动工位',
  `work_type` char(1) DEFAULT '0' COMMENT '工作类型 0单机/1联机',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `interval` int(10) unsigned DEFAULT '0' COMMENT '生产时间（秒）',
  PRIMARY KEY (`tree_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_alarm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_alarm` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `device_sn` varchar(100) DEFAULT '' COMMENT '设备编号',
  `type` varchar(100) DEFAULT '' COMMENT '报警类型',
  `content` text COMMENT '报警额外参数',
  `state` char(1) DEFAULT '0' COMMENT '状态 0=待处理 1=已处理',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备报警记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_cate`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_cate` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '主键id',
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_date` datetime DEFAULT NULL COMMENT '创建',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  `create_by` varchar(64) DEFAULT '',
  `update_by` varchar(64) DEFAULT '',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备分类';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_check`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_check` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(100) DEFAULT '' COMMENT '名称',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `type` char(1) DEFAULT '0' COMMENT '类型（0=选择框 1=输入框）',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备检查项';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_client`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_client` (
  `id` varchar(64) NOT NULL,
  `tree_name` varchar(200) NOT NULL COMMENT '设备名称',
  `sn` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '唯一编号',
  `cate_id` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '分类',
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `oprno` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '工位',
  `device_code` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '设备识别码',
  `remark` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='工位设备信息记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_consumable`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_consumable` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(100) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `aa` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='易耗品';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_consumable_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_consumable_record` (
  `id` varchar(64) NOT NULL,
  `consumable_id` varchar(64) DEFAULT '' COMMENT '易耗品',
  `device_record_id` varchar(64) DEFAULT '0',
  `num` int(11) DEFAULT '0' COMMENT '使用数量',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  `bus_type` char(1) DEFAULT '0' COMMENT '业务类型 0=点检记录 1=紧急性维修记录 2=预防性维修记录',
  `bus_id` varchar(64) DEFAULT '' COMMENT '业务id',
  `device_id` varchar(64) DEFAULT '' COMMENT '设备id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='易耗品使用记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_copy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_copy` (
  `tree_code` varchar(64) NOT NULL,
  `parent_code` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) CHARACTER SET utf8 NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) CHARACTER SET utf8 NOT NULL COMMENT '全节点名',
  `tree_name` varchar(200) CHARACTER SET utf8 NOT NULL COMMENT '节点名称',
  `remarks` varchar(255) DEFAULT '' COMMENT '备注',
  `sn` varchar(255) DEFAULT '' COMMENT '唯一编号',
  `ip` varchar(255) DEFAULT '' COMMENT 'IP地址',
  `spec` varchar(255) DEFAULT '' COMMENT '规格型号',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `online` tinyint(2) DEFAULT '0' COMMENT '在线状态0在线1离线',
  `company` varchar(255) DEFAULT '' COMMENT '制造商',
  `outdate` date DEFAULT NULL COMMENT '出场日期',
  `gw` varchar(255) DEFAULT NULL COMMENT '工位',
  `bc` varchar(10) DEFAULT NULL COMMENT '班次 A白班/B夜班',
  `cate_id` varchar(64) DEFAULT '' COMMENT '分类',
  `work_status` char(1) DEFAULT '1' COMMENT '设备工作状态 （1自动，2手动，3故障，4维修，5质量报警，6物流堵料）',
  `work_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '设备工作时间',
  `postion` varchar(50) DEFAULT NULL COMMENT '工位地图位置',
  `device_type` varchar(10) DEFAULT NULL COMMENT '设备类型 A自动工位/M手动工位',
  `work_type` char(1) DEFAULT '0' COMMENT '工作类型 0单机/1联机',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `interval` int(10) unsigned DEFAULT '0' COMMENT '生产时间（秒）',
  PRIMARY KEY (`tree_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_form`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_form` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(100) DEFAULT '' COMMENT '名称',
  `device_id` varchar(64) DEFAULT '' COMMENT '设备',
  `device_check` text COMMENT '设备检查项',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备任务内容';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_log` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `device_id` varchar(64) DEFAULT '' COMMENT '设备id',
  `content` text COMMENT '修改内容',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='设备修改记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_prevent`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_prevent` (
  `id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `cate` varchar(100) DEFAULT '' COMMENT '技术类型',
  `cycle` varchar(100) DEFAULT '' COMMENT '周期',
  `labor_hour` varchar(100) DEFAULT '' COMMENT '工时',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='预防性维修任务';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_prevent_form`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_prevent_form` (
  `id` varchar(64) NOT NULL,
  `prevent_id` varchar(64) DEFAULT '' COMMENT '任务清单',
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `labor_hour` varchar(100) DEFAULT '' COMMENT '工时',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='预防性维修任务清单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_prevent_task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_prevent_task` (
  `id` varchar(64) NOT NULL,
  `prevent_id` varchar(64) DEFAULT '' COMMENT '任务清单',
  `user_code` varchar(100) DEFAULT '' COMMENT '执行人员',
  `device_id` varchar(64) DEFAULT '' COMMENT '设备',
  `start_date` datetime DEFAULT NULL COMMENT '任务开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '任务结束时间',
  `content` varchar(255) DEFAULT '' COMMENT '提交内容',
  `check_json` text COMMENT '任务清单内容',
  `state` char(1) DEFAULT '0' COMMENT '状态 ''0''=待处理 ''1''=''已完成''',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='预防性维修任务';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_record` (
  `id` varchar(64) NOT NULL,
  `device_id` varchar(64) DEFAULT '' COMMENT '设备id',
  `type` char(1) DEFAULT '0' COMMENT '类型（0=紧急性 1=预防性）',
  `content` text COMMENT '提交内容',
  `user_code` varchar(100) DEFAULT '' COMMENT '用户',
  `repair_date` datetime DEFAULT NULL COMMENT '维修时间',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `form_id` varchar(64) DEFAULT '' COMMENT '任务内容',
  `task_id` varchar(64) DEFAULT '' COMMENT '计划id',
  `check_json` text COMMENT '检查结果',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备维修记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_state`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_state` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `device_sn` varchar(100) DEFAULT '' COMMENT '设备编号',
  `mode` varchar(64) DEFAULT '' COMMENT '设备工作模式',
  `state` char(2) DEFAULT '' COMMENT '设备状态',
  `content` varchar(255) DEFAULT '' COMMENT '状态描述',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `start_date` datetime DEFAULT NULL COMMENT '开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '结束时间',
  `interval` int(10) unsigned DEFAULT '0' COMMENT '生产时间（秒）',
  `code` varchar(255) DEFAULT '' COMMENT '错误码',
  `deal_by` varchar(255) DEFAULT NULL COMMENT '处理人',
  `deal_date` datetime DEFAULT NULL COMMENT '处理时间',
  `is_deal` varchar(1) DEFAULT NULL COMMENT '是否已处理 0=未处理 1=已处理',
  `sn` varchar(50) DEFAULT NULL COMMENT '工件码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备运行状态表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_task` (
  `id` varchar(64) NOT NULL,
  `title` varchar(100) DEFAULT '' COMMENT '计划名称',
  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `state` char(1) DEFAULT '0' COMMENT '状态（0=未执行 1=执行中 2=已完成 3=未完成）',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  `device_check` text COMMENT '设备检查项',
  `user_code` text COMMENT '检查人',
  `days` int(11) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备计划';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_task_form`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_task_form` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `device_task_id` varchar(64) NOT NULL DEFAULT '任务id',
  `device_form_id` varchar(64) NOT NULL DEFAULT '任务内容id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备计划任务内容关系表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_task_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_task_user` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `device_task_id` varchar(64) NOT NULL DEFAULT '任务id',
  `user_code` varchar(64) NOT NULL DEFAULT '检查人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备计划检查人关系表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_time`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_time` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `oprno` varchar(50) DEFAULT '' COMMENT '工序号',
  `sn` varchar(50) DEFAULT '' COMMENT '产品二维码',
  `start_date` datetime DEFAULT NULL COMMENT '开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '结束时间',
  `interval` int(10) unsigned DEFAULT '0' COMMENT '生产时间（秒）',
  `create_date` datetime NOT NULL,
  `update_date` datetime DEFAULT NULL,
  `scheduled_date` datetime DEFAULT NULL COMMENT '预计完成时间',
  `transfer` tinyint(1) unsigned DEFAULT '0' COMMENT '是否已转移 0=未发送 1=已发送',
  `product_cate` varchar(20) DEFAULT NULL COMMENT '产线编号',
  `create_by` varchar(64) DEFAULT '',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE,
  KEY `oprnocate` (`oprno`,`product_cate`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工位生产时间表'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_device_urgency`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_device_urgency` (
  `id` varchar(64) NOT NULL,
  `device_id` varchar(64) DEFAULT '' COMMENT '设备id',
  `user_code` varchar(100) DEFAULT '' COMMENT '维修人员',
  `alarm_id` varchar(64) DEFAULT '' COMMENT '报警id',
  `content` varchar(1000) DEFAULT '' COMMENT '维修内容',
  `start_date` datetime DEFAULT NULL COMMENT '开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '结束时间',
  `state` char(1) DEFAULT '0' COMMENT '状态 0=处理中 1=已完成',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `interval` int(10) unsigned DEFAULT '0' COMMENT '维修时间（分）',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `oprno` varchar(255) DEFAULT '' COMMENT '工位号',
  `cate_id` varchar(64) DEFAULT '' COMMENT '分类',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='紧急性维修记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_document`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_document` (
  `id` varchar(64) NOT NULL,
  `cate_id` varchar(64) DEFAULT '' COMMENT '文档类型',
  `title` varchar(255) DEFAULT '' COMMENT '文档名称',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建时间',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '修改时间',
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='文档表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_document_cate`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_document_cate` (
  `tree_code` varchar(64) NOT NULL COMMENT '节点编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `tree_name` varchar(200) NOT NULL COMMENT '节点名称',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`tree_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='文档类型表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_electric_torque`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_electric_torque` (
  `id` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '工序id',
  `sn` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产品二维码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `torsion` varchar(100) DEFAULT NULL COMMENT '扭力',
  `task` varchar(100) DEFAULT NULL COMMENT '任务',
  `number` varchar(100) DEFAULT NULL COMMENT '圈数',
  `elapsed_time` varchar(100) DEFAULT NULL COMMENT '耗时',
  `result` varchar(100) DEFAULT NULL COMMENT '结果',
  `batch_id` varchar(64) DEFAULT NULL COMMENT '电批扭力参数批次id(关联外键)',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`),
  KEY `cdate` (`create_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='电批扭力参数记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_electric_torque_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_electric_torque_info` (
  `id` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT 'id',
  `sn` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产品二维码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `batch` varchar(100) DEFAULT NULL COMMENT '批次',
  `count` int(10) DEFAULT NULL COMMENT '总数',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`),
  KEY `cdate` (`create_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='电批扭力参数批次表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_group`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_group` (
  `id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产组';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_group_oprno`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_group_oprno` (
  `id` varchar(64) NOT NULL,
  `group_id` varchar(64) DEFAULT '',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `enable` char(1) DEFAULT '1' COMMENT '1启用0禁用',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产组工位号';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_group_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_group_user` (
  `id` varchar(64) NOT NULL,
  `group_id` varchar(64) DEFAULT '',
  `user_code` varchar(64) DEFAULT '' COMMENT '用户',
  `auth_edit` char(1) DEFAULT '0' COMMENT '编辑权限 0=无 1=有',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `enable` char(1) DEFAULT '1' COMMENT '1启用0禁用',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产组成员';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_icons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_icons` (
  `id` varchar(64) NOT NULL,
  `title` varchar(100) DEFAULT '' COMMENT '名称',
  `mode` varchar(100) DEFAULT '' COMMENT '标识',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `auth` varchar(255) DEFAULT '' COMMENT '对应权限id',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建时间',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='功能模块表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_insulation_detection`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_insulation_detection` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) DEFAULT NULL COMMENT '工件码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) DEFAULT NULL COMMENT '产线编号',
  `function_code` varchar(50) DEFAULT NULL COMMENT '功能码',
  `state` varchar(20) DEFAULT NULL COMMENT '判断/状态',
  `voltage` varchar(50) DEFAULT NULL COMMENT '测试电压',
  `current` varchar(50) DEFAULT NULL COMMENT '测试电流',
  `resistance` varchar(50) DEFAULT NULL COMMENT '测试电阻',
  `test_time` datetime DEFAULT NULL COMMENT '测试时间',
  `ramp_time` datetime DEFAULT NULL COMMENT '斜坡时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='绝缘检测记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_ipqc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_ipqc` (
  `id` varchar(64) NOT NULL,
  `bus_type` char(1) DEFAULT '' COMMENT '业务类型 1=来料入库 2=返工/返修',
  `bus_id` varchar(64) DEFAULT '' COMMENT '业务id',
  `type` varchar(255) DEFAULT '' COMMENT '不合格类型，多个逗号隔开',
  `state` char(255) DEFAULT '0' COMMENT '状态（0=待审核 1=线下评审 2=通过 3=未通过）',
  `content` text COMMENT '不合格描述',
  `create_by` varchar(64) DEFAULT '' COMMENT '发现人',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `batch_sn` varchar(200) DEFAULT '' COMMENT '不合格批次',
  `program` varchar(200) DEFAULT '' COMMENT '项目',
  `ps_by` varchar(64) DEFAULT '' COMMENT '线下评审操作人',
  `ps_date` datetime DEFAULT NULL COMMENT '线下评审操作时间',
  `ps_remark` varchar(255) DEFAULT '' COMMENT '评审备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='不合格评审单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_iqc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_iqc` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `line_sn` varchar(100) DEFAULT '' COMMENT '产线编号',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `state` char(1) DEFAULT '1' COMMENT '状态1合格2不合格',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='驻场IQC检查记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_jb_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_jb_log` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `sn` varchar(255) DEFAULT '' COMMENT '工件码',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='工件解绑记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_line`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_line` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '编号',
  `title` varchar(100) DEFAULT '' COMMENT '名称',
  `rules` varchar(255) DEFAULT '' COMMENT '质量检查规则',
  `rules_type` char(1) DEFAULT NULL COMMENT '规则状态1=每个几分钟检查一次 2=每个几件检查一次',
  `classes` text COMMENT '排班班次json',
  `sn` char(2) DEFAULT '' COMMENT '产线编号',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `product_cate` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产线表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_line_process`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_line_process` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '编号',
  `line_id` varchar(64) DEFAULT '' COMMENT '生产线id',
  `title` varchar(100) DEFAULT '' COMMENT '工序名称',
  `oprno` varchar(255) DEFAULT '' COMMENT '工位号',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `sorts` int(10) unsigned DEFAULT '0' COMMENT '排序正序',
  `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT '' COMMENT '修改人',
  `update_date` datetime DEFAULT NULL COMMENT '修改时间',
  `repeat` char(1) DEFAULT '0' COMMENT '是否可重复工作 0=否 1=是',
  `quality` char(1) DEFAULT '0' COMMENT '是否防呆（0=否 1=是）',
  `devices` varchar(500) DEFAULT '' COMMENT '设备编号',
  `gzs` varchar(500) DEFAULT '' COMMENT '工装编号',
  `stop` char(1) DEFAULT '0' COMMENT '设备启动 1=首件检禁止 2=更换配件检禁止 其他允许',
  `pid` varchar(64) DEFAULT NULL COMMENT '父级ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生成工序表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_line_process_material`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_line_process_material` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `line_process_id` varchar(64) NOT NULL DEFAULT '' COMMENT '生成工序id',
  `material_id` varchar(64) NOT NULL DEFAULT '' COMMENT '物料id',
  `nums` int(10) DEFAULT NULL COMMENT '数量',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `craft` varchar(10) DEFAULT NULL COMMENT '工艺号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='生产工序物料表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_line_process_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_line_process_user` (
  `line_process_id` varchar(64) DEFAULT '' COMMENT '工艺id',
  `user_code` varchar(100) DEFAULT '' COMMENT '用户',
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '编号',
  `auth` char(1) DEFAULT '0' COMMENT '权限 0=生产 1=质量 2=全部',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工艺人员关系表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_log` (
  `id` varchar(64) NOT NULL,
  `content` text COMMENT '内容',
  `create_date` datetime NOT NULL COMMENT '创建日期',
  `ip` varchar(100) DEFAULT '' COMMENT 'ip',
  `type` char(1) DEFAULT '' COMMENT '类型 0=tcp 1=http',
  `oprno` varchar(10) DEFAULT NULL COMMENT '工位号',
  `line_sn` varchar(10) DEFAULT NULL COMMENT '产线编号',
  `btype` varchar(100) DEFAULT NULL COMMENT '报文类型',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `createDate` (`create_date`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产日志表'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_log_useless`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_log_useless` (
  `id` varchar(64) NOT NULL,
  `content` varchar(2000) DEFAULT '' COMMENT '内容',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `ip` varchar(200) DEFAULT '' COMMENT 'ip',
  `type` char(1) DEFAULT '' COMMENT '类型',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `cdate` (`create_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='心跳同步日志表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(255) DEFAULT NULL COMMENT '部件名称',
  `spec` varchar(255) DEFAULT NULL COMMENT '部件规格',
  `erp_sn` varchar(64) DEFAULT NULL COMMENT 'ERP编码',
  `img_sn` varchar(255) DEFAULT NULL COMMENT '内部图号',
  `nums` int(10) DEFAULT NULL COMMENT '数量/套',
  `attr` varchar(255) DEFAULT NULL COMMENT '加工属性',
  `supplier` varchar(255) DEFAULT NULL COMMENT '供应商',
  `aging` int(10) DEFAULT NULL COMMENT '有效期（单位：月） 0=无有效期',
  `type` char(1) DEFAULT NULL COMMENT '追溯类型 1=批追 2=精追',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '状态',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `is_bom` char(1) DEFAULT '1' COMMENT '是否BOM物料 0=否 1=是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='物料表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_bf_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_bf_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `state` char(1) DEFAULT '1' COMMENT '状态1=待审核2=通过3=未通过',
  `remark` varchar(255) DEFAULT '',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='物料报废记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_bf_record_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_bf_record_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `kc_id` varchar(64) DEFAULT '' COMMENT '库存记录id',
  `record_id` varchar(64) DEFAULT '' COMMENT '记录id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `nums` int(11) DEFAULT '0' COMMENT '报废数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='物料报废记录明细';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_blp_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_blp_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `check_record_id` varchar(64) DEFAULT '' COMMENT '来料检查记录id',
  `state` char(1) DEFAULT '1' COMMENT '状态1=待审核2=通过3=未通过',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料不良品记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_check`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_check` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `org` char(5) CHARACTER SET utf8mb4 DEFAULT '1' COMMENT '项目',
  `content` text COMMENT '检查内容',
  `status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '状态',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `type` char(1) DEFAULT '2' COMMENT '1=系统 2=人工',
  `min_value` decimal(15,3) DEFAULT NULL,
  `max_value` decimal(15,3) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料检查内容表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_check_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_check_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `material_check_id` varchar(64) DEFAULT '' COMMENT '物料检查内容id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='物料检查内容';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_check_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_check_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `sn` varchar(255) DEFAULT NULL COMMENT '来料码',
  `fa_date` varchar(100) DEFAULT '' COMMENT '发货日期',
  `fa_nums` int(11) DEFAULT NULL COMMENT '发货数量',
  `nums` int(11) DEFAULT '0' COMMENT '实际数量',
  `state` char(1) DEFAULT '1' COMMENT '1合格2不合格',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料检查记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_check_record_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_check_record_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `record_id` varchar(64) DEFAULT '' COMMENT '检查记录id',
  `check_id` varchar(64) DEFAULT '' COMMENT '检查内容id',
  `a1` text COMMENT '实测值1',
  `a2` text COMMENT '实测值2',
  `a3` text COMMENT '实测值3',
  `a4` text COMMENT '实测值4',
  `a5` text COMMENT '实测值5',
  `result` char(1) DEFAULT '1' COMMENT '状态1=合格 2=不合格',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料检查记录详细表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_ck_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_ck_log` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `ll_record_id` varchar(64) DEFAULT '' COMMENT '领料单id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `nums` int(11) DEFAULT NULL COMMENT '数量',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `old_batch_sn` varchar(255) DEFAULT '' COMMENT '原批次码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='出库记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_kc_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_kc_log` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `rk_record_id` varchar(64) DEFAULT '' COMMENT '入库单id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `kw_id` varchar(64) DEFAULT '' COMMENT '库位',
  `expire_date` varchar(100) DEFAULT NULL COMMENT '过期时间',
  `nums` int(11) DEFAULT NULL COMMENT '数量',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `old_batch_sn` varchar(255) DEFAULT '' COMMENT '原批次码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料库存表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_kw`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_kw` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(255) DEFAULT '' COMMENT '库位名称',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料库位';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_ll_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_ll_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `plan_id` varchar(64) DEFAULT '' COMMENT '班次计划id',
  `state` char(1) DEFAULT '1' COMMENT '状态1=待领料2=已领料',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='领料记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_ll_record_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_ll_record_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `record_id` varchar(64) DEFAULT '' COMMENT '记录id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `nums` int(11) DEFAULT '0' COMMENT '数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='领料记录明细';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_prebind`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_prebind` (
  `id` varchar(64) NOT NULL,
  `line_sn` varchar(10) DEFAULT NULL COMMENT '产线编号',
  `oprno` varchar(10) DEFAULT NULL COMMENT '工位号',
  `batch_sn` varchar(100) DEFAULT NULL COMMENT '批次码',
  `craft` varchar(10) DEFAULT NULL COMMENT '工艺号',
  `last_times` int(10) unsigned DEFAULT '0' COMMENT '剩余使用次数',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `material_id` varchar(64) NOT NULL DEFAULT '' COMMENT '物料id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='工位绑定物料批次';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_report`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_report` (
  `id` varchar(64) NOT NULL,
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `sn` varchar(150) DEFAULT NULL COMMENT '来料码',
  `fa_date` varchar(100) DEFAULT '' COMMENT '发货日期',
  `fa_nums` int(11) DEFAULT '0' COMMENT '发货数量',
  `nums` int(11) DEFAULT '0' COMMENT '实际数量',
  `state` char(1) NOT NULL DEFAULT '1' COMMENT '状态 0=未检查 1=已检查',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '报检人',
  `create_date` datetime DEFAULT NULL COMMENT '报检时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `status` char(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料报检';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_rk_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_rk_log` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `rk_record_id` varchar(64) DEFAULT '' COMMENT '入库单id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `kw_id` varchar(64) DEFAULT '' COMMENT '库位',
  `expire_date` varchar(100) DEFAULT NULL COMMENT '过期时间',
  `nums` int(11) DEFAULT NULL COMMENT '数量',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `old_batch_sn` varchar(255) DEFAULT '' COMMENT '原批次码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_rk_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_rk_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `check_record_id` varchar(64) DEFAULT '' COMMENT '来料检查记录id',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `state` char(1) DEFAULT '1' COMMENT '状态1=待处理2=已处理',
  `type` char(1) DEFAULT '1' COMMENT '入库类型1=正常入库2=让步入库3=余料入库',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='入库记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_rk_record_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_rk_record_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `record_id` varchar(64) DEFAULT '' COMMENT '记录id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `nums` int(11) DEFAULT '0' COMMENT '入库数量',
  `old_batch_sn` varchar(255) DEFAULT '' COMMENT '原批次妈',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='入库记录明细';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_th_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_th_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `check_record_id` varchar(64) DEFAULT '' COMMENT '来料检查记录id',
  `blp_record_id` varchar(64) DEFAULT '' COMMENT '不良品记录id',
  `state` char(1) DEFAULT '1' COMMENT '状态1=待处理2=已处理',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料退货记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_material_th_record_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_material_th_record_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `record_id` varchar(64) DEFAULT '' COMMENT '记录id',
  `material_id` varchar(64) DEFAULT '' COMMENT '物料id',
  `nums` int(11) DEFAULT '0' COMMENT '入库数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='来料退货记录明细';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_ng`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_ng` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) DEFAULT '' COMMENT '工件号',
  `oprno` varchar(20) DEFAULT '' COMMENT '发现工位',
  `type` char(1) DEFAULT '' COMMENT '类型 1=在线返修 2=离线返修',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `items` text COMMENT '返修问题清单',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='ng记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_periodic_maintenance`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_periodic_maintenance` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(100) DEFAULT NULL COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `name` varchar(255) DEFAULT NULL COMMENT '唯一标识',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='周期性维护类型';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_periodic_maintenance_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_periodic_maintenance_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `pmid` varchar(64) DEFAULT '' COMMENT '类型',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '' COMMENT '维护人员',
  `create_date` datetime DEFAULT NULL COMMENT '维护日期',
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='周期性维护记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_plan`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_plan` (
  `id` varchar(64) NOT NULL,
  `shift_id` varchar(64) DEFAULT '' COMMENT '班次',
  `cate_id` varchar(64) DEFAULT '' COMMENT '产品',
  `nums` int(10) unsigned DEFAULT '0' COMMENT '计划数量',
  `day` date DEFAULT NULL COMMENT '日期',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='班次生产计划';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_alarm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_alarm` (
  `id` varchar(64) NOT NULL DEFAULT '1',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `line_sn` varchar(10) DEFAULT '' COMMENT '产线编号',
  `sn` varchar(100) DEFAULT NULL COMMENT '工件码',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `state` char(1) DEFAULT '1' COMMENT '状态 0=未处理 1=已处理',
  `content` varchar(255) DEFAULT NULL COMMENT '处理说明',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='报警记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_check`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_check` (
  `id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '名称',
  `type` char(255) DEFAULT NULL COMMENT '点检类型（1=点检内容 2=工装点检 3=设备点检 4=工艺参数）',
  `status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '状态',
  `line_process_id` varchar(64) DEFAULT NULL COMMENT '工位',
  `input` char(1) DEFAULT NULL COMMENT '输入类型 1=选择框 2=输入框',
  `sort` int(255) unsigned DEFAULT NULL COMMENT '排序，正序',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `min_value` decimal(15,3) DEFAULT NULL,
  `max_value` decimal(15,3) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='工位点检项表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_check_gz`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_check_gz` (
  `id` varchar(64) NOT NULL,
  `shift` varchar(255) DEFAULT NULL COMMENT '班次',
  `content` varchar(255) DEFAULT NULL COMMENT '点检内容',
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `oprno` varchar(100) DEFAULT NULL COMMENT '工位号',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='工装点检记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_check_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_check_record` (
  `id` varchar(64) NOT NULL,
  `shift` varchar(255) DEFAULT NULL COMMENT '班次',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `oprno` varchar(100) DEFAULT NULL COMMENT '工位号',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `result` varchar(10) NOT NULL DEFAULT '' COMMENT '结果 OK/NG',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='点检记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_check_record_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_check_record_items` (
  `id` varchar(64) NOT NULL,
  `record_id` varchar(64) DEFAULT NULL COMMENT '记录id',
  `check_id` varchar(64) DEFAULT NULL COMMENT '点检项',
  `content` varchar(255) DEFAULT NULL COMMENT '点检结果',
  `result` varchar(10) DEFAULT NULL COMMENT '结果 OK/NG',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='点检项记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_product` (
  `id` varchar(64) NOT NULL,
  `product_cate` varchar(20) DEFAULT NULL COMMENT '产品类型编码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `sn` varchar(1000) DEFAULT '' COMMENT '产品二维码',
  `create_date` datetime DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工位当前产品';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_process_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_process_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `line_sn` varchar(10) DEFAULT '' COMMENT '产线编号',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='禁用设备处理记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '主键id',
  `sn` varchar(100) DEFAULT '' COMMENT '产品二维码编号',
  `psn` varchar(200) DEFAULT '' COMMENT '生产批号',
  `title` varchar(255) DEFAULT '' COMMENT '产品名称',
  `state` char(1) DEFAULT '0' COMMENT '0=生产中 1=合格 2=返修中 3=报废',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `batch_sn` varchar(100) DEFAULT '' COMMENT '打包批号',
  `weight` varchar(10) DEFAULT '' COMMENT '重量kg',
  `bind_date` datetime DEFAULT NULL COMMENT '绑定时间',
  `bind_by` varchar(64) DEFAULT '' COMMENT '绑定人',
  `create_date` datetime DEFAULT NULL COMMENT '创建',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  `create_by` varchar(64) DEFAULT '',
  `update_by` varchar(64) DEFAULT '',
  `cate` varchar(20) DEFAULT '' COMMENT '产品类型',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_batch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_batch` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `batch_sn` varchar(100) DEFAULT '' COMMENT '批次码',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='成品批次表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_bs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_bs` (
  `id` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '工序id',
  `sn` varchar(50) DEFAULT NULL COMMENT '产品二维码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `result` varchar(100) DEFAULT NULL COMMENT '结果',
  `torque` varchar(30) DEFAULT NULL COMMENT '扭矩值',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `create_date` datetime DEFAULT NULL COMMENT '日期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='扭力扳手记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_cache` (
  `id` varchar(64) NOT NULL,
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `content` text COMMENT '缓存值json',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `state` char(1) DEFAULT '0' COMMENT '0=可修改 1=不可修改',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产记录缓存表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_cate`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_cate` (
  `id` varchar(64) NOT NULL,
  `title` varchar(200) DEFAULT '' COMMENT '类型名称',
  `sn` varchar(50) DEFAULT '' COMMENT '类型编号',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `template_id` varchar(64) DEFAULT '' COMMENT '模板id',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `cate` int(10) unsigned DEFAULT '0' COMMENT '0=产品 1=零件',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件类型表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_ccd`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_ccd` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `cate` varchar(50) DEFAULT '' COMMENT '产品类型',
  `title` varchar(50) DEFAULT '' COMMENT '检测设备名称',
  `photo_num` varchar(50) DEFAULT '' COMMENT '拍照区序号',
  `test_num` varchar(50) DEFAULT '' COMMENT '测点编号',
  `test_cate` varchar(50) DEFAULT '' COMMENT '测点类型',
  `test_date` datetime DEFAULT NULL COMMENT '测试时间',
  `result` varchar(100) DEFAULT '' COMMENT '检测结果OK/NG',
  `recheck` varchar(100) DEFAULT '' COMMENT '人工复检',
  `create_date` datetime NOT NULL,
  `line_sn` varchar(10) DEFAULT '' COMMENT '产线编号',
  `oid` varchar(255) DEFAULT '' COMMENT '原id',
  `test_param` varchar(255) DEFAULT NULL COMMENT '检测参数',
  `test_value` varchar(255) DEFAULT NULL COMMENT '检测值',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE,
  KEY `oid` (`oid`) USING BTREE,
  KEY `testDate` (`test_date`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_check`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_check` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `type` char(1) DEFAULT '0' COMMENT '检查类型 0=随机检查 1=首件检查 2=下线目视检查 3=手动抽查 4=追溯检查',
  `sn` varchar(100) DEFAULT '' COMMENT '产品二维码',
  `product_record_id` varchar(64) DEFAULT '' COMMENT '记录id',
  `line_process_id` varchar(64) DEFAULT '' COMMENT '工艺id',
  `state` char(1) DEFAULT '0' COMMENT '0=待检测 1=合格 2=返修 3=报废 4=返工',
  `remark` varchar(255) DEFAULT '' COMMENT '备注说明',
  `check_id` varchar(64) DEFAULT '' COMMENT '检查内容',
  `items` text COMMENT '检查内容JSON',
  `pid` varchar(64) DEFAULT NULL COMMENT '追溯检查id',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL COMMENT '检查时间',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品质量检查记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_check_first`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_check_first` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产品二维码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `type` varchar(50) DEFAULT NULL COMMENT '类型 1=开班首件检查 2=换配件首件检',
  `state` char(1) DEFAULT NULL COMMENT '状态(0未检查,1已检查)',
  `result` varchar(50) DEFAULT NULL COMMENT '检查结果',
  `remark` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '检查人',
  `create_date` datetime DEFAULT NULL COMMENT '检查时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='首件检查记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_check_test`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_check_test` (
  `id` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '工序id',
  `sn` varchar(100) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产品二维码编号',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` varchar(10) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `type` varchar(10) DEFAULT NULL COMMENT '类型',
  `result` varchar(100) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '检测结果OK/NG',
  `result2` varchar(100) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '检测结果OK/NG',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='点检测试记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_cmt`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_cmt` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `line_sn` varchar(10) DEFAULT NULL COMMENT '产线编号',
  `content` mediumtext COMMENT '参数内容',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `sn` (`sn`),
  KEY `cdate` (`create_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_cnc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_cnc` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '工件码',
  `line_sn` varchar(10) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `oprno` varchar(10) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `tools` varchar(255) DEFAULT NULL COMMENT '刀号',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `create_date` datetime DEFAULT NULL COMMENT '日期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='CNC断刀记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_dhb`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_dhb` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT NULL COMMENT '工件码',
  `batch_sn` varchar(100) DEFAULT NULL COMMENT '底护板码',
  `create_by` varchar(64) DEFAULT NULL COMMENT '绑定人',
  `create_date` datetime DEFAULT NULL COMMENT '绑定时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE,
  KEY `batch_sn` (`batch_sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件底护板';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_ding`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_ding` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `njdw` varchar(255) DEFAULT '' COMMENT '扭矩单位',
  `jddw` varchar(255) DEFAULT '' COMMENT '角度单位',
  `yldw` varchar(255) DEFAULT '' COMMENT '压力单位',
  `cddw` varchar(255) DEFAULT '' COMMENT '长度单位',
  `sjjmc` varchar(255) DEFAULT '' COMMENT '数据集名称',
  `rqsj` datetime DEFAULT NULL COMMENT '日期时间',
  `sjjlx` varchar(255) DEFAULT '' COMMENT '数据集类型',
  `bm` varchar(255) DEFAULT '' COMMENT '编码',
  `sjjxh` varchar(255) DEFAULT '' COMMENT '数据集序号',
  `zt` varchar(255) DEFAULT '' COMMENT '状态',
  `zsj` varchar(255) DEFAULT '' COMMENT '总时间',
  `bzsjydw` varchar(255) DEFAULT '' COMMENT '步骤时间-预定位',
  `bzsjych` varchar(255) DEFAULT '' COMMENT '步骤时间-啮合',
  `chnj` varchar(255) DEFAULT '' COMMENT '啮合-扭矩',
  `chnjsx` varchar(255) DEFAULT '' COMMENT '啮合-扭矩上限',
  `chxyl` varchar(255) DEFAULT '' COMMENT '啮合-下压力',
  `jczclxd` varchar(255) DEFAULT '' COMMENT '检测 支撑力限度',
  `bzsj` varchar(255) DEFAULT '' COMMENT '步骤时间',
  `ctnj` varchar(255) DEFAULT '' COMMENT '穿透-扭矩',
  `ctnjsxz` varchar(255) DEFAULT '' COMMENT '穿透-扭矩上限值',
  `ctxyl` varchar(255) DEFAULT '' COMMENT '穿透-下压力',
  `ckzclxd` varchar(255) DEFAULT '' COMMENT '穿孔 支撑力限度',
  `ctzjd` varchar(255) DEFAULT '' COMMENT '穿透-总角度',
  `ctfbpyl` varchar(255) DEFAULT '' COMMENT '穿透-分步偏移量',
  `ctnjsd` varchar(255) DEFAULT '' COMMENT '穿透-拧紧深度',
  `bzsj2` varchar(255) DEFAULT '' COMMENT '步骤时间',
  `ctnj2` varchar(255) DEFAULT '' COMMENT '穿透-扭矩',
  `ctnjsxz2` varchar(255) DEFAULT '' COMMENT '穿透-扭矩上限值',
  `ctxyl2` varchar(255) DEFAULT '' COMMENT '穿透-下压力',
  `ctxylsx2` varchar(255) DEFAULT '' COMMENT '穿透-下压力上限',
  `ctzjd2` varchar(255) DEFAULT '' COMMENT '穿透-总角度',
  `ctnjsd2` varchar(255) DEFAULT '' COMMENT '穿透-拧紧深度',
  `ctfbpyl2` varchar(255) DEFAULT '' COMMENT '穿透-分步偏移量',
  `bzsj3` varchar(255) DEFAULT '' COMMENT '步骤时间',
  `zznjnj` varchar(255) DEFAULT NULL COMMENT '最终拧紧-扭矩',
  `zznjnjxxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-扭矩下限值',
  `zznjnjsxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-扭矩上限值',
  `zznjxyl` varchar(255) DEFAULT NULL COMMENT '最终拧紧-下压力',
  `zznjxylsxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-下压力上限值',
  `zznjjd` varchar(255) DEFAULT NULL COMMENT '最终拧紧-角度',
  `zznjnjfz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-扭矩阈值',
  `zznjjdsxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-角度上限值',
  `zznjjdxxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-角度下限值',
  `zznjnjsd` varchar(255) DEFAULT NULL COMMENT '最终拧紧-拧紧深度',
  `zznjnjsdxxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-拧紧深度下限值',
  `zznjnjsdsxz` varchar(255) DEFAULT NULL COMMENT '最终拧紧-拧紧深度上限值',
  `sn` varchar(100) DEFAULT NULL COMMENT '工件码',
  `oprno` varchar(100) DEFAULT NULL COMMENT '工位号',
  `line_sn` varchar(100) DEFAULT '' COMMENT '产线编号',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='打钉数据表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_finish_package`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_finish_package` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `batch_sn` varchar(255) DEFAULT '' COMMENT '批次码',
  `nums` int(11) DEFAULT '0' COMMENT '数量',
  `storage_location` varchar(64) DEFAULT NULL COMMENT '库位',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '入库人',
  `create_date` datetime DEFAULT NULL COMMENT '入库时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='成品打包记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_fsw`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_fsw` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(100) DEFAULT NULL COMMENT '工件码',
  `line_sn` varchar(10) DEFAULT '' COMMENT '产线编号',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `spindle_speed` varchar(1000) DEFAULT NULL COMMENT '主轴转速（转速/程序运行时间）',
  `feed_rate` varchar(1000) DEFAULT NULL COMMENT '进给速度（进给/程序运行时间）',
  `pressure` text COMMENT '焊接压力',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='FSW过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_gp12`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_gp12` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工件码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `remark` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='GP12下线记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_gq`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_gq` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(255) DEFAULT NULL COMMENT '工件码',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_gumming`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_gumming` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `sn` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '产品二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) DEFAULT '' COMMENT '产线编号',
  `result` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '结果',
  `photo_address` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '图片地址',
  `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT '' COMMENT '修改人',
  `update_date` datetime DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='断胶检测记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_hb`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_hb` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '工件码',
  `line_sn` varchar(30) DEFAULT '' COMMENT '产线编号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `group_count` varchar(100) DEFAULT '0.000' COMMENT '群组计数',
  `group_total` varchar(100) DEFAULT '0.000' COMMENT '群组总数',
  `tensile_fore` varchar(100) DEFAULT '0.000' COMMENT '拉力值',
  `journey` varchar(100) DEFAULT '' COMMENT '行程值',
  `depth` varchar(100) DEFAULT '0.00' COMMENT '深度值',
  `product_name` varchar(100) DEFAULT '0.00' COMMENT '产品名称',
  `result` varchar(100) DEFAULT NULL COMMENT '结果',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `la_mao_id` int(11) NOT NULL COMMENT '拉铆机数据库数据id',
  PRIMARY KEY (`id`,`la_mao_id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='宏博拉铆参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_helium`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_helium` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(100) DEFAULT NULL COMMENT '工件码',
  `line_sn` varchar(10) DEFAULT '' COMMENT '产线编号',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `test_time` datetime DEFAULT NULL COMMENT '测试时间',
  `box_vacuum_degree` varchar(100) DEFAULT '' COMMENT '真空箱真空度',
  `product_vacuum_degree` varchar(100) DEFAULT '' COMMENT '冷板真空度',
  `pressure` varchar(100) DEFAULT '' COMMENT '充氦压力',
  `detection_time` varchar(100) DEFAULT NULL COMMENT '氦检时间',
  `bendi` varchar(100) DEFAULT '' COMMENT '本底',
  `leakage_rate` varchar(100) DEFAULT '' COMMENT '漏率',
  `result` varchar(100) DEFAULT '' COMMENT '检测结果',
  `create_date` datetime DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `fid` varchar(64) DEFAULT '' COMMENT '来源主键id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `fid` (`fid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='氦检记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_insulation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_insulation` (
  `id` varchar(255) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '工件码',
  `duration1` varchar(255) DEFAULT '' COMMENT 'DC2700V测试时长',
  `leak` varchar(255) DEFAULT '' COMMENT '漏电流(mA)',
  `duration2` varchar(255) DEFAULT '' COMMENT 'DC1000V测试时长',
  `resistance` varchar(255) DEFAULT '' COMMENT '绝缘阻值(MΩ)',
  `result` varchar(255) DEFAULT '' COMMENT '测试结果',
  `test_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '测试时间',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `dc` varchar(255) DEFAULT NULL COMMENT 'DC',
  `ir` varchar(255) DEFAULT NULL COMMENT 'IR',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='冷板绝缘检测';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_leakage_point`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_leakage_point` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT NULL COMMENT '工件码',
  `oprno` varchar(100) DEFAULT NULL COMMENT '工位',
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `normal` varchar(1000) DEFAULT NULL COMMENT '正常漏点',
  `abnormal` varchar(1000) DEFAULT NULL COMMENT '异常漏点',
  `create_by` varchar(255) DEFAULT NULL COMMENT '工作人员',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `result` varchar(255) DEFAULT NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件气密漏点记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_leakage_point_repair`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_leakage_point_repair` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT NULL COMMENT '工件码',
  `leakage_point_id` varchar(64) DEFAULT NULL COMMENT '漏点记录id',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(255) DEFAULT NULL COMMENT '工作人员',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='气密漏点补焊记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_material`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_material` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(100) DEFAULT '' COMMENT '产品二维码',
  `material_sn` varchar(100) DEFAULT '' COMMENT '材料编码',
  `type` char(1) DEFAULT NULL COMMENT '类型 0=工艺上料 1=返修用料',
  `bus_id` varchar(64) DEFAULT NULL COMMENT '业务id（关联mes_product_record和mes_product_repair）',
  `count` int(10) unsigned DEFAULT '0' COMMENT '数量',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用料记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_model`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_model` (
  `id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '名称',
  `model` varchar(255) DEFAULT NULL COMMENT '型号',
  `spec` varchar(255) DEFAULT NULL COMMENT '规格',
  `spec_start` int(10) DEFAULT NULL COMMENT '规格起始位数',
  `length` int(10) DEFAULT NULL COMMENT '条码长度',
  `nums` int(10) DEFAULT NULL COMMENT '入库数量',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `gh` int(10) unsigned DEFAULT '0' COMMENT '固化时长（单位：分钟）',
  `state` char(1) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品型号表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_modify_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_modify_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) DEFAULT '' COMMENT '产品二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `content_old` varchar(10) DEFAULT NULL COMMENT '原结果',
  `content` varchar(10) DEFAULT '' COMMENT '结果',
  `source` char(1) DEFAULT '0' COMMENT '来源(0系统,1后台,2PDA)',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品修改记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_mpp`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_mpp` (
  `id` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '工序id',
  `sn` varchar(50) DEFAULT NULL COMMENT '产品二维码',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `line_sn` char(2) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `result` varchar(100) DEFAULT NULL COMMENT '结果',
  `photo_address` varchar(255) DEFAULT NULL COMMENT '图片地址',
  `test_time` datetime DEFAULT NULL COMMENT '检测时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_offline`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_offline` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '主键',
  `sn` varchar(100) DEFAULT '' COMMENT '工件码',
  `state` char(1) DEFAULT '0' COMMENT '状态: 0=正常出货 1=漏加工确认下线',
  `miss_oprno` varchar(20) DEFAULT '' COMMENT '漏加工工位号',
  `miss_remark` varchar(500) DEFAULT '' COMMENT '漏加工确认原因',
  `remark` varchar(500) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL COMMENT '出货时间',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sn` (`sn`) USING BTREE,
  KEY `idx_create_date` (`create_date`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件出货记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op050`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op050` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `hj_vdc1` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机1电压',
  `hj_vdc2` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机2电压',
  `hj_current1` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机1电流',
  `hj_current2` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机2电流',
  `hj_wirefeed1` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机1送丝速度',
  `hj_wirefeed2` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机2送丝速度',
  `hj_job1` int(10) DEFAULT '0' COMMENT '焊机1job',
  `hj_job2` int(10) DEFAULT '0' COMMENT '焊机2job',
  `hj_err1` int(10) DEFAULT '0' COMMENT '焊机1错误代码',
  `hj_err2` int(10) DEFAULT '0' COMMENT '焊机2错误代码',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op130`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op130` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `hj_vdc1` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机1电压',
  `hj_vdc2` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机2电压',
  `hj_current1` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机1电流',
  `hj_current2` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机2电流',
  `hj_wirefeed1` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机1送丝速度',
  `hj_wirefeed2` decimal(10,4) DEFAULT '0.0000' COMMENT '焊机2送丝速度',
  `hj_job1` int(10) DEFAULT '0' COMMENT '焊机1job',
  `hj_job2` int(10) DEFAULT '0' COMMENT '焊机2job',
  `hj_err1` int(10) DEFAULT '0' COMMENT '焊机1错误代码',
  `hj_err2` int(10) DEFAULT '0' COMMENT '焊机2错误代码',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op170`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op170` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `number` int(10) DEFAULT '0',
  `x` decimal(10,3) unsigned DEFAULT '0.000',
  `y` decimal(10,3) unsigned DEFAULT '0.000',
  `z` decimal(10,3) unsigned DEFAULT '0.000',
  `result` varchar(100) DEFAULT '',
  `pulling` decimal(10,2) DEFAULT '0.00',
  `depth` decimal(10,2) DEFAULT '0.00',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op180`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op180` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `number` int(10) DEFAULT '0',
  `x` decimal(10,3) unsigned DEFAULT '0.000',
  `y` decimal(10,3) unsigned DEFAULT '0.000',
  `z` decimal(10,3) unsigned DEFAULT '0.000',
  `result` varchar(100) DEFAULT '',
  `pulling` decimal(10,2) DEFAULT '0.00',
  `depth` decimal(10,2) DEFAULT '0.00',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op200`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op200` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `number` int(10) DEFAULT '0',
  `x` decimal(10,3) unsigned DEFAULT '0.000',
  `y` decimal(10,3) unsigned DEFAULT '0.000',
  `z` decimal(10,3) unsigned DEFAULT '0.000',
  `result` varchar(100) DEFAULT '',
  `pulling` decimal(10,2) DEFAULT '0.00',
  `depth` decimal(10,2) DEFAULT '0.00',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op240`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op240` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `number` int(10) DEFAULT '0',
  `x` decimal(10,3) unsigned DEFAULT '0.000',
  `y` decimal(10,3) unsigned DEFAULT '0.000',
  `z` decimal(10,3) unsigned DEFAULT '0.000',
  `result` varchar(100) DEFAULT '',
  `pulling` decimal(10,2) DEFAULT '0.00',
  `depth` decimal(10,2) DEFAULT '0.00',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_op330`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_op330` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '二维码',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `cate` varchar(50) DEFAULT '' COMMENT '产品类型',
  `title` varchar(50) DEFAULT '' COMMENT '检测设备名称',
  `photo_num` varchar(50) DEFAULT '' COMMENT '拍照区序号',
  `test_num` varchar(50) DEFAULT '' COMMENT '测点编号',
  `test_cate` varchar(50) DEFAULT '' COMMENT '测点类型',
  `test_date` datetime DEFAULT NULL COMMENT '测试时间',
  `result` varchar(100) DEFAULT '' COMMENT '检测结果OK/NG',
  `recheck` varchar(100) DEFAULT '' COMMENT '人工复检',
  `create_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_parts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_parts` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `product_flow_num` varchar(200) DEFAULT '' COMMENT '产品流水号',
  `made_time` datetime DEFAULT NULL COMMENT '制造时间',
  `record_num` varchar(200) DEFAULT '' COMMENT '记录编号',
  `device_caption` varchar(200) DEFAULT '' COMMENT '设备名称',
  `device_num` varchar(200) DEFAULT '' COMMENT '设备号',
  `channel_des` varchar(200) DEFAULT '' COMMENT '通道描述',
  `test_time` datetime DEFAULT NULL COMMENT '测试时间',
  `work_num` varchar(255) DEFAULT '' COMMENT '工号',
  `work_pos_num` varchar(200) DEFAULT '' COMMENT '工位号',
  `component_num` varchar(200) DEFAULT '' COMMENT '工件号',
  `test_pressure` varchar(200) DEFAULT '' COMMENT '测试压',
  `test_pressure_unit` varchar(200) DEFAULT '' COMMENT '测试压单位',
  `leak_val` varchar(200) DEFAULT '' COMMENT '泄露值',
  `leak_val_unit` varchar(200) DEFAULT '' COMMENT '泄露值单位',
  `test_result` varchar(200) DEFAULT '' COMMENT '测试结果',
  `test_pace` varchar(200) DEFAULT '' COMMENT '测试节拍',
  `create_date` datetime DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产零件记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_prod`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_prod` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(100) DEFAULT NULL COMMENT '工件码',
  `oprno` varchar(100) DEFAULT NULL COMMENT '工位',
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `type` varchar(100) DEFAULT '' COMMENT '类型，A枪 B枪',
  `f_out` varchar(100) DEFAULT '0',
  `s_out` varchar(100) DEFAULT '0.000',
  `f_min` varchar(100) DEFAULT '0',
  `s_min` varchar(100) DEFAULT '0',
  `f_max` varchar(100) DEFAULT '0',
  `s_max` varchar(100) DEFAULT '0',
  `qty` varchar(100) DEFAULT NULL,
  `date_time` datetime DEFAULT NULL COMMENT '拉铆时间',
  `create_by` varchar(255) DEFAULT NULL COMMENT '工作人员',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `f_set` varchar(100) DEFAULT '0',
  `s_set` varchar(100) DEFAULT '0.000',
  `serial_number` varchar(100) DEFAULT NULL,
  `md5` varchar(255) DEFAULT NULL,
  `old_sn` varchar(100) DEFAULT NULL COMMENT '序列号',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE,
  KEY `dateTime` (`date_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='拉铆过程参数'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_push`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_push` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(64) DEFAULT '' COMMENT '工件码',
  `state` char(1) DEFAULT '' COMMENT '状态 0=未推送 1=已推送',
  `create_date` datetime DEFAULT NULL COMMENT '下线时间',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  `content` text COMMENT '推送内容',
  `type` char(1) DEFAULT NULL COMMENT '类型1=下线称重 2=半成品气密检测 3=总成气密检测 4=冷板气密检测 5=冷板绝缘检测',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='欣旺达数据推送';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_qm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_qm` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `test_time` datetime DEFAULT NULL COMMENT '测试时间',
  `work_num` varchar(255) DEFAULT '' COMMENT '工号',
  `work_pos_num` varchar(200) DEFAULT '' COMMENT '工位号',
  `component_num` varchar(200) DEFAULT '' COMMENT '工件号',
  `test_pressure` varchar(200) DEFAULT '' COMMENT '测试压',
  `test_pressure_unit` varchar(200) DEFAULT '' COMMENT '测试压单位',
  `leak_val` varchar(200) DEFAULT '' COMMENT '泄露值',
  `leak_val_unit` varchar(200) DEFAULT '' COMMENT '泄露值单位',
  `leak_rate` varchar(200) DEFAULT NULL COMMENT '泄露率',
  `leak_rate_unit` varchar(200) DEFAULT NULL COMMENT '泄露率单位',
  `test_result` varchar(200) DEFAULT '' COMMENT '测试结果',
  `test_pace` varchar(200) DEFAULT '' COMMENT '测试节拍',
  `product_cate` varchar(10) DEFAULT NULL COMMENT '产线编号',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `device_type` varchar(200) DEFAULT '1' COMMENT '设备类型',
  `create_date` datetime DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `fid` varchar(64) DEFAULT '' COMMENT '来源主键id',
  `cq_duration` varchar(100) DEFAULT NULL COMMENT '充气时间',
  `by_duration` varchar(100) DEFAULT NULL COMMENT '保压时间',
  `cs_duration` varchar(100) DEFAULT NULL COMMENT '测试时间',
  `line_sn` varchar(10) DEFAULT NULL COMMENT '产线编号',
  `program_no` varchar(100) DEFAULT '' COMMENT '程序号',
  `title` varchar(255) DEFAULT NULL COMMENT '名称',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `component_num` (`component_num`) USING BTREE,
  KEY `testtime` (`test_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件气密检查记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_qmwy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_qmwy` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `product_flow_num` varchar(200) DEFAULT '' COMMENT '产品流水号',
  `made_time` datetime DEFAULT NULL COMMENT '制造时间',
  `record_num` varchar(200) DEFAULT '' COMMENT '记录编号',
  `device_caption` varchar(200) DEFAULT '' COMMENT '设备名称',
  `device_num` varchar(200) DEFAULT '' COMMENT '设备号',
  `channel_des` varchar(200) DEFAULT '' COMMENT '通道描述',
  `test_time` datetime DEFAULT NULL COMMENT '测试时间',
  `work_num` varchar(255) DEFAULT '' COMMENT '工号',
  `work_pos_num` varchar(200) DEFAULT '' COMMENT '工位号',
  `component_num` varchar(200) DEFAULT '' COMMENT '工件号',
  `test_pressure` varchar(200) DEFAULT '' COMMENT '测试压',
  `test_pressure_unit` varchar(200) DEFAULT '' COMMENT '测试压单位',
  `leak_val` varchar(200) DEFAULT '' COMMENT '泄露值',
  `leak_val_unit` varchar(200) DEFAULT '' COMMENT '泄露值单位',
  `test_result` varchar(200) DEFAULT '' COMMENT '测试结果',
  `test_pace` varchar(200) DEFAULT '' COMMENT '测试节拍',
  `create_date` datetime DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `product_cate` varchar(10) DEFAULT NULL COMMENT '产品类型',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件气密检查记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_qmxd`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_qmxd` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `test_time` datetime DEFAULT NULL COMMENT '测试时间',
  `work_num` varchar(255) DEFAULT '' COMMENT '作业员',
  `work_pos_num` varchar(200) DEFAULT '' COMMENT '工位号',
  `component_num` varchar(200) DEFAULT '' COMMENT '工件号',
  `test_pressure` varchar(200) DEFAULT '' COMMENT '压力值',
  `test_pressure_unit` varchar(200) DEFAULT '' COMMENT '压力单位',
  `leak_val` varchar(200) DEFAULT '' COMMENT '泄露值',
  `leak_val_unit` varchar(200) DEFAULT '' COMMENT '泄露值单位',
  `test_result` varchar(200) DEFAULT '' COMMENT '测试结果',
  `remark` varchar(200) DEFAULT '' COMMENT '备注',
  `create_date` datetime DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `product_cate` varchar(10) DEFAULT NULL COMMENT '产品类型',
  `oprno` varchar(10) DEFAULT '' COMMENT '工位号',
  `program_no` varchar(100) DEFAULT NULL COMMENT '程序号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工件气密检查记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_record` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `sn` varchar(50) DEFAULT '' COMMENT '产品二维码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `serial` int(10) unsigned DEFAULT '0' COMMENT '工位结果序号',
  `cate_sn` varchar(30) DEFAULT '' COMMENT '工件类型',
  `materiel_sn` varchar(255) DEFAULT '' COMMENT '绑定内容',
  `content` varchar(100) DEFAULT '' COMMENT '结果',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `pid` varchar(64) DEFAULT '' COMMENT '父级id',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime NOT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `tree_level` decimal(4,0) NOT NULL DEFAULT '0' COMMENT '层次级别',
  `sort` int(10) unsigned DEFAULT '0' COMMENT '排序',
  `tid` varchar(64) DEFAULT '' COMMENT '模板报文id',
  `cdate` int(10) unsigned DEFAULT '0' COMMENT '排序字段（创建时间）',
  `line_sn` char(2) DEFAULT '' COMMENT '产线编号',
  `source` char(1) DEFAULT '0' COMMENT '来源',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE,
  KEY `lsn` (`oprno`,`craft`,`cate_sn`) USING BTREE,
  KEY `msn` (`materiel_sn`) USING BTREE,
  KEY `updateDate` (`update_date`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产记录表'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_record_unbind`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_record_unbind` (
  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '工序id',
  `record_id` varchar(64) DEFAULT '' COMMENT '记录id',
  `materiel_sn` varchar(50) DEFAULT '' COMMENT '物料批次二维码',
  `create_date` datetime DEFAULT NULL,
  `user_code` varchar(64) DEFAULT '' COMMENT '操作人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='物料解绑记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_repair`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_repair` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(100) DEFAULT '' COMMENT '工件码',
  `product_model_id` varchar(64) DEFAULT '' COMMENT '产品型号',
  `reason` varchar(255) DEFAULT '' COMMENT '问题描述',
  `state` char(1) DEFAULT '0' COMMENT '状态 \r\n0=待返修 1=待检查 2=已检查',
  `result` varchar(255) DEFAULT '' COMMENT '维修结果 OK/NG',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '' COMMENT '上报人',
  `create_date` datetime DEFAULT NULL COMMENT '上报时间',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `repair_by` varchar(255) DEFAULT NULL COMMENT '维修人',
  `repair_date` datetime DEFAULT NULL COMMENT '维修时间',
  `repair_remark` varchar(255) DEFAULT NULL COMMENT '维修说明',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_repair_quality`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_repair_quality` (
  `id` varchar(64) NOT NULL,
  `repair_id` varchar(64) DEFAULT '' COMMENT '返修单',
  `result` char(1) DEFAULT '' COMMENT '结果1=OK 2=NG',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修质量确认';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_repair_receive`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_repair_receive` (
  `id` varchar(64) NOT NULL,
  `repair_id` varchar(64) DEFAULT '' COMMENT '返修id',
  `dep_id` varchar(100) DEFAULT '' COMMENT '部门',
  `content` text COMMENT '异常原因',
  `apply_by` varchar(100) DEFAULT '' COMMENT '申请人',
  `apply_date` datetime DEFAULT NULL COMMENT '申请日期',
  `ps_by` varchar(64) DEFAULT '' COMMENT '线下评审操作人',
  `ps_date` datetime DEFAULT NULL COMMENT '线下评审操作时间',
  `ps_remark` varchar(255) DEFAULT '' COMMENT '评审备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修让步接收单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_repair_sop`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_repair_sop` (
  `id` varchar(64) NOT NULL,
  `repair_id` varchar(64) DEFAULT '' COMMENT '返修id',
  `sop_id` varchar(64) DEFAULT '' COMMENT 'SOPid',
  `way_id` varchar(64) DEFAULT '' COMMENT '指导书id',
  `steps` text COMMENT '步骤json',
  `repair_by` varchar(100) DEFAULT '' COMMENT '责任人',
  `repair_date` datetime DEFAULT NULL COMMENT '维修时间',
  `create_date` datetime DEFAULT NULL,
  `create_by` varchar(100) DEFAULT '' COMMENT '创建人',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返工返修清单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_scrap`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_scrap` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(100) DEFAULT '' COMMENT '二维码',
  `repair_id` varchar(64) DEFAULT '' COMMENT '返工/返修id',
  `check_id` varchar(64) DEFAULT '' COMMENT '检查记录id',
  `state` char(1) DEFAULT '0' COMMENT '状态 0=待审核 1=已报废 2=线下评审 3=HOLD',
  `remark` varchar(255) DEFAULT '' COMMENT '备注说明',
  `items` text COMMENT '检查项json',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  `ps_by` varchar(64) DEFAULT '' COMMENT '线下评审操作人',
  `ps_date` datetime DEFAULT NULL COMMENT '线下评审操作时间',
  `ps_remark` varchar(255) DEFAULT '' COMMENT '评审备注',
  `oprno` varchar(255) DEFAULT '' COMMENT '发现工序号',
  `tx_date` date DEFAULT NULL COMMENT '提醒日期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='报废记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_storage_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_storage_record` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT NULL COMMENT '工件码',
  `relation_sn1` varchar(50) DEFAULT NULL COMMENT '关联码1（供应商批次）',
  `relation_sn2` varchar(50) DEFAULT NULL COMMENT '关联码2（32位流水码）',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `cpleak` varchar(255) DEFAULT NULL COMMENT '成品泄露值',
  `slleak` varchar(255) DEFAULT NULL COMMENT '水冷泄露值',
  `batch_sn` varchar(255) DEFAULT NULL,
  `bind` char(1) DEFAULT '1',
  `remark2` varchar(255) DEFAULT NULL,
  `customer` varchar(255) DEFAULT NULL COMMENT '所属客户',
  `product_model` varchar(255) DEFAULT NULL COMMENT '产品型号',
  `order_no` varchar(255) DEFAULT NULL COMMENT '订单号',
  `cold_plate_qr` varchar(255) DEFAULT NULL COMMENT '冷板二维码',
  `batch_sn2` varchar(255) DEFAULT NULL COMMENT '批次码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='产品入库表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_warehouse`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_warehouse` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '物料批次码',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `craft` varchar(30) DEFAULT '' COMMENT '工艺号',
  `cates` varchar(500) DEFAULT '' COMMENT '产品类型及数量json, [{"id":"123","title":"产品","sn":"A","nums":10}]',
  `nums` int(10) unsigned DEFAULT '0' COMMENT '每批数量',
  `remain_nums` int(10) unsigned DEFAULT '0' COMMENT '剩余数量',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用料批次表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_xwd`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_xwd` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(64) DEFAULT '' COMMENT '*供应商内部条码/产品条码',
  `swd_sn` varchar(64) DEFAULT '' COMMENT '*零件编号，SWD料号',
  `uptime` datetime DEFAULT NULL COMMENT '*数据上传时间',
  `gys` varchar(255) DEFAULT NULL COMMENT '*供应商编码',
  `line` varchar(255) DEFAULT NULL COMMENT '*产线名称',
  `oprno_title` varchar(255) DEFAULT NULL COMMENT '*工序名称',
  `device_sn` varchar(255) DEFAULT NULL COMMENT '*测试机名称',
  `clamp` varchar(255) DEFAULT '' COMMENT '夹具',
  `classes` varchar(255) DEFAULT NULL COMMENT '班次',
  `operator` varchar(255) DEFAULT NULL COMMENT '操作员',
  `product_title` varchar(255) DEFAULT NULL COMMENT '*产品名称',
  `program_title` varchar(255) DEFAULT NULL COMMENT '*项目名称',
  `note` varchar(255) DEFAULT NULL COMMENT '注释',
  `pallet` varchar(255) DEFAULT NULL COMMENT '托盘号',
  `pallet_idx` varchar(255) DEFAULT '' COMMENT '产品在托盘内的位置, 默认第0个',
  `test_date` datetime DEFAULT NULL COMMENT '*测试完成时间',
  `test_duration` varchar(255) DEFAULT NULL COMMENT '*测试时长',
  `test_result4` varchar(255) DEFAULT NULL COMMENT '*测试结果_level_4',
  `test_title` varchar(255) DEFAULT NULL COMMENT '*测试项名称',
  `test_unit` varchar(255) DEFAULT NULL COMMENT '*测试值单位',
  `test_val` varchar(255) DEFAULT NULL COMMENT '*测试值',
  `max_val` varchar(255) DEFAULT NULL COMMENT '*上限值',
  `min_val` varchar(255) DEFAULT NULL COMMENT '*下限值',
  `test_result7` varchar(255) DEFAULT NULL COMMENT '*测试结果_level_7',
  `rule` varchar(255) DEFAULT NULL COMMENT '*规则',
  `target_val` varchar(255) DEFAULT NULL COMMENT '目标值',
  `data_type` varchar(255) DEFAULT NULL COMMENT '*数据类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='欣旺达数据同步';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_xwd_gztool`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_xwd_gztool` (
  `id` varchar(64) NOT NULL,
  `gzid` varchar(64) DEFAULT NULL COMMENT '工装关联id',
  `program_title` varchar(255) DEFAULT NULL COMMENT '项目名称',
  `swd_sn` varchar(64) DEFAULT '' COMMENT '零件编码',
  `product_title` varchar(255) DEFAULT NULL COMMENT '零件名称',
  `process_name` varchar(255) DEFAULT NULL COMMENT '工序名称',
  `equipment_name` varchar(255) DEFAULT NULL COMMENT '设备名称&编号',
  `tooling_mold_name` varchar(255) DEFAULT NULL COMMENT '工装/模具名称',
  `tooling_mold_code` varchar(255) DEFAULT NULL COMMENT '工装/模具编号',
  `design_life` int(10) unsigned DEFAULT '0' COMMENT '设计寿命（次数）',
  `start_time` date DEFAULT NULL COMMENT '开始使用时间',
  `used_count` int(10) unsigned DEFAULT '0' COMMENT '已使用次数',
  `utilization_rate` decimal(10,4) unsigned DEFAULT '0.0000' COMMENT '使用率',
  `first_warning_time` date DEFAULT NULL COMMENT '首次预警时间',
  `end_of_life_time` date DEFAULT NULL COMMENT '寿命结束时间',
  `new_tooling_mold_code` varchar(255) DEFAULT NULL COMMENT '新工装/模具编号',
  `changer` varchar(255) DEFAULT NULL COMMENT '更换人',
  `data_upload_time` varchar(255) DEFAULT NULL COMMENT '数据上传时间：2024-03-15T10:18:17.017+08:00',
  `sync` int(1) DEFAULT '0' COMMENT '同步 0=未同步 1=已同步',
  `sync_err` varchar(255) DEFAULT NULL COMMENT '同步失败原因',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工装寿命同步数据';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_xwd_oee`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_xwd_oee` (
  `id` varchar(64) NOT NULL,
  `program_title` varchar(255) DEFAULT NULL COMMENT '项目名称',
  `swd_sn` varchar(64) DEFAULT '' COMMENT '零件编码',
  `product_title` varchar(255) DEFAULT NULL COMMENT '零件名称',
  `process_name` varchar(255) DEFAULT NULL COMMENT '工序名称',
  `equipment_capacity` varchar(100) DEFAULT '0' COMMENT '设备能力',
  `yield_rate` varchar(100) DEFAULT '0' COMMENT '良率',
  `equipment_utilization_rate` varchar(100) DEFAULT '0.0000' COMMENT '设备稼动率',
  `oee` varchar(100) DEFAULT NULL COMMENT 'OEE',
  `data_upload_time` varchar(255) DEFAULT NULL COMMENT '数据上传时间：2024-03-15T10:18:17.017+08:00',
  `sync` int(1) DEFAULT '0' COMMENT '同步 0=未同步 1=已同步',
  `sync_err` varchar(255) DEFAULT NULL COMMENT '同步失败原因',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='OEE同步数据';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_xwd_stock`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_xwd_stock` (
  `id` varchar(64) NOT NULL,
  `program_title` varchar(255) DEFAULT NULL COMMENT '项目名称',
  `swd_sn` varchar(64) DEFAULT '' COMMENT '零件编码',
  `product_title` varchar(255) DEFAULT NULL COMMENT '零件名称',
  `process_name` varchar(255) DEFAULT NULL COMMENT '工序名称',
  `production_quantity` int(10) unsigned DEFAULT '0' COMMENT '生产数量',
  `data_upload_time` varchar(255) DEFAULT NULL COMMENT '数据上传时间：2024-03-15T10:18:17.017+08:00',
  `sync` int(1) DEFAULT '0' COMMENT '同步 0=未同步 1=已同步',
  `sync_err` varchar(255) DEFAULT NULL COMMENT '同步失败原因',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='库存数据导入';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_xwd_ztl`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_xwd_ztl` (
  `id` varchar(64) NOT NULL,
  `program_title` varchar(255) DEFAULT NULL COMMENT '项目名称',
  `swd_sn` varchar(64) DEFAULT '' COMMENT '零件编码',
  `product_title` varchar(255) DEFAULT NULL COMMENT '零件名称',
  `process_name` varchar(255) DEFAULT NULL COMMENT '工序名称',
  `production_quantity` int(10) unsigned DEFAULT '0' COMMENT '生产数量',
  `qualified_quantity` int(10) unsigned DEFAULT '0' COMMENT '合格数量',
  `un_qualified_quantity` int(10) unsigned DEFAULT '0' COMMENT '不合格数量',
  `qualified_rate` decimal(10,4) unsigned DEFAULT '0.0000' COMMENT '合格率',
  `data_upload_time` varchar(255) DEFAULT NULL COMMENT '数据上传时间：2024-03-15T10:18:17.017+08:00',
  `sync` int(1) DEFAULT '0' COMMENT '同步 0=未同步 1=已同步',
  `sync_err` varchar(255) DEFAULT NULL COMMENT '同步失败原因',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='直通率同步数据';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_product_ygsl`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_product_ygsl` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工件码',
  `line_sn` varchar(30) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '产线编号',
  `oprno` varchar(20) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '工位号',
  `pos` varchar(10) DEFAULT NULL COMMENT '枪类型',
  `tightening_status` varchar(10) DEFAULT NULL COMMENT '拧紧状态',
  `torque_status` varchar(10) DEFAULT NULL COMMENT '扭矩状态',
  `angle_status` varchar(10) DEFAULT NULL COMMENT '角度状态',
  `torque_min` varchar(30) DEFAULT NULL COMMENT '最小扭矩',
  `torque_max` varchar(30) DEFAULT NULL COMMENT '最大扭矩',
  `torque_final` varchar(30) DEFAULT NULL COMMENT '目标扭矩',
  `torque` varchar(30) DEFAULT NULL COMMENT '扭矩值',
  `angle_min` varchar(30) DEFAULT NULL COMMENT '最小角度',
  `angle_max` varchar(30) DEFAULT NULL COMMENT '最大角度',
  `angle_final` varchar(30) DEFAULT NULL COMMENT '目标角度',
  `angle` varchar(30) DEFAULT NULL COMMENT '角度值',
  `tightening_date` datetime DEFAULT NULL COMMENT '拧紧时间',
  `serial_number` varchar(10) DEFAULT NULL COMMENT '拧紧序号',
  `tightening_id` varchar(50) DEFAULT NULL COMMENT '拧紧ID',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`,`create_date`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='扭力枪参数'
/*!50100 PARTITION BY RANGE (MONTH(create_date))
(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (5) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (6) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (7) ENGINE = InnoDB,
 PARTITION p6 VALUES LESS THAN (8) ENGINE = InnoDB,
 PARTITION p7 VALUES LESS THAN (9) ENGINE = InnoDB,
 PARTITION p8 VALUES LESS THAN (10) ENGINE = InnoDB,
 PARTITION p9 VALUES LESS THAN (11) ENGINE = InnoDB,
 PARTITION p10 VALUES LESS THAN (12) ENGINE = InnoDB,
 PARTITION p11 VALUES LESS THAN (13) ENGINE = InnoDB) */;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_quality`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_quality` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) DEFAULT '' COMMENT '工件号',
  `oprno` varchar(20) DEFAULT '' COMMENT '工位',
  `type` char(1) DEFAULT '' COMMENT '状态 1=首件 2=中间件 3=末件',
  `result` varchar(255) DEFAULT '' COMMENT '检查结果',
  `items` varchar(3000) DEFAULT NULL COMMENT '问题清单',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='抽检记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_recover`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_recover` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '工件码',
  `oprno` varchar(50) DEFAULT '' COMMENT '工位号',
  `reason` varchar(255) DEFAULT '' COMMENT '报废原因',
  `status` char(1) DEFAULT '' COMMENT '状态 ',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '恢复时间',
  `product_cate` varchar(20) DEFAULT '' COMMENT '产品类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产恢复记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_repair`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_repair` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) DEFAULT '' COMMENT '工件号',
  `fx_oprno` varchar(20) DEFAULT '' COMMENT '返修工位',
  `oprno` varchar(20) DEFAULT '' COMMENT '发现工位',
  `sops` varchar(3000) DEFAULT NULL COMMENT '选择的修复方案',
  `state` char(1) DEFAULT '' COMMENT '状态 1=待处理 2=待检查 3=已检查',
  `remark` varchar(255) DEFAULT NULL COMMENT '不良信息',
  `result` char(1) DEFAULT '' COMMENT '结果1=OK 2=NG',
  `fx_by` varchar(64) DEFAULT NULL COMMENT '返修人',
  `fx_date` datetime DEFAULT NULL COMMENT '返修时间',
  `check_by` varchar(64) DEFAULT NULL COMMENT '检查人',
  `check_date` datetime DEFAULT NULL COMMENT '检查时间',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `line_sn` varchar(50) DEFAULT '' COMMENT '产线编号',
  `ngid` varchar(64) DEFAULT NULL COMMENT 'NG处理',
  `item_id` varchar(64) DEFAULT NULL COMMENT '返工名单',
  `type` char(1) DEFAULT '' COMMENT '类型 1=在线 2=离线',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返工记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_repair_cate`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_repair_cate` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(50) DEFAULT '' COMMENT '类型名称',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `sort` int(10) unsigned DEFAULT '0' COMMENT '排序 正序',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `remark` varchar(255) DEFAULT '' COMMENT '备注说明',
  `sop` varchar(255) DEFAULT NULL COMMENT '返修对策',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='维修类型表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_repair_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_repair_items` (
  `id` varchar(64) NOT NULL,
  `oprno` varchar(20) DEFAULT '' COMMENT '工位号',
  `title` varchar(255) DEFAULT '' COMMENT '标题',
  `content` text COMMENT '修复描述',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `line_sn` varchar(100) DEFAULT NULL COMMENT '产线编号',
  `introduction` varchar(255) DEFAULT NULL COMMENT '返工动作简要介绍',
  `inspection_points` varchar(255) DEFAULT NULL COMMENT '检验要点',
  `return_oprno` varchar(100) DEFAULT NULL COMMENT '回归工位',
  `rework_mode` varchar(255) DEFAULT NULL COMMENT '离线/在线返工',
  `type` char(1) DEFAULT '' COMMENT '类型 1=在线 2=离线 3=在线/离线',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修问题清单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_repair_oprno`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_repair_oprno` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(50) DEFAULT '' COMMENT '工位编号',
  `oprnos` varchar(1000) DEFAULT '' COMMENT '管理工位',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修工位';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_repair_quality`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_repair_quality` (
  `id` varchar(64) NOT NULL,
  `repair_id` varchar(64) DEFAULT '' COMMENT '返修单',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `result` char(1) DEFAULT '' COMMENT '结果1=OK 2=NG',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修质量确认';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_repair_sop`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_repair_sop` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返修方案';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_robot`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_robot` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(100) DEFAULT '' COMMENT '机器人编号',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='机器人表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_robot_oprno`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_robot_oprno` (
  `id` varchar(64) NOT NULL,
  `robot_id` varchar(64) DEFAULT '' COMMENT '机器人id',
  `oprno` varchar(255) DEFAULT '' COMMENT '工位号',
  `next_oprno` varchar(255) DEFAULT '' COMMENT '下级工位编号，多个逗号隔开',
  `type` char(255) DEFAULT '1' COMMENT '工位类型 1=首个 2=中间 3=末尾',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='机器人工位范围';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_scrap`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_scrap` (
  `id` varchar(64) NOT NULL,
  `sn` varchar(50) DEFAULT '' COMMENT '工件码',
  `reason` varchar(255) DEFAULT '' COMMENT '报废原因',
  `status` char(255) DEFAULT '' COMMENT '状态',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `product_cate` varchar(20) DEFAULT '' COMMENT '产品类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='报废记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_screen_plan`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_screen_plan` (
  `id` varchar(64) NOT NULL,
  `xzcsx` int(10) unsigned DEFAULT '0' COMMENT '小总成上线',
  `xzcxx` int(10) unsigned DEFAULT '0' COMMENT '小总成下线',
  `p1sx` int(10) unsigned DEFAULT '0' COMMENT 'OP40-210上线',
  `p1xx` int(10) unsigned DEFAULT '0' COMMENT 'OP40-210下线',
  `p2sx` int(10) unsigned DEFAULT '0' COMMENT 'OP220-350上线',
  `p2xx` int(10) unsigned DEFAULT '0' COMMENT 'OP220-350下线',
  `start_date` datetime DEFAULT NULL COMMENT '开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '结束时间',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='大屏计划表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_shift`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_shift` (
  `id` varchar(64) NOT NULL DEFAULT '64',
  `title` varchar(100) DEFAULT '' COMMENT '名称',
  `start` varchar(50) DEFAULT '' COMMENT '开始时间',
  `end` varchar(50) DEFAULT '' COMMENT '结束时间',
  `next` tinyint(1) unsigned DEFAULT '0' COMMENT '是否跨天',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='班次表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_shipment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_shipment` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `sn` varchar(255) DEFAULT '' COMMENT '出货单号',
  `state` char(1) DEFAULT '0' COMMENT '0待出货1已出货',
  `nums` int(11) DEFAULT '0' COMMENT '出货数量',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='出货记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_shipment_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_shipment_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `shipment_id` varchar(64) DEFAULT '' COMMENT '出货记录',
  `tp_sn` varchar(255) DEFAULT '' COMMENT '托盘码',
  `nums` int(11) DEFAULT '0' COMMENT '数量',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='出货记录关联表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_shipp_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_shipp_order` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `name` varchar(100) DEFAULT '' COMMENT '收货人',
  `phone` varchar(100) DEFAULT '' COMMENT '电话',
  `address` text COMMENT '地址',
  `nums` int(255) DEFAULT '0' COMMENT '数量',
  `state` char(1) DEFAULT '1' COMMENT '状态1待出货2已出货',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_shipp_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_shipp_record` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `order_id` varchar(64) DEFAULT '' COMMENT '出货通知单',
  `batch_sn` varchar(100) DEFAULT '' COMMENT '批次',
  `nums` int(255) DEFAULT '0' COMMENT '数量',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_skill`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_skill` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `line_id` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '生产线id',
  `line_process_id` varchar(64) NOT NULL DEFAULT '' COMMENT '生成工序id',
  `skill` varchar(255) DEFAULT NULL COMMENT '技能',
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '修改人',
  `update_date` datetime DEFAULT NULL COMMENT '修改时间',
  `status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '状态',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='生产工位技能';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_sop`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_sop` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `process_sn` varchar(200) DEFAULT '' COMMENT '工序号',
  `process_title` varchar(200) DEFAULT '' COMMENT '工序名称',
  `defect` varchar(200) DEFAULT '' COMMENT '缺陷类型',
  `standard` varchar(200) DEFAULT '' COMMENT '可接受标准',
  `way` varchar(1000) DEFAULT '' COMMENT '返工方式',
  `tool` varchar(200) DEFAULT '' COMMENT '返修工具',
  `condition` varchar(255) DEFAULT '' COMMENT '返修条件',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `cate` char(1) DEFAULT '1' COMMENT '类型 1=返工 2=返修',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返工SOP';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_sop_step`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_sop_step` (
  `id` varchar(64) NOT NULL,
  `way_id` varchar(64) DEFAULT '' COMMENT '指导书',
  `title` varchar(200) DEFAULT '' COMMENT '步骤名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指导书步骤表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_sop_way`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_sop_way` (
  `id` varchar(64) NOT NULL,
  `sop_id` varchar(64) DEFAULT '' COMMENT 'sop_id',
  `title` varchar(200) DEFAULT '' COMMENT '名称',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='返工指导书';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_template`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_template` (
  `id` varchar(64) NOT NULL,
  `title` varchar(200) DEFAULT '' COMMENT '类型名称',
  `status` char(1) DEFAULT '0' COMMENT '状态',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='生产模板表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_template_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_template_items` (
  `id` varchar(64) NOT NULL COMMENT '编码',
  `template_id` varchar(64) DEFAULT '' COMMENT '模板id',
  `oprno` char(6) DEFAULT '' COMMENT '工位号',
  `craft` char(6) DEFAULT '' COMMENT '工艺号',
  `cate` varchar(50) DEFAULT '' COMMENT '报文类型',
  `title` varchar(255) DEFAULT '' COMMENT '报文名称',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `rank` int(10) unsigned DEFAULT '0' COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='模板清单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_template_items_copy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_template_items_copy` (
  `id` varchar(64) NOT NULL COMMENT '编码',
  `template_id` varchar(64) DEFAULT '' COMMENT '模板id',
  `oprno` varchar(255) DEFAULT '' COMMENT '工位号',
  `craft` varchar(50) DEFAULT '' COMMENT '工艺号',
  `cate` varchar(50) DEFAULT '' COMMENT '报文类型',
  `title` varchar(255) DEFAULT '' COMMENT '报文名称',
  `sort` int(10) unsigned DEFAULT '0' COMMENT '工位结果序号',
  `pid` varchar(64) DEFAULT '' COMMENT '父级编码',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `rank` int(10) unsigned DEFAULT '0' COMMENT '一级排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='模板清单';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_tool_life`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_tool_life` (
  `id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `name` varchar(50) DEFAULT '' COMMENT '唯一标识',
  `max_life` int(10) unsigned DEFAULT '0' COMMENT '最大寿命',
  `cur_life` int(10) unsigned DEFAULT '0' COMMENT '剩余寿命',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `consume_life` int(10) unsigned DEFAULT '0' COMMENT '每次消耗寿命数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工具寿命表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_tool_replace_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_tool_replace_record` (
  `id` varchar(64) NOT NULL,
  `create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '更换人',
  `create_date` datetime DEFAULT NULL COMMENT '更换时间',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `tool_life_id` varchar(64) DEFAULT NULL COMMENT '关联id(mes_tool_life)',
  `check` char(1) DEFAULT NULL COMMENT '是否已生成首件检查记录 1=已生成',
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='工具寿命更换记录';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_torsional_process`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_torsional_process` (
  `id` varchar(64) NOT NULL COMMENT 'id',
  `sn` varchar(50) DEFAULT NULL COMMENT '产品二维码',
  `oprno` varchar(20) DEFAULT NULL COMMENT '工位号',
  `line_sn` char(2) DEFAULT NULL COMMENT '产线编号',
  `torque` varchar(50) DEFAULT NULL COMMENT '扭矩',
  `number` varchar(50) DEFAULT NULL,
  `angle` varchar(50) DEFAULT NULL COMMENT '角度',
  `result` varchar(50) DEFAULT NULL COMMENT '结果',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='扭力过程参数';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_user_skill`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_user_skill` (
  `id` varchar(64) NOT NULL,
  `user_code` varchar(64) DEFAULT NULL,
  `skill_id` varchar(64) DEFAULT '',
  `degree` char(1) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse` (
  `id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `spec` varchar(255) DEFAULT '' COMMENT '型号',
  `sn` varchar(100) DEFAULT '' COMMENT '编号',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `status` char(1) DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT '',
  `update_date` datetime DEFAULT NULL,
  `nums` int(10) unsigned DEFAULT '0' COMMENT '数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='物料管理表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse_in`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse_in` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `from` char(1) DEFAULT '' COMMENT '来源 0=正常入库 1=特殊通道入库',
  `from_id` varchar(64) DEFAULT '' COMMENT '来源id,入采购单',
  `state` char(1) DEFAULT '0' COMMENT '状态（0=待审核 1=已处理）',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `reason` varchar(255) DEFAULT '' COMMENT '审核备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='来料入库记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse_in_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse_in_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `warehouse_id` varchar(64) DEFAULT '' COMMENT '物品id',
  `warehouse_in_id` varchar(64) DEFAULT '' COMMENT '入库记录id',
  `count` int(10) unsigned DEFAULT '0' COMMENT '数量',
  `refund` char(255) DEFAULT '0' COMMENT '0=未退货 1=已退货',
  `batch` varchar(255) DEFAULT '' COMMENT '批次',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='入库单关联物料表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse_out`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse_out` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `from_id` varchar(64) DEFAULT '' COMMENT '来源id',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='来料出库记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse_out_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse_out_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `warehouse_id` varchar(64) DEFAULT '' COMMENT '物品id',
  `warehouse_out_id` varchar(64) DEFAULT '' COMMENT '入库记录id',
  `count` int(10) unsigned DEFAULT '0' COMMENT '数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='入库单关联物料表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse_refund`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse_refund` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `from_id` varchar(64) DEFAULT '' COMMENT '来源id采购单',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_by` varchar(64) DEFAULT '',
  `create_date` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_date` datetime DEFAULT NULL,
  `extend_s1` varchar(500) DEFAULT NULL COMMENT '扩展 String 1',
  `extend_s2` varchar(500) DEFAULT NULL COMMENT '扩展 String 2',
  `extend_s3` varchar(500) DEFAULT NULL COMMENT '扩展 String 3',
  `extend_s4` varchar(500) DEFAULT NULL COMMENT '扩展 String 4',
  `extend_s5` varchar(500) DEFAULT NULL COMMENT '扩展 String 5',
  `extend_s6` varchar(500) DEFAULT NULL COMMENT '扩展 String 6',
  `extend_s7` varchar(500) DEFAULT NULL COMMENT '扩展 String 7',
  `extend_s8` varchar(500) DEFAULT NULL COMMENT '扩展 String 8',
  `extend_i1` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 1',
  `extend_i2` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 2',
  `extend_i3` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 3',
  `extend_i4` decimal(19,0) DEFAULT NULL COMMENT '扩展 Integer 4',
  `extend_f1` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 1',
  `extend_f2` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 2',
  `extend_f3` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 3',
  `extend_f4` decimal(19,4) DEFAULT NULL COMMENT '扩展 Float 4',
  `extend_d1` datetime DEFAULT NULL COMMENT '扩展 Date 1',
  `extend_d2` datetime DEFAULT NULL COMMENT '扩展 Date 2',
  `extend_d3` datetime DEFAULT NULL COMMENT '扩展 Date 3',
  `extend_d4` datetime DEFAULT NULL COMMENT '扩展 Date 4',
  `extend_json` varchar(1000) DEFAULT NULL COMMENT '扩展 JSON',
  `warehouse_in_id` varchar(64) DEFAULT '' COMMENT '入库单id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='来料退货记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mes_warehouse_refund_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mes_warehouse_refund_items` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `warehouse_id` varchar(64) DEFAULT '' COMMENT '物品id',
  `warehouse_refund_id` varchar(64) DEFAULT '' COMMENT '入库记录id',
  `count` int(10) unsigned DEFAULT '0' COMMENT '数量',
  `company` varchar(255) DEFAULT '' COMMENT '退货单位',
  `reason` varchar(255) DEFAULT '' COMMENT '原因',
  `batch` varchar(200) DEFAULT '' COMMENT '产品批次',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='入库单关联物料表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `test_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `test_data` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `test_input` varchar(200) DEFAULT NULL COMMENT '单行文本',
  `test_textarea` varchar(200) DEFAULT NULL COMMENT '多行文本',
  `test_select` varchar(10) DEFAULT NULL COMMENT '下拉框',
  `test_select_multiple` varchar(200) DEFAULT NULL COMMENT '下拉多选',
  `test_radio` varchar(10) DEFAULT NULL COMMENT '单选框',
  `test_checkbox` varchar(200) DEFAULT NULL COMMENT '复选框',
  `test_date` datetime DEFAULT NULL COMMENT '日期选择',
  `test_datetime` datetime DEFAULT NULL COMMENT '日期时间',
  `test_user_code` varchar(64) DEFAULT NULL COMMENT '用户选择',
  `test_office_code` varchar(64) DEFAULT NULL COMMENT '机构选择',
  `test_area_code` varchar(64) DEFAULT NULL COMMENT '区域选择',
  `test_area_name` varchar(100) DEFAULT NULL COMMENT '区域名称',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='测试数据';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `test_data_child`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `test_data_child` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `test_sort` int(11) DEFAULT NULL COMMENT '排序号',
  `test_data_id` varchar(64) DEFAULT NULL COMMENT '父表主键',
  `test_input` varchar(200) DEFAULT NULL COMMENT '单行文本',
  `test_textarea` varchar(200) DEFAULT NULL COMMENT '多行文本',
  `test_select` varchar(10) DEFAULT NULL COMMENT '下拉框',
  `test_select_multiple` varchar(200) DEFAULT NULL COMMENT '下拉多选',
  `test_radio` varchar(10) DEFAULT NULL COMMENT '单选框',
  `test_checkbox` varchar(200) DEFAULT NULL COMMENT '复选框',
  `test_date` datetime DEFAULT NULL COMMENT '日期选择',
  `test_datetime` datetime DEFAULT NULL COMMENT '日期时间',
  `test_user_code` varchar(64) DEFAULT NULL COMMENT '用户选择',
  `test_office_code` varchar(64) DEFAULT NULL COMMENT '机构选择',
  `test_area_code` varchar(64) DEFAULT NULL COMMENT '区域选择',
  `test_area_name` varchar(100) DEFAULT NULL COMMENT '区域名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='测试数据子表';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `test_tree`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `test_tree` (
  `tree_code` varchar(64) NOT NULL COMMENT '节点编码',
  `parent_code` varchar(64) NOT NULL COMMENT '父级编号',
  `parent_codes` varchar(767) NOT NULL COMMENT '所有父级编号',
  `tree_sort` decimal(10,0) NOT NULL COMMENT '排序号（升序）',
  `tree_sorts` varchar(767) NOT NULL COMMENT '所有排序号',
  `tree_leaf` char(1) NOT NULL COMMENT '是否最末级',
  `tree_level` decimal(4,0) NOT NULL COMMENT '层次级别',
  `tree_names` varchar(767) NOT NULL COMMENT '全节点名',
  `tree_name` varchar(200) NOT NULL COMMENT '节点名称',
  `status` char(1) NOT NULL DEFAULT '0' COMMENT '状态（0正常 1删除 2停用）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(500) DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`tree_code`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='测试树表';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

