ccrc.sql 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 研发
  4. Source Server Type : MySQL
  5. Source Server Version : 50729
  6. Source Host : 10.0.0.161:3306
  7. Source Schema : ccrc
  8. Target Server Type : MySQL
  9. Target Server Version : 50729
  10. File Encoding : 65001
  11. Date: 06/04/2021 10:13:26
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for prict_info
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `prict_info`;
  19. CREATE TABLE `prict_info` (
  20. `waterTypeName` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  21. `laddertype` int(11) NULL DEFAULT 1,
  22. `feetype` int(11) NULL DEFAULT NULL,
  23. `feeTypeName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  24. `ladderlevel` int(11) NULL DEFAULT NULL,
  25. `price` decimal(12, 2) NULL DEFAULT NULL,
  26. `available1` decimal(12, 2) NULL DEFAULT 0.00,
  27. `available2` decimal(12, 2) NULL DEFAULT 0.00,
  28. `available3` decimal(12, 2) NULL DEFAULT 0.00,
  29. `available4` decimal(12, 2) NULL DEFAULT 0.00
  30. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  31. -- ----------------------------
  32. -- Table structure for sc_area
  33. -- ----------------------------
  34. DROP TABLE IF EXISTS `sc_area`;
  35. CREATE TABLE `sc_area` (
  36. `id` int(11) NULL DEFAULT NULL,
  37. `parent_id` int(11) NULL DEFAULT NULL,
  38. `name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  39. `manger_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  40. `short_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  41. `manger_short_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  42. `level_type` tinyint(4) NULL DEFAULT NULL,
  43. `city_code` char(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  44. `zip_code` char(6) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  45. `pin_yin` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  46. `jian_pin` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  47. `first_char` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  48. `lng` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  49. `lat` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  50. `remark` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  51. INDEX `id`(`id`) USING BTREE,
  52. INDEX `level_type`(`level_type`) USING BTREE
  53. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  54. -- ----------------------------
  55. -- Table structure for sc_building
  56. -- ----------------------------
  57. DROP TABLE IF EXISTS `sc_building`;
  58. CREATE TABLE `sc_building` (
  59. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  60. `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  61. `community_id` int(11) NULL DEFAULT NULL COMMENT '小区',
  62. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  63. `address` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'address',
  64. `province` int(16) NULL DEFAULT NULL COMMENT 'province',
  65. `city` int(16) NULL DEFAULT NULL COMMENT 'city',
  66. `region` int(16) NULL DEFAULT NULL COMMENT 'region',
  67. `longitude` decimal(16, 10) NULL DEFAULT NULL,
  68. `latitude` decimal(16, 10) NULL DEFAULT NULL,
  69. `status` tinyint(1) NULL DEFAULT -1 COMMENT 'status',
  70. `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  71. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  72. `update_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  73. `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  74. PRIMARY KEY (`id`) USING BTREE
  75. ) ENGINE = InnoDB AUTO_INCREMENT = 8055 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '建筑' ROW_FORMAT = Dynamic;
  76. -- ----------------------------
  77. -- Table structure for sc_channel_device_type_use
  78. -- ----------------------------
  79. DROP TABLE IF EXISTS `sc_channel_device_type_use`;
  80. CREATE TABLE `sc_channel_device_type_use` (
  81. `id` int(11) NOT NULL AUTO_INCREMENT,
  82. `channel_id` int(11) NULL DEFAULT NULL COMMENT '场景',
  83. `device_type_id` int(11) NULL DEFAULT NULL COMMENT '设备类型',
  84. `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态',
  85. `date_create` datetime(0) NULL DEFAULT NULL,
  86. `date_update` datetime(0) NULL DEFAULT NULL,
  87. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  88. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  89. PRIMARY KEY (`id`) USING BTREE
  90. ) ENGINE = InnoDB AUTO_INCREMENT = 137 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  91. -- ----------------------------
  92. -- Table structure for sc_community
  93. -- ----------------------------
  94. DROP TABLE IF EXISTS `sc_community`;
  95. CREATE TABLE `sc_community` (
  96. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  97. `site_id` int(11) NULL DEFAULT NULL COMMENT '站点',
  98. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区名称',
  99. `longitude` decimal(16, 10) NULL DEFAULT NULL COMMENT 'longitude',
  100. `latitude` decimal(16, 10) NULL DEFAULT NULL COMMENT 'latitude',
  101. `province` int(16) NULL DEFAULT NULL COMMENT '省',
  102. `city` int(16) NULL DEFAULT NULL COMMENT '市',
  103. `region` int(16) NULL DEFAULT NULL COMMENT '区',
  104. `district_id` int(11) NULL DEFAULT NULL COMMENT '片区',
  105. `address` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
  106. `remark` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  107. `status` int(11) NULL DEFAULT NULL COMMENT '状态',
  108. `date_create` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  109. `date_update` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  110. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  111. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  112. `code` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  113. `customer_id` int(11) NULL DEFAULT NULL COMMENT '客户id',
  114. `org_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  115. PRIMARY KEY (`id`) USING BTREE
  116. ) ENGINE = InnoDB AUTO_INCREMENT = 1054 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  117. -- ----------------------------
  118. -- Table structure for sc_community_org
  119. -- ----------------------------
  120. DROP TABLE IF EXISTS `sc_community_org`;
  121. CREATE TABLE `sc_community_org` (
  122. `id` int(11) NOT NULL AUTO_INCREMENT,
  123. `org_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  124. `community_id` int(11) NULL DEFAULT NULL COMMENT '小区id',
  125. `create_date` datetime(0) NULL DEFAULT NULL,
  126. `update_date` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  127. `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  128. `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  129. `status` int(255) NULL DEFAULT NULL,
  130. `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  131. PRIMARY KEY (`id`) USING BTREE
  132. ) ENGINE = InnoDB AUTO_INCREMENT = 113 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  133. -- ----------------------------
  134. -- Table structure for sc_customer
  135. -- ----------------------------
  136. DROP TABLE IF EXISTS `sc_customer`;
  137. CREATE TABLE `sc_customer` (
  138. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  139. `site_id` int(11) NULL DEFAULT NULL COMMENT '站点,参考sc_site主键',
  140. `customer_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户名称',
  141. `customer_phone` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户联系方式',
  142. `customer_contact_person` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户联系人',
  143. `push_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '推送地址',
  144. `customer_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户编号',
  145. `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户token',
  146. `remark` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  147. `status` int(11) NULL DEFAULT NULL COMMENT '状态',
  148. `customer_org_id` int(11) NULL DEFAULT NULL COMMENT '客户对应机构,每个客户都会有个对应的机构',
  149. `date_create` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  150. `date_update` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  151. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  152. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  153. `stage_type` int(11) NULL DEFAULT NULL COMMENT '用水阶段类型 1:年 2:月 3:日',
  154. `picture_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '价格图',
  155. `parent_id` int(11) NOT NULL DEFAULT 0,
  156. `children_num` int(11) NOT NULL DEFAULT 0 COMMENT 'childrenNum',
  157. `pay_invoice_type` int(11) NULL DEFAULT 0 COMMENT '收据类型:0:默认 1:开鲁 2:盖州',
  158. PRIMARY KEY (`id`) USING BTREE
  159. ) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备的客户信息,一个客户可以有多个设备' ROW_FORMAT = Dynamic;
  160. -- ----------------------------
  161. -- Table structure for sc_device
  162. -- ----------------------------
  163. DROP TABLE IF EXISTS `sc_device`;
  164. CREATE TABLE `sc_device` (
  165. `id` bigint(20) NOT NULL,
  166. `device_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  167. `meter_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  168. `file_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  169. `seal_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  170. `site_id` int(11) NULL DEFAULT NULL,
  171. `sys_id` int(11) NULL DEFAULT NULL,
  172. `device_type_id` int(11) NULL DEFAULT NULL,
  173. `manufacturer_id` int(11) NULL DEFAULT NULL,
  174. `building_id` int(11) NULL DEFAULT NULL,
  175. `community_id` int(11) NULL DEFAULT NULL,
  176. `loc_desc` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  177. `meter_reading` decimal(10, 2) NULL DEFAULT NULL,
  178. `valve_status` int(11) NULL DEFAULT NULL,
  179. `device_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  180. `last_receive_time` timestamp(0) NULL DEFAULT NULL,
  181. `status` tinyint(1) NULL DEFAULT NULL,
  182. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  183. `date_create` timestamp(0) NULL DEFAULT NULL,
  184. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  185. `date_update` timestamp(0) NULL DEFAULT NULL,
  186. PRIMARY KEY (`id`) USING BTREE
  187. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  188. -- ----------------------------
  189. -- Table structure for sc_device_manufacturer
  190. -- ----------------------------
  191. DROP TABLE IF EXISTS `sc_device_manufacturer`;
  192. CREATE TABLE `sc_device_manufacturer` (
  193. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  194. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  195. `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  196. `status` tinyint(1) NULL DEFAULT 0 COMMENT 'delFlag',
  197. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  198. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  199. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  200. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  201. `en_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  202. PRIMARY KEY (`id`) USING BTREE
  203. ) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备厂商' ROW_FORMAT = Dynamic;
  204. -- ----------------------------
  205. -- Table structure for sc_device_type
  206. -- ----------------------------
  207. DROP TABLE IF EXISTS `sc_device_type`;
  208. CREATE TABLE `sc_device_type` (
  209. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  210. `equipment_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'equipmentType',
  211. `model` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'model',
  212. `channel_id` int(11) NULL DEFAULT -1 COMMENT 'channelId',
  213. `manufacturer_id` int(11) NULL DEFAULT -1 COMMENT 'manufacturerId',
  214. `device_type` int(11) NULL DEFAULT 1 COMMENT 'deviceType',
  215. `period` decimal(5, 2) NULL DEFAULT NULL COMMENT '上报周期',
  216. `expression` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '配合上报周期使用',
  217. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'delFlag',
  218. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  219. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  220. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  221. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  222. `en_model` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  223. `en_equipment_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  224. `agent_identifier` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  225. `is_valve` int(1) NULL DEFAULT 0 COMMENT '有无阀门 0:无 1:有',
  226. `is_register` int(1) NULL DEFAULT 0 COMMENT '是否需要注册 0:否:是',
  227. PRIMARY KEY (`id`) USING BTREE
  228. ) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备类型' ROW_FORMAT = Dynamic;
  229. -- ----------------------------
  230. -- Table structure for sc_file
  231. -- ----------------------------
  232. DROP TABLE IF EXISTS `sc_file`;
  233. CREATE TABLE `sc_file` (
  234. `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id',
  235. `file_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'fileType',
  236. `size` bigint(15) NULL DEFAULT 0 COMMENT 'size',
  237. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  238. `path` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'path',
  239. `url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'url',
  240. `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  241. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  242. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  243. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  244. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  245. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  246. PRIMARY KEY (`id`) USING BTREE
  247. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件' ROW_FORMAT = Dynamic;
  248. -- ----------------------------
  249. -- Table structure for sc_grid_management
  250. -- ----------------------------
  251. DROP TABLE IF EXISTS `sc_grid_management`;
  252. CREATE TABLE `sc_grid_management` (
  253. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  254. `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  255. `customer_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户编号',
  256. `customer_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户手机',
  257. `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户名称',
  258. `label` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签',
  259. `emergency_contact` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '紧急联系人',
  260. `emergency_contact_phone_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '紧急联系人电话',
  261. `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
  262. `is_default` int(255) NULL DEFAULT 0 COMMENT '默认客户',
  263. `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  264. `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  265. `create_time` datetime(0) NULL DEFAULT NULL,
  266. `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  267. `status` int(255) NULL DEFAULT NULL,
  268. PRIMARY KEY (`id`) USING BTREE
  269. ) ENGINE = InnoDB AUTO_INCREMENT = 68 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  270. -- ----------------------------
  271. -- Table structure for sc_login_logs
  272. -- ----------------------------
  273. DROP TABLE IF EXISTS `sc_login_logs`;
  274. CREATE TABLE `sc_login_logs` (
  275. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  276. `user_id` int(11) NOT NULL DEFAULT -1 COMMENT 'userId',
  277. `region` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'region',
  278. `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'ip',
  279. `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  280. `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  281. PRIMARY KEY (`id`) USING BTREE
  282. ) ENGINE = InnoDB AUTO_INCREMENT = 516 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_login_logs' ROW_FORMAT = Dynamic;
  283. -- ----------------------------
  284. -- Table structure for sc_message
  285. -- ----------------------------
  286. DROP TABLE IF EXISTS `sc_message`;
  287. CREATE TABLE `sc_message` (
  288. `id` int(11) NOT NULL AUTO_INCREMENT,
  289. `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  290. `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
  291. `message_type` int(11) NULL DEFAULT NULL COMMENT '消息类型',
  292. `message_title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息标题',
  293. `message_content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息内容',
  294. `message_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息url',
  295. `obj_id` int(11) NULL DEFAULT NULL COMMENT '对象id',
  296. `read` int(11) NULL DEFAULT NULL COMMENT '是否已读',
  297. `status` int(11) NULL DEFAULT NULL,
  298. `date_create` timestamp(0) NULL DEFAULT NULL,
  299. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  300. `date_update` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  301. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  302. PRIMARY KEY (`id`) USING BTREE
  303. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  304. -- ----------------------------
  305. -- Table structure for sc_operation_log
  306. -- ----------------------------
  307. DROP TABLE IF EXISTS `sc_operation_log`;
  308. CREATE TABLE `sc_operation_log` (
  309. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  310. `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  311. `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  312. `operation_name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作名称',
  313. `username` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户',
  314. `old_data` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '旧数据',
  315. `new_data` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '新数据',
  316. `status` int(11) NULL DEFAULT NULL COMMENT '状态',
  317. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  318. `create_date` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  319. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  320. `update_date` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  321. `mobilephone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  322. PRIMARY KEY (`id`) USING BTREE
  323. ) ENGINE = InnoDB AUTO_INCREMENT = 1121 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  324. -- ----------------------------
  325. -- Table structure for sc_organization
  326. -- ----------------------------
  327. DROP TABLE IF EXISTS `sc_organization`;
  328. CREATE TABLE `sc_organization` (
  329. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  330. `parent_id` int(11) NULL DEFAULT -1 COMMENT 'parentId',
  331. `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  332. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'nane',
  333. `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  334. `address` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'address',
  335. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  336. `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  337. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  338. `update_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  339. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  340. `collections` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'collections',
  341. `customer_id` bigint(11) NULL DEFAULT NULL,
  342. `area_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域id',
  343. PRIMARY KEY (`id`) USING BTREE
  344. ) ENGINE = InnoDB AUTO_INCREMENT = 140 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '机构' ROW_FORMAT = Dynamic;
  345. -- ----------------------------
  346. -- Table structure for sc_permission
  347. -- ----------------------------
  348. DROP TABLE IF EXISTS `sc_permission`;
  349. CREATE TABLE `sc_permission` (
  350. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  351. `parent_id` int(11) NULL DEFAULT NULL COMMENT 'pid',
  352. `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'name',
  353. `permission` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'code',
  354. `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'icon',
  355. `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'path',
  356. `sort` int(11) NULL DEFAULT 1 COMMENT 'sort',
  357. `is_menu` tinyint(1) NULL DEFAULT 1 COMMENT 'isMenu',
  358. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'enable',
  359. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  360. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  361. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  362. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  363. `is_super_admin_menu` tinyint(1) NULL DEFAULT 0,
  364. `is_site_menu` tinyint(1) NULL DEFAULT 0,
  365. `sys_id` int(11) NULL DEFAULT NULL COMMENT 'sysId',
  366. `alias` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '别名',
  367. `is_billing_menu` int(11) NULL DEFAULT 0 COMMENT '是否是计费菜单',
  368. PRIMARY KEY (`id`) USING BTREE
  369. ) ENGINE = InnoDB AUTO_INCREMENT = 1032 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_menu' ROW_FORMAT = Dynamic;
  370. -- ----------------------------
  371. -- Table structure for sc_role
  372. -- ----------------------------
  373. DROP TABLE IF EXISTS `sc_role`;
  374. CREATE TABLE `sc_role` (
  375. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  376. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'name',
  377. `description` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'nameZh',
  378. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  379. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  380. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  381. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  382. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  383. `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  384. `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  385. PRIMARY KEY (`id`) USING BTREE
  386. ) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_role' ROW_FORMAT = Dynamic;
  387. -- ----------------------------
  388. -- Table structure for sc_role_permission
  389. -- ----------------------------
  390. DROP TABLE IF EXISTS `sc_role_permission`;
  391. CREATE TABLE `sc_role_permission` (
  392. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  393. `rid` int(11) NOT NULL DEFAULT -1 COMMENT 'rid',
  394. `pid` int(11) NOT NULL DEFAULT -1 COMMENT 'mid',
  395. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  396. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  397. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  398. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  399. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  400. PRIMARY KEY (`id`) USING BTREE,
  401. INDEX `index_rp`(`rid`, `pid`) USING BTREE
  402. ) ENGINE = InnoDB AUTO_INCREMENT = 327 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_role_menu' ROW_FORMAT = Dynamic;
  403. -- ----------------------------
  404. -- Table structure for sc_site
  405. -- ----------------------------
  406. DROP TABLE IF EXISTS `sc_site`;
  407. CREATE TABLE `sc_site` (
  408. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  409. `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  410. `website` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'website',
  411. `cust_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户号',
  412. `type` int(11) NULL DEFAULT NULL COMMENT '站点类型 1:水务 2:计费',
  413. `apikey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'apikey',
  414. `logo_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'logoUrl',
  415. `customer_id` int(11) NULL DEFAULT NULL COMMENT '客户id',
  416. `status` tinyint(1) NULL DEFAULT -1 COMMENT 'status',
  417. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  418. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  419. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  420. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  421. `account` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号',
  422. PRIMARY KEY (`id`) USING BTREE
  423. ) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点' ROW_FORMAT = Dynamic;
  424. -- ----------------------------
  425. -- Table structure for sc_site_permission
  426. -- ----------------------------
  427. DROP TABLE IF EXISTS `sc_site_permission`;
  428. CREATE TABLE `sc_site_permission` (
  429. `id` int(11) NOT NULL AUTO_INCREMENT,
  430. `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  431. `permission_id` int(11) NULL DEFAULT NULL COMMENT '权限id',
  432. `status` int(11) NULL DEFAULT NULL,
  433. `create_date` timestamp(0) NULL DEFAULT NULL,
  434. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  435. `update_date` timestamp(0) NULL DEFAULT NULL,
  436. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  437. PRIMARY KEY (`id`) USING BTREE
  438. ) ENGINE = InnoDB AUTO_INCREMENT = 983 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  439. -- ----------------------------
  440. -- Table structure for sc_site_user
  441. -- ----------------------------
  442. DROP TABLE IF EXISTS `sc_site_user`;
  443. CREATE TABLE `sc_site_user` (
  444. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  445. `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  446. `user_id` int(11) NULL DEFAULT -1 COMMENT 'userId',
  447. `organ_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  448. `type` int(11) NULL DEFAULT NULL COMMENT '类型 2:站点管理员 3:普通人员',
  449. `is_admin` tinyint(1) NULL DEFAULT 0 COMMENT 'isAdmin',
  450. `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  451. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  452. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  453. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  454. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  455. PRIMARY KEY (`id`) USING BTREE,
  456. INDEX `user_id`(`user_id`, `status`) USING BTREE
  457. ) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点人员' ROW_FORMAT = Dynamic;
  458. -- ----------------------------
  459. -- Table structure for sc_user
  460. -- ----------------------------
  461. DROP TABLE IF EXISTS `sc_user`;
  462. CREATE TABLE `sc_user` (
  463. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  464. `username` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'username',
  465. `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'password',
  466. `mobile_phone` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'mobilePhone',
  467. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'name',
  468. `status` tinyint(1) NULL DEFAULT 0 COMMENT 'status',
  469. `work_unit` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'workUnit',
  470. `city` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'city',
  471. `address` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'address',
  472. `wechat` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'wechat',
  473. `email` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'email',
  474. `is_super_admin` tinyint(1) NULL DEFAULT 0 COMMENT 'isSuperAdmin',
  475. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  476. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  477. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  478. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  479. `openid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'openid',
  480. `organ_id` int(11) NULL DEFAULT -1 COMMENT 'organId',
  481. `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  482. `enable` int(11) NULL DEFAULT 1,
  483. PRIMARY KEY (`id`) USING BTREE
  484. ) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_user' ROW_FORMAT = Dynamic;
  485. -- ----------------------------
  486. -- Table structure for sc_user_role
  487. -- ----------------------------
  488. DROP TABLE IF EXISTS `sc_user_role`;
  489. CREATE TABLE `sc_user_role` (
  490. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  491. `uid` int(11) NOT NULL DEFAULT -1 COMMENT 'uid',
  492. `rid` int(11) NOT NULL DEFAULT -1 COMMENT 'rid',
  493. `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  494. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  495. `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  496. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  497. `status` tinyint(1) NULL DEFAULT 1,
  498. PRIMARY KEY (`id`) USING BTREE,
  499. INDEX `index_ur`(`uid`, `rid`) USING BTREE
  500. ) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_user_role' ROW_FORMAT = Dynamic;
  501. -- ----------------------------
  502. -- Table structure for sc_warning_log
  503. -- ----------------------------
  504. DROP TABLE IF EXISTS `sc_warning_log`;
  505. CREATE TABLE `sc_warning_log` (
  506. `id` int(11) NOT NULL AUTO_INCREMENT,
  507. `client_user_id` int(11) NULL DEFAULT NULL COMMENT '客户id',
  508. `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  509. `warning_type` int(11) NULL DEFAULT NULL COMMENT '预警类型',
  510. `feedback_status` int(11) NULL DEFAULT NULL COMMENT '反馈状态',
  511. `feedback_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '反馈内容',
  512. `last_date` timestamp(0) NULL DEFAULT NULL COMMENT '最后预警时间',
  513. `status` int(11) NULL DEFAULT NULL,
  514. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  515. `date_create` timestamp(0) NULL DEFAULT NULL,
  516. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  517. `date_update` timestamp(0) NULL DEFAULT NULL,
  518. `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  519. `account_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  520. `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  521. PRIMARY KEY (`id`) USING BTREE
  522. ) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  523. -- ----------------------------
  524. -- Table structure for sc_warning_message
  525. -- ----------------------------
  526. DROP TABLE IF EXISTS `sc_warning_message`;
  527. CREATE TABLE `sc_warning_message` (
  528. `id` int(11) NOT NULL AUTO_INCREMENT,
  529. `warning_log_id` int(11) NULL DEFAULT NULL,
  530. `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  531. `status` int(11) NULL DEFAULT NULL,
  532. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  533. `date_create` timestamp(0) NULL DEFAULT NULL,
  534. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  535. `date_update` timestamp(0) NULL DEFAULT NULL,
  536. PRIMARY KEY (`id`) USING BTREE
  537. ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  538. -- ----------------------------
  539. -- Table structure for sc_warning_rule
  540. -- ----------------------------
  541. DROP TABLE IF EXISTS `sc_warning_rule`;
  542. CREATE TABLE `sc_warning_rule` (
  543. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  544. `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  545. `warning_type` int(11) NULL DEFAULT NULL COMMENT '预警类型',
  546. `status` int(11) NULL DEFAULT NULL,
  547. `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  548. `date_create` timestamp(0) NULL DEFAULT NULL,
  549. `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  550. `date_update` timestamp(0) NULL DEFAULT NULL,
  551. PRIMARY KEY (`id`) USING BTREE
  552. ) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
  553. -- ----------------------------
  554. -- Event structure for e_test_insert
  555. -- ----------------------------
  556. DROP EVENT IF EXISTS `e_test_insert`;
  557. delimiter ;;
  558. CREATE EVENT `e_test_insert`
  559. ON SCHEDULE
  560. EVERY '10' SECOND STARTS '2019-08-07 20:04:55'
  561. DISABLE
  562. DO call batch_insert()
  563. ;;
  564. delimiter ;
  565. SET FOREIGN_KEY_CHECKS = 1;
  566. INSERT INTO `ccrc`.`sc_user`(`id`, `username`, `password`, `mobile_phone`, `name`, `status`, `work_unit`, `city`, `address`, `wechat`, `email`, `is_super_admin`, `create_date`, `create_by`, `update_date`, `update_by`, `openid`, `organ_id`, `type`, `enable`) VALUES (1, 'admin', '', '18800000000', 'admin', 1, '', '', '', '', '', 1, '2019-05-11 00:00:00', '', '2021-04-01 17:57:08', 'admin', NULL, -1, 1, 1);