/*
Navicat MySQL Data Transfer

Source Server         : localhost_3306
Source Server Version : 50528
Source Host           : localhost:3306
Source Database       : gmms

Target Server Type    : MYSQL
Target Server Version : 50528
File Encoding         : 65001

Date: 2021-01-31 18:47:27
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `gmms_arrange_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_arrange_machine`;
CREATE TABLE `gmms_arrange_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `picture_url` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_arrange_machine
-- ----------------------------
INSERT INTO `gmms_arrange_machine` VALUES ('1', '01', null, null, null, '8002');

-- ----------------------------
-- Table structure for `gmms_arrange_machine_rank`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_arrange_machine_rank`;
CREATE TABLE `gmms_arrange_machine_rank` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `toughening_glass_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `toughening_glass_id` (`toughening_glass_id`),
  CONSTRAINT `gmms_arrange_machine_rank_ibfk_1` FOREIGN KEY (`toughening_glass_id`) REFERENCES `gmms_toughening_glass` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_arrange_machine_rank
-- ----------------------------
INSERT INTO `gmms_arrange_machine_rank` VALUES ('1', '01', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('2', '02', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('3', '03', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('4', '04', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('5', '05', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('6', '06', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('7', '07', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('8', '08', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('9', '09', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('10', '10', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('11', '11', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('12', '12', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('13', '13', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('14', '14', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('15', '15', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('16', '16', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('17', '17', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('18', '18', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('19', '19', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('20', '20', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('21', '21', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('22', '22', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('23', '23', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('24', '24', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('25', '25', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('26', '26', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('27', '27', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('28', '28', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('29', '29', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('30', '30', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('31', '31', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('32', '32', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('33', '33', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('34', '34', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('35', '35', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('36', '36', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('37', '37', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('38', '38', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('39', '39', null, null);
INSERT INTO `gmms_arrange_machine_rank` VALUES ('40', '40', null, null);

-- ----------------------------
-- Table structure for `gmms_arrange_machine_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_arrange_machine_task`;
CREATE TABLE `gmms_arrange_machine_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `state` varchar(50) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `task_type` varchar(50) DEFAULT NULL,
  `toughening_glass_id` bigint(20) DEFAULT NULL,
  `measure_machine_id` bigint(20) DEFAULT NULL,
  `arrange_machine_rank_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `toughening_glass_id` (`toughening_glass_id`),
  KEY `measure_machine_id` (`measure_machine_id`),
  KEY `arrange_machine_rank_id` (`arrange_machine_rank_id`),
  CONSTRAINT `gmms_arrange_machine_task_ibfk_1` FOREIGN KEY (`toughening_glass_id`) REFERENCES `gmms_toughening_glass` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_arrange_machine_task_ibfk_2` FOREIGN KEY (`measure_machine_id`) REFERENCES `gmms_measure_machine` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_arrange_machine_task_ibfk_3` FOREIGN KEY (`arrange_machine_rank_id`) REFERENCES `gmms_arrange_machine_rank` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_arrange_machine_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_break_report`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_break_report`;
CREATE TABLE `gmms_break_report` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `opt_batch` varchar(50) DEFAULT NULL,
  `glass_id` varchar(50) DEFAULT NULL,
  `width` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `thickness` double DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `loadmachine_number` varchar(5) DEFAULT NULL,
  `break_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_break_report
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_count_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_count_machine`;
CREATE TABLE `gmms_count_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_count_machine
-- ----------------------------
INSERT INTO `gmms_count_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Not Connected', '9004');
INSERT INTO `gmms_count_machine` VALUES ('2', '02', 'Machine Shuts Down', 'Not Connected', '9005');

-- ----------------------------
-- Table structure for `gmms_count_machine_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_count_machine_task`;
CREATE TABLE `gmms_count_machine_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `state` varchar(50) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `count_machine_id` bigint(20) DEFAULT NULL,
  `glass_id` bigint(20) DEFAULT NULL,
  `manufacture_batch_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `glass_id` (`glass_id`),
  KEY `count_machine_id` (`count_machine_id`),
  KEY `manufacture_batch_id` (`manufacture_batch_id`),
  CONSTRAINT `gmms_count_machine_task_ibfk_1` FOREIGN KEY (`glass_id`) REFERENCES `gmms_glass` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_count_machine_task_ibfk_2` FOREIGN KEY (`count_machine_id`) REFERENCES `gmms_count_machine` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_count_machine_task_ibfk_3` FOREIGN KEY (`manufacture_batch_id`) REFERENCES `gmms_manufacture_batch` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_count_machine_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_cut_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_cut_machine`;
CREATE TABLE `gmms_cut_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `picture_url` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_cut_machine
-- ----------------------------
INSERT INTO `gmms_cut_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Not Connected', null, '3000');
INSERT INTO `gmms_cut_machine` VALUES ('2', '02', 'Machine Shuts Down', 'Not Connected', null, '3001');

-- ----------------------------
-- Table structure for `gmms_cut_machine_message`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_cut_machine_message`;
CREATE TABLE `gmms_cut_machine_message` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `cut_machine_id` bigint(20) DEFAULT NULL,
  `reada` tinyint(1) DEFAULT NULL,
  `message_type` varchar(50) DEFAULT NULL,
  `client_address` varchar(255) DEFAULT NULL,
  `client_port` varchar(10) DEFAULT NULL,
  `content` varchar(5000) DEFAULT NULL,
  `send_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `receive_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `cut_machine_id` (`cut_machine_id`),
  CONSTRAINT `gmms_cut_machine_message_ibfk_1` FOREIGN KEY (`cut_machine_id`) REFERENCES `gmms_cut_machine` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_cut_machine_message
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_cut_machine_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_cut_machine_task`;
CREATE TABLE `gmms_cut_machine_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `state` varchar(50) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `cut_machine_id` bigint(20) DEFAULT NULL,
  `load_machine_id` bigint(20) DEFAULT NULL,
  `opt_pattern_id` bigint(20) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `opt_pattern_id` (`opt_pattern_id`),
  KEY `load_machine_id` (`load_machine_id`),
  KEY `cut_machine_id` (`cut_machine_id`),
  CONSTRAINT `gmms_cut_machine_task_ibfk_1` FOREIGN KEY (`opt_pattern_id`) REFERENCES `gmms_opt_pattern` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_cut_machine_task_ibfk_2` FOREIGN KEY (`load_machine_id`) REFERENCES `gmms_load_machine` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_cut_machine_task_ibfk_3` FOREIGN KEY (`cut_machine_id`) REFERENCES `gmms_cut_machine` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_cut_machine_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_film_remove_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_film_remove_machine`;
CREATE TABLE `gmms_film_remove_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `picture_url` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_film_remove_machine
-- ----------------------------
INSERT INTO `gmms_film_remove_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Not Connected', null, '7000');
INSERT INTO `gmms_film_remove_machine` VALUES ('2', '02', 'Machine Shuts Down', 'Not Connected', null, '7001');

-- ----------------------------
-- Table structure for `gmms_glass`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_glass`;
CREATE TABLE `gmms_glass` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `glass_id` int(11) DEFAULT NULL,
  `manufacture_id` varchar(50) DEFAULT NULL,
  `process_sequence` int(11) DEFAULT NULL,
  `length` double DEFAULT NULL,
  `width` double DEFAULT NULL,
  `thickness` double DEFAULT NULL,
  `color` varchar(25) DEFAULT NULL,
  `customer` varchar(255) DEFAULT NULL,
  `manufacturer` varchar(255) DEFAULT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `pieces` int(11) DEFAULT NULL,
  `complete_pieces` int(11) DEFAULT NULL,
  `manufacture_batch_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacture_batch_id` (`manufacture_batch_id`),
  CONSTRAINT `gmms_glass_ibfk_1` FOREIGN KEY (`manufacture_batch_id`) REFERENCES `gmms_manufacture_batch` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_glass
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_glass_number_color`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_glass_number_color`;
CREATE TABLE `gmms_glass_number_color` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `glass_id` varchar(50) DEFAULT NULL,
  `flag` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_glass_number_color
-- ----------------------------
INSERT INTO `gmms_glass_number_color` VALUES ('1', '100', '0');
INSERT INTO `gmms_glass_number_color` VALUES ('2', '101', '0');
INSERT INTO `gmms_glass_number_color` VALUES ('3', '102', '1');
INSERT INTO `gmms_glass_number_color` VALUES ('4', '103', '0');
INSERT INTO `gmms_glass_number_color` VALUES ('5', '104', '1');
INSERT INTO `gmms_glass_number_color` VALUES ('6', '105', '1');
INSERT INTO `gmms_glass_number_color` VALUES ('7', '106', '1');
INSERT INTO `gmms_glass_number_color` VALUES ('8', '107', '0');
INSERT INTO `gmms_glass_number_color` VALUES ('9', '108', '0');
INSERT INTO `gmms_glass_number_color` VALUES ('10', '109', '1');
INSERT INTO `gmms_glass_number_color` VALUES ('11', '110', '0');
INSERT INTO `gmms_glass_number_color` VALUES ('12', '111', '1');

-- ----------------------------
-- Table structure for `gmms_grind_edge_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_grind_edge_machine`;
CREATE TABLE `gmms_grind_edge_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `proximity_switch` varchar(50) DEFAULT NULL,
  `allow_control` varchar(50) DEFAULT NULL,
  `glass_info` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_grind_edge_machine
-- ----------------------------
INSERT INTO `gmms_grind_edge_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Not Connected', '9003', null, null, null);

-- ----------------------------
-- Table structure for `gmms_grind_edge_machine_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_grind_edge_machine_task`;
CREATE TABLE `gmms_grind_edge_machine_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `state` varchar(50) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `glass_id` bigint(20) DEFAULT NULL,
  `manufacture_batch_id` bigint(20) DEFAULT NULL,
  `grind_edge_machine_id` bigint(20) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `manufacture_batch_id` (`manufacture_batch_id`),
  KEY `grind_edge_machine_id` (`grind_edge_machine_id`),
  KEY `glass_id` (`glass_id`),
  CONSTRAINT `gmms_grind_edge_machine_task_ibfk_1` FOREIGN KEY (`manufacture_batch_id`) REFERENCES `gmms_manufacture_batch` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_grind_edge_machine_task_ibfk_2` FOREIGN KEY (`grind_edge_machine_id`) REFERENCES `gmms_grind_edge_machine` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_grind_edge_machine_task_ibfk_3` FOREIGN KEY (`glass_id`) REFERENCES `gmms_glass` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_grind_edge_machine_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_grind_edge_machine_two`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_grind_edge_machine_two`;
CREATE TABLE `gmms_grind_edge_machine_two` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `proximity_switch` varchar(50) DEFAULT NULL,
  `allow_control` varchar(50) DEFAULT NULL,
  `glass_info` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_grind_edge_machine_two
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_grind_face_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_grind_face_machine`;
CREATE TABLE `gmms_grind_face_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `allow_control_one` varchar(50) DEFAULT NULL,
  `fault_one` varchar(50) DEFAULT NULL,
  `allow_control_two` varchar(50) DEFAULT NULL,
  `fault_two` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_grind_face_machine
-- ----------------------------
INSERT INTO `gmms_grind_face_machine` VALUES ('1', '01', null, null, '9002', null, null, null, null);

-- ----------------------------
-- Table structure for `gmms_identify_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_identify_machine`;
CREATE TABLE `gmms_identify_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `initialized` tinyint(1) DEFAULT NULL,
  `ceiling` int(11) DEFAULT NULL,
  `floor` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_identify_machine
-- ----------------------------
INSERT INTO `gmms_identify_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Not Connected', '8001', '0', '5', '5');
INSERT INTO `gmms_identify_machine` VALUES ('2', '02', 'Machine Shuts Down', 'Not Connected', '8000', '0', '5', '5');

-- ----------------------------
-- Table structure for `gmms_load_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_load_machine`;
CREATE TABLE `gmms_load_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `opt_name` varchar(255) DEFAULT NULL,
  `cut_machine_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cut_machine_id` (`cut_machine_id`),
  CONSTRAINT `gmms_load_machine_ibfk_1` FOREIGN KEY (`cut_machine_id`) REFERENCES `gmms_cut_machine` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_load_machine
-- ----------------------------
INSERT INTO `gmms_load_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Connecting', '8120', null, null, '1');
INSERT INTO `gmms_load_machine` VALUES ('2', '02', 'Machine Shuts Down', 'Connecting', '8121', null, null, '2');

-- ----------------------------
-- Table structure for `gmms_load_machine_rack`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_load_machine_rack`;
CREATE TABLE `gmms_load_machine_rack` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `raw_package_id` bigint(20) DEFAULT NULL,
  `load_machine_id` bigint(20) DEFAULT NULL,
  `raw_package_ready` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_package_id` (`raw_package_id`),
  KEY `load_machine_id` (`load_machine_id`),
  CONSTRAINT `gmms_load_machine_rack_ibfk_1` FOREIGN KEY (`raw_package_id`) REFERENCES `gmms_raw_package` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_load_machine_rack_ibfk_2` FOREIGN KEY (`load_machine_id`) REFERENCES `gmms_load_machine` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_load_machine_rack
-- ----------------------------
INSERT INTO `gmms_load_machine_rack` VALUES ('1', '101', null, null, null, '1', null);
INSERT INTO `gmms_load_machine_rack` VALUES ('2', '102', null, null, null, '1', null);
INSERT INTO `gmms_load_machine_rack` VALUES ('3', '103', null, null, null, '2', null);
INSERT INTO `gmms_load_machine_rack` VALUES ('4', '104', null, null, null, '2', null);

-- ----------------------------
-- Table structure for `gmms_load_machine_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_load_machine_task`;
CREATE TABLE `gmms_load_machine_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `state` varchar(50) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `load_machine_id` bigint(20) DEFAULT NULL,
  `load_machine_rack_id` bigint(20) DEFAULT NULL,
  `raw_package_id` bigint(20) DEFAULT NULL,
  `opt_pattern_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_package_id` (`raw_package_id`),
  KEY `opt_pattern_id` (`opt_pattern_id`),
  KEY `load_machine_id` (`load_machine_id`),
  KEY `load_machine_rack_id` (`load_machine_rack_id`),
  CONSTRAINT `gmms_load_machine_task_ibfk_1` FOREIGN KEY (`raw_package_id`) REFERENCES `gmms_raw_package` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_load_machine_task_ibfk_2` FOREIGN KEY (`opt_pattern_id`) REFERENCES `gmms_opt_pattern` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_load_machine_task_ibfk_3` FOREIGN KEY (`load_machine_id`) REFERENCES `gmms_load_machine` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_load_machine_task_ibfk_4` FOREIGN KEY (`load_machine_rack_id`) REFERENCES `gmms_load_machine_rack` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_load_machine_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_manufacture_batch`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_manufacture_batch`;
CREATE TABLE `gmms_manufacture_batch` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_manufacture_batch
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_manufacture_batch_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_manufacture_batch_machine`;
CREATE TABLE `gmms_manufacture_batch_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `machine_type` varchar(100) DEFAULT NULL,
  `machine_id` bigint(20) DEFAULT NULL,
  `manufacture_batch_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacture_batch_id` (`manufacture_batch_id`),
  CONSTRAINT `gmms_manufacture_batch_machine_ibfk_1` FOREIGN KEY (`manufacture_batch_id`) REFERENCES `gmms_manufacture_batch` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_manufacture_batch_machine
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_manufacture_sequence`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_manufacture_sequence`;
CREATE TABLE `gmms_manufacture_sequence` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `manufacture_date` varchar(50) DEFAULT NULL,
  `max_sequence` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_manufacture_sequence
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_measure_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_measure_machine`;
CREATE TABLE `gmms_measure_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `picture_url` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_measure_machine
-- ----------------------------
INSERT INTO `gmms_measure_machine` VALUES ('1', '01', null, null, null, '8003');
INSERT INTO `gmms_measure_machine` VALUES ('2', '02', null, null, null, '8004');

-- ----------------------------
-- Table structure for `gmms_opt_pattern`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_opt_pattern`;
CREATE TABLE `gmms_opt_pattern` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `opt_id` varchar(50) DEFAULT NULL,
  `glass_id` varchar(50) DEFAULT NULL,
  `glass_description` varchar(255) DEFAULT NULL,
  `glass_thickness` double DEFAULT NULL,
  `pieces` int(11) DEFAULT NULL,
  `completed_pieces` int(11) DEFAULT NULL,
  `width` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `content` varchar(10000) DEFAULT NULL,
  `batch` varchar(255) DEFAULT NULL,
  `groups` varchar(255) DEFAULT NULL,
  `raw_package_txt_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_package_txt_id` (`raw_package_txt_id`),
  CONSTRAINT `gmms_opt_pattern_ibfk_1` FOREIGN KEY (`raw_package_txt_id`) REFERENCES `gmms_raw_package_txt` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_opt_pattern
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_preprocessing_glass`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_preprocessing_glass`;
CREATE TABLE `gmms_preprocessing_glass` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `actual_length` double DEFAULT NULL,
  `actual_width` double DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `glass_id` bigint(20) DEFAULT NULL,
  `manufacture_batch_id` bigint(20) DEFAULT NULL,
  `identify_machine_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacture_batch_id` (`manufacture_batch_id`),
  KEY `glass_id` (`glass_id`),
  KEY `identify_machine_id` (`identify_machine_id`),
  CONSTRAINT `gmms_preprocessing_glass_ibfk_1` FOREIGN KEY (`manufacture_batch_id`) REFERENCES `gmms_manufacture_batch` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_preprocessing_glass_ibfk_2` FOREIGN KEY (`glass_id`) REFERENCES `gmms_glass` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_preprocessing_glass_ibfk_3` FOREIGN KEY (`identify_machine_id`) REFERENCES `gmms_identify_machine` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_preprocessing_glass
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_prod_line_state`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_prod_line_state`;
CREATE TABLE `gmms_prod_line_state` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `line` int(11) DEFAULT NULL,
  `state` tinyint(1) DEFAULT NULL,
  `standalonestate` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_prod_line_state
-- ----------------------------
INSERT INTO `gmms_prod_line_state` VALUES ('1', '1', '0', '0');
INSERT INTO `gmms_prod_line_state` VALUES ('2', '2', '0', '0');

-- ----------------------------
-- Table structure for `gmms_raw_package`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_raw_package`;
CREATE TABLE `gmms_raw_package` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `glass_id` varchar(50) DEFAULT NULL,
  `pieces` int(11) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `width` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `thickness` double DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `left_pieces` int(11) DEFAULT NULL,
  `manufacturer` varchar(255) DEFAULT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `raw_package_txt_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_package_txt_id` (`raw_package_txt_id`),
  CONSTRAINT `gmms_raw_package_ibfk_1` FOREIGN KEY (`raw_package_txt_id`) REFERENCES `gmms_raw_package_txt` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_raw_package
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_raw_package_txt`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_raw_package_txt`;
CREATE TABLE `gmms_raw_package_txt` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `txt_name` varchar(50) DEFAULT NULL,
  `groups` varchar(50) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_raw_package_txt
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_report_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_report_task`;
CREATE TABLE `gmms_report_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `opt_name` varchar(50) DEFAULT NULL,
  `piece` int(11) DEFAULT NULL,
  `complete_piece` int(11) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `complete_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `reson` varchar(255) DEFAULT NULL,
  `load_machine_id` bigint(20) DEFAULT NULL,
  `opt_pattern_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `load_machine_id` (`load_machine_id`),
  KEY `opt_pattern_id` (`opt_pattern_id`),
  CONSTRAINT `gmms_report_task_ibfk_1` FOREIGN KEY (`load_machine_id`) REFERENCES `gmms_load_machine` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_report_task_ibfk_2` FOREIGN KEY (`opt_pattern_id`) REFERENCES `gmms_opt_pattern` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_report_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_shelf`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_shelf`;
CREATE TABLE `gmms_shelf` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_shelf
-- ----------------------------
INSERT INTO `gmms_shelf` VALUES ('1', '01', '8110', 'Machine Shuts Down', 'Connecting');

-- ----------------------------
-- Table structure for `gmms_shelf_hoist`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_shelf_hoist`;
CREATE TABLE `gmms_shelf_hoist` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `raw_package_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_package_id` (`raw_package_id`),
  CONSTRAINT `gmms_shelf_hoist_ibfk_1` FOREIGN KEY (`raw_package_id`) REFERENCES `gmms_raw_package` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_shelf_hoist
-- ----------------------------
INSERT INTO `gmms_shelf_hoist` VALUES ('1', '99', null, null);

-- ----------------------------
-- Table structure for `gmms_shelf_message`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_shelf_message`;
CREATE TABLE `gmms_shelf_message` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `shelf_id` bigint(20) DEFAULT NULL,
  `reada` tinyint(1) DEFAULT NULL,
  `message_type` varchar(50) DEFAULT NULL,
  `client_address` varchar(255) DEFAULT NULL,
  `client_port` varchar(10) DEFAULT NULL,
  `content` varchar(5000) DEFAULT NULL,
  `send_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `receive_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `shelf_id` (`shelf_id`),
  CONSTRAINT `gmms_shelf_message_ibfk_1` FOREIGN KEY (`shelf_id`) REFERENCES `gmms_shelf` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_shelf_message
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_shelf_rank`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_shelf_rank`;
CREATE TABLE `gmms_shelf_rank` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `raw_package_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_package_id` (`raw_package_id`),
  CONSTRAINT `gmms_shelf_rank_ibfk_1` FOREIGN KEY (`raw_package_id`) REFERENCES `gmms_raw_package` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_shelf_rank
-- ----------------------------
INSERT INTO `gmms_shelf_rank` VALUES ('1', '01', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('2', '02', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('3', '03', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('4', '04', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('5', '05', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('6', '06', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('7', '07', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('8', '08', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('9', '09', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('10', '10', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('11', '11', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('12', '12', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('13', '13', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('14', '14', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('15', '15', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('16', '16', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('17', '17', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('18', '18', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('19', '19', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('20', '20', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('21', '21', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('22', '22', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('23', '23', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('24', '24', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('25', '25', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('26', '26', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('27', '27', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('28', '28', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('29', '29', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('30', '30', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('31', '31', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('32', '32', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('33', '33', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('34', '34', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('35', '35', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('36', '36', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('37', '37', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('38', '38', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('39', '39', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('40', '40', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('41', '41', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('42', '42', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('43', '43', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('44', '44', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('45', '45', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('46', '46', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('47', '47', null, null);
INSERT INTO `gmms_shelf_rank` VALUES ('48', '48', null, null);

-- ----------------------------
-- Table structure for `gmms_shelf_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_shelf_task`;
CREATE TABLE `gmms_shelf_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `state` varchar(50) DEFAULT NULL,
  `task_type` varchar(255) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `flag` varchar(255) DEFAULT NULL,
  `shelf_hoist_id` bigint(20) DEFAULT NULL,
  `shelf_rank_id` bigint(20) DEFAULT NULL,
  `load_machine_rack_id` bigint(20) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `complete_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `shelf_hoist_id` (`shelf_hoist_id`),
  KEY `shelf_rank_id` (`shelf_rank_id`),
  KEY `load_machine_rack_id` (`load_machine_rack_id`),
  CONSTRAINT `gmms_shelf_task_ibfk_1` FOREIGN KEY (`shelf_hoist_id`) REFERENCES `gmms_shelf_hoist` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_shelf_task_ibfk_2` FOREIGN KEY (`shelf_rank_id`) REFERENCES `gmms_shelf_rank` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_shelf_task_ibfk_3` FOREIGN KEY (`load_machine_rack_id`) REFERENCES `gmms_load_machine_rack` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_shelf_task
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_task`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_task`;
CREATE TABLE `gmms_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `title` varchar(128) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_task
-- ----------------------------
INSERT INTO `gmms_task` VALUES ('1', 'Study PlayFramework 2.0', 'http://www.playframework.org/', '2');
INSERT INTO `gmms_task` VALUES ('2', 'Study Grails 2.0', 'http://www.grails.org/', '2');
INSERT INTO `gmms_task` VALUES ('3', 'Try SpringFuse', 'http://www.springfuse.com/', '2');
INSERT INTO `gmms_task` VALUES ('4', 'Try Spring Roo', 'http://www.springsource.org/spring-roo', '2');
INSERT INTO `gmms_task` VALUES ('5', 'Release SpringSide 4.0', 'As soon as posibble.', '2');

-- ----------------------------
-- Table structure for `gmms_toughening_glass`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_toughening_glass`;
CREATE TABLE `gmms_toughening_glass` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `actual_length` double DEFAULT NULL,
  `actual_width` double DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `glass_id` bigint(20) DEFAULT NULL,
  `manufacture_batch_id` bigint(20) DEFAULT NULL,
  `measure_machine_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacture_batch_id` (`manufacture_batch_id`),
  KEY `glass_id` (`glass_id`),
  KEY `measure_machine_id` (`measure_machine_id`),
  CONSTRAINT `gmms_toughening_glass_ibfk_1` FOREIGN KEY (`manufacture_batch_id`) REFERENCES `gmms_manufacture_batch` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_toughening_glass_ibfk_2` FOREIGN KEY (`glass_id`) REFERENCES `gmms_glass` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `gmms_toughening_glass_ibfk_3` FOREIGN KEY (`measure_machine_id`) REFERENCES `gmms_measure_machine` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_toughening_glass
-- ----------------------------

-- ----------------------------
-- Table structure for `gmms_user`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_user`;
CREATE TABLE `gmms_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `login_name` varchar(64) NOT NULL,
  `name` varchar(64) NOT NULL,
  `password` varchar(255) NOT NULL,
  `salt` varchar(64) NOT NULL,
  `roles` varchar(255) NOT NULL,
  `groups` varchar(255) NOT NULL,
  `register_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `login_name` (`login_name`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_user
-- ----------------------------
INSERT INTO `gmms_user` VALUES ('1', 'admin', 'Admin', '691b14d79bf0fa2215f155235df5e670b64394cc', '7efbd59d9741d34f', 'admin', '1', '2012-06-04 01:00:00');
INSERT INTO `gmms_user` VALUES ('2', 'user', 'Calvin', '2488aa0c31c624687bd9928e0a5d29e7d1ed520b', '6d65d24122c30500', 'user', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('3', 'cangchu', 'cangchu', '0b758ab9fb7b358b93961ab047224fda16a8bf6a', 'd04571a0f1ca1a30', 'cangchu', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('4', 'qiege', 'qiege', '1f6ca85a796572b9d236e0487521c870a7a60be1', 'fc961ed3a7d9da04', 'qiege', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('5', 'manager', 'manager', '680ed74ba20ea5fb0454cc0bbfbeee4e917c1e89', '69247bcc1a1dd877', 'manager', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('6', 'group', 'group', 'b387bc3bd054d66bcd9f07324d5f1c408603dc86', '37f680f83155559d', 'group', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('7', 'xiapian', 'xiapian', '[REDACTED]', 'ec1f393b29ae0179', 'xiapian', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('8', 'celiang', 'celiang', 'bf9b3d04d7a74f67ea4101d53935a1e580be20e1', '883ab755fc387bef', 'celiang', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('9', 'zuzhang', 'zuzhang', 'ad56fe11012c113fcd60263e404d57f69f7a9947', 'dcf2bf4ba2ec9569', 'grouper', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('10', 'xiapian2', 'xiapian2', 'aa85bd5a296f54105a1180197d400cc0203bcda7', 'ec1f393b29ae0179', 'xiapian', '2', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('11', 'celiang2', 'celiang2', 'bf9b3d04d7a74f67ea4101d53935a1e580be20e1', '883ab755fc387bef', 'celiang', '2', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('12', 'zuzhang2', 'zuzhang2', 'ad56fe11012c113fcd60263e404d57f69f7a9947', 'dcf2bf4ba2ec9569', 'grouper', '2', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('13', 'qiege2', 'qiege2', '1f6ca85a796572b9d236e0487521c870a7a60be1', 'fc961ed3a7d9da04', 'qiege2', '2', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('14', 'test', 'test', '165f6df21e67a643875614ec23457b6335e35ed5', '68e1f82d53d015fd', 'test', '1', '2012-06-04 02:00:00');
INSERT INTO `gmms_user` VALUES ('15', 'hmi', 'hmi', 'cdb74c7e0af74d02b1d8ddb31748f490f325bbad', '56c1988f1539be86', 'hmi', '1', '2012-11-19 02:00:00');

-- ----------------------------
-- Table structure for `gmms_wash_machine`
-- ----------------------------
DROP TABLE IF EXISTS `gmms_wash_machine`;
CREATE TABLE `gmms_wash_machine` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `number` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `connect_state` varchar(50) DEFAULT NULL,
  `picture_url` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of gmms_wash_machine
-- ----------------------------
INSERT INTO `gmms_wash_machine` VALUES ('1', '01', 'Machine Shuts Down', 'Not Connected', null, '10000');
INSERT INTO `gmms_wash_machine` VALUES ('2', '02', 'Machine Shuts Down', 'Not Connected', null, '10001');
