/*
 Navicat Premium Data Transfer

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

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

 Date: 04/02/2026 22:00:37
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for configs
-- ----------------------------
DROP TABLE IF EXISTS `configs`;
CREATE TABLE `configs`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `label` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数名称',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '值',
  `note` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for group
-- ----------------------------
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `status` int(10) NULL DEFAULT NULL COMMENT '0关闭1正常',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for group_menu
-- ----------------------------
DROP TABLE IF EXISTS `group_menu`;
CREATE TABLE `group_menu`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) NULL DEFAULT NULL,
  `menu_id` int(11) NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 758 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Fixed;

-- ----------------------------
-- Table structure for institutional_calendar
-- ----------------------------
DROP TABLE IF EXISTS `institutional_calendar`;
CREATE TABLE `institutional_calendar`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '体检日历表',
  `institution_id` int(11) NULL DEFAULT NULL COMMENT '机构id',
  `date` datetime(0) NULL DEFAULT NULL COMMENT '日期',
  `week` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '星期',
  `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '时间段',
  `end_time` datetime(0) NULL DEFAULT NULL COMMENT '预约截止时间',
  `count` int(5) NULL DEFAULT NULL COMMENT '可预约数量',
  `status` tinyint(2) NULL DEFAULT NULL COMMENT '0关闭1正常',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 138 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pid` int(11) NULL DEFAULT NULL,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `order` int(10) NULL DEFAULT NULL COMMENT '排序',
  `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `status` tinyint(4) NULL DEFAULT NULL COMMENT '0:关闭1:正常',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 49 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for outside_user
-- ----------------------------
DROP TABLE IF EXISTS `outside_user`;
CREATE TABLE `outside_user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `app_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `status` int(10) NULL DEFAULT NULL COMMENT '0关闭1正常',
  `app_secrect` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密钥',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '对接第三方用户表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_appointment_type
-- ----------------------------
DROP TABLE IF EXISTS `s_appointment_type`;
CREATE TABLE `s_appointment_type`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `jiancheng` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简称',
  `is_del` int(4) NULL DEFAULT NULL COMMENT '是否删除0否1删除',
  `status` int(4) NULL DEFAULT NULL COMMENT '0关闭1正常',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '预约方式' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_appointment_type_ratio
-- ----------------------------
DROP TABLE IF EXISTS `s_appointment_type_ratio`;
CREATE TABLE `s_appointment_type_ratio`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_id` int(10) NULL DEFAULT NULL COMMENT '科室id',
  `appointment_type_id` int(11) NULL DEFAULT NULL COMMENT '预约类型id',
  `ratio` int(10) NULL DEFAULT NULL COMMENT '占比0-100',
  `link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '与其合并的号源类型id',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '预约类型比例设置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_check_item
-- ----------------------------
DROP TABLE IF EXISTS `s_check_item`;
CREATE TABLE `s_check_item`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `item_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检查编号',
  `item_class_id` int(11) NULL DEFAULT NULL COMMENT '检查项目分类id',
  `sheetType` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'His对应的sheetType，对应class表consInfoCode',
  `item_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
  `item_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检查项目名称',
  `reservation_method` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '关联的预约方式id\r\n',
  `limosis` int(11) NULL DEFAULT NULL COMMENT '是否空腹1是0否',
  `check_notice` varchar(8000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检查须知',
  `check_time` int(11) NULL DEFAULT NULL COMMENT '检查时间,单位分钟',
  `services_group` int(255) NULL DEFAULT NULL COMMENT '关联的服务组',
  `use_seats` int(10) NULL DEFAULT 1 COMMENT '占位，预约时占用几个号源',
  `status` int(4) NULL DEFAULT 1 COMMENT '1启用0停用',
  `is_del` int(11) NULL DEFAULT 0 COMMENT '是否删除0否1是',
  `check_begin_time` int(11) NULL DEFAULT 0 COMMENT '检查开始时间，医嘱开具后，预约时间需在设定的等待期之后,单位分钟',
  `hisExecDepts` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'his那边绑定的执行科室，无用，就是记录一下',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 779 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '检查项目' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_check_item_class
-- ----------------------------
DROP TABLE IF EXISTS `s_check_item_class`;
CREATE TABLE `s_check_item_class`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `item_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '检查项目分类名称',
  `pid` int(8) NULL DEFAULT NULL COMMENT '检查项目分类父id,0大分类',
  `is_del` int(255) NULL DEFAULT 0 COMMENT '是否删除0否1是',
  `CTC_Code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '代码',
  `CTC_Desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '描述',
  `CTC_Status` int(2) NULL DEFAULT NULL COMMENT '1启用0停用-1删除',
  `consInfoCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '中医院his项目分类标识',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '检查项目类别表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_check_item_device
-- ----------------------------
DROP TABLE IF EXISTS `s_check_item_device`;
CREATE TABLE `s_check_item_device`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NULL DEFAULT NULL COMMENT '检查项目id',
  `device_id` int(11) NULL DEFAULT NULL COMMENT '设备id',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 26 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '科室-资源-服务组对应表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_department
-- ----------------------------
DROP TABLE IF EXISTS `s_department`;
CREATE TABLE `s_department`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '科室id',
  `department_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '科室名称',
  `department_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '科室编号',
  `department_status` int(11) NULL DEFAULT 0 COMMENT '状态0关闭1是正常',
  `is_del` int(11) NULL DEFAULT 0 COMMENT '是否删除0否1是',
  `department_addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '科室位置',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '科室表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_department_resources
-- ----------------------------
DROP TABLE IF EXISTS `s_department_resources`;
CREATE TABLE `s_department_resources`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '资源id',
  `department_resources_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '资源名称',
  `department_resources_status` int(11) NULL DEFAULT NULL COMMENT '当前状态0不可用1可用',
  `department_id` int(11) NULL DEFAULT NULL COMMENT '所属科室',
  `adduser` int(11) NULL DEFAULT NULL COMMENT '添加人',
  `is_del` int(11) NULL DEFAULT NULL COMMENT '是否删除0否1是',
  `department_resources_addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '资源位置',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '科室资源表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_department_resources_device
-- ----------------------------
DROP TABLE IF EXISTS `s_department_resources_device`;
CREATE TABLE `s_department_resources_device`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_id` int(11) NULL DEFAULT NULL COMMENT '科室id',
  `rsourece_id` int(11) NULL DEFAULT NULL COMMENT '资源id',
  `device_id` int(11) NULL DEFAULT NULL COMMENT '服务组id',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '科室-资源-服务组对应表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_devices
-- ----------------------------
DROP TABLE IF EXISTS `s_devices`;
CREATE TABLE `s_devices`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `device_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备名称',
  `status` int(255) NULL DEFAULT NULL COMMENT '状态0不可用1可用',
  `adduser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_holiday
-- ----------------------------
DROP TABLE IF EXISTS `s_holiday`;
CREATE TABLE `s_holiday`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `year` year NOT NULL,
  `date` date NOT NULL,
  `type` tinyint(4) NOT NULL COMMENT '1:工作日, 2:节假日',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `appointment_holidays_date_index`(`date`) USING BTREE,
  INDEX `appointment_holidays_year_index`(`year`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '节假日表' ROW_FORMAT = Fixed;

-- ----------------------------
-- Table structure for s_huchi
-- ----------------------------
DROP TABLE IF EXISTS `s_huchi`;
CREATE TABLE `s_huchi`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检查项目code',
  `code2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检查项目code',
  `time` int(11) NULL DEFAULT NULL COMMENT '互斥时间 单位小时，0为永久互斥',
  `add_user` int(11) NULL DEFAULT NULL COMMENT '添加入id',
  `is_del` int(4) NULL DEFAULT NULL COMMENT '是否删除0否1是',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '互斥表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_inpatient_ward
-- ----------------------------
DROP TABLE IF EXISTS `s_inpatient_ward`;
CREATE TABLE `s_inpatient_ward`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '病区名称',
  `status` int(10) NULL DEFAULT 1 COMMENT '0关闭1正常',
  `is_del` int(10) 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),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '病区表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_list
-- ----------------------------
DROP TABLE IF EXISTS `s_list`;
CREATE TABLE `s_list`  (
  `id` bigint(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `list_status` int(11) NULL DEFAULT NULL COMMENT '0正在申请\r\n1预约\r\n2登记\r\n3结束\r\n',
  `reg_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '登记号',
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '患者姓名',
  `user_sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者性别',
  `user_age` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者年龄',
  `entrust_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '医嘱代码对应item表code',
  `entrust` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '医嘱',
  `is_pay` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '是否交费 1是 0否',
  `reservation_date` date NULL DEFAULT NULL COMMENT '预约日期',
  `reservation_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '预约时间段id',
  `reg_date` date NULL DEFAULT NULL COMMENT '登记日期',
  `reg_time` time(0) NULL DEFAULT NULL COMMENT '登记时间',
  `reservation_department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '入院科室-代表开医嘱的科室',
  `entrust_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '医嘱日期',
  `entrust_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '医嘱时间',
  `money` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `check_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检查号',
  `user_brithday` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '生日',
  `docotr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请医生,开遗嘱的医生',
  `patient_type` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT ' 住院 -> 0 门诊 -> 1 急诊 -> 2 体检 -> 3',
  `reg_equipment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '登记设备',
  `reservation_sources` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '预约资源',
  `user_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `hospital_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '住院号',
  `implement_department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '执行科室',
  `expedited` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '是否加急',
  `services_group` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '服务组',
  `app_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请单号',
  `reservation_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '预约号',
  `is_del` int(4) NULL DEFAULT 0 COMMENT '是否删除0否1是',
  `precautions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '注意事项',
  `app_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请内容',
  `department_id` int(11) NULL DEFAULT NULL COMMENT '已经预约的科室id',
  `roster_id` int(11) NULL DEFAULT NULL COMMENT '预约计划明细ID',
  `canel_time` datetime(0) NULL DEFAULT NULL COMMENT '预约取消时间',
  `user_weight` int(11) NULL DEFAULT NULL COMMENT '体重',
  `room` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '房间',
  `serial_num` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '流水号',
  `alphabetic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '拼音',
  `operation_technician` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '操作技师',
  `assistant_technician` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '辅助技师',
  `reg_canel_time` datetime(0) NULL DEFAULT NULL COMMENT '登记取消时间',
  `list_type` int(11) NULL DEFAULT NULL COMMENT '0通过his接口插入数据\r\n1手工登记插入数据',
  `reservation_type` int(255) NULL DEFAULT 0 COMMENT '预约类型0自动预约1手动预约',
  `entrust_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'his传过来的本地医嘱id',
  `episodeid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '就诊号',
  `prescription_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者id',
  `canel_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '取消类型为空代表从系统取消',
  `warddesc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '病区',
  `wardcode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '病区编号',
  `bedname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '床号名称',
  `bedno` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '床号',
  `addtime` datetime(0) NULL DEFAULT NULL COMMENT '预约时间',
  `flag_tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '执行标记,是否和his同步过0未同步过,1同步结束',
  `flag_str` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '取消预约原因,检查门诊患者是否缴费程序负责更新',
  `last_status` int(8) NULL DEFAULT NULL,
  `is_nullify` int(4) NULL DEFAULT 0 COMMENT '是否作废 0否1是',
  `entrust_status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '医嘱状态',
  `RISRExamID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检查号',
  `RISRAcceptDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '接收科室代码',
  `RISRPatDiag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '孕周',
  `xuhao` int(8) NULL DEFAULT NULL,
  `xuhaouse` int(8) NULL DEFAULT NULL,
  `doccode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `shenfenzheng` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `baodaoren` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `xuhaopanduan` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `appointment_type_id` int(11) NULL DEFAULT NULL COMMENT '真正占用号源的 预约类型id 对应 appointment_type表，有可能医生渠道，但是使用护士的号源池',
  `qudao_appointment_type_id` int(11) NULL DEFAULT NULL COMMENT '来源渠道',
  `medicalHistory` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '病史摘要',
  `diagnosisName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '临床诊断（诊断名称）',
  `idCardNumber` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '身份证号',
  `check_aply_pdf` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检查申请单pdf地址',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `list_status`(`list_status`) USING BTREE,
  INDEX `reg_num`(`reg_num`) USING BTREE,
  INDEX `user_name`(`user_name`) USING BTREE,
  INDEX `entrust`(`entrust`) USING BTREE,
  INDEX `reservation_date`(`reservation_date`) USING BTREE,
  INDEX `reservation_time`(`reservation_time`) USING BTREE,
  INDEX `entrust_date`(`entrust_date`) USING BTREE,
  INDEX `entrust_time`(`entrust_time`) USING BTREE,
  INDEX `is_del`(`is_del`) USING BTREE,
  INDEX `baodaoren`(`baodaoren`) USING BTREE,
  INDEX `RISRAcceptDeptCode`(`RISRAcceptDeptCode`) USING BTREE,
  INDEX `entrust_id`(`entrust_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_list_log
-- ----------------------------
DROP TABLE IF EXISTS `s_list_log`;
CREATE TABLE `s_list_log`  (
  `id` bigint(11) NOT NULL AUTO_INCREMENT,
  `list_id` bigint(11) NULL DEFAULT NULL COMMENT '主表id',
  `reg_num` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主表登记号',
  `old_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更前状态，文字',
  `new_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更后的状态，文字',
  `create_user` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人',
  `note` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'json数据',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 575 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '医嘱日志表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_list1111
-- ----------------------------
DROP TABLE IF EXISTS `s_list1111`;
CREATE TABLE `s_list1111`  (
  `id` bigint(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `list_status` int(11) NULL DEFAULT NULL COMMENT '0正在申请\r\n1预约\r\n2登记\r\n3结束\r\n',
  `reg_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '登记号',
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '患者姓名',
  `user_sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者性别',
  `user_age` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者年龄',
  `entrust_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '医嘱代码对应item表code',
  `entrust` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '医嘱',
  `is_pay` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '是否交费 1是 0否',
  `reservation_date` date NULL DEFAULT NULL COMMENT '预约日期',
  `reservation_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '预约时间',
  `reg_date` date NULL DEFAULT NULL COMMENT '登记日期',
  `reg_time` time(0) NULL DEFAULT NULL COMMENT '登记时间',
  `reservation_department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '入院科室-代表开医嘱的科室',
  `entrust_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '医嘱日期',
  `entrust_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '医嘱时间',
  `money` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `check_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检查号',
  `user_brithday` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '生日',
  `docotr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请医生,开遗嘱的医生',
  `patient_type` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者类型',
  `reg_equipment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '登记设备',
  `reservation_sources` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '预约资源',
  `user_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `hospital_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '住院号',
  `implement_department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '执行科室',
  `expedited` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '是否加急',
  `services_group` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '服务组',
  `app_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请单号',
  `reservation_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '预约号',
  `is_del` int(4) NULL DEFAULT 0 COMMENT '是否删除0否1是',
  `precautions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '注意事项',
  `app_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请内容',
  `department_id` int(11) NULL DEFAULT NULL COMMENT '已经预约的科室id',
  `roster_id` int(11) NULL DEFAULT NULL COMMENT '预约计划明细ID',
  `canel_time` datetime(0) NULL DEFAULT NULL COMMENT '预约取消时间',
  `user_weight` int(11) NULL DEFAULT NULL COMMENT '体重',
  `room` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '房间',
  `serial_num` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '流水号',
  `alphabetic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '拼音',
  `operation_technician` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '操作技师',
  `assistant_technician` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '辅助技师',
  `reg_canel_time` datetime(0) NULL DEFAULT NULL COMMENT '登记取消时间',
  `list_type` int(11) NULL DEFAULT NULL COMMENT '0通过his接口插入数据\r\n1手工登记插入数据',
  `reservation_type` int(255) NULL DEFAULT 0 COMMENT '预约类型0自动预约1手动预约',
  `entrust_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'his传过来的本地医嘱id,非常重要，全局唯一',
  `episodeid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '就诊号',
  `prescription_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者id',
  `canel_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '取消类型为空代表从系统取消',
  `wardcode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '病区编号',
  `warddesc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '病区',
  `bedno` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '床号',
  `bedname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '床号名称',
  `addtime` datetime(0) NULL DEFAULT NULL COMMENT '预约时间',
  `flag_tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '执行标记,是否和his同步过0未同步过,1同步结束',
  `flag_str` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '取消预约原因,检查门诊患者是否缴费程序负责更新',
  `last_status` int(8) NULL DEFAULT NULL,
  `is_nullify` int(4) NULL DEFAULT 0 COMMENT '是否作废 0否1是',
  `entrust_status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '医嘱状态',
  `RISRExamID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检查号',
  `RISRAcceptDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '接收科室代码',
  `RISRPatDiag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '孕周',
  `xuhao` int(8) NULL DEFAULT NULL,
  `xuhaouse` int(8) NULL DEFAULT NULL,
  `doccode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `shenfenzheng` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `baodaoren` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `xuhaopanduan` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `appointment_type_id` int(11) NULL DEFAULT NULL COMMENT '真正占用号源的 预约类型id 对应 appointment_type表，有可能医生渠道，但是使用护士的号源池',
  `qudao_appointment_type_id` int(11) NULL DEFAULT NULL COMMENT '来源渠道',
  `medicalHistory` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '病史摘要',
  `diagnosisName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '临床诊断（诊断名称）',
  `idCardNumber` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '身份证号',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `entrust_id_only_one`(`entrust_id`) USING BTREE,
  INDEX `list_status`(`list_status`) USING BTREE,
  INDEX `reg_num`(`reg_num`) USING BTREE,
  INDEX `user_name`(`user_name`) USING BTREE,
  INDEX `entrust`(`entrust`) USING BTREE,
  INDEX `reservation_date`(`reservation_date`) USING BTREE,
  INDEX `reservation_time`(`reservation_time`) USING BTREE,
  INDEX `entrust_date`(`entrust_date`) USING BTREE,
  INDEX `entrust_time`(`entrust_time`) USING BTREE,
  INDEX `is_del`(`is_del`) USING BTREE,
  INDEX `baodaoren`(`baodaoren`) USING BTREE,
  INDEX `RISRAcceptDeptCode`(`RISRAcceptDeptCode`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_period
-- ----------------------------
DROP TABLE IF EXISTS `s_period`;
CREATE TABLE `s_period`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '时间段ID',
  `date_type` tinyint(4) NULL DEFAULT 1 COMMENT '1工作日2节假日',
  `period_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '时间段名称',
  `period_begin_time` time(0) NULL DEFAULT NULL COMMENT '开始时间',
  `period_end_time` time(0) NULL DEFAULT NULL COMMENT '结束时间',
  `period_deadline` time(0) NULL DEFAULT NULL COMMENT '截止预约时间，到此时间则不能预约此时段',
  `period_status` int(4) NULL DEFAULT NULL COMMENT '状态0不可用1正常',
  `department_id` int(10) NOT NULL COMMENT '科室id',
  `is_del` int(2) NULL DEFAULT 0 COMMENT '是否删除0否1是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '预约时间段' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_source_roster
-- ----------------------------
DROP TABLE IF EXISTS `s_source_roster`;
CREATE TABLE `s_source_roster`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_type` tinyint(4) NULL DEFAULT 1 COMMENT '1工作日2节假日',
  `weekname` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '星期几',
  `department_id` int(11) NULL DEFAULT NULL COMMENT '科室id',
  `resources_id` int(11) NULL DEFAULT NULL COMMENT '资源id',
  `device_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '设备id',
  `period_id` int(11) NULL DEFAULT NULL COMMENT '预约时间段id',
  `patient_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者类型0住院1门诊2急诊3体检',
  `begin_time` time(0) NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` time(0) NULL DEFAULT NULL COMMENT '结束时间',
  `end_reservation_time` time(0) NULL DEFAULT NULL COMMENT '停止预约时间',
  `time_unit` int(11) NULL DEFAULT 0 COMMENT '可用时间长度单位分钟',
  `status` int(4) NULL DEFAULT 1 COMMENT '是否可用0不可用1可用',
  `adduser` int(11) NULL DEFAULT NULL COMMENT '添加者',
  `is_del` int(11) 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),
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `department`(`department_id`) USING BTREE COMMENT '科室id索引',
  INDEX `resourece`(`resources_id`) USING BTREE COMMENT '资源id索引',
  INDEX `services`(`device_id`) USING BTREE COMMENT '服务组id索引'
) ENGINE = InnoDB AUTO_INCREMENT = 51 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '资源计划预约模板' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_source_roster_count
-- ----------------------------
DROP TABLE IF EXISTS `s_source_roster_count`;
CREATE TABLE `s_source_roster_count`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `roster_id` int(10) NULL DEFAULT NULL COMMENT '计划模板id',
  `appointment_type_id` int(10) NULL DEFAULT NULL COMMENT '预约类型id',
  `count` int(10) NULL DEFAULT NULL COMMENT '渠道可预约数量',
  `max_total` int(10) NULL DEFAULT NULL COMMENT '单日全渠道最大量',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 223 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '预约计划模板对应的各个渠道可预约数量' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_source_roster_detail
-- ----------------------------
DROP TABLE IF EXISTS `s_source_roster_detail`;
CREATE TABLE `s_source_roster_detail`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `roster_id` int(11) NULL DEFAULT NULL COMMENT '对应的模板id',
  `date` date NULL DEFAULT NULL COMMENT '日期',
  `weekname` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '星期几',
  `department_id` int(11) NULL DEFAULT NULL COMMENT '科室id',
  `resources_id` int(11) NULL DEFAULT NULL COMMENT '资源id',
  `device_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '设备id',
  `period_id` int(11) NULL DEFAULT NULL COMMENT '预约时间段id',
  `patient_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '患者类型0住院1门诊2急诊3体检',
  `begin_time` time(0) NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` time(0) NULL DEFAULT NULL COMMENT '结束时间',
  `end_reservation_time` time(0) NULL DEFAULT NULL COMMENT '停止预约时间',
  `time_unit` int(11) NULL DEFAULT 0 COMMENT '可用时间长度单位分钟',
  `status` int(4) NULL DEFAULT NULL COMMENT '是否可用0不可用1可用',
  `adduser` int(11) NULL DEFAULT NULL COMMENT '添加者',
  `is_del` int(11) 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),
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `department`(`department_id`) USING BTREE COMMENT '科室id索引',
  INDEX `resourece`(`resources_id`) USING BTREE COMMENT '资源id索引',
  INDEX `services`(`device_id`) USING BTREE COMMENT '服务组id索引'
) ENGINE = InnoDB AUTO_INCREMENT = 393 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '资源计划预约详情' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_source_roster_detail_count
-- ----------------------------
DROP TABLE IF EXISTS `s_source_roster_detail_count`;
CREATE TABLE `s_source_roster_detail_count`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `roster_detail_id` int(10) NULL DEFAULT NULL COMMENT '计划模板id',
  `appointment_type_id` int(10) NULL DEFAULT NULL COMMENT '预约类型id',
  `count` int(10) NULL DEFAULT NULL COMMENT '渠道可预约数量',
  `used_count` int(10) NULL DEFAULT 0 COMMENT '已经预约的数量',
  `locked_count` int(10) NULL DEFAULT NULL COMMENT '占位数量',
  `max_total` int(10) NULL DEFAULT NULL COMMENT '单日全渠道最大量',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1631 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '预约计划详情对应的各个渠道数量和已经预约数量' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_source_roster_detail_device
-- ----------------------------
DROP TABLE IF EXISTS `s_source_roster_detail_device`;
CREATE TABLE `s_source_roster_detail_device`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `roster_detail_id` int(10) NULL DEFAULT NULL COMMENT '计划模板id',
  `device_id` int(11) NULL DEFAULT NULL COMMENT '设备id',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 393 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '计划明细关联设备表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for s_source_roster_detail_log
-- ----------------------------
DROP TABLE IF EXISTS `s_source_roster_detail_log`;
CREATE TABLE `s_source_roster_detail_log`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `roster_detail_id` int(11) NULL DEFAULT NULL COMMENT '号源id',
  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作类型',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'json串',
  `userid` int(11) NULL DEFAULT NULL COMMENT '操作人',
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '号源日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '系统用户表',
  `cn_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `username` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `pwd` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `cas_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'CAS_code',
  `department_id` int(11) NULL DEFAULT NULL COMMENT '科室id',
  `department_ids` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '如果属于多个科室 对应id,逗号分隔',
  `ward` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '关联病区名称，多个，逗号分隔',
  `img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像',
  `status` int(11) NULL DEFAULT NULL COMMENT '0锁定1正常2已删除',
  `group` int(11) NULL DEFAULT NULL COMMENT '分租',
  `times` int(11) NULL DEFAULT 5 COMMENT '校验密钥剩余次数',
  `lock_to` datetime(0) NULL DEFAULT '1999-01-01 00:00:00' COMMENT '锁定至时间',
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
