编辑代码

CREATE DATABASE  IF NOT EXISTS `kanc` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `kanc`;
-- MySQL dump 10.13  Distrib 5.7.4-m14, for Win64 (x86_64)
--
-- Host: localhost    Database: kanc
-- ------------------------------------------------------
-- Server version	5.7.4-m14

/*!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 utf8 */;
/*!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 */;

--
-- Table structure for table `auth`
--

DROP TABLE IF EXISTS `auth`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auth` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `auth` int(11) NOT NULL,
  `content` varchar(100) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `auth` WRITE;
/*!40000 ALTER TABLE `auth` DISABLE KEYS */;
INSERT INTO `auth` VALUES (1,1,'查看钻孔数据'),(2,2,'查看电脑数据'),(3,4,'查看日志文件'),(4,8,'查看操作员信息'),(5,16,'修改传感器数据'),(6,32,'修改电脑信息'),(7,64,'修改操作员信息,重置操作员密码'),(8,128,'开启关闭服务器');
/*!40000 ALTER TABLE `auth` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `comput`
--

DROP TABLE IF EXISTS `comput`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comput` (
  `ID_machine` varchar(26) NOT NULL,
  `regions` int(11) DEFAULT NULL,
  `name` varchar(60) NOT NULL,
  `state` varchar(10) NOT NULL DEFAULT '未知',
  `servingtime` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID_machine`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `comput` WRITE;
/*!40000 ALTER TABLE `comput` DISABLE KEYS */;
INSERT INTO `comput` VALUES ('1001',2,'1号电脑','正常','2017-06-18 21:02:50');
/*!40000 ALTER TABLE `comput` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `comput_view`
--

DROP TABLE IF EXISTS `comput_view`;
/*!50001 DROP VIEW IF EXISTS `comput_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `comput_view` (
  `名称` tinyint NOT NULL,
  `状态` tinyint NOT NULL,
  `服务时间` tinyint NOT NULL,
  `编号` tinyint NOT NULL,
  `隶属单位` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `groups`
--

DROP TABLE IF EXISTS `groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `groups` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `groups` WRITE;
/*!40000 ALTER TABLE `groups` DISABLE KEYS */;
INSERT INTO `groups` VALUES (1,'晚班'),(4,'中班'),(5,'早班');
/*!40000 ALTER TABLE `groups` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `lgs`
--

DROP TABLE IF EXISTS `lgs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lgs` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(10) NOT NULL,
  `content` varchar(100) NOT NULL,
  `time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1426 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `machine`
--

DROP TABLE IF EXISTS `machine`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `machine` (
  `ID_machine` varchar(26) NOT NULL,
  `Relation` varchar(26) DEFAULT NULL,
  `regions` varchar(16) DEFAULT NULL,
  `state` varchar(10) NOT NULL DEFAULT '未知',
  `servingtime` datetime DEFAULT CURRENT_TIMESTAMP,
  `name` varchar(60) NOT NULL,
  PRIMARY KEY (`ID_machine`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `machine` WRITE;
/*!40000 ALTER TABLE `machine` DISABLE KEYS */;
INSERT INTO `machine` VALUES ('1D0026000757345833373020','2E0030001257345833373020','1001','正常','2019-06-19 12:45:45','车集新长1'),('220031000857345738333120','2E001E000857345539353220','1001','正常','2019-03-30 15:46:38','平顶山2号'),('2B0018000657345539353220','2A0027000657345539353220','1001','正常','2019-03-21 14:42:15','车集矿'),('2E0026001257345833373020','30003B000157345833373020','1001','正常','2019-06-06 21:50:52','平顶山3号'),('2E002E001257345833373020','2B0029000657345539353220','1001','正常','2019-05-19 09:28:35','山西煤矿'),('310030001257345833373020','30003B000157345833373020','1001','正常','2019-06-09 17:51:52','平顶山4号'),('350036000957345434363720','31003C000957345434363720','1001','正常','2019-04-01 16:31:46','龙门煤矿'),('35003D001257345833373020','2D003C001257345833373020','1001','正常','2019-06-19 12:44:57','车集新短1');
/*!40000 ALTER TABLE `machine` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `machine_view`
--

DROP TABLE IF EXISTS `machine_view`;
/*!50001 DROP VIEW IF EXISTS `machine_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `machine_view` (
  `名称` tinyint NOT NULL,
  `状态` tinyint NOT NULL,
  `服务时间` tinyint NOT NULL,
  `编号` tinyint NOT NULL,
  `隶属单位` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Temporary table structure for view `recoder_view`
--

DROP TABLE IF EXISTS `recoder_view`;
/*!50001 DROP VIEW IF EXISTS `recoder_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `recoder_view` (
  `ID` tinyint NOT NULL,
  `编号` tinyint NOT NULL,
  `设备名称` tinyint NOT NULL,
  `开始时间` tinyint NOT NULL,
  `结束时间` tinyint NOT NULL,
  `所属巷道` tinyint NOT NULL,
  `所属班组` tinyint NOT NULL,
  `钻孔编号` tinyint NOT NULL,
  `钻孔直径` tinyint NOT NULL,
  `钻杆长度` tinyint NOT NULL,
  `开孔点x` tinyint NOT NULL,
  `开孔点y` tinyint NOT NULL,
  `开孔点z` tinyint NOT NULL,
  `原始数据` tinyint NOT NULL,
  `图形数据` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `recoders`
--

DROP TABLE IF EXISTS `recoders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `recoders` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ID_machine` varchar(26) NOT NULL DEFAULT '123',
  `stimer` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `etimer` datetime DEFAULT CURRENT_TIMESTAMP,
  `Tunnel` int(11) NOT NULL DEFAULT '1',
  `group` int(11) NOT NULL DEFAULT '1',
  `drill_Number` varchar(10) DEFAULT NULL,
  `drill_d` int(11) DEFAULT NULL,
  `drill_len` float DEFAULT '1',
  `pointx` float DEFAULT '0',
  `pointy` float DEFAULT '0',
  `pointz` float DEFAULT '0',
  `decstart` float DEFAULT '0',
  `drill_height` float DEFAULT '0',
  `mcname` varchar(45) DEFAULT '1',
  `mcqj` float DEFAULT '0',
  `mcheight` float DEFAULT '1',
  `mczx` float DEFAULT '0',
  `jsons` longblob,
  `brep` longblob,
  `rets` mediumblob,
  `dwdd` varchar(45) DEFAULT '1',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `region`
--

DROP TABLE IF EXISTS `region`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `region` (
  `name` varchar(60) NOT NULL,
  `regions` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`regions`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `region` WRITE;
/*!40000 ALTER TABLE `region` DISABLE KEYS */;
INSERT INTO `region` VALUES ('矿安能创',1),('优斯兰德',2);
/*!40000 ALTER TABLE `region` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tunnel`
--

DROP TABLE IF EXISTS `tunnel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tunnel` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `number` varchar(10) NOT NULL,
  `thick` float NOT NULL DEFAULT '0',
  `length` float NOT NULL DEFAULT '0',
  `width` float NOT NULL DEFAULT '0',
  `Dipangle` float NOT NULL DEFAULT '0',
  `Azimuth` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `tunnel` WRITE;
/*!40000 ALTER TABLE `tunnel` DISABLE KEYS */;
INSERT INTO `tunnel` VALUES (1,'二号巷','003',5,100,10,0,0);
/*!40000 ALTER TABLE `tunnel` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `usrs`
--

DROP TABLE IF EXISTS `usrs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usrs` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(10) NOT NULL,
  `authority` int(11) DEFAULT '0',
  `tel` varchar(15) NOT NULL,
  `user` varchar(10) NOT NULL,
  `pass` varchar(50) NOT NULL DEFAULT '29AC25660E3078E87E3097D3822E50D7',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `user_UNIQUE` (`user`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `usrs` WRITE;
/*!40000 ALTER TABLE `usrs` DISABLE KEYS */;
INSERT INTO `usrs` VALUES (1,'admin',255,'+8613584014975','Admin','29AC25660E3078E87E3097D3822E50D7');
/*!40000 ALTER TABLE `usrs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Final view structure for view `comput_view`
--

/*!50001 DROP TABLE IF EXISTS `comput_view`*/;
/*!50001 DROP VIEW IF EXISTS `comput_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `comput_view` AS select `comput`.`name` AS `名称`,`comput`.`state` AS `状态`,`comput`.`servingtime` AS `服务时间`,`comput`.`ID_machine` AS `编号`,`region`.`name` AS `隶属单位` from (`comput` left join `region` on((`comput`.`regions` = `region`.`regions`))) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `machine_view`
--

/*!50001 DROP TABLE IF EXISTS `machine_view`*/;
/*!50001 DROP VIEW IF EXISTS `machine_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `machine_view` AS select `machine`.`name` AS `名称`,`machine`.`state` AS `状态`,`machine`.`servingtime` AS `服务时间`,`machine`.`ID_machine` AS `编号`,`comput`.`name` AS `隶属单位` from (`machine` left join `comput` on((`machine`.`regions` = `comput`.`ID_machine`))) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `recoder_view`
--

/*!50001 DROP TABLE IF EXISTS `recoder_view`*/;
/*!50001 DROP VIEW IF EXISTS `recoder_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `recoder_view` AS select `recoders`.`ID` AS `ID`,`recoders`.`ID_machine` AS `编号`,`machine`.`name` AS `设备名称`,`recoders`.`stimer` AS `开始时间`,`recoders`.`etimer` AS `结束时间`,`tunnel`.`name` AS `所属巷道`,`groups`.`name` AS `所属班组`,`recoders`.`drill_Number` AS `钻孔编号`,`recoders`.`drill_d` AS `钻孔直径`,`recoders`.`drill_len` AS `钻杆长度`,`recoders`.`pointx` AS `开孔点x`,`recoders`.`pointy` AS `开孔点y`,`recoders`.`pointz` AS `开孔点z`,`recoders`.`jsons` AS `原始数据`,`recoders`.`brep` AS `图形数据` from (((`recoders` left join `machine` on((`recoders`.`ID_machine` = `machine`.`ID_machine`))) left join `tunnel` on((`recoders`.`Tunnel` = `tunnel`.`ID`))) left join `groups` on((`recoders`.`group` = `groups`.`ID`))) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!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 */;

-- Dump completed on 2019-06-29  9:42:15