/*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 5.7.32-log : Database - lims_laboratory
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`lims_laboratory` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;

USE `lims_laboratory`;

/*Table structure for table `classify` */

DROP TABLE IF EXISTS `classify`;

CREATE TABLE `classify` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '分类主键',
  `father_name` varchar(25) NOT NULL COMMENT '分类父名称',
  `son_name` varchar(25) DEFAULT NULL COMMENT '分类子名称',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `version` int(1) NOT NULL DEFAULT '1' COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;

/*Data for the table `classify` */

insert  into `classify`(`id`,`father_name`,`son_name`,`state`,`create_time`,`update_time`,`version`) values 
(1,'温度测量仪表','体温计',1,'2023-07-21 10:42:26','2023-07-21 14:14:54',1),
(3,'体温计',NULL,1,'2023-07-21 10:48:51','2023-07-21 10:48:51',1),
(5,'体温',NULL,1,'2023-07-21 10:53:32','2023-07-21 10:53:32',1),
(10,'体温','体温',0,'2023-07-21 11:16:51','2023-07-21 13:45:52',1),
(12,'体温','体温计',1,'2023-07-21 11:16:51','2023-07-21 11:16:51',1),
(14,'温度测量仪表','体温枪',1,'2023-07-27 09:35:26','2023-07-27 09:35:26',1),
(15,'温度测量仪1表','体温计',1,'2023-08-04 11:29:26','2023-08-04 11:29:26',1);

/*Table structure for table `enterprise` */

DROP TABLE IF EXISTS `enterprise`;

CREATE TABLE `enterprise` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '企业编号',
  `name` varchar(20) NOT NULL COMMENT '企业名字',
  `byname` varchar(20) NOT NULL COMMENT '企业简称',
  `link_name` varchar(10) NOT NULL COMMENT '联系人名字',
  `link_phone` varchar(11) NOT NULL COMMENT '联系人电话',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `version` int(1) NOT NULL DEFAULT '1' COMMENT '锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

/*Data for the table `enterprise` */

insert  into `enterprise`(`id`,`name`,`byname`,`link_name`,`link_phone`,`create_time`,`update_time`,`version`) values 
(1,'中天科技网络有限公司','中天科技','李林','18400000000','2023-07-07 10:51:38','2023-07-07 10:51:41',1);

/*Table structure for table `equipment_point` */

DROP TABLE IF EXISTS `equipment_point`;

CREATE TABLE `equipment_point` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `instrument_id` int(10) NOT NULL COMMENT '仪器Id 关联',
  `user_id` int(10) NOT NULL COMMENT '用户Id 关联',
  `equipment_point` varchar(25) NOT NULL COMMENT '码点编号',
  `equipment_point_name` varchar(25) NOT NULL COMMENT '码点名称',
  `unit` varchar(20) NOT NULL COMMENT '单位',
  `descriptiveness` varchar(100) DEFAULT '--' COMMENT '描述',
  `create_time` datetime NOT NULL COMMENT '创建日期',
  `update_time` datetime NOT NULL COMMENT '更新日期',
  `state` int(11) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `version` int(11) DEFAULT '1' COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;

/*Data for the table `equipment_point` */

insert  into `equipment_point`(`id`,`instrument_id`,`user_id`,`equipment_point`,`equipment_point_name`,`unit`,`descriptiveness`,`create_time`,`update_time`,`state`,`version`) values 
(1,1,7,'Area-1','导体屏蔽（壁厚面积）','mm','疯了，做不了','2023-07-24 14:40:01','2023-07-24 17:23:15',1,1),
(2,1,7,'Area-2','导体屏蔽（壁厚面积）','mm','太困了','2023-07-24 14:40:01','2023-07-24 15:03:44',1,1),
(3,1,7,'Area-3','导体屏蔽（壁厚面积）','mm','','2023-07-26 13:55:28','2023-07-24 08:00:00',1,1),
(4,2,7,'Area-6','导体屏蔽（壁厚面积）','mm','','2023-07-27 15:06:06','2023-07-24 08:00:00',1,1);

/*Table structure for table `inspection` */

DROP TABLE IF EXISTS `inspection`;

