You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

373 lines
55 KiB

3 years ago
  1. -- MySQL dump 10.13 Distrib 8.0.25, for Win64 (x86_64)
  2. --
  3. -- Host: 124.221.242.70 Database: iboot
  4. -- ------------------------------------------------------
  5. -- Server version 8.0.29-0ubuntu0.20.04.3
  6. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  7. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  8. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  9. /*!50503 SET NAMES utf8mb4 */;
  10. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  11. /*!40103 SET TIME_ZONE='+00:00' */;
  12. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  13. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  14. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  15. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  16. --
  17. -- Table structure for table `iot_collect_data`
  18. --
  19. DROP TABLE IF EXISTS `iot_collect_data`;
  20. /*!40101 SET @saved_cs_client = @@character_set_client */;
  21. /*!50503 SET character_set_client = utf8mb4 */;
  22. CREATE TABLE `iot_collect_data` (
  23. `id` bigint NOT NULL AUTO_INCREMENT,
  24. `cid` bigint NOT NULL COMMENT '任务执行标识',
  25. `uid` bigint DEFAULT NULL COMMENT '设备uid',
  26. `signal_id` bigint NOT NULL COMMENT '信号id',
  27. `field_type` tinyint DEFAULT NULL COMMENT '数据类型',
  28. `collect_task_id` bigint NOT NULL COMMENT '任务id',
  29. `address` varchar(128) DEFAULT NULL COMMENT '信号地址',
  30. `value` varchar(256) DEFAULT NULL COMMENT '',
  31. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '采集状态',
  32. `reason` varchar(64) NOT NULL DEFAULT '' COMMENT '错误说明',
  33. `collect_time` datetime NOT NULL COMMENT '采集时间',
  34. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  35. PRIMARY KEY (`id`),
  36. KEY `iot_collect_data_cid_index` (`cid` DESC),
  37. KEY `iot_collect_data_collect_time_index` (`collect_time` DESC),
  38. KEY `iot_collect_data_signal_id_index` (`signal_id`),
  39. KEY `iot_collect_data_uid_index` (`uid` DESC)
  40. ) ENGINE=InnoDB AUTO_INCREMENT=543 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='采集到的数据';
  41. /*!40101 SET character_set_client = @saved_cs_client */;
  42. --
  43. -- Dumping data for table `iot_collect_data`
  44. --
  45. LOCK TABLES `iot_collect_data` WRITE;
  46. /*!40000 ALTER TABLE `iot_collect_data` DISABLE KEYS */;
  47. INSERT INTO `iot_collect_data` VALUES (271,1587346702532595712,1550801539290628000,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(272,1587346702532595712,1550801539290628000,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(273,1587362682827042816,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(274,1587362682827042816,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(275,1587362808643579904,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(276,1587362808643579904,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(277,1587362934460116992,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(278,1587362934460116992,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(279,1587363060259876864,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(280,1587363060259876864,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(281,1587363186088996864,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(282,1587363186088996864,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(283,1587363311922311168,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(284,1587363311922311168,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(285,1587363437755625472,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(286,1587363437755625472,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(287,1587363563635077120,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(288,1587363563635077120,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(289,1587383444641673216,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(290,1587383444641673216,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(291,1587383570454016000,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(292,1587383570454016000,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(293,1587383696278941696,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(294,1587383696278941696,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(295,1587383822116450304,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(296,1587383822116450304,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(297,1587383947903627264,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(298,1587383947903627264,1582605843000504300,2,3,1,'102',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(299,1587384073745330176,1582605843000504300,1,3,1,'100',NULL,0,'无此设备或设备断线','2022-11-01 00:00:00','2022-11-01 00:00:00'),(300,1587384073745330176,1
  48. /*!40000 ALTER TABLE `iot_collect_data` ENABLE KEYS */;
  49. UNLOCK TABLES;
  50. --
  51. -- Table structure for table `iot_collect_detail`
  52. --
  53. DROP TABLE IF EXISTS `iot_collect_detail`;
  54. /*!40101 SET @saved_cs_client = @@character_set_client */;
  55. /*!50503 SET character_set_client = utf8mb4 */;
  56. CREATE TABLE `iot_collect_detail` (
  57. `id` bigint NOT NULL AUTO_INCREMENT,
  58. `uid` bigint NOT NULL COMMENT '设备uid',
  59. `child_sn` varchar(64) DEFAULT NULL COMMENT '子设备编号',
  60. `extend` varchar(512) DEFAULT NULL COMMENT '扩展字段',
  61. `store_uid` bigint DEFAULT NULL COMMENT '存储设备uid',
  62. `store_action` varchar(36) DEFAULT NULL COMMENT '存储动作',
  63. `collect_action` varchar(36) DEFAULT NULL COMMENT '采集动作',
  64. `point_group_id` bigint NOT NULL COMMENT '点位组',
  65. `collect_task_id` bigint NOT NULL COMMENT '采集任务id',
  66. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  67. PRIMARY KEY (`id`),
  68. KEY `iot_collect_detail_collect_task_id_index` (`collect_task_id`),
  69. KEY `iot_collect_detail_point_group_id_index` (`point_group_id`),
  70. KEY `iot_collect_detail_uid_index` (`uid`),
  71. KEY `iot_collect_detail_child_sn_index` (`child_sn`)
  72. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='采集明细';
  73. /*!40101 SET character_set_client = @saved_cs_client */;
  74. --
  75. -- Dumping data for table `iot_collect_detail`
  76. --
  77. LOCK TABLES `iot_collect_detail` WRITE;
  78. /*!40000 ALTER TABLE `iot_collect_detail` DISABLE KEYS */;
  79. INSERT INTO `iot_collect_detail` VALUES (1,1582605843000504300,'01',NULL,NULL,'STORE:RDBMS','MODBUS:DTU:TCP',6,1,'2022-10-30 09:47:24');
  80. /*!40000 ALTER TABLE `iot_collect_detail` ENABLE KEYS */;
  81. UNLOCK TABLES;
  82. --
  83. -- Table structure for table `iot_collect_task`
  84. --
  85. DROP TABLE IF EXISTS `iot_collect_task`;
  86. /*!40101 SET @saved_cs_client = @@character_set_client */;
  87. /*!50503 SET character_set_client = utf8mb4 */;
  88. CREATE TABLE `iot_collect_task` (
  89. `id` bigint NOT NULL AUTO_INCREMENT,
  90. `name` varchar(64) NOT NULL COMMENT '任务名称',
  91. `cron` varchar(32) NOT NULL COMMENT '任务调度',
  92. `status` char(12) NOT NULL DEFAULT 'stop' COMMENT '任务状态(start, stop, fail)',
  93. `remark` varchar(128) NOT NULL DEFAULT '' COMMENT '采集任务说明',
  94. `reason` varchar(128) NOT NULL DEFAULT '' COMMENT '任务失败的原因',
  95. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  96. `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  97. PRIMARY KEY (`id`),
  98. UNIQUE KEY `iot_collect_task_name_uindex` (`name`)
  99. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据采集任务';
  100. /*!40101 SET character_set_client = @saved_cs_client */;
  101. --
  102. -- Dumping data for table `iot_collect_task`
  103. --
  104. LOCK TABLES `iot_collect_task` WRITE;
  105. /*!40000 ALTER TABLE `iot_collect_task` DISABLE KEYS */;
  106. INSERT INTO `iot_collect_task` VALUES (1,'plc采集','0/30 * * * * ?','stop','S71200设备采集任务','','2022-08-28 15:29:51','2022-11-01 09:57:50');
  107. /*!40000 ALTER TABLE `iot_collect_task` ENABLE KEYS */;
  108. UNLOCK TABLES;
  109. --
  110. -- Table structure for table `iot_device`
  111. --
  112. DROP TABLE IF EXISTS `iot_device`;
  113. /*!40101 SET @saved_cs_client = @@character_set_client */;
  114. /*!50503 SET character_set_client = utf8mb4 */;
  115. CREATE TABLE `iot_device` (
  116. `id` bigint NOT NULL AUTO_INCREMENT,
  117. `ip` varchar(32) DEFAULT NULL COMMENT '设备ip',
  118. `uid` bigint NOT NULL COMMENT '设备唯一的uid',
  119. `name` varchar(64) NOT NULL COMMENT '设备名称',
  120. `port` int DEFAULT NULL COMMENT '设备端口',
  121. `model` int DEFAULT NULL COMMENT '设备型号',
  122. `status` enum('online','offline') NOT NULL DEFAULT 'offline' COMMENT '设备状态',
  123. `user_id` bigint DEFAULT NULL COMMENT '所属会员',
  124. `account` varchar(64) DEFAULT NULL COMMENT '账号',
  125. `password` varchar(64) DEFAULT NULL COMMENT '密码',
  126. `device_sn` varchar(64) NOT NULL COMMENT '设备编号',
  127. `switch_time` timestamp NULL DEFAULT NULL COMMENT '设备状态切换时间',
  128. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  129. `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  130. `device_type_id` bigint NOT NULL COMMENT '设备所属类型',
  131. PRIMARY KEY (`id`),
  132. UNIQUE KEY `iot_device_uid_uindex` (`uid`)
  133. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备表';
  134. /*!40101 SET character_set_client = @saved_cs_client */;
  135. --
  136. -- Dumping data for table `iot_device`
  137. --
  138. LOCK TABLES `iot_device` WRITE;
  139. /*!40000 ALTER TABLE `iot_device` DISABLE KEYS */;
  140. INSERT INTO `iot_device` VALUES (5,'172.16.30.1',1550801539290628000,'欧姆龙PLC',9600,7,'offline',NULL,NULL,NULL,'omron001','2022-11-01 09:51:04','2022-07-23 19:14:34',NULL,3),(6,NULL,1555798233911939000,'RTU协议测试',NULL,10,'offline',NULL,NULL,NULL,'RTU_IOT_MODBUS_01','2022-11-01 09:51:04','2022-08-06 14:09:38',NULL,8),(8,NULL,1559835702382841900,'DTU模拟设测试',NULL,19,'offline',NULL,NULL,NULL,'100000000003','2022-11-01 09:51:04','2022-08-17 17:33:06',NULL,10),(16,NULL,1582605843000504300,'温湿度测试',NULL,9,'offline',NULL,NULL,NULL,'45332450','2022-11-01 09:51:04','2022-10-19 13:33:31',NULL,9);
  141. /*!40000 ALTER TABLE `iot_device` ENABLE KEYS */;
  142. UNLOCK TABLES;
  143. --
  144. -- Table structure for table `iot_device_child`
  145. --
  146. DROP TABLE IF EXISTS `iot_device_child`;
  147. /*!40101 SET @saved_cs_client = @@character_set_client */;
  148. /*!50503 SET character_set_client = utf8mb4 */;
  149. CREATE TABLE `iot_device_child` (
  150. `id` bigint NOT NULL AUTO_INCREMENT,
  151. `name` varchar(64) NOT NULL COMMENT '子设备名称',
  152. `uid` bigint NOT NULL COMMENT '设备uid',
  153. `remark` varchar(256) DEFAULT NULL COMMENT '备注',
  154. `child_sn` varchar(64) NOT NULL COMMENT '子设备编号',
  155. `protocol_type` smallint DEFAULT NULL COMMENT '协议类型',
  156. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  157. PRIMARY KEY (`id`),
  158. KEY `iot_device_child_child_sn_index` (`child_sn`),
  159. KEY `iot_device_child_uid_index` (`uid`)
  160. ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COMMENT='子设备';
  161. /*!40101 SET character_set_client = @saved_cs_client */;
  162. --
  163. -- Dumping data for table `iot_device_child`
  164. --
  165. LOCK TABLES `iot_device_child` WRITE;
  166. /*!40000 ALTER TABLE `iot_device_child` DISABLE KEYS */;
  167. INSERT INTO `iot_device_child` VALUES (1,'继电器',1537990013924249600,'用于控制设备开关状态','1',1,'2022-06-18 10:48:32'),(2,'温湿度传感器',1555798233911939000,'用于采集环境的温湿度数据','1',1,'2022-08-06 14:10:05'),(4,'电表',1559835702382841900,'电表设备','1',NULL,'2022-08-18 14:12:28'),(5,'电表2',1559835702382841900,NULL,'0003',NULL,'2022-08-24 17:05:47'),(6,'从机1',1565594612523905000,NULL,'1',NULL,'2022-09-02 15:02:34'),(7,'343',1569960474991177700,NULL,'1',NULL,'2022-09-14 16:05:29'),(8,'rtutest001',1567785941169385500,NULL,'rtutest001',NULL,'2022-09-19 10:44:53'),(9,'wendu',1579858029321433000,NULL,'01',NULL,'2022-10-11 23:34:58'),(10,'shidu',1579858029321433000,NULL,'02',NULL,'2022-10-11 23:35:06'),(11,'2',1565594612523905000,NULL,'2',NULL,'2022-10-13 17:15:11'),(12,'温湿度',1582605843000504300,NULL,'01',NULL,'2022-10-19 13:33:56');
  168. /*!40000 ALTER TABLE `iot_device_child` ENABLE KEYS */;
  169. UNLOCK TABLES;
  170. --
  171. -- Table structure for table `iot_device_model`
  172. --
  173. DROP TABLE IF EXISTS `iot_device_model`;
  174. /*!40101 SET @saved_cs_client = @@character_set_client */;
  175. /*!50503 SET character_set_client = utf8mb4 */;
  176. CREATE TABLE `iot_device_model` (
  177. `id` int NOT NULL AUTO_INCREMENT,
  178. `type_id` int NOT NULL COMMENT '设备类型id',
  179. `model` varchar(36) DEFAULT NULL COMMENT '型号',
  180. `remark` varchar(128) DEFAULT NULL COMMENT '型号说明',
  181. PRIMARY KEY (`id`)
  182. ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb3 COMMENT='设备型号';
  183. /*!40101 SET character_set_client = @saved_cs_client */;
  184. --
  185. -- Dumping data for table `iot_device_model`
  186. --
  187. LOCK TABLES `iot_device_model` WRITE;
  188. /*!40000 ALTER TABLE `iot_device_model` DISABLE KEYS */;
  189. INSERT INTO `iot_device_model` VALUES (1,2,'S200',NULL),(2,2,'S300',NULL),(3,2,'S400',NULL),(4,2,'S1200',NULL),(5,2,'S1500',NULL),(6,2,'S200Smart',NULL),(7,3,'omron',NULL),(9,9,'温湿度传感器','温湿度采集'),(10,8,'继电器8bits','8路状态继电器'),(11,13,'modbus_rtu','modbus_rtu_test'),(13,15,'Photo','1'),(17,20,'1234','12354'),(19,10,'通用型号','dtu通用设备');
  190. /*!40000 ALTER TABLE `iot_device_model` ENABLE KEYS */;
  191. UNLOCK TABLES;
  192. --
  193. -- Table structure for table `iot_device_type`
  194. --
  195. DROP TABLE IF EXISTS `iot_device_type`;
  196. /*!40101 SET @saved_cs_client = @@character_set_client */;
  197. /*!50503 SET character_set_client = utf8mb4 */;
  198. CREATE TABLE `iot_device_type` (
  199. `id` bigint NOT NULL AUTO_INCREMENT,
  200. `pid` bigint NOT NULL DEFAULT '0' COMMENT '父id',
  201. `path` varchar(128) DEFAULT NULL COMMENT '路径',
  202. `name` varchar(64) NOT NULL COMMENT '类型名称',
  203. `alias` varchar(36) DEFAULT NULL COMMENT '类型别名',
  204. `image` varchar(128) DEFAULT NULL COMMENT '类型图地址',
  205. `remark` varchar(256) DEFAULT NULL COMMENT '类型说明',
  206. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  207. PRIMARY KEY (`id`),
  208. KEY `iot_device_type_alias_index` (`alias`)
  209. ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备类型';
  210. /*!40101 SET character_set_client = @saved_cs_client */;
  211. --
  212. -- Dumping data for table `iot_device_type`
  213. --
  214. LOCK TABLES `iot_device_type` WRITE;
  215. /*!40000 ALTER TABLE `iot_device_type` DISABLE KEYS */;
  216. INSERT INTO `iot_device_type` VALUES (1,5,'5,1','plc','PLC',NULL,'plc设备','2022-05-15 22:04:02'),(2,1,'5,1,2','西门子','PLC',NULL,'西门子','2022-05-15 22:08:08'),(3,1,'5,1,3','欧姆龙','PLC',NULL,'欧姆龙','2022-05-15 22:09:24'),(4,5,'5,4','dtu','DTU',NULL,'数据传输单元(用于串口转互联网)','2022-06-04 14:07:42'),(5,0,'5','工业物联网',NULL,NULL,'用于工业物联网平台设备的管理','2022-06-12 13:10:58'),(8,4,'5,4,8','modbus_rtu','DTU',NULL,'用于支持dtu操作modbus rtu设备','2022-08-18 12:29:37'),(9,4,'5,4,9','modbus_tcp','DTU',NULL,'用于支持dtu操作modbus tcp设备','2022-08-18 12:30:19'),(10,4,'5,4,10','自定义协议','DTU',NULL,'用于支持dtu操作其他协议的设备','2022-08-18 12:31:18'),(11,0,'11','智能家居',NULL,NULL,'用于智能家居平台设备的管理','2022-08-27 12:33:02'),(13,5,'5,13','modbus','MODBUS',NULL,'基于modbus的客户端实现','2022-09-02 10:13:12'),(23,13,'5,13,23','modbus_tcp','MODBUS',NULL,'基于modbus_tcp协议的主机','2022-11-01 16:14:08'),(24,13,'5,13,24','modbus_rtu','MODBUS',NULL,'基于modbus_rtu协议的主机','2022-11-01 16:15:12');
  217. /*!40000 ALTER TABLE `iot_device_type` ENABLE KEYS */;
  218. UNLOCK TABLES;
  219. --
  220. -- Table structure for table `iot_group_point`
  221. --
  222. DROP TABLE IF EXISTS `iot_group_point`;
  223. /*!40101 SET @saved_cs_client = @@character_set_client */;
  224. /*!50503 SET character_set_client = utf8mb4 */;
  225. CREATE TABLE `iot_group_point` (
  226. `id` bigint NOT NULL AUTO_INCREMENT,
  227. `signal_id` bigint NOT NULL COMMENT '所属点位',
  228. `group_id` bigint NOT NULL COMMENT '所属点位组',
  229. PRIMARY KEY (`id`),
  230. UNIQUE KEY `iot_group_point_group_id_signal_id_uindex` (`group_id`,`signal_id`),
  231. KEY `iot_group_point_group_id_index` (`group_id`),
  232. KEY `iot_group_point_point_id_index` (`signal_id`)
  233. ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb3 COMMENT='组点位';
  234. /*!40101 SET character_set_client = @saved_cs_client */;
  235. --
  236. -- Dumping data for table `iot_group_point`
  237. --
  238. LOCK TABLES `iot_group_point` WRITE;
  239. /*!40000 ALTER TABLE `iot_group_point` DISABLE KEYS */;
  240. INSERT INTO `iot_group_point` VALUES (15,1,1),(16,2,1),(27,2,2),(23,3,3),(12,3,4),(24,1,5),(25,2,5),(26,6,5),(30,9,6),(29,10,6);
  241. /*!40000 ALTER TABLE `iot_group_point` ENABLE KEYS */;
  242. UNLOCK TABLES;
  243. --
  244. -- Table structure for table `iot_point_group`
  245. --
  246. DROP TABLE IF EXISTS `iot_point_group`;
  247. /*!40101 SET @saved_cs_client = @@character_set_client */;
  248. /*!50503 SET character_set_client = utf8mb4 */;
  249. CREATE TABLE `iot_point_group` (
  250. `id` bigint NOT NULL AUTO_INCREMENT,
  251. `name` varchar(36) NOT NULL COMMENT '组名称',
  252. `model_id` int NOT NULL COMMENT '所属型号',
  253. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  254. PRIMARY KEY (`id`)
  255. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COMMENT='点位组';
  256. /*!40101 SET character_set_client = @saved_cs_client */;
  257. --
  258. -- Dumping data for table `iot_point_group`
  259. --
  260. LOCK TABLES `iot_point_group` WRITE;
  261. /*!40000 ALTER TABLE `iot_point_group` DISABLE KEYS */;
  262. INSERT INTO `iot_point_group` VALUES (2,'13',1,'2022-08-14 21:13:23'),(3,'继电器控制',10,'2022-08-27 14:59:40'),(4,'modbus_tcp',10,'2022-09-02 14:26:59'),(6,'温湿度组',9,'2022-10-30 18:44:35');
  263. /*!40000 ALTER TABLE `iot_point_group` ENABLE KEYS */;
  264. UNLOCK TABLES;
  265. --
  266. -- Table structure for table `iot_product`
  267. --
  268. DROP TABLE IF EXISTS `iot_product`;
  269. /*!40101 SET @saved_cs_client = @@character_set_client */;
  270. /*!50503 SET character_set_client = utf8mb4 */;
  271. CREATE TABLE `iot_product` (
  272. `id` bigint NOT NULL AUTO_INCREMENT,
  273. `pid` bigint NOT NULL DEFAULT '0' COMMENT '父id',
  274. `path` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '产品id路径',
  275. `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '产品名称',
  276. `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '产品说明',
  277. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  278. PRIMARY KEY (`id`)
  279. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='设备产品';
  280. /*!40101 SET character_set_client = @saved_cs_client */;
  281. --
  282. -- Dumping data for table `iot_product`
  283. --
  284. LOCK TABLES `iot_product` WRITE;
  285. /*!40000 ALTER TABLE `iot_product` DISABLE KEYS */;
  286. /*!40000 ALTER TABLE `iot_product` ENABLE KEYS */;
  287. UNLOCK TABLES;
  288. --
  289. -- Table structure for table `iot_signal`
  290. --
  291. DROP TABLE IF EXISTS `iot_signal`;
  292. /*!40101 SET @saved_cs_client = @@character_set_client */;
  293. /*!50503 SET character_set_client = utf8mb4 */;
  294. CREATE TABLE `iot_signal` (
  295. `id` bigint NOT NULL AUTO_INCREMENT,
  296. `name` varchar(64) NOT NULL COMMENT '点位名称',
  297. `address` varchar(16) NOT NULL DEFAULT '' COMMENT '点位地址',
  298. `message` varchar(256) DEFAULT NULL COMMENT '自定义报文',
  299. `type` tinyint DEFAULT NULL COMMENT '1. 点位 2. 自定义',
  300. `num` tinyint DEFAULT '0' COMMENT '读取的数量',
  301. `model_id` int NOT NULL COMMENT '型号id',
  302. `encode` char(8) DEFAULT NULL COMMENT '自定义报文编码(HEX,UTF8,ASCII)',
  303. `field_name` varchar(32) NOT NULL COMMENT '点位字段名称',
  304. `field_type` tinyint DEFAULT NULL COMMENT '字段类型(int、float、...)',
  305. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  306. `update_time` timestamp NULL DEFAULT NULL,
  307. PRIMARY KEY (`id`)
  308. ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb3 COMMENT='寄存器点位';
  309. /*!40101 SET character_set_client = @saved_cs_client */;
  310. --
  311. -- Dumping data for table `iot_signal`
  312. --
  313. LOCK TABLES `iot_signal` WRITE;
  314. /*!40000 ALTER TABLE `iot_signal` DISABLE KEYS */;
  315. INSERT INTO `iot_signal` VALUES (1,'电压值','100','',1,0,1,NULL,'voltage',3,'2022-07-28 17:42:35',NULL),(2,'电流值','102','',1,0,1,NULL,'current',3,'2022-08-16 21:48:24',NULL),(3,'继电器状态','1','',1,0,10,NULL,'status',7,'2022-08-27 14:57:25',NULL),(4,'测试1','2','',1,0,10,NULL,'22',1,'2022-09-08 15:10:11',NULL),(6,'开关','Q100','',1,0,4,NULL,'kaiguan',5,'2022-09-12 18:37:59',NULL),(8,'TEST','','345779348948983495',2,0,19,'HEX','TEST',NULL,'2022-10-29 20:09:24',NULL),(9,'温度','100',NULL,1,0,9,'HEX','temp',5,'2022-10-30 18:43:18',NULL),(10,'湿度','101',NULL,1,0,9,'HEX','humidity',5,'2022-10-30 18:45:49',NULL);
  316. /*!40000 ALTER TABLE `iot_signal` ENABLE KEYS */;
  317. UNLOCK TABLES;
  318. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  319. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  320. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  321. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  322. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  323. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  324. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  325. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  326. -- Dump completed on 2022-12-01 14:56:48