/*
 Navicat Premium Data Transfer

 Source Server         : 测试
 Source Server Type    : MariaDB
 Source Server Version : 100318
 Source Host           : test.tall.wiki:3306
 Source Schema         : health

 Target Server Type    : MariaDB
 Target Server Version : 100318
 File Encoding         : 65001

 Date: 13/05/2021 15:11:25
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_constant
-- ----------------------------
DROP TABLE IF EXISTS `t_constant`;
CREATE TABLE `t_constant`  (
  `id` bigint(20) NOT NULL,
  `t_key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
  `t_value` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '常量表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_department
-- ----------------------------
DROP TABLE IF EXISTS `t_department`;
CREATE TABLE `t_department`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '部门名称（企业微信不返回）',
  `name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '英文名',
  `parentid` bigint(20) NULL DEFAULT 1 COMMENT '部门父id，根部门为1',
  `order` int(11) NULL DEFAULT 0 COMMENT '父部门中的次序值',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_department_employee
-- ----------------------------
DROP TABLE IF EXISTS `t_department_employee`;
CREATE TABLE `t_department_employee`  (
  `id` bigint(20) NOT NULL,
  `department_id` bigint(20) NULL DEFAULT 0 COMMENT '部门id',
  `employee_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `order` int(20) NULL DEFAULT 0 COMMENT '员工在部门的顺序',
  `sort` int(20) NULL DEFAULT 0 COMMENT '企业微信返回的顺序',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `department_index`(`department_id`) USING BTREE,
  INDEX `employee_index`(`employee_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门成员表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_dinding_user
-- ----------------------------
DROP TABLE IF EXISTS `t_dinding_user`;
CREATE TABLE `t_dinding_user`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT 'tall user_id',
  `corp_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '企业ID',
  `userid` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户id',
  `unionid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '员工在当前开发者企业账号范围内的唯一标识，系统生成，固定值，不会改变',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '员工名字',
  `active` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否激活',
  `order_in_depts` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '在对应的部门中的排序，Map结构的json字符串，key是部门的Id，value是人员在这个部门的排序值',
  `is_admin` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否为企业的管理员1:是 0:否',
  `is_boss` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否为企业的老板1:是 0:否',
  `is_leader_in_depts` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '在对应的部门中是否为主管：Map结构的json字符串，key是部门的Id，value是人员在这个部门中是否为主管，true表示是，false表示不是',
  `is_hide` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否号码隐藏1:是 0:否',
  `department` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '成员所属部门id列表',
  `position` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '职位信息',
  `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像url',
  `hired_date` bigint(20) NULL DEFAULT 0 COMMENT '入职时间',
  `jobnumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '员工工号',
  `isSenior` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否是高管',
  `roles` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户所在角色列表',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `ding_user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '钉钉用户信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_employee
-- ----------------------------
DROP TABLE IF EXISTS `t_employee`;
CREATE TABLE `t_employee`  (
  `id` bigint(20) NOT NULL,
  `corpid` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '授权方企业微信id',
  `userid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '对应管理端的账号',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '姓名',
  `gender` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '性别 0男 1女',
  `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0激活 1禁用 2未激活',
  `address` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '地址',
  `hide_mobile` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否隐藏手机号',
  `avatar` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像',
  `thumb_avatar` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像缩略图url',
  `english_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '英文名',
  `tall_user_id` bigint(20) NULL DEFAULT 0 COMMENT 'tall里的userId',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `tall_user_index`(`tall_user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '成员表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_health_abnormal
-- ----------------------------
DROP TABLE IF EXISTS `t_health_abnormal`;
CREATE TABLE `t_health_abnormal`  (
  `id` bigint(20) NOT NULL,
  `wkno` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '学号/工号',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '姓名',
  `department` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '所在机构',
  `animal_heat` decimal(3, 1) NULL DEFAULT 0.0 COMMENT '体温',
  `reason` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '原因',
  `health_status` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '状态id',
  `start_time` bigint(20) NULL DEFAULT 0 COMMENT '开始时间',
  `end_time` bigint(20) NULL DEFAULT 0 COMMENT '结束时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `health_abn_wkno_index`(`wkno`) USING BTREE,
  INDEX `health_abn_status_index`(`health_status`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '健康异常表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_health_auth
-- ----------------------------
DROP TABLE IF EXISTS `t_health_auth`;
CREATE TABLE `t_health_auth`  (
  `id` bigint(20) NOT NULL DEFAULT 0,
  `access_token` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方（企业）access_token,最长为512字节	 ',
  `expires_in` int(20) NULL DEFAULT 0 COMMENT '	授权方（企业）access_token超时时间	 ',
  `permanent_code` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	企业微信永久授权码,最长为512字节	 ',
  `corpid` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方企业微信id	 ',
  `corp_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方企业名称，即企业简称	 ',
  `corp_type` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方企业类型，认证号：verified, 注册号：unverified	 ',
  `corp_square_logo_url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方企业方形头像	 ',
  `corp_user_max` int(11) NULL DEFAULT 0 COMMENT '	授权方企业用户规模	 ',
  `corp_agent_max` bigint(20) NULL DEFAULT 0 COMMENT '	授权方企业应用数上限	 ',
  `corp_full_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方企业的主体名称(仅认证或验证过的企业有)，即企业全称。	 ',
  `subject_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '	企业类型，1. 企业; 2. 政府以及事业单位; 3. 其他组织, 4.团队号	 ',
  `verified_end_time` bigint(20) NULL DEFAULT 0 COMMENT '	认证到期时间	 ',
  `corp_wxqrcode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权企业在微工作台（原企业号）的二维码，可用于关注微工作台	 ',
  `corp_scale` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	企业规模。当企业未设置该属性时，值为空	 ',
  `corp_industry` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	企业所属行业。当企业未设置该属性时，值为空	 ',
  `corp_sub_industry` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	企业所属子行业。当企业未设置该属性时，值为空	 ',
  `location` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	企业所在地信息, 为空时表示未知	 ',
  `auth_userid` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权管理员的userid，可能为空（内部管理员一定有，不可更改）	 ',
  `auth_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权管理员的name，可能为空（内部管理员一定有，不可更改）	 ',
  `auth_avatar` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权管理员的头像url	 ',
  `dealer_corp_info_corpid` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	代理服务商企业微信id	 ',
  `dealer_corp_info_corp_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	代理服务商企业微信名称	 ',
  `register_code` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	注册码	 ',
  `template_id` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	推广包ID	 ',
  `state` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	仅当获取注册码指定该字段时才返回	 ',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `health_auth_index`(`corpid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_health_auth_agent
-- ----------------------------
DROP TABLE IF EXISTS `t_health_auth_agent`;
CREATE TABLE `t_health_auth_agent`  (
  `id` bigint(20) NOT NULL DEFAULT 0 COMMENT '		 ',
  `auth_id` bigint(20) NULL DEFAULT 0 COMMENT '		 ',
  `agentid` bigint(20) NULL DEFAULT 0 COMMENT '	授权方应用id	 ',
  `name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方应用名字	 ',
  `square_logo_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方应用方形头像	 ',
  `round_logo_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	授权方应用圆形头像	 ',
  `privilege` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	应用对应的权限	 ',
  `allow_party` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	应用可见范围（部门）	 ',
  `allow_tag` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	应用可见范围（标签）	 ',
  `allow_user` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	应用可见范围（成员）	 ',
  `extra_party` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	额外通讯录（部门）	 ',
  `extra_user` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	额外通讯录（成员）	 ',
  `extra_tag` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	额外通讯录（标签）	 ',
  `level` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '	权限等级。1:通讯录基本信息只读2:通讯录全部信息只读3:通讯录全部信息读写4:单个基本信息只读5:通讯录全部信息只写	 ',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `health_auth_agent_index`(`auth_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_health_qrcode
-- ----------------------------
DROP TABLE IF EXISTS `t_health_qrcode`;
CREATE TABLE `t_health_qrcode`  (
  `id` bigint(20) NOT NULL,
  `health_records_id` bigint(20) NULL DEFAULT 0 COMMENT '健康记录id',
  `health_type_id` bigint(20) NULL DEFAULT 0 COMMENT '当前健康状态',
  `qrcode_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '健康码路径',
  `time` bigint(32) NULL DEFAULT 0 COMMENT '二维码生成时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `health_type_index`(`health_type_id`) USING BTREE,
  INDEX `health_records_index`(`health_records_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '健康码' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_health_records
-- ----------------------------
DROP TABLE IF EXISTS `t_health_records`;
CREATE TABLE `t_health_records`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '日期',
  `district` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '当前所在区',
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '当前详细地址',
  `health_type_id` bigint(20) NULL DEFAULT 0 COMMENT '当前健康状态',
  `animal_heat` decimal(3, 1) NULL DEFAULT 0.0 COMMENT '体温',
  `hospital` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '就诊医院',
  `touch_hubei` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '有无湖北武汉接触史 0没有 1有',
  `touch_sick` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '有无接触患者 0无 1有',
  `touch_overseas` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '有无境外人员接触史 0没有 1有',
  `school_location` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否在学校所在地 0否 1是',
  `emergency_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '紧急联系人姓名',
  `emergency_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '紧急联系人电话',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注信息',
  `health_agreement` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否同意疫情防控协议 0否 1是',
  `self_fill` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否本人填写 0否 1是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `health_type_index`(`health_type_id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '每日健康表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_health_remark_file
-- ----------------------------
DROP TABLE IF EXISTS `t_health_remark_file`;
CREATE TABLE `t_health_remark_file`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件名',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件路径',
  `health_records_id` bigint(20) NULL DEFAULT 0 COMMENT '健康记录id',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '上传的时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `health_records_index`(`health_records_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '健康上报的文件信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_health_type
-- ----------------------------
DROP TABLE IF EXISTS `t_health_type`;
CREATE TABLE `t_health_type`  (
  `id` bigint(20) NOT NULL,
  `code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '健康类型code',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '名字',
  `independent` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否单独统计 0否 1是',
  `quarantine` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否需要隔离 0否 1是',
  `scene` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '使用的场景，0小程序 1后台',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '健康状态表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_journey
-- ----------------------------
DROP TABLE IF EXISTS `t_journey`;
CREATE TABLE `t_journey`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `trip_mode` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他',
  `car_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '车次号',
  `start_time` bigint(20) NULL DEFAULT 0 COMMENT '出发时间',
  `end_time` bigint(20) NULL DEFAULT 0 COMMENT '到达时间',
  `journey_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '行程类型 0未填写 1返校行程 2日常外出',
  `together` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '同行人员',
  `health_agreement` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否同意疫情防控协议 0否 1是',
  `self_fill` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否本人填写 0否 1是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '学生行程表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_journey_abnormal
-- ----------------------------
DROP TABLE IF EXISTS `t_journey_abnormal`;
CREATE TABLE `t_journey_abnormal`  (
  `id` bigint(20) NOT NULL,
  `trip_mode` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他',
  `car_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '车次号',
  `start_time` bigint(20) NULL DEFAULT 0 COMMENT '出发时间',
  `end_time` bigint(20) NULL DEFAULT 0 COMMENT '到达时间',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '异常行程表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_member
-- ----------------------------
DROP TABLE IF EXISTS `t_member`;
CREATE TABLE `t_member`  (
  `id` bigint(20) NOT NULL,
  `wkno` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '学号/工号',
  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '姓名',
  `department` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '所在机构',
  `province` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '省',
  `city` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '市',
  `county` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '县区',
  `site` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '所在地点',
  `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '身份类型 0本科 1研究生 2工作人员',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `stu_wkno_index`(`wkno`) USING BTREE,
  INDEX `stu_name_index`(`name`) USING BTREE,
  INDEX `stu_department_index`(`department`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '学生表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_real_name_auth
-- ----------------------------
DROP TABLE IF EXISTS `t_real_name_auth`;
CREATE TABLE `t_real_name_auth`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT 'tall的userid',
  `id_card` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '身份证',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '姓名',
  `post` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '身份 0学生 1老师 2工作人员',
  `no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '学号',
  `phone` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '联系方式',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '实名认证表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_site
-- ----------------------------
DROP TABLE IF EXISTS `t_site`;
CREATE TABLE `t_site`  (
  `id` bigint(20) NOT NULL,
  `site_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '场馆名',
  `site_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '场馆code',
  `longitude` decimal(20, 15) NULL DEFAULT 0.000000000000000 COMMENT '经度',
  `latitude` decimal(20, 15) NULL DEFAULT 0.000000000000000 COMMENT '纬度',
  `parent_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '父级code',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '场所表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_site_clock_in
-- ----------------------------
DROP TABLE IF EXISTS `t_site_clock_in`;
CREATE TABLE `t_site_clock_in`  (
  `id` bigint(20) NOT NULL,
  `site_id` bigint(20) NULL DEFAULT NULL COMMENT '场所ID',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '进入打卡时间',
  `location_longitude` decimal(20, 15) NULL DEFAULT 0.000000000000000 COMMENT '进入打卡定位-经度',
  `location_latitude` decimal(20, 15) NULL DEFAULT 0.000000000000000 COMMENT '进入打卡定位-纬度',
  `out_time` bigint(20) NULL DEFAULT 0 COMMENT '出去打卡时间',
  `out_location_longitude` decimal(20, 15) NULL DEFAULT NULL COMMENT '出去打卡定位-经度',
  `out_location_latitude` decimal(20, 15) NULL DEFAULT NULL COMMENT '出去打卡定位-纬度',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT 'user_id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_index`(`user_id`) USING BTREE,
  INDEX `clock_site_index`(`site_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '打卡记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_site_qrcode
-- ----------------------------
DROP TABLE IF EXISTS `t_site_qrcode`;
CREATE TABLE `t_site_qrcode`  (
  `id` bigint(20) NOT NULL,
  `site_id` bigint(20) NULL DEFAULT 0 COMMENT '场馆id',
  `out_or_in` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '进or出 0进 1出',
  `qrcode_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '二维码路径',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `site_index`(`site_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '场所二维码表' ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
