SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for mortals_xhx_idgenerator
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_idgenerator`;
CREATE TABLE `mortals_xhx_idgenerator`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `idType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id类型',
  `idMaxValue` bigint(20) UNSIGNED NOT NULL COMMENT 'id值',
  `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
  `versionNum` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '版本号，默认0',
  `gmtModify` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '主键Id生成器' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of mortals_xhx_idgenerator
-- ----------------------------
INSERT INTO `mortals_xhx_idgenerator` VALUES (1, 'INFO_VERSION_KEY', 1, '基础信息版本号生成因子', 0, '2019-04-18 18:00:00');

-- ----------------------------
-- Table structure for mortals_xhx_menu
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_menu`;
CREATE TABLE `mortals_xhx_menu`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID，主键，自增长',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
  `url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '连接地址',
  `parentId` bigint(20) NULL DEFAULT NULL COMMENT '父菜单ID，一级菜单的该字段值为-1',
  `orderId` int(11) NULL DEFAULT NULL COMMENT '排序编号',
  `status` tinyint(2) NULL DEFAULT 1 COMMENT '菜单状态，0：禁用，1：启用，默认1',
  `linkType` tinyint(2) NULL DEFAULT 0 COMMENT '链接方式，0：普通，1：弹出，2：脚本（JavaScript），默认0',
  `groupId` int(11) NULL DEFAULT 1 COMMENT '分组编号，使用菜单分隔符按该值分隔，默认1',
  `groupName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `imgPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主菜单图标，主菜单图标的css样式名',
  `buttonImgPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '按钮图标，按钮图标的css样式名',
  `imgCommPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '常用菜单图标，常用菜单图标的css样式名',
  `commMenu` tinyint(2) NULL DEFAULT 0 COMMENT '是否常用菜单，0：非常用，1：常用，默认0',
  `menuType` tinyint(2) NULL DEFAULT 0 COMMENT '菜单类型，0：主菜单，1：非主菜单(功能操作组)，默认0',
  `authType` tinyint(2) NULL DEFAULT 3 COMMENT '权限类型，0：无限制，1：无需登录查看，2：需要登录查看，3：需要角色权限查看，默认3',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
  `createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of mortals_xhx_menu
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (91, '系统管理', '', 0, 9999, 1, 0, 0, NULL, 'setting', '', '', 0, 0, 3, NULL, NULL, '');
INSERT INTO `mortals_xhx_menu` VALUES (108, '区域信息', '/area/list', 91, 65, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9001, '主页', '/index', 90, 10, 1, 0, 1, NULL, '', NULL, NULL, 0, 0, 3, '2019-02-19 16:08:09', 1, 'admin');
INSERT INTO `mortals_xhx_menu` VALUES (9101, '用户信息', '/user/list', 91, 10, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9102, '角色信息', '/role/list', 91, 20, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9103, '资源信息', '/resource/list', 91, 30, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9104, '菜单信息', '/menu/list', 91, 40, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9105, '参数信息', '/param/list', 91, 50, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9106, '任务信息', '/task/list', 91, 60, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_menu` VALUES (9107, '操作日志', '/oper/log/list', 91, 70, 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);


-- ----------------------------
-- Table structure for mortals_xhx_oper_log
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_oper_log`;
CREATE TABLE `mortals_xhx_oper_log`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `platformMark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '平台标识',
  `userId` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  `userName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名称',
  `loginName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户登录名',
  `requestUrl` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求地址',
  `content` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作内容，记录操作具体信息，如修改前修改或的数据',
  `ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作IP地址',
  `logDate` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
  `operType` tinyint(2) NULL DEFAULT NULL COMMENT '操作类型，0：新增，1：修改，2：删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_xhx_param
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_param`;
CREATE TABLE `mortals_xhx_param`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数名称',
  `firstOrganize` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一级组织，如：平台配置',
  `secondOrganize` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '二级组织，如：基础配置',
  `paramKey` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数键，全局唯一',
  `paramValue` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数值',
  `validStatus` tinyint(2) NULL DEFAULT 1 COMMENT '参数有效状态，0：禁用，1：启用，默认1',
  `modStatus` tinyint(2) NULL DEFAULT 4 COMMENT '参数修改状态，0：隐藏，1：页面仅查看，2：页面可修改，3：页面可删除，4：页面可修改删除，默认4',
  `displayType` tinyint(2) NULL DEFAULT 0 COMMENT '展现类型，0：普通文本框，1：多行文本框，2：开关，3：块输入框，默认：0',
  `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
  `createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '参数信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_xhx_resource
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_resource`;
CREATE TABLE `mortals_xhx_resource`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID，主键，自增长',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
  `url` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '连接地址，多个地址以逗号分隔',
  `authType` tinyint(2) NULL DEFAULT 3 COMMENT '权限类型，0：无限制，1：无需登录查看，2：需要登录查看，3：需要角色权限查看，默认3',
  `sourceType` tinyint(2) NULL DEFAULT 0 COMMENT '资源类型，0：系统资源，1：开放资源，默认0',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
  `createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
  `userType` tinyint(2) NULL DEFAULT NULL COMMENT '用户类型，0：系统用户 1:代理商用户 2:品牌商用户',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资源信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of mortals_xhx_resource
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (101001, '系统管理-菜单管理-查看', '/menu/list,/menu/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101002, '系统管理-菜单管理-维护', '/menu/add,/menu/edit,/menu/delete,/menu/save', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101003, '系统管理-角色管理-查看', '/role/list,/role/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101004, '系统管理-角色管理-维护', '/role/add,/role/edit,/role/save,/role/delete,/role/auth/list,/role/auth/distributionSource,/role/user/distributionUser,/user/list,/role/user/list,/role/user/distributionUser', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101005, '系统管理-用户管理-查看', '/user/list,/user/view,/role/roleNameByUserId', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101006, '系统管理-用户管理-维护', '/user/add,/user/edit,/user/delete,/user/save', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101007, '系统管理-任务设置-查看', '/task/list,/task/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101008, '系统管理-任务设置-维护', '/task/add,/task/edit,/task/delete,/task/save', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101009, '系统管理-参数设置-查看', '/param/list,/param/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101010, '系统管理-参数设置-维护', '/param/add,/param/edit,/param/delete,/param/save', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101011, '系统管理-资源管理-查看', '/resource/list,/resource/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101012, '系统管理-资源管理-维护', '/resource/add,/resource/edit,/resource/delete,/resource/save', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101013, '系统管理-操作日志-查看', '/oper/log/list,/oper/log/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101014, '系统管理-区域管理-查看', '/area/list,/area/view', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (101015, '系统管理-区域管理-维护', '/area/add,/area/edit,/area/delete,/area/save', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (150000, '控制台-主页', '/index', 3, 0, '2019-06-01 13:04:18', 1, '系统管理员', NULL);
INSERT INTO `mortals_xhx_resource` VALUES (150001, '公共资源', '/area/list', 2, 0, '2019-06-01 23:56:55', 1, '系统管理员', NULL);

-- ----------------------------
-- Table structure for mortals_xhx_role
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role`;
CREATE TABLE `mortals_xhx_role`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名称',
  `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `roleType` tinyint(2) NULL DEFAULT 2 COMMENT '角色类型，0：系统内置角色（不可删除），1：默认系统角色，2：普通角色，默认2',
  `customerId` bigint(20) NULL DEFAULT NULL COMMENT '归属客户ID',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
  `createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
  `userType` tinyint(2) NULL DEFAULT NULL COMMENT '用户类型，0：系统用户 1:代理商用户 2:品牌商用户',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of mortals_xhx_role
-- ----------------------------
INSERT INTO `mortals_xhx_role` VALUES (1, '管理员', '类似admin', 0, NULL, '2019-03-04 11:41:06', 1, 'admin', NULL);

-- ----------------------------
-- Table structure for mortals_xhx_role_auth
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_auth`;
CREATE TABLE `mortals_xhx_role_auth`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `roleId` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
  `resourceId` bigint(20) NULL DEFAULT NULL COMMENT '资源ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色资源权限' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_xhx_role_user
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_user`;
CREATE TABLE `mortals_xhx_role_user`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `roleId` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
  `userId` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色用户' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_xhx_site
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_site`;
CREATE TABLE `mortals_xhx_site`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，主键，自增长',
  `siteName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '站点名',
  `parentId` bigint(11) NOT NULL COMMENT '父级id',
  `ancestors` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '祖级列表，逗号分隔',
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '地址',
  `mobile` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '电话',
  `introduce` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '单位介绍',
  `workday1` tinyint(1) NULL DEFAULT NULL COMMENT '周一 1上班 0不上',
  `workday2` tinyint(1) NULL DEFAULT NULL COMMENT '周二 1上班 0不上',
  `workday3` tinyint(1) NULL DEFAULT NULL COMMENT '周三 1上班 0不上',
  `workday4` tinyint(1) NULL DEFAULT NULL COMMENT '周四 1上班 0不上',
  `workday5` tinyint(1) NULL DEFAULT NULL COMMENT '周五 1上班 0不上',
  `workday6` tinyint(1) NULL DEFAULT NULL COMMENT '周六 1上班 0不上',
  `workday7` tinyint(1) NULL DEFAULT NULL COMMENT '周日 1上班 0不上',
  `number` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '站点编号',
  `summary` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '中心介绍',
  `orderNum` int(9) NULL DEFAULT 0 COMMENT '排序字段',
  `status` tinyint(2) NULL DEFAULT 1 COMMENT '站点状态 ，0，停用，1，正常 默认1',
  `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '变更时间',
  `updateUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '变更用户loginName',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建用户loginName',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '站点信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_xhx_table_index
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_table_index`;
CREATE TABLE `mortals_xhx_table_index`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID，主键，自增长',
  `tableName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表名称',
  `tableMark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表标识',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '分表索引信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_xhx_task
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_task`;
CREATE TABLE `mortals_xhx_task`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称',
  `taskKey` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务关键字，区分任务执行流程',
  `status` tinyint(2) NULL DEFAULT 0 COMMENT '任务状态，0：未启动，1：执行中，默认0',
  `excuteService` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务执行服务',
  `excuteParam` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '任务执行参数',
  `excuteHost` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务执行主机，为空表示不限制任务的执行主机，多个用逗号分隔',
  `excuteStrategy` tinyint(2) NULL DEFAULT 1 COMMENT '执行策略，1：按日，2：按周，3：按月，4：按间隔时间，默认1',
  `excuteDate` int(11) NULL DEFAULT 0 COMMENT '执行日期，按日：则为0；按周：则为1-7；按月：则为：1-31；按间隔时间：则为间隔时间，单位：秒；默认0',
  `excuteTime` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '00' COMMENT '执行时间，格式：HH:mm，默认：00:00',
  `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `lastExcuteHost` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后执行主机',
  `lastExcuteTime` datetime(0) NULL DEFAULT NULL COMMENT '最后执行时间',
  `interimExcuteStatus` tinyint(2) NULL DEFAULT 0 COMMENT '临时执行状态，0：未启用，1：立即执行并保留，2：立即执行并删除，默认0',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
  `createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '任务信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of mortals_xhx_task
-- ----------------------------
INSERT INTO `mortals_xhx_task` VALUES (2, '分表创建任务', 'tableIndexService', 0, 'tableIndexService', NULL, NULL, 1, 0, '00:30', NULL, '192.168.1.106', '2021-08-18 00:30:01', 0, '2021-08-12 11:07:23', 1, '系统管理员');

-- ----------------------------
-- Table structure for mortals_xhx_uploadfile
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_uploadfile`;
CREATE TABLE `mortals_xhx_uploadfile`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，主键，自增长',
  `fileName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
  `filePath` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件路径',
  `fileType` tinyint(2) NULL DEFAULT NULL COMMENT '文件类型，1 excel ,2 img,3 zip, 4 pdf',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '上传文件' ROW_FORMAT = Dynamic;

-- ----------------------------
-- 用户信息业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user`;
CREATE TABLE mortals_xhx_user(
    `id` bigint(20)   AUTO_INCREMENT  COMMENT '用户ID，主键，自增长',
    `loginName` varchar(50)     COMMENT '登录名',
    `loginPwd` varchar(128)     COMMENT '登录密码，使用md5双次加密',
    `loginLimitAddress` varchar(200)     COMMENT '登录限制地址，多个IP地址用逗号分隔，可以使用IP段匹配，如：172.17.*非空：则只能该值内的IP可以登录',
    `realName` varchar(64)     COMMENT '用户名',
    `mobile` varchar(21)     COMMENT '用户手机号',
    `phone` varchar(21)     COMMENT '用户联系电话',
    `email` varchar(50)     COMMENT '用户邮箱',
    `qq` varchar(20)     COMMENT 'QQ号码',
    `userType` tinyint(2)     COMMENT '用户类型(0.系统用户,1.后台管理,2.工作人员)',
    `deptId` bigint(20)     COMMENT '用户所属部门id',
    `deptName` varchar(512)     COMMENT '所属部门名称',
    `siteIds` varchar(512)     COMMENT '所属站点id,多个逗号分隔',
    `areaCodes` varchar(512)     COMMENT '所属区域code,多个逗号分隔',
    `status` tinyint(2)     COMMENT '用户状态(0.停用，1.正常，2.冻结，3.销户，4.离职)',
    `createTime` datetime     COMMENT '创建时间',
    `createUserId` bigint(20)     COMMENT '创建用户',
    `createUserName` varchar(50)     COMMENT '创建用户名称',
    `lastLoginTime` datetime     COMMENT '最后一次登录时间',
    `lastLoginAddress` varchar(21)     COMMENT '最后一次登录地址',
PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息业务';


-- ----------------------------
-- Records of mortals_xhx_user
-- ----------------------------
INSERT INTO `mortals_xhx_user`(`id`, `loginName`, `loginPwd`, `loginLimitAddress`, `realName`, `mobile`, `phone`, `email`, `qq`, `userType`, `siteIds`, `areaCodes`, `status`, `createTime`, `createUserId`, `createUserName`, `lastLoginTime`, `lastLoginAddress`) VALUES (1, 'admin', '43442676c74ae59f219c2d87fd6bad52', NULL, '系统管理员', '13808095770', NULL, NULL, NULL, 0, '', '', 1, '2022-06-02 09:12:26', 1, 'admin', '2022-06-02 09:12:26', '127.0.0.1');

-- ----------------------------
-- Table structure for mortals_xhx_valid_code
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_valid_code`;
CREATE TABLE `mortals_xhx_valid_code`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID，主键，自增长',
  `code` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验证码',
  `url` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验地址，email校验使用',
  `mobile` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验手机号',
  `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验邮箱',
  `type` tinyint(2) NULL DEFAULT 0 COMMENT '校验方式，0：图片校验，1：手机校验，2：邮箱校验，默认0',
  `sessionId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '会话ID',
  `ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP地址',
  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `lapseTime` datetime(0) NULL DEFAULT NULL COMMENT '失效时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB  CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '验证码信息' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;


-- 添加模块表(区域信息)
-- ----------------------------
-- Table structure for mortals_xhx_area
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_area`;
CREATE TABLE `mortals_xhx_area` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
  `parentId` bigint(20) DEFAULT NULL COMMENT '上级区域ID',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '区域名称',
  `level` tinyint(4) DEFAULT NULL COMMENT '区域级别，按所处树的节点层次',
  `code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '区域编码，按全国省市编码',
  `contactsPeople` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '区域负责人',
  `contactsMobile` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '区域负责人电话',
  `childSize` int(11) DEFAULT '0' COMMENT '子区域数量，默认0',
  `maxChildId` int(11) DEFAULT '0' COMMENT '子区域的最大ID，默认0',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态，0停用，1启用',
  `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '描述',
  `createTime` datetime DEFAULT NULL COMMENT '创建时间',
  `updateTime` datetime DEFAULT NULL COMMENT '更新时间',
  `createUserId` bigint(20) DEFAULT NULL COMMENT '创建用户ID',
  `createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建用户名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='区域信息';