CREATE TABLE `inspection` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '申请单编号',
  `code` varchar(25) NOT NULL COMMENT '申请单编码',
  `type` int(1) NOT NULL COMMENT '检验类型 0：原材料；1：产品；2：半成品；',
  `inspection_status` int(1) DEFAULT NULL COMMENT '检验状态：1：合格；0：不合格',
  `start_time` datetime NOT NULL COMMENT '检验开始日期',
  `end_time` datetime NOT NULL COMMENT '检验结束日期',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL COMMENT '登记日期',
  `update_time` datetime NOT NULL,
  `user_id` int(10) NOT NULL COMMENT '关联 登记人（用户id）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='申请表';

/*Data for the table `inspection` */

/*Table structure for table `inspection_material_list` */

DROP TABLE IF EXISTS `inspection_material_list`;

CREATE TABLE `inspection_material_list` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `material_id` varchar(25) NOT NULL COMMENT '物料id',
  `material_num` int(10) NOT NULL COMMENT '报检数量-物料数量',
  `material_supplier` varchar(25) NOT NULL COMMENT '供应商',
  `material_name` varchar(25) NOT NULL COMMENT '物料名称',
  `material_location` varchar(25) NOT NULL COMMENT '物料存放地',
  `material_batch` varchar(25) NOT NULL COMMENT '物料批次',
  `material_reel_number` varchar(25) NOT NULL COMMENT '物料盘号',
  `specifications_serial_number` varchar(50) NOT NULL COMMENT '规格名称/型号名称',
  `specifications_voltage_level` varchar(30) DEFAULT NULL COMMENT '电压等级',
  `specifications_cross_section` varchar(30) DEFAULT NULL COMMENT '主线心截面',
  `specifications_number_of_cores` varchar(30) DEFAULT NULL COMMENT '主线芯芯数',
  `specifications_instruct` varchar(30) DEFAULT NULL COMMENT '生产指令号',
  `notes` varchar(100) DEFAULT NULL COMMENT '备注',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL COMMENT '报检时间',
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT '1',
  `inspection_id` varchar(25) NOT NULL COMMENT '关联 报检单id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;

/*Data for the table `inspection_material_list` */

insert  into `inspection_material_list`(`id`,`material_id`,`material_num`,`material_supplier`,`material_name`,`material_location`,`material_batch`,`material_reel_number`,`specifications_serial_number`,`specifications_voltage_level`,`specifications_cross_section`,`specifications_number_of_cores`,`specifications_instruct`,`notes`,`state`,`create_time`,`update_time`,`version`,`inspection_id`) values 
(1,'1680929494813868034',100,'中天','电线电缆','地下一层','1','123','测试规格/dsahj1','1','1','1','1',NULL,1,'2023-07-17 21:16:36','2023-07-17 21:16:36',1,'1681215775833042945'),
(2,'1680929899014750210',100,'中天','电线电缆','地下一层','1','123','测试规格/dsahj1','1','1','1','1',NULL,1,'2023-07-17 21:18:13','2023-07-17 21:18:13',1,'1681215775833042945'),
(3,'1681499095783407618',100,'中天','电线电缆','地下一层','1','123','23123','3424','2131','2','123','312',1,'2023-07-19 11:00:00','2023-07-19 11:00:00',1,'1681215775833042945'),
(4,'1',10,'中天','电线电缆','地下一层','1','123','','','规格/型号','','','',1,'2023-07-19 13:59:46','2023-07-19 13:59:46',1,'1681215775833042945'),
(5,'1',10,'中天','电线电缆','地下一层','1','123','','','规格/型号','','','',1,'2023-07-19 14:00:51','2023-07-19 14:00:51',1,'1681215775833042945'),
(6,'1',10,'中天','电线电缆','地下一层','1','123','','','规格/型号','','','',0,'2023-07-19 14:01:46','2023-07-19 14:01:46',1,'1681215775833042945'),
(7,'1',10,'中天','电线电缆','地下一层','1','123','','','规格/型号','','','',0,'2023-07-19 14:02:47','2023-07-19 14:02:47',1,'1681215775833042945'),
(8,'1',10,'中天','电线电缆','地下一层','1','123','规格/型号','5','2','4','3','1',1,'2023-07-19 14:25:56','2023-07-19 14:39:23',1,'1681215775833042945'),
(9,'1',10,'中天','电线电缆','地下一层','1','123','规格/型号','5','2','4','3','1',1,'2023-07-19 15:17:56','2023-07-19 15:17:56',1,'1681215775833042945'),
(13,'1',10,'中天','电线电缆','地下一层','1','123','规格/型号','5','2','4','3','1',0,'2023-07-19 15:44:51','2023-07-20 11:07:27',1,'1681215775833042945');

