/*
 Navicat Premium Data Transfer

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 50726
 Source Host           : localhost:3306
 Source Schema         : common

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

 Date: 12/01/2026 11:06:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for appointment_record
-- ----------------------------
DROP TABLE IF EXISTS `appointment_record`;
CREATE TABLE `appointment_record`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '预约记录表',
  `source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据来源',
  `tel` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电话',
  `sex` tinyint(2) NULL DEFAULT NULL COMMENT '性别 0女1男',
  `age` int(11) NULL DEFAULT NULL COMMENT '创建记录时的年龄',
  `birthday` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `fee_type` int(10) NULL DEFAULT NULL COMMENT '收费类型0免费1自费',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容json',
  `type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体检类型 1,健康证2老年人',
  `calendar_id` int(11) NULL DEFAULT NULL COMMENT '关联的机构日历表',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
  `id_card_num` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证件号',
  `person_id` int(10) NULL DEFAULT NULL COMMENT '关联的用户id',
  `openid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date` datetime(0) NULL DEFAULT NULL COMMENT '预约的日期',
  `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约的时间段',
  `doc_type_id` int(10) NULL DEFAULT NULL COMMENT '行业证件id',
  `doc_type_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '行业证件名称',
  `org_id` int(10) NULL DEFAULT NULL COMMENT '预约的机构id',
  `org_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约的机构code',
  `org_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约的机构name',
  `status` int(10) NULL DEFAULT NULL COMMENT '0关闭1已预约2已体检',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  `is_del` int(4) NULL DEFAULT 0 COMMENT '0否1删除',
  `hmac` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '摘要',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '预约记录表,在本平台预约的信息先进入此表，体检完成进入 ”体检记录表“' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for examination_records
-- ----------------------------
DROP TABLE IF EXISTS `examination_records`;
CREATE TABLE `examination_records`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '体检记录表',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体检人姓名',
  `sex` tinyint(4) NULL DEFAULT NULL COMMENT '性别 0女1男',
  `age` int(11) NULL DEFAULT NULL COMMENT '创建记录时的年龄',
  `birthday` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `tel` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电话',
  `id_card_num` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证件号',
  `head_img` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '头像base64',
  `type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '1,健康证2老年人',
  `industry_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '健康证行业类型名称',
  `institution_id` int(11) NULL DEFAULT NULL COMMENT '体检机构ID',
  `tijian_num` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体检机构生成的体检号',
  `tijian_time` datetime(0) NULL DEFAULT NULL COMMENT '体检时间',
  `register_time` datetime(0) NULL DEFAULT NULL COMMENT '登记时间',
  `report_file` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体检报告文件',
  `report_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '报告内容json',
  `fee_type` int(2) NULL DEFAULT NULL COMMENT '收费类型0免费1自费',
  `result_status` tinyint(4) NULL DEFAULT NULL COMMENT '体检结果状态 0不合格1合格',
  `pdfs` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'pdf列表',
  `issue_time` datetime(0) NULL DEFAULT NULL COMMENT '发证时间',
  `expire_time` datetime(0) NULL DEFAULT NULL COMMENT '证件到期时间',
  `is_del` int(4) NULL DEFAULT 0 COMMENT '是否删除 0否1是',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  `hmac` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `is_sanfang` tinyint(4) NULL DEFAULT 0 COMMENT '是否是三方机构0否1是',
  `is_has_file` tinyint(4) NULL DEFAULT 0 COMMENT '是否上传证明文件（三方免费必须传文件）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '体检记录表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
