/*
 Navicat Premium Data Transfer

 Source Server         : 研发
 Source Server Type    : MySQL
 Source Server Version : 50729
 Source Host           : 10.0.0.161:3306
 Source Schema         : ccrc

 Target Server Type    : MySQL
 Target Server Version : 50729
 File Encoding         : 65001

 Date: 06/04/2021 10:13:26
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for prict_info
-- ----------------------------
DROP TABLE IF EXISTS `prict_info`;
CREATE TABLE `prict_info`  (
  `waterTypeName` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `laddertype` int(11) NULL DEFAULT 1,
  `feetype` int(11) NULL DEFAULT NULL,
  `feeTypeName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ladderlevel` int(11) NULL DEFAULT NULL,
  `price` decimal(12, 2) NULL DEFAULT NULL,
  `available1` decimal(12, 2) NULL DEFAULT 0.00,
  `available2` decimal(12, 2) NULL DEFAULT 0.00,
  `available3` decimal(12, 2) NULL DEFAULT 0.00,
  `available4` decimal(12, 2) NULL DEFAULT 0.00
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_area
-- ----------------------------
DROP TABLE IF EXISTS `sc_area`;
CREATE TABLE `sc_area`  (
  `id` int(11) NULL DEFAULT NULL,
  `parent_id` int(11) NULL DEFAULT NULL,
  `name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `manger_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `short_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `manger_short_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `level_type` tinyint(4) NULL DEFAULT NULL,
  `city_code` char(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `zip_code` char(6) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `pin_yin` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `jian_pin` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `first_char` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `lng` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `lat` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `remark` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  INDEX `id`(`id`) USING BTREE,
  INDEX `level_type`(`level_type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_building
-- ----------------------------
DROP TABLE IF EXISTS `sc_building`;
CREATE TABLE `sc_building`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  `community_id` int(11) NULL DEFAULT NULL COMMENT '小区',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  `address` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'address',
  `province` int(16) NULL DEFAULT NULL COMMENT 'province',
  `city` int(16) NULL DEFAULT NULL COMMENT 'city',
  `region` int(16) NULL DEFAULT NULL COMMENT 'region',
  `longitude` decimal(16, 10) NULL DEFAULT NULL,
  `latitude` decimal(16, 10) NULL DEFAULT NULL,
  `status` tinyint(1) NULL DEFAULT -1 COMMENT 'status',
  `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8055 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '建筑' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_channel_device_type_use
-- ----------------------------
DROP TABLE IF EXISTS `sc_channel_device_type_use`;
CREATE TABLE `sc_channel_device_type_use`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `channel_id` int(11) NULL DEFAULT NULL COMMENT '场景',
  `device_type_id` int(11) NULL DEFAULT NULL COMMENT '设备类型',
  `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态',
  `date_create` datetime(0) NULL DEFAULT NULL,
  `date_update` datetime(0) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 137 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_community
-- ----------------------------
DROP TABLE IF EXISTS `sc_community`;
CREATE TABLE `sc_community`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `site_id` int(11) NULL DEFAULT NULL COMMENT '站点',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区名称',
  `longitude` decimal(16, 10) NULL DEFAULT NULL COMMENT 'longitude',
  `latitude` decimal(16, 10) NULL DEFAULT NULL COMMENT 'latitude',
  `province` int(16) NULL DEFAULT NULL COMMENT '省',
  `city` int(16) NULL DEFAULT NULL COMMENT '市',
  `region` int(16) NULL DEFAULT NULL COMMENT '区',
  `district_id` int(11) NULL DEFAULT NULL COMMENT '片区',
  `address` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
  `remark` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `status` int(11) NULL DEFAULT NULL COMMENT '状态',
  `date_create` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  `date_update` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `code` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `customer_id` int(11) NULL DEFAULT NULL COMMENT '客户id',
  `org_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1054 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_community_org
-- ----------------------------
DROP TABLE IF EXISTS `sc_community_org`;
CREATE TABLE `sc_community_org`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `org_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  `community_id` int(11) NULL DEFAULT NULL COMMENT '小区id',
  `create_date` datetime(0) NULL DEFAULT NULL,
  `update_date` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `status` int(255) NULL DEFAULT NULL,
  `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 113 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_customer
-- ----------------------------
DROP TABLE IF EXISTS `sc_customer`;
CREATE TABLE `sc_customer`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `site_id` int(11) NULL DEFAULT NULL COMMENT '站点，参考sc_site主键',
  `customer_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户名称',
  `customer_phone` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户联系方式',
  `customer_contact_person` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户联系人',
  `push_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '推送地址',
  `customer_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户编号',
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户token',
  `remark` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `status` int(11) NULL DEFAULT NULL COMMENT '状态',
  `customer_org_id` int(11) NULL DEFAULT NULL COMMENT '客户对应机构，每个客户都会有个对应的机构',
  `date_create` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  `date_update` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `stage_type` int(11) NULL DEFAULT NULL COMMENT '用水阶段类型 1:年 2：月 3：日',
  `picture_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '价格图',
  `parent_id` int(11) NOT NULL DEFAULT 0,
  `children_num` int(11) NOT NULL DEFAULT 0 COMMENT 'childrenNum',
  `pay_invoice_type` int(11) NULL DEFAULT 0 COMMENT '收据类型：0：默认 1：开鲁 2：盖州',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备的客户信息，一个客户可以有多个设备' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_device
-- ----------------------------
DROP TABLE IF EXISTS `sc_device`;
CREATE TABLE `sc_device`  (
  `id` bigint(20) NOT NULL,
  `device_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `meter_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `file_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `seal_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `site_id` int(11) NULL DEFAULT NULL,
  `sys_id` int(11) NULL DEFAULT NULL,
  `device_type_id` int(11) NULL DEFAULT NULL,
  `manufacturer_id` int(11) NULL DEFAULT NULL,
  `building_id` int(11) NULL DEFAULT NULL,
  `community_id` int(11) NULL DEFAULT NULL,
  `loc_desc` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `meter_reading` decimal(10, 2) NULL DEFAULT NULL,
  `valve_status` int(11) NULL DEFAULT NULL,
  `device_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `last_receive_time` timestamp(0) NULL DEFAULT NULL,
  `status` tinyint(1) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_create` timestamp(0) NULL DEFAULT NULL,
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_update` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_device_manufacturer
-- ----------------------------
DROP TABLE IF EXISTS `sc_device_manufacturer`;
CREATE TABLE `sc_device_manufacturer`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  `status` tinyint(1) NULL DEFAULT 0 COMMENT 'delFlag',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `en_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备厂商' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_device_type
-- ----------------------------
DROP TABLE IF EXISTS `sc_device_type`;
CREATE TABLE `sc_device_type`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `equipment_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'equipmentType',
  `model` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'model',
  `channel_id` int(11) NULL DEFAULT -1 COMMENT 'channelId',
  `manufacturer_id` int(11) NULL DEFAULT -1 COMMENT 'manufacturerId',
  `device_type` int(11) NULL DEFAULT 1 COMMENT 'deviceType',
  `period` decimal(5, 2) NULL DEFAULT NULL COMMENT '上报周期',
  `expression` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '配合上报周期使用',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'delFlag',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `en_model` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `en_equipment_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `agent_identifier` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `is_valve` int(1) NULL DEFAULT 0 COMMENT '有无阀门 0：无 1：有',
  `is_register` int(1) NULL DEFAULT 0 COMMENT '是否需要注册 0：否：是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备类型' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_file
-- ----------------------------
DROP TABLE IF EXISTS `sc_file`;
CREATE TABLE `sc_file`  (
  `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id',
  `file_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'fileType',
  `size` bigint(15) NULL DEFAULT 0 COMMENT 'size',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  `path` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'path',
  `url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'url',
  `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_grid_management
-- ----------------------------
DROP TABLE IF EXISTS `sc_grid_management`;
CREATE TABLE `sc_grid_management`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  `customer_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户编号',
  `customer_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户手机',
  `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户名称',
  `label` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签',
  `emergency_contact` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '紧急联系人',
  `emergency_contact_phone_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '紧急联系人电话',
  `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
  `is_default` int(255) NULL DEFAULT 0 COMMENT '默认客户',
  `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `create_time` datetime(0) NULL DEFAULT NULL,
  `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  `status` int(255) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 68 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_login_logs
-- ----------------------------
DROP TABLE IF EXISTS `sc_login_logs`;
CREATE TABLE `sc_login_logs`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(11) NOT NULL DEFAULT -1 COMMENT 'userId',
  `region` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'region',
  `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'ip',
  `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 516 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_login_logs' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_message
-- ----------------------------
DROP TABLE IF EXISTS `sc_message`;
CREATE TABLE `sc_message`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
  `message_type` int(11) NULL DEFAULT NULL COMMENT '消息类型',
  `message_title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息标题',
  `message_content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息内容',
  `message_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息url',
  `obj_id` int(11) NULL DEFAULT NULL COMMENT '对象id',
  `read` int(11) NULL DEFAULT NULL COMMENT '是否已读',
  `status` int(11) NULL DEFAULT NULL,
  `date_create` timestamp(0) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_update` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `sc_operation_log`;
CREATE TABLE `sc_operation_log`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  `operation_name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作名称',
  `username` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户',
  `old_data` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '旧数据',
  `new_data` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '新数据',
  `status` int(11) NULL DEFAULT NULL COMMENT '状态',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `create_date` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `update_date` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  `mobilephone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1121 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_organization
-- ----------------------------
DROP TABLE IF EXISTS `sc_organization`;
CREATE TABLE `sc_organization`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `parent_id` int(11) NULL DEFAULT -1 COMMENT 'parentId',
  `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'nane',
  `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  `address` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'address',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `collections` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'collections',
  `customer_id` bigint(11) NULL DEFAULT NULL,
  `area_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 140 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '机构' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_permission
-- ----------------------------
DROP TABLE IF EXISTS `sc_permission`;
CREATE TABLE `sc_permission`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `parent_id` int(11) NULL DEFAULT NULL COMMENT 'pid',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'name',
  `permission` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'code',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'icon',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'path',
  `sort` int(11) NULL DEFAULT 1 COMMENT 'sort',
  `is_menu` tinyint(1) NULL DEFAULT 1 COMMENT 'isMenu',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'enable',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `is_super_admin_menu` tinyint(1) NULL DEFAULT 0,
  `is_site_menu` tinyint(1) NULL DEFAULT 0,
  `sys_id` int(11) NULL DEFAULT NULL COMMENT 'sysId',
  `alias` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '别名',
  `is_billing_menu` int(11) NULL DEFAULT 0 COMMENT '是否是计费菜单',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1032 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_menu' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_role
-- ----------------------------
DROP TABLE IF EXISTS `sc_role`;
CREATE TABLE `sc_role`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'name',
  `description` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'nameZh',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_role' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sc_role_permission`;
CREATE TABLE `sc_role_permission`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `rid` int(11) NOT NULL DEFAULT -1 COMMENT 'rid',
  `pid` int(11) NOT NULL DEFAULT -1 COMMENT 'mid',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_rp`(`rid`, `pid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 327 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_role_menu' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_site
-- ----------------------------
DROP TABLE IF EXISTS `sc_site`;
CREATE TABLE `sc_site`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'name',
  `website` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'website',
  `cust_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户号',
  `type` int(11) NULL DEFAULT NULL COMMENT '站点类型 1：水务 2：计费',
  `apikey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'apikey',
  `logo_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'logoUrl',
  `customer_id` int(11) NULL DEFAULT NULL COMMENT '客户id',
  `status` tinyint(1) NULL DEFAULT -1 COMMENT 'status',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `account` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_site_permission
-- ----------------------------
DROP TABLE IF EXISTS `sc_site_permission`;
CREATE TABLE `sc_site_permission`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id',
  `permission_id` int(11) NULL DEFAULT NULL COMMENT '权限id',
  `status` int(11) NULL DEFAULT NULL,
  `create_date` timestamp(0) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `update_date` timestamp(0) NULL DEFAULT NULL,
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 983 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_site_user
-- ----------------------------
DROP TABLE IF EXISTS `sc_site_user`;
CREATE TABLE `sc_site_user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `site_id` int(11) NULL DEFAULT -1 COMMENT 'siteId',
  `user_id` int(11) NULL DEFAULT -1 COMMENT 'userId',
  `organ_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  `type` int(11) NULL DEFAULT NULL COMMENT '类型 2:站点管理员 3:普通人员',
  `is_admin` tinyint(1) NULL DEFAULT 0 COMMENT 'isAdmin',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT 'status',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`, `status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点人员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_user
-- ----------------------------
DROP TABLE IF EXISTS `sc_user`;
CREATE TABLE `sc_user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `username` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'username',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'password',
  `mobile_phone` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'mobilePhone',
  `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'name',
  `status` tinyint(1) NULL DEFAULT 0 COMMENT 'status',
  `work_unit` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'workUnit',
  `city` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'city',
  `address` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'address',
  `wechat` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'wechat',
  `email` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'email',
  `is_super_admin` tinyint(1) NULL DEFAULT 0 COMMENT 'isSuperAdmin',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `openid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'openid',
  `organ_id` int(11) NULL DEFAULT -1 COMMENT 'organId',
  `type` int(11) NULL DEFAULT 1 COMMENT 'type',
  `enable` int(11) NULL DEFAULT 1,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_user' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sc_user_role`;
CREATE TABLE `sc_user_role`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `uid` int(11) NOT NULL DEFAULT -1 COMMENT 'uid',
  `rid` int(11) NOT NULL DEFAULT -1 COMMENT 'rid',
  `create_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'createDate',
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'createBy',
  `update_date` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'updateDate',
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'updateBy',
  `status` tinyint(1) NULL DEFAULT 1,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_ur`(`uid`, `rid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sc_user_role' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_warning_log
-- ----------------------------
DROP TABLE IF EXISTS `sc_warning_log`;
CREATE TABLE `sc_warning_log`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_user_id` int(11) NULL DEFAULT NULL COMMENT '客户id',
  `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  `warning_type` int(11) NULL DEFAULT NULL COMMENT '预警类型',
  `feedback_status` int(11) NULL DEFAULT NULL COMMENT '反馈状态',
  `feedback_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '反馈内容',
  `last_date` timestamp(0) NULL DEFAULT NULL COMMENT '最后预警时间',
  `status` int(11) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_create` timestamp(0) NULL DEFAULT NULL,
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_update` timestamp(0) NULL DEFAULT NULL,
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `account_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_warning_message
-- ----------------------------
DROP TABLE IF EXISTS `sc_warning_message`;
CREATE TABLE `sc_warning_message`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `warning_log_id` int(11) NULL DEFAULT NULL,
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `status` int(11) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_create` timestamp(0) NULL DEFAULT NULL,
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_update` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sc_warning_rule
-- ----------------------------
DROP TABLE IF EXISTS `sc_warning_rule`;
CREATE TABLE `sc_warning_rule`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id',
  `warning_type` int(11) NULL DEFAULT NULL COMMENT '预警类型',
  `status` int(11) NULL DEFAULT NULL,
  `create_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_create` timestamp(0) NULL DEFAULT NULL,
  `update_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date_update` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Event structure for e_test_insert
-- ----------------------------
DROP EVENT IF EXISTS `e_test_insert`;
delimiter ;;
CREATE EVENT `e_test_insert`
ON SCHEDULE
EVERY '10' SECOND STARTS '2019-08-07 20:04:55'
DISABLE
DO call batch_insert()
;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
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);