/*Table structure for table `inspection_product_list` */

DROP TABLE IF EXISTS `inspection_product_list`;

CREATE TABLE `inspection_product_list` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '项目id',
  `name` varchar(25) NOT NULL COMMENT '项目名称',
  `method` varchar(25) NOT NULL COMMENT '试验方法',
  `ask` varchar(30) DEFAULT NULL COMMENT '试验要求',
  `unit` varchar(20) NOT NULL COMMENT '单位',
  `required` varchar(20) NOT NULL COMMENT '招标人要求值',
  `internal` varchar(20) NOT NULL COMMENT '内控值',
  `start_time` datetime DEFAULT NULL COMMENT '开始日期',
  `end_time` datetime DEFAULT NULL COMMENT '结束日期',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT '1',
  `inspection_material_list_id` int(10) NOT NULL COMMENT '关联 报检物料id',
  `user_id` int(10) NOT NULL COMMENT '关联 用户id 试验员',
  `instrument_id` int(10) DEFAULT NULL COMMENT '关联 设备id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;

/*Data for the table `inspection_product_list` */

insert  into `inspection_product_list`(`id`,`name`,`method`,`ask`,`unit`,`required`,`internal`,`start_time`,`end_time`,`state`,`create_time`,`update_time`,`version`,`inspection_material_list_id`,`user_id`,`instrument_id`) values 
(2,'项目一','尺表测量',NULL,'米','>=1','>1',NULL,NULL,1,'2023-07-17 21:16:36','2023-07-17 21:16:36',1,1,1,NULL),
(3,'项目一','尺表测量',NULL,'米','>=1','>1',NULL,NULL,1,'2023-07-17 21:18:13','2023-07-17 21:18:13',1,2,1,NULL),
(4,'项目二','测试方法',NULL,'人民币','>1','>2',NULL,NULL,1,'2023-07-17 21:18:13','2023-07-17 21:18:13',1,3,1,NULL),
(5,'项目一','尺表测量',NULL,'米','>=1','>1',NULL,NULL,0,'2023-07-19 15:44:51','2023-07-20 11:07:27',1,0,1,NULL),
(6,'项目二','测试方法',NULL,'人民币','>1','>2',NULL,NULL,0,'2023-07-19 15:44:51','2023-07-20 11:07:27',1,0,1,NULL);

/*Table structure for table `inspection_records` */

DROP TABLE IF EXISTS `inspection_records`;

CREATE TABLE `inspection_records` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '记录id',
  `method` varchar(25) NOT NULL COMMENT '检测方法',
  `num` int(10) NOT NULL COMMENT '检测的样品数量',
  `value` varchar(25) NOT NULL COMMENT '检测值',
  `submit_state` int(1) NOT NULL DEFAULT '0' COMMENT '提交状态 0：待提交；1：待审核；2：已通过',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL COMMENT '检测日期',
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT NULL,
  `inspection_product_list_id` int(10) NOT NULL COMMENT '关联 样品下的项目id',
  `user_name` int(10) DEFAULT NULL COMMENT '关联 审批人（用户名称）',
  `approval_time` datetime DEFAULT NULL COMMENT '审批日期',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Data for the table `inspection_records` */

/*Table structure for table `instrument` */

DROP TABLE IF EXISTS `instrument`;

CREATE TABLE `instrument` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `classify_id` int(10) NOT NULL COMMENT '分类ID 关联',
  `user_id` int(10) NOT NULL COMMENT '用户关联 保管人',
  `create_user_id` int(10) NOT NULL COMMENT '创建人',
  `equipment_code` varchar(25) NOT NULL COMMENT '仪器设备编号',
  `equipment_name` varchar(25) NOT NULL COMMENT '仪器设备名称',
  `conditions` int(1) NOT NULL COMMENT '默认1；1：运行、2：故障、3：报修、4：检修、5：待机',
  `specifications_models` varchar(25) NOT NULL COMMENT '规格型号',
  `measuring_range` varchar(25) DEFAULT '--' COMMENT '测量范围',
  `error_rate` varchar(10) DEFAULT '--' COMMENT '误差',
  `manufacturer` varchar(50) DEFAULT '--' COMMENT '生产厂家',
  `arrival_date` datetime DEFAULT NULL COMMENT '到货日期',
  `acceptance_date` datetime DEFAULT NULL COMMENT '验收日期',
  `storage_place` varchar(100) DEFAULT '--' COMMENT '存放地',
  `whether_data_acquisition` int(1) NOT NULL COMMENT '是否支持数采',
  `equipment_measurement` int(1) NOT NULL COMMENT '是否需要仪器设备计量：如果需要计量周期必填；如果不需要计量周期不必填',
  `term_validity` int(11) DEFAULT NULL COMMENT '计量截止有效期',
  `descriptiveness` varchar(100) DEFAULT '--' COMMENT '描述',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `version` int(1) DEFAULT '1' COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;

/*Data for the table `instrument` */

insert  into `instrument`(`id`,`classify_id`,`user_id`,`create_user_id`,`equipment_code`,`equipment_name`,`conditions`,`specifications_models`,`measuring_range`,`error_rate`,`manufacturer`,`arrival_date`,`acceptance_date`,`storage_place`,`whether_data_acquisition`,`equipment_measurement`,`term_validity`,`descriptiveness`,`create_time`,`update_time`,`state`,`version`) values 
(1,13,9,9,'JSTC-W1-00001','数字电桥',1,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-21 15:15:23','2023-07-28 11:37:02',0,1),
(2,1,9,9,'JSTC-W1-00002','数字电桥',1,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-21 15:17:56','2023-07-21 15:58:35',1,1),
(3,1,10,9,'JSTC-W1-00003','数字电桥',3,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2020-01-09 15:18:02','2023-07-21 15:18:02',1,1),
(4,1,11,9,'JSTC-W1-00004','数字电桥',2,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-21 15:18:10','2023-07-21 15:18:10',1,1),
(5,1,12,11,'JSTC-W1-00005','数字电桥',4,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-21 15:18:15','2023-07-21 15:18:15',1,1),
(6,1,13,11,'JSTC-W1-00006','A数字电桥',1,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-21 15:18:19','2023-07-21 15:18:19',1,1),
(7,1,14,11,'JSTC-W1-00007','数字电桥',5,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-21 15:18:23','2023-07-21 15:18:23',1,1),
(8,1,9,11,'JSTC-W1-00008','数字电桥',1,'WCDMS-1','12毫米','0.000001微米','江苏鵷雏','2001-07-06 00:00:00','2060-07-06 00:00:00','地球亚洲中国江苏南通',1,0,12,'疯狂星期五！！！','2023-07-24 14:16:07','2023-07-24 14:16:07',1,1),
(9,3,7,11,'2','2',2,'2','2','2','2','2023-07-26 00:00:00','2023-07-26 00:00:00','2',1,1,2,'2','2023-07-26 11:26:53','2023-07-26 11:26:53',1,1),
(10,3,7,11,'3','2',2,'2','2','2','2','2023-07-26 00:00:00','2023-07-26 00:00:00','2',1,0,2,'2','2023-07-26 11:27:05','2023-07-26 11:27:05',1,1);

/*Table structure for table `link_basic_information` */

DROP TABLE IF EXISTS `link_basic_information`;

CREATE TABLE `link_basic_information` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键自增',
  `entrust_coding` varchar(25) NOT NULL COMMENT '委托编码',
  `entrusted` varchar(25) NOT NULL COMMENT '委托单位',
  `contacts` varchar(25) NOT NULL COMMENT '联系人',
  `contact_number` varchar(16) NOT NULL COMMENT '联系电话',
  `contact_address` varchar(50) NOT NULL COMMENT '联系地址',
  `completion_deadline` date NOT NULL COMMENT '完成期限',
  `inspection_time` date NOT NULL COMMENT '送样时间',
  `sample_delivery_mode` int(1) NOT NULL COMMENT '送样方式:1送样;2上门',
  `sample_sender` varchar(25) DEFAULT NULL COMMENT '送样人',
  `sample_delivery_phone` varchar(16) DEFAULT NULL COMMENT '送样人电话',
  `report_number` int(10) NOT NULL COMMENT '报告数',
  `entrust_remarks` varchar(100) DEFAULT NULL COMMENT '委托备注',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

/*Data for the table `link_basic_information` */

insert  into `link_basic_information`(`id`,`entrust_coding`,`entrusted`,`contacts`,`contact_number`,`contact_address`,`completion_deadline`,`inspection_time`,`sample_delivery_mode`,`sample_sender`,`sample_delivery_phone`,`report_number`,`entrust_remarks`,`state`,`create_time`,`update_time`) values 
(2,'SL20230803000003','阿里巴巴','小黑','12321423432','江苏南通','2023-08-03','2023-08-03',1,'小白','123456789676',23,'委托备注YPBH123456789YPBH123456789YPBH123456789',1,'2023-08-03 11:45:01','2023-08-03 11:45:01'),
(3,'SL20230803000003','阿里巴巴','小黑','12321423432','江苏南通','2023-08-03','2023-08-03',1,'小白','123456789676',23,'委托备注YPBH123456789YPBH123456789YPBH123456789',1,'2023-08-03 11:45:01','2023-08-03 11:45:01'),
(4,'SL20230803000003','阿里巴巴','小黑','12321423432','江苏南通','2023-08-03','2023-08-03',1,'小白','123456789676',23,'委托备注YPBH123456789YPBH123456789YPBH123456789',1,'2023-08-03 11:45:01','2023-08-03 11:45:01'),
(5,'SL20230803000003','阿里巴巴','小黑','12321423432','江苏南通','2023-08-03','2023-08-03',1,'小白','123456789676',23,'委托备注YPBH123456789YPBH123456789YPBH123456789',1,'2023-08-03 11:45:01','2023-08-03 11:45:01');

/*Table structure for table `link_detection` */

DROP TABLE IF EXISTS `link_detection`;

CREATE TABLE `link_detection` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `sample_number` varchar(16) NOT NULL COMMENT '样品编号',
  `sample_name` varchar(25) NOT NULL COMMENT '样品名称',
  `specifications_models` varchar(25) NOT NULL COMMENT '规格型号',
  `unit` varchar(10) NOT NULL COMMENT '单位',
  `samples_number` int(10) NOT NULL COMMENT '样品数量',
  `experiment` varchar(50) NOT NULL COMMENT '试验',
  `remarks` varchar(100) NOT NULL COMMENT '备注',
  `link_basic_id` int(10) NOT NULL COMMENT 'link_basic_information 关联Id',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `date_survey` date DEFAULT NULL COMMENT '检验日期',
  `inspection_status` int(1) NOT NULL DEFAULT '2' COMMENT '检验状态 1:已检测 2:待检测',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;

/*Data for the table `link_detection` */

insert  into `link_detection`(`id`,`sample_number`,`sample_name`,`specifications_models`,`unit`,`samples_number`,`experiment`,`remarks`,`link_basic_id`,`state`,`create_time`,`update_time`,`date_survey`,`inspection_status`) values 
(1,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(2,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(3,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(4,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(5,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(6,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(7,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(8,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(9,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(10,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(11,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(12,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1),
(13,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(14,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',2),
(15,'YPBH123456789','发动机','GGXH-AAAAA','百度',0,'做梦','通过了',2,1,'2023-08-03 11:45:01','2023-08-03 11:45:01','2023-08-03',1);

/*Table structure for table `material` */

DROP TABLE IF EXISTS `material`;

CREATE TABLE `material` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '物料id',
  `code` varchar(25) NOT NULL COMMENT '物料编码',
  `name` varchar(25) NOT NULL COMMENT '物料名称',
  `type` int(1) NOT NULL COMMENT '0：原材料；1：成品；2：半成品',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

/*Data for the table `material` */

insert  into `material`(`id`,`code`,`name`,`type`,`state`,`create_time`,`update_time`,`version`) values 
(1,'wl1','电线电缆',0,1,'2023-07-17 14:29:30','2023-07-31 09:58:05',1),
(2,'wl2','铝线',1,1,'2023-07-26 16:51:49','2023-07-26 16:51:50',1),
(3,'BZ1685832056873074690','石头',1,1,'2023-07-31 09:57:38','2023-07-31 09:57:38',1);

/*Table structure for table `metering_plan` */

DROP TABLE IF EXISTS `metering_plan`;

CREATE TABLE `metering_plan` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'Id主键',
  `measure_person` int(10) NOT NULL COMMENT '计量负责人 关联用户表',
  `create_Person` int(10) NOT NULL COMMENT '创建人 关联用户表',
  `planned_order_number` varchar(25) NOT NULL COMMENT '计划单号',
  `begin_time` datetime NOT NULL COMMENT '开始时间',
  `end_time` datetime NOT NULL COMMENT '结束时间',
  `planning_status` int(1) NOT NULL COMMENT '计划状态：三种：1：已完成；2：待提交；3：未完成',
  `unit` varchar(10) NOT NULL COMMENT '计量单位',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `version` int(1) DEFAULT '1' COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

/*Data for the table `metering_plan` */

insert  into `metering_plan`(`id`,`measure_person`,`create_Person`,`planned_order_number`,`begin_time`,`end_time`,`planning_status`,`unit`,`create_time`,`update_time`,`state`,`version`) values 
(1,10,21,'P20230728000003','2023-07-06 00:00:00','2023-07-06 00:00:00',1,'GB','2023-07-28 10:07:53','2023-07-28 10:07:53',1,1),
(2,10,21,'P20230728000004','2023-07-06 00:00:00','2023-07-06 00:00:00',1,'GB','2023-07-28 10:27:30','2023-07-28 10:27:30',1,1);

/*Table structure for table `metrical_information` */

DROP TABLE IF EXISTS `metrical_information`;

CREATE TABLE `metrical_information` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` int(10) NOT NULL COMMENT '用户关联Id',
  `instrument_id` int(10) NOT NULL COMMENT '仪器Id 关联',
  `measurement_unit` varchar(15) NOT NULL COMMENT '计量单位',
  `begin_date` datetime NOT NULL COMMENT '开始日期',
  `end_date` datetime NOT NULL COMMENT '结束日期',
  `uncertainty` varchar(20) NOT NULL COMMENT '不确定度',
  `result` int(1) NOT NULL COMMENT '结果 1：合格；2：矫正后可用；3：不合格',
  `performance_index` varchar(100) DEFAULT NULL COMMENT '性能指标',
  `remarks` varchar(100) DEFAULT NULL COMMENT '备注',
  `file_path` varchar(50) DEFAULT NULL COMMENT '文件路径',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除',
  `version` int(1) DEFAULT '1' COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;

/*Data for the table `metrical_information` */

insert  into `metrical_information`(`id`,`user_id`,`instrument_id`,`measurement_unit`,`begin_date`,`end_date`,`uncertainty`,`result`,`performance_index`,`remarks`,`file_path`,`create_time`,`update_time`,`state`,`version`) values 
(1,7,1,'1','2023-07-25 00:00:00','2023-07-25 00:00:00','1',1,'1','1','1690255123954_131493.png','2023-07-25 10:43:30','2023-07-25 13:50:24',1,1),
(2,7,1,'2','2023-07-25 00:00:00','2023-07-25 00:00:00','2',2,'2','2','1690264656523_540845.png','2023-07-25 11:18:44','2023-07-25 13:57:37',1,1),
(3,7,2,'2','2023-07-25 00:00:00','2023-07-25 00:00:00','2',2,'2','2','1690264656523_540845.png','2023-07-25 11:18:44','2023-07-25 13:57:37',1,1),
(4,9,2,'1','2023-07-12 00:00:00','2023-08-23 00:00:00','1',2,'2','3','1690358892408_021031.gif','2023-07-26 16:08:12','2023-07-26 16:08:12',1,1);

/*Table structure for table `plan` */

DROP TABLE IF EXISTS `plan`;

CREATE TABLE `plan` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '计划编号',
  `results` int(10) DEFAULT NULL COMMENT '检验结果 0：未完成；1：已完成；',
  `thing` varchar(50) DEFAULT NULL COMMENT '试验说明',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '1：待认领；2：待分配；3：已分配；4：超期待分配；5：已完成；0：已作废',
  `create_time` datetime NOT NULL COMMENT '任务登记时间',
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT '1',
  `inspection_id` varchar(25) NOT NULL COMMENT '关联 报检id(申请单编号)',
  `user_id` int(10) DEFAULT NULL COMMENT '关联 用户id(负责人id)',
  `device_id` int(10) DEFAULT NULL COMMENT '关联 设备id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Data for the table `plan` */

/*Table structure for table `product` */

DROP TABLE IF EXISTS `product`;

CREATE TABLE `product` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '项目id',
  `name` varchar(25) NOT NULL COMMENT '项目名称',
  `father` varchar(20) DEFAULT NULL COMMENT '项目父类',
  `unit` varchar(20) NOT NULL COMMENT '单位',
  `required` varchar(20) NOT NULL COMMENT '标准值',
  `internal` varchar(20) NOT NULL COMMENT '内控值',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(1) NOT NULL DEFAULT '1',
  `specifications_id` int(10) NOT NULL COMMENT '关联 规格id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

/*Data for the table `product` */

insert  into `product`(`id`,`name`,`father`,`unit`,`required`,`internal`,`state`,`create_time`,`update_time`,`version`,`specifications_id`) values 
(1,'项目一','项目父类','米','>=1','>1',1,'2023-07-17 15:03:17','2023-07-31 09:58:05',1,1),
(2,'项目二','父亲','人民币','>1','>2',1,'2023-07-17 21:17:54','2023-07-31 09:58:05',1,1),
(3,'项目三','父亲','人民币','>1','>2',1,'2023-07-17 21:17:54','2023-07-31 09:58:05',1,1);

/*Table structure for table `raw_material` */

DROP TABLE IF EXISTS `raw_material`;

CREATE TABLE `raw_material` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '原材料id',
  `supplier_name` varchar(25) NOT NULL COMMENT '供应商名称',
  `material_coding` varchar(25) NOT NULL COMMENT '材料编码',
  `material_name` varchar(25) NOT NULL COMMENT '材料名称',
  `specifications_models` varchar(25) NOT NULL COMMENT '规格型号',
  `unit` varchar(25) NOT NULL COMMENT '单位',
  `quantity` int(10) NOT NULL COMMENT '数量',
  `inspection_date` datetime NOT NULL COMMENT '报检日期',
  `surveyor` varchar(25) NOT NULL COMMENT '检验人',
  `date_survey` datetime NOT NULL COMMENT '检验日期',
  `condition` int(1) NOT NULL COMMENT '状态',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` date NOT NULL COMMENT '来料日期',
  `update_time` date NOT NULL,
  `version` int(1) DEFAULT '1' COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

/*Data for the table `raw_material` */

insert  into `raw_material`(`id`,`supplier_name`,`material_coding`,`material_name`,`specifications_models`,`unit`,`quantity`,`inspection_date`,`surveyor`,`date_survey`,`condition`,`state`,`create_time`,`update_time`,`version`) values 
(1,'test','test','test','test','123',43,'2023-07-31 10:16:50','test','2023-07-31 10:16:54',1,1,'2023-07-31','2023-07-31',1),
(2,'test','test','test','test','123',43,'2023-07-31 10:16:50','test','2023-07-31 10:16:54',1,1,'2023-07-31','2023-07-31',1),
(3,'test','test','test','test','123',43,'2023-07-31 10:16:50','test','2023-07-31 10:16:54',1,1,'2023-07-31','2023-07-31',1);

/*Table structure for table `role` */

DROP TABLE IF EXISTS `role`;

CREATE TABLE `role` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '角色id',
  `name` varchar(30) NOT NULL COMMENT '角色名',
  `power` int(1) NOT NULL COMMENT '0：无权限；1：有权限',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '逻辑删除 正常>=1,删除<=0',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(10) NOT NULL COMMENT '乐观锁',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

/*Data for the table `role` */

insert  into `role`(`id`,`name`,`power`,`state`,`create_time`,`update_time`,`version`) values 
(1,'普通人员',1,1,'2023-07-07 11:30:06','2023-07-07 11:30:11',1);

/*Table structure for table `specifications` */

DROP TABLE IF EXISTS `specifications`;

CREATE TABLE `specifications` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '规格id',
  `name` varchar(25) NOT NULL COMMENT '规格名称',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT '1',
  `standard_id` int(10) NOT NULL COMMENT '关联 标准id',
  PRIMARY KEY (`id`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;

/*Data for the table `specifications` */

insert  into `specifications`(`id`,`name`,`state`,`create_time`,`update_time`,`version`,`standard_id`) values 
(1,'规格1',1,'2023-07-25 17:21:01','2023-07-31 10:08:16',1,1),
(2,'规格2',1,'2023-07-26 16:36:50','2023-07-31 09:58:05',1,1),
(3,'AB',1,'2023-07-31 09:57:38','2023-07-31 09:57:38',1,3),
(4,'AB',1,'2023-07-31 09:58:30','2023-07-31 09:58:30',1,4),
(5,'AB',1,'2023-07-31 09:58:58','2023-07-31 09:58:58',1,5),
(6,'AB',1,'2023-07-31 09:59:07','2023-07-31 09:59:07',1,1);

/*Table structure for table `standard` */

DROP TABLE IF EXISTS `standard`;

CREATE TABLE `standard` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(25) NOT NULL COMMENT '标准名称',
  `state` int(1) NOT NULL DEFAULT '1',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(1) DEFAULT '1',
  `material_id` int(10) NOT NULL COMMENT '关联 物料id',
  PRIMARY KEY (`id`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

/*Data for the table `standard` */

insert  into `standard`(`id`,`name`,`state`,`create_time`,`update_time`,`version`,`material_id`) values 
(1,'标准1',1,'2023-07-25 17:08:58','2023-07-31 09:58:05',1,1),
(2,'标准2',1,'2023-07-26 22:15:55','2023-07-31 09:58:05',1,1),
(3,'光纤',1,'2023-07-31 09:57:38','2023-07-31 09:57:38',1,3),
(4,'光纤',1,'2023-07-31 09:58:30','2023-07-31 09:58:30',1,1),
(5,'光纤',1,'2023-07-31 09:58:58','2023-07-31 09:58:58',1,1);

/*Table structure for table `user` */

DROP TABLE IF EXISTS `user`;

CREATE TABLE `user` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `account` varchar(20) NOT NULL COMMENT '账号',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `name` varchar(20) NOT NULL COMMENT '姓名',
  `phone` varchar(11) DEFAULT NULL COMMENT '手机号',
  `email` varchar(30) DEFAULT NULL COMMENT '邮箱',
  `age` int(3) DEFAULT NULL COMMENT '年龄',
  `job_state` int(1) NOT NULL DEFAULT '1' COMMENT '在职状态 正常>=1,离职<=0',
  `info` varchar(100) DEFAULT NULL COMMENT '个性签名',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `version` int(1) NOT NULL DEFAULT '1',
  `role_id` int(10) NOT NULL,
  `enterprise_id` int(10) NOT NULL COMMENT '关联 企业ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_unique` (`account`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4;

/*Data for the table `user` */

insert  into `user`(`id`,`account`,`password`,`name`,`phone`,`email`,`age`,`job_state`,`info`,`create_time`,`update_time`,`version`,`role_id`,`enterprise_id`) values 
(7,'123456','123456','小小','12345678981','12345678@qq.com',23,1,NULL,'2023-07-11 09:14:50','2023-07-11 09:14:50',1,1,1),
(9,'1388967','123456','鱼鱼','19727565533','1981343953@qq.com',18,1,NULL,'2023-07-13 14:51:41','2023-07-13 14:51:41',1,1,1),
(10,'1111111','123456','叮叮当','17726824629','13958368246@gmail.com',13,1,NULL,'2023-07-13 14:57:23','2023-07-13 14:57:23',1,0,1),
(11,'135686632','123456','叮叮当','13795639054','19813438642@qq.com',18,1,NULL,'2023-07-13 14:58:45','2023-07-13 14:58:45',1,1,1),
(12,'333','123456','鱼鱼','72398','2144',36,1,NULL,'2023-07-13 15:21:34','2023-07-13 15:21:34',1,0,1),
(13,'199999','123456','鱼鱼','2154364646','18913908',34,1,NULL,'2023-07-13 15:22:16','2023-07-13 15:22:16',1,1,1),
(14,'8957824','123456','张三','23875185298','2222222872',13,1,NULL,'2023-07-13 15:29:13','2023-07-13 15:29:13',1,1,1),
(21,'45612345','123456','小黑','12345678981','12345678@qq.com',23,1,NULL,'2023-07-17 10:36:23','2023-07-17 10:36:23',1,1,1),
(23,'4561278345','123456','小黑','12345678981','12345678@qq.com',23,1,NULL,'2023-07-17 11:28:50','2023-07-17 11:28:50',1,1,1);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
