/*
SQLyog v10.2 
MySQL - 5.6.29 : Database - wlyy
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`wlyy` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;

USE `wlyy`;

/*Table structure for table `dm_city` */

DROP TABLE IF EXISTS `dm_city`;

CREATE TABLE `dm_city` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `province` varchar(10) DEFAULT NULL COMMENT '省编码',
  `code` varchar(50) DEFAULT NULL COMMENT '城市编码',
  `name` varchar(50) DEFAULT NULL COMMENT '城市名称',
  PRIMARY KEY (`id`),
  KEY `idx_dm_city_province` (`province`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='城市字典表';

/*Data for the table `dm_city` */

insert  into `dm_city`(`id`,`province`,`code`,`name`) values (1,'1','01','湖里区');

/*Table structure for table `dm_device_category` */

DROP TABLE IF EXISTS `dm_device_category`;

CREATE TABLE `dm_device_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '设备类型标识',
  `name` varchar(50) NOT NULL COMMENT '设备类型名称',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备分类表';

/*Data for the table `dm_device_category` */

/*Table structure for table `dm_disease` */

DROP TABLE IF EXISTS `dm_disease`;

CREATE TABLE `dm_disease` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '疾病标识',
  `name` varchar(100) DEFAULT NULL COMMENT '疾病名称',
  `dept` varchar(20) DEFAULT NULL COMMENT '科室标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0删除',
  PRIMARY KEY (`id`),
  KEY `idx_dm_disease_1` (`dept`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='疾病字典表';

/*Data for the table `dm_disease` */

/*Table structure for table `dm_error_code` */

DROP TABLE IF EXISTS `dm_error_code`;

CREATE TABLE `dm_error_code` (
  `code` varchar(50) NOT NULL COMMENT '错误编码',
  `des` varchar(200) NOT NULL COMMENT '错误描述'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='错误代码表';

/*Data for the table `dm_error_code` */

/*Table structure for table `dm_hospital` */

DROP TABLE IF EXISTS `dm_hospital`;

CREATE TABLE `dm_hospital` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '医院标识',
  `province` varchar(50) DEFAULT NULL COMMENT '省份标识',
  `city` varchar(50) DEFAULT NULL COMMENT '城市标识',
  `town` varchar(50) DEFAULT NULL COMMENT '区县标识',
  `name` varchar(100) NOT NULL COMMENT '医院名称',
  `level` int(11) NOT NULL DEFAULT '1' COMMENT '级别，1医院，2社区医院',
  `address` varchar(300) NOT NULL COMMENT '医院详细地址',
  `intro` text COMMENT '医院简介',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_dm_hospital_1` (`province`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='医院字典表';

/*Data for the table `dm_hospital` */

insert  into `dm_hospital`(`id`,`code`,`province`,`city`,`town`,`name`,`level`,`address`,`intro`,`del`) values (1,'HOS2016032600000001','1','1','1','厦门自贸互联网医院',1,'福建省厦门市',NULL,'1');

/*Table structure for table `dm_hospital_dept` */

DROP TABLE IF EXISTS `dm_hospital_dept`;

CREATE TABLE `dm_hospital_dept` (
  `code` varchar(50) NOT NULL COMMENT '科室标识',
  `name` varchar(50) NOT NULL COMMENT '科室名称',
  `del` varchar(1) DEFAULT '1' COMMENT '删除标识，1正常，0删除',
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '非业务主键',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='医院科室字典表';

/*Data for the table `dm_hospital_dept` */

insert  into `dm_hospital_dept`(`code`,`name`,`del`,`id`) values ('1','妇科','1',1),('2','心脑血管','1',2),('3','耳鼻喉外科','1',3);

/*Table structure for table `dm_intervene_item_type` */

DROP TABLE IF EXISTS `dm_intervene_item_type`;

CREATE TABLE `dm_intervene_item_type` (
  `code` varchar(50) NOT NULL COMMENT '血糖记录类型标识',
  `name` varchar(50) NOT NULL COMMENT '血糖记录类型名称',
  `type` int(11) NOT NULL COMMENT '健康指标类型（1血糖，2血压，3体重，4腰围，5运动，6用药）',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1否，0是'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康干预选项类型表';

/*Data for the table `dm_intervene_item_type` */

/*Table structure for table `dm_job` */

DROP TABLE IF EXISTS `dm_job`;

CREATE TABLE `dm_job` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '非业务主键',
  `code` varchar(50) DEFAULT NULL COMMENT '职称标识',
  `name` varchar(20) DEFAULT NULL COMMENT '职称名',
  `del` varchar(1) DEFAULT NULL COMMENT '是否正常 1正常 0异常',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

/*Data for the table `dm_job` */

insert  into `dm_job`(`id`,`code`,`name`,`del`) values (1,'1','主任医师','1'),(2,'2','副主任医师','1');

/*Table structure for table `dm_medicines` */

DROP TABLE IF EXISTS `dm_medicines`;

CREATE TABLE `dm_medicines` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '药品编码',
  `name` varchar(50) NOT NULL COMMENT '药品名称',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_dm_medicines_1` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='药品字典';

/*Data for the table `dm_medicines` */

/*Table structure for table `dm_province` */

DROP TABLE IF EXISTS `dm_province`;

CREATE TABLE `dm_province` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(50) NOT NULL COMMENT '省份编码',
  `name` varchar(50) NOT NULL COMMENT '省份名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='省份表';

/*Data for the table `dm_province` */

insert  into `dm_province`(`id`,`code`,`name`) values (1,'1','厦门市');

/*Table structure for table `dm_relationship` */

DROP TABLE IF EXISTS `dm_relationship`;

CREATE TABLE `dm_relationship` (
  `code` varchar(50) NOT NULL COMMENT '关系标识',
  `name` varchar(50) NOT NULL COMMENT '关系名称',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  KEY `idx_dm_relationship_1` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='家族关系字典表';

/*Data for the table `dm_relationship` */

/*Table structure for table `dm_rsa` */

DROP TABLE IF EXISTS `dm_rsa`;

CREATE TABLE `dm_rsa` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `data` blob,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='RSA加密信息';

/*Data for the table `dm_rsa` */

insert  into `dm_rsa`(`id`,`data`) values (1,'��\0sr\0java.security.KeyPair�:���\0L\0\nprivateKeyt\0\ZLjava/security/PrivateKey;L\0	publicKeyt\0Ljava/security/PublicKey;xpsr\01org.bouncycastle.jce.provider.JCERSAPrivateCrtKeyl���sU.\0L\0crtCoefficientt\0Ljava/math/BigInteger;L\0primeExponentPq\0~\0L\0primeExponentQq\0~\0L\0primePq\0~\0L\0primeQq\0~\0L\0publicExponentq\0~\0xr\0.org.bouncycastle.jce.provider.JCERSAPrivateKeyF�	��A\0L\0attrCarriert\0=Lorg/bouncycastle/jce/provider/PKCS12BagAttributeCarrierImpl;L\0modulusq\0~\0L\0privateExponentq\0~\0xpsr\0java.math.BigInteger����;�\0I\0bitCountI\0	bitLengthI\0firstNonzeroByteNumI\0lowestSetBitI\0signum[\0	magnitudet\0[Bxr\0java.lang.Number������\0\0xp����������������\0\0\0ur\0[B���T�\0\0xp\0\0\0��x��քxش���ݐV��3X�׸�u�L��2�N#��(c�|*�9H�J�V̐���Ò�Ҟ@���iq\'��˦���q�޺��ܟs3�S��ԃ�f�����Fpj7��\0\ZE�ܻ��`zt�Axsr\0java.util.Hashtable�%!J�\0F\0\nloadFactorI\0	thresholdxp?@\0\0\0\0\0w\0\0\0\0\0\0\0xsr\0java.util.Vectorٗ}[�;�\0I\0capacityIncrementI\0elementCount[\0elementDatat\0[Ljava/lang/Object;xp\0\0\0\0\0\0\0\0ur\0[Ljava.lang.Object;��X�s)l\0\0xp\0\0\0\nppppppppppxsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0��%N�Zy]� �,�W��,&?��2D_\' �L%5*~�0ImS#V�g���b0c67Oՙc�[���i|e����@��4aɖ�җ�cJ�gy�z�}��q�\"�ys�O�\ne���OXi@��;,��Axxsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0@��#.ܿw�$���?i��G����r����P��D����+[��2jպV��%˽��A��#�xsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0@������U$�<bCu6A}2��$�+E^i1V���N��p��E#���v�vL�\r%��:Oe�vRK�w�xsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0@H��uW���}1\nÒH	�K���c�O�+Al;���ɓ7e²�	�̤�G+�d�Z{Ǆ���xsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0@���A@x/�v�-��y��X�e��X��:\\�ݒ п�6��}�?����˧\\msO�����X�8�xsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0@�L�ʎ�\06	���x���T�s���jB����+�ħ�2>b�=�w�?�*�jS!0.��~����=��xsq\0~\0	����������������\0\0\0uq\0~\0\r\0\0\0\0xsr\0-org.bouncycastle.jce.provider.JCERSAPublicKey%\"j[�l�\0L\0modulusq\0~\0L\0publicExponentq\0~\0xpq\0~\0q\0~\0\"');

/*Table structure for table `dm_sequence` */

DROP TABLE IF EXISTS `dm_sequence`;

CREATE TABLE `dm_sequence` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `prefix` varchar(10) NOT NULL COMMENT '前缀，如DOC',
  `time` varchar(8) NOT NULL COMMENT '日期，如20160301',
  `seq` int(8) NOT NULL COMMENT '当前序号',
  `len` int(11) NOT NULL COMMENT '序号长度，不足默认补0',
  `flag` int(11) DEFAULT NULL COMMENT '是否要包含前缀，1包含，0不包含',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dm_sequence_1` (`prefix`,`time`)
) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COMMENT='序列生成记录表';

/*Data for the table `dm_sequence` */

insert  into `dm_sequence`(`id`,`prefix`,`time`,`seq`,`len`,`flag`) values (15,'PATIENT','20160322',2,6,0),(45,'FUP','20160323',3,8,1),(46,'MSG','20160323',3,8,1),(47,'PHA','20160324',1,6,1),(49,'PRE','20160326',3,8,1),(53,'PRIN','20160326',2,8,1),(54,'TEMP','20160326',1,8,1),(57,'CONS','20160326',5,6,0),(59,'REF','20160326',2,8,1),(60,'INS','20160326',1,8,1),(61,'INSI','20160326',2,8,1),(62,'FUP','20160326',1,8,1),(63,'PAR','20160328',2,8,1),(64,'CHK','20160328',1,8,1),(66,'IMG','20160328',3,8,1),(67,'POS','20160328',1,8,1),(68,'INS','20160328',1,8,1),(69,'IMG','20160329',55,8,1),(81,'CONS','20160329',36,6,0),(82,'PAR','20160330',11,8,1),(83,'CONS','20160330',23,8,1),(84,'IMG','20160330',18,8,1),(85,'INS','20160330',13,8,1),(89,'ORD','20160330',5,8,1),(91,'CONS','20160331',96,6,0),(92,'PRE','20160331',2,8,1),(93,'PRIN','20160331',4,8,1),(94,'ORD','20160331',4,8,1),(95,'CHK','20160331',13,8,1),(96,'INS','20160331',2,8,1),(97,'IMG','20160331',1,8,1),(98,'CONS','20160401',36,6,0),(99,'PRE','20160401',5,8,1),(100,'PRIN','20160401',10,8,1),(101,'CHK','20160401',12,8,1),(107,'INS','20160401',3,8,1),(108,'IMG','20160401',1,8,1),(109,'PAR','20160401',1,8,1),(115,'CHK','20160402',4,8,1),(116,'PRE','20160402',1,8,1),(117,'PRIN','20160402',2,8,1),(123,'CONS','20160405',9,6,0),(129,'PAR','20160405',5,8,1),(135,'INS','20160406',1,8,1),(136,'CONS','20160406',3,6,0),(139,'ORD','20160406',9,8,1),(140,'IMG','20160406',1,8,1),(141,'PAR','20160406',7,8,1),(142,'CONS','20160407',46,6,0),(143,'INS','20160407',5,8,1),(144,'PAR','20160407',7,8,1),(145,'ORD','20160407',15,8,1),(146,'PRE','20160407',1,8,1),(147,'PRIN','20160407',2,8,1),(148,'IMG','20160407',16,8,1),(149,'CHK','20160408',2,8,1),(150,'PAR','20160408',1,8,1),(151,'CONS','20160408',7,6,0),(152,'IMG','20160408',1,8,1),(153,'CONS','20160411',1,6,0),(154,'PAR','20160411',9,8,1),(155,'CONS','20160412',27,6,0),(156,'ORD','20160408',11,8,1),(157,'PRE','20160412',4,8,1),(158,'PRIN','20160412',8,8,1),(159,'PAR','20160412',1,8,1),(160,'PRE','20160413',1,8,1),(161,'PRIN','20160413',2,8,1);

/*Table structure for table `dm_sports` */

DROP TABLE IF EXISTS `dm_sports`;

CREATE TABLE `dm_sports` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '运动编码',
  `name` varchar(100) DEFAULT NULL COMMENT '运动名称',
  `type` varchar(20) DEFAULT NULL COMMENT '运动强度类型标识',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_dm_sports_1` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运动类型字典表';

/*Data for the table `dm_sports` */

/*Table structure for table `dm_sports_type` */

DROP TABLE IF EXISTS `dm_sports_type`;

CREATE TABLE `dm_sports_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '强度编码',
  `name` varchar(100) DEFAULT NULL COMMENT '强度名称',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_dm_sports_type_1` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运动强度字典表';

/*Data for the table `dm_sports_type` */

/*Table structure for table `dm_town` */

DROP TABLE IF EXISTS `dm_town`;

CREATE TABLE `dm_town` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `province` varchar(50) DEFAULT NULL COMMENT '省编码',
  `city` varchar(50) DEFAULT NULL COMMENT '城市编码',
  `code` varchar(50) DEFAULT NULL COMMENT '区县编码',
  `name` varchar(50) DEFAULT NULL COMMENT '区县名称',
  PRIMARY KEY (`id`),
  KEY `idx_dm_town_1` (`city`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='区县字典表';

/*Data for the table `dm_town` */

insert  into `dm_town`(`id`,`province`,`city`,`code`,`name`) values (1,'1','01','0101','新店镇');

/*Table structure for table `wlyy_advert` */

DROP TABLE IF EXISTS `wlyy_advert`;

CREATE TABLE `wlyy_advert` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `title` varchar(100) DEFAULT NULL COMMENT '广告标题',
  `from` varchar(100) DEFAULT NULL COMMENT '广告来源',
  `photo` varchar(100) DEFAULT NULL COMMENT '广告图片',
  `url` varchar(100) DEFAULT NULL COMMENT '广告链接地址',
  `seq` int(11) DEFAULT NULL COMMENT '广告显示顺序',
  `type` int(11) DEFAULT NULL COMMENT '广告类型（如主页广告）',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '发布时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  `czy` varchar(20) NOT NULL COMMENT '操作员，关联wlyy_user表',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统广告表';

/*Data for the table `wlyy_advert` */

/*Table structure for table `wlyy_chat_log` */

DROP TABLE IF EXISTS `wlyy_chat_log`;

CREATE TABLE `wlyy_chat_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `msgid` varchar(50) DEFAULT NULL COMMENT '消息ID',
  `sender` varchar(50) DEFAULT NULL COMMENT '发送人',
  `receiver` varchar(50) DEFAULT NULL COMMENT '接收人',
  `msg_type` int(11) DEFAULT NULL COMMENT '消息类型（1文本，2图片、3语音）',
  `chat_type` int(11) DEFAULT NULL COMMENT '聊天类型（1单聊，2群聊）',
  `content` text COMMENT '消息内容',
  `state` int(11) DEFAULT NULL COMMENT '消息状态（1已发送，2已接收，3已读）',
  `platform` int(11) DEFAULT NULL COMMENT '消息平台，1微信，2医生APP',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '发送时间',
  `del` varchar(1) DEFAULT NULL COMMENT '是否已作废（1正常，0已作废）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='聊天记录表';

/*Data for the table `wlyy_chat_log` */

/*Table structure for table `wlyy_complaint_doctor` */

DROP TABLE IF EXISTS `wlyy_complaint_doctor`;

CREATE TABLE `wlyy_complaint_doctor` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '投诉标识',
  `user` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `content` varchar(3000) DEFAULT NULL COMMENT '投诉内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '投诉时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投诉医生表';

/*Data for the table `wlyy_complaint_doctor` */

/*Table structure for table `wlyy_consult` */

DROP TABLE IF EXISTS `wlyy_consult`;

CREATE TABLE `wlyy_consult` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '咨询标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识、三师团队标识',
  `type` int(11) DEFAULT NULL COMMENT '0公共咨询，1指定医生，2三师咨询',
  `user` varchar(50) DEFAULT NULL COMMENT '提问人标识',
  `target` int(11) DEFAULT NULL COMMENT '咨询对象：0自己，1家人，2其他人',
  `family` varchar(50) DEFAULT NULL COMMENT '家人标识',
  `title` varchar(100) DEFAULT NULL COMMENT '标题（用于列表展示）',
  `name` varchar(50) DEFAULT NULL COMMENT '患者：姓名',
  `age` int(11) DEFAULT NULL COMMENT '患者：年龄',
  `sex` int(11) DEFAULT NULL COMMENT '患者：性别',
  `province` varchar(50) DEFAULT NULL COMMENT '患者：省',
  `city` varchar(50) DEFAULT NULL COMMENT '患者：市',
  `catgory` varchar(50) DEFAULT NULL COMMENT '咨询分类',
  `fbrq` varchar(30) DEFAULT NULL COMMENT '发病日期',
  `symptoms` varchar(500) DEFAULT NULL COMMENT '主要症状',
  `visits_doctor` varchar(500) DEFAULT NULL COMMENT '就诊经历',
  `would_help` varchar(500) DEFAULT NULL COMMENT '想要帮助',
  `status` int(11) DEFAULT NULL COMMENT '咨询状态（0进行中，1已完成，-1患者取消）',
  `comment` varchar(50) DEFAULT NULL COMMENT '用户评价标识',
  `doctor_read` int(11) DEFAULT NULL COMMENT '医生未读数量',
  `patient_read` int(11) DEFAULT NULL COMMENT '患者未读数量',
  `del` varchar(1) DEFAULT NULL COMMENT '作废标识，1正常，0作废',
  `czrq` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '咨询时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_consult_1` (`doctor`),
  KEY `idx_wlyy_consult_2` (`user`)
) ENGINE=InnoDB AUTO_INCREMENT=231 DEFAULT CHARSET=utf8mb4 COMMENT='咨询表';

/*Data for the table `wlyy_consult` */

insert  into `wlyy_consult`(`id`,`code`,`doctor`,`type`,`user`,`target`,`family`,`title`,`name`,`age`,`sex`,`province`,`city`,`catgory`,`fbrq`,`symptoms`,`visits_doctor`,`would_help`,`status`,`comment`,`doctor_read`,`patient_read`,`del`,`czrq`) values (152,'20160401000026','20160322000001',1,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'最近24小时','凌晨胃痛，起身略好。饭后痛，无食欲，心情不好，焦虑，煩，失眠。便秘。请问医生要怎么办？\n','凌晨胃痛，起身略好。饭后痛，无食欲，心情不好，焦虑，煩，失眠。便秘。请问医生要怎么办？\n','凌晨胃痛，起身略好。饭后痛，无食欲，心情不好，焦虑，煩，失眠。便秘。请问医生要怎么办？\n',-1,'0',NULL,NULL,'1','2016-04-08 12:58:45'),(195,'20160407000033','20160322000001',1,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'最近24小时','头晕目眩，失眠无法入睡','无','医生，要吃什么药？',0,'0',NULL,NULL,'1','2016-04-07 21:53:44'),(196,'20160407000034','20160322000001',1,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'最近一周','咳嗽，流鼻涕，口干','4天前在社区诊所看过一次，但是症状没有减轻','该吃点什么药',0,'0',NULL,NULL,'1','2016-04-07 22:03:52'),(204,'20160407000046','20160322000001',1,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'最近24小时','血压用控制药物吗 我还年轻30岁 当地医院医生说先治疗高血脂 吃中药效果不理想 想吃西药不知道吃什么药 希望推荐西药吃 有说吃阿司匹林+菲诺贝特 可以吗','有','血压用控制药物吗？希望推荐西药吃 有说吃阿司匹林+菲诺贝特 可以吗',2,'0',NULL,NULL,'1','2016-04-08 12:57:30'),(207,'20160408000003','20160322000001',1,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'最近三个月','背部肌肉疼痛，弯腰和转身都觉得刺疼','还未去就诊','想知道这是什么问题，需要做什么样的治疗',0,'0',NULL,NULL,'1','2016-04-08 12:08:21'),(210,'20160408000007','1',0,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'最近24小时','肌肉酸疼，犯困，没精神','还未就诊过','需要做什么样的治疗',0,'0',NULL,NULL,'1','2016-04-08 13:11:17'),(229,'20160412000026','1',0,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'','头晕目眩，有时心还发慌','无','开开药吃，',0,'0',NULL,NULL,'1','2016-04-12 14:24:58'),(230,'20160412000027','20160322000001',1,'20160322000001',NULL,NULL,NULL,'李碧玉',23,1,NULL,NULL,NULL,'','','','',0,'0',NULL,NULL,'1','2016-04-12 15:30:40');

/*Table structure for table `wlyy_consult_doctor` */

DROP TABLE IF EXISTS `wlyy_consult_doctor`;

CREATE TABLE `wlyy_consult_doctor` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `consult` varchar(50) DEFAULT NULL COMMENT '三师咨询标识',
  `from` varchar(50) DEFAULT NULL COMMENT '转接医生标识',
  `to` varchar(50) DEFAULT NULL COMMENT '接收医生标识',
  `reply` int(11) DEFAULT NULL COMMENT '是否有回复过',
  `czrq` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '转接时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='三师咨询转接给的医生记录';

/*Data for the table `wlyy_consult_doctor` */

insert  into `wlyy_consult_doctor`(`id`,`consult`,`from`,`to`,`reply`,`czrq`,`del`) values (1,'1','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(2,'20160331000002','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(3,'20160331000096','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(4,'20160401000001','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(5,'20160401000023','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(6,'20160401000026','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(7,'20160401000033','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(8,'20160401000035','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(9,'20160407000034','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(10,'20160407000046','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(11,'20160407000033','20160322000001','',NULL,'2016-04-29 09:34:02','1'),(12,'20160408000007','1','',NULL,'2016-04-29 09:34:02','1'),(14,'20160408000007','1','',NULL,'2016-04-29 09:34:02','1'),(15,'20160408000007','1','',NULL,'2016-04-29 09:34:02','1');

/*Table structure for table `wlyy_consult_log` */

DROP TABLE IF EXISTS `wlyy_consult_log`;

CREATE TABLE `wlyy_consult_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `consult` varchar(50) DEFAULT NULL COMMENT '咨询标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '回复医生标识',
  `doctor_name` varchar(50) DEFAULT NULL COMMENT '回复医生姓名',
  `content` varchar(3000) DEFAULT NULL COMMENT '回复内容/追问内容',
  `type` int(11) DEFAULT NULL COMMENT '类型，0问，1回复，2追问，3评价',
  `chat_type` int(11) DEFAULT '1' COMMENT '记录类型：1文字，2图片，3语音',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作时间',
  `del` varchar(1) DEFAULT NULL COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_consult_log_1` (`consult`)
) ENGINE=InnoDB AUTO_INCREMENT=337 DEFAULT CHARSET=utf8mb4 COMMENT='咨询记录表';

/*Data for the table `wlyy_consult_log` */

insert  into `wlyy_consult_log`(`id`,`consult`,`doctor`,`doctor_name`,`content`,`type`,`chat_type`,`czrq`,`del`) values (221,'20160401000017',NULL,NULL,'主要症状：尽可能默默联系我现在我们提供<br>就诊经历：你你你你你你你你你你你你你你你你你<br>想要帮助：look胡救苦救难摸摸摸鸭子',0,1,'2016-04-01 11:23:39','1'),(282,'20160407000023',NULL,NULL,'主要症状：头晕，恶心<br>就诊经历：无<br>想要帮助：需要吃什么药',0,1,'2016-04-07 21:29:39','1'),(286,'20160407000029',NULL,NULL,'主要症状：头晕目眩，但是血压在140/90<br>就诊经历：还没有就诊过<br>想要帮助：医生…这是高血压的症状',0,1,'2016-04-07 21:44:09','1'),(290,'20160407000033',NULL,NULL,'主要症状：头晕目眩，失眠无法入睡<br>就诊经历：无<br>想要帮助：医生，要吃什么药？',0,1,'2016-04-07 21:53:44','1'),(291,'20160407000034',NULL,NULL,'主要症状：咳嗽，流鼻涕，口干<br>就诊经历：4天前在社区诊所看过一次，但是症状没有减轻<br>想要帮助：该吃点什么药',0,1,'2016-04-07 22:03:52','1'),(299,'20160407000041',NULL,NULL,'主要症状：咳嗽，没有精神，浑身酸痛的，时不时又冷又热<br>就诊经历：无<br>想要帮助：医生，我这是感冒了吗需要吃什么药？',0,1,'2016-04-07 22:40:41','1'),(303,'20160407000046',NULL,NULL,'主要症状：血压用控制药物吗 我还年轻30岁 当地医院医生说先治疗高血脂 吃中药效果不理想 想吃西药不知道吃什么药 希望推荐西药吃 有说吃阿司匹林+菲诺贝特 可以吗<br>就诊经历：有<br>想要帮助：血压用控制药物吗？希望推荐西药吃 有说吃阿司匹林+菲诺贝特 可以吗',0,1,'2016-04-07 23:53:23','1'),(304,'20160407000046','20160322000001','徐小鹏','目前用药可以，要先把血压控制好，平时注意点，影响不大。',1,1,'2016-04-07 23:56:59','1'),(305,'20160407000034','20160322000001','徐小鹏','主要考虑上呼吸道感染，可以吃点消炎的，如罗红霉素，同时要多喝水，头痛，流鼻涕可以吃点重感灵。',1,1,'2016-04-08 00:03:05','1'),(306,'20160407000033','20160322000001','徐小鹏','常见于高血压或者颈椎引起的，建议你找到医院做下颈椎CT,明确病因。',1,1,'2016-04-08 00:07:42','1'),(309,'20160408000003',NULL,NULL,'主要症状：背部肌肉疼痛，弯腰和转身都觉得刺疼<br>就诊经历：还未去就诊<br>想要帮助：想知道这是什么问题，需要做什么样的治疗',0,1,'2016-04-08 12:08:21','1'),(311,'20160408000005',NULL,NULL,'主要症状：感冒咳嗽，没有发烧<br>就诊经历：有去诊所看了<br>想要帮助：吃了诊所医生开的药，感觉很困，这药还能吃吗',0,1,'2016-04-08 12:25:49','1'),(312,'20160408000007',NULL,NULL,'主要症状：肌肉酸疼，犯困，没精神<br>就诊经历：还未就诊过<br>想要帮助：需要做什么样的治疗',0,1,'2016-04-08 13:11:17','1'),(313,'20160408000007','20160322000001','徐小鹏','这种症状有可能是病毒性感冒，建议到就近医院进行检查，以进行确诊',1,1,'2016-04-08 13:13:39','1'),(315,'20160408000007','20160322000001','徐小鹏','及时进行检查，有助于康复',1,1,'2016-04-08 13:16:47','1'),(317,'20160411000001',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-11 10:39:15','1'),(318,'20160412000001',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:42:04','1'),(319,'20160412000002',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:44:40','1'),(320,'20160412000003',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:45:10','1'),(321,'20160412000004',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:46:57','1'),(322,'20160412000005',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:47:21','1'),(323,'20160412000006',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:51:58','1'),(324,'20160412000007',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 08:53:01','1'),(325,'20160412000009',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 09:36:32','1'),(326,'20160412000016',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 09:48:47','1'),(327,'20160412000017',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 09:49:01','1'),(328,'20160412000018',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 10:32:57','1'),(329,'20160412000019',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 10:37:25','1'),(330,'20160412000020',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 10:43:08','1'),(331,'20160412000021',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 10:52:31','1'),(332,'20160412000022',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 10:52:40','1'),(333,'20160412000023',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 11:06:14','1'),(334,'20160412000024',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 11:16:30','1'),(335,'20160412000026',NULL,NULL,'主要症状：头晕目眩，有时心还发慌<br>就诊经历：无<br>想要帮助：开开药吃，',0,1,'2016-04-12 14:24:58','1'),(336,'20160412000027',NULL,NULL,'主要症状：<br>想要帮助：',0,1,'2016-04-12 15:30:40','1');

/*Table structure for table `wlyy_consult_movi` */

DROP TABLE IF EXISTS `wlyy_consult_movi`;

CREATE TABLE `wlyy_consult_movi` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '电话视频咨询标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '三师团队/医生标识',
  `target` int(11) DEFAULT NULL COMMENT '预约类型：1指定医生，2三师预约',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `family` varchar(50) DEFAULT NULL COMMENT '家人标识',
  `type` int(11) DEFAULT NULL COMMENT '咨询类型，1电话咨询，2视频咨询',
  `content` varchar(3000) DEFAULT NULL COMMENT '咨询内容说明',
  `appo_date` varchar(20) DEFAULT NULL COMMENT '预约日期',
  `appo_week` varchar(20) DEFAULT NULL COMMENT '预约星期',
  `time_slot` varchar(20) DEFAULT NULL COMMENT '预约时间段',
  `status` int(11) DEFAULT NULL COMMENT '咨询状态：0待医生同意，-1医生拒绝，1医生同意，2咨询完成',
  `czrq` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '咨询时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_consult_movi_1` (`code`),
  KEY `idx_wlyy_consult_movi_2` (`doctor`),
  KEY `idx_wlyy_consult_movi_3` (`patient`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COMMENT='电话、视频咨询表';

/*Data for the table `wlyy_consult_movi` */

insert  into `wlyy_consult_movi`(`id`,`code`,`doctor`,`target`,`patient`,`family`,`type`,`content`,`appo_date`,`appo_week`,`time_slot`,`status`,`czrq`,`del`) values (47,'20160401000015','20160322000001',NULL,'20160322000001',NULL,1,'脖子不舒服，想咨询一下您','05月01日','星期五','09:00-21:00',0,'2016-04-07 10:24:43','1'),(48,'20160401000016','20160322000001',NULL,'20160322000001',NULL,2,'脖子不舒服，想咨询一下您','03月29日','星期二','09:00-09:15',0,'2016-04-07 10:24:37','1'),(51,'20160401000020','20160322000001',NULL,'20160322000001',NULL,2,'最理想的血糖控制目标是多少？','03月29日','星期二','08:30-08:45',2,'2016-04-01 17:43:20','1'),(53,'20160401000022','20160322000001',NULL,'20160322000001',NULL,2,'去年三月高位胃炎治愈，现胃部疼痛。','03月29日','星期二','08:45-09:00',2,'2016-04-01 17:43:22','1'),(55,'20160401000027','20160322000001',NULL,'20160322000001',NULL,1,'凌晨胃痛，起身略好。饭后痛，无食欲，心情不好，焦虑，煩，失眠。便秘。请问医生要怎么办？\n','04月30日','星期四','08:00-20:00',0,'2016-04-01 15:12:53','1'),(56,'20160401000028','20160322000001',NULL,'20160322000001',NULL,1,'高压138～152，低压76～82，用药卡托普利，每日早一片，现在每日10000步运动2年，20000步运动半年，运动心率达到105，感觉良好。只是目前高压调不下来。今日与同学交流，说服用三七粉可以','05月02日','星期五','09:00-21:00',0,'2016-04-07 20:47:19','1'),(64,'20160407000024','20160322000001',NULL,'20160322000001',NULL,1,'最近总感觉头晕眼花的，注意力无法集中','04月30日','星期四','08:00-20:00',0,'2016-04-07 21:30:37','1'),(66,'20160407000035','20160322000001',NULL,'20160322000001',NULL,1,'喉痛疼了好几天了，没见好','04月30日','星期四','08:00-20:00',0,'2016-04-07 22:05:01','1'),(67,'20160407000036','20160322000001',NULL,'20160322000001',NULL,2,'最近脸上长了好多痘痘，该怎么办','03月29日','星期二','08:45-09:00',0,'2016-04-07 22:06:04','1'),(68,'20160407000040','20160322000001',NULL,'20160322000001',NULL,2,'头疼头晕，恶心，有时会突然心慌','03月29日','星期二','08:30-08:45',0,'2016-04-07 22:34:35','1'),(70,'20160408000006','20160322000001',NULL,'20160322000001',NULL,2,'感冒','03月29日','星期二','08:30-08:45',0,'2016-04-08 12:26:40','1'),(71,'20160412000008','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','09:00-09:15',0,'2016-04-12 08:53:46','1'),(72,'20160412000010','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','08:45-09:00',0,'2016-04-12 09:39:50','1'),(73,'20160412000011','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','09:00-09:15',0,'2016-04-12 09:42:09','1'),(74,'20160412000012','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','09:15-09:30',0,'2016-04-12 09:42:24','1'),(75,'20160412000013','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','08:45-09:00',0,'2016-04-12 09:45:09','1'),(76,'20160412000014','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','08:30-08:45',0,'2016-04-12 09:46:51','1'),(77,'20160412000015','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','08:30-08:45',0,'2016-04-12 09:48:28','1'),(78,'20160412000025','20160322000001',NULL,'20160322000001',NULL,2,'','03月29日','星期二','08:45-09:00',0,'2016-04-12 11:17:11','1');

/*Table structure for table `wlyy_doctor` */

DROP TABLE IF EXISTS `wlyy_doctor`;

CREATE TABLE `wlyy_doctor` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '医生标识',
  `name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `sex` int(11) DEFAULT NULL COMMENT '性别（1男，2女）',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `photo` varchar(100) DEFAULT NULL COMMENT '头像http地址',
  `mobile` varchar(20) NOT NULL COMMENT '手机号',
  `password` varchar(50) NOT NULL COMMENT '密码',
  `salt` varchar(50) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT '1' COMMENT '状态（1正常，0禁用）',
  `province` varchar(50) DEFAULT NULL COMMENT '省',
  `city` varchar(50) DEFAULT NULL COMMENT '市',
  `hospital` varchar(50) DEFAULT NULL COMMENT '医院标识',
  `dept` varchar(50) DEFAULT NULL COMMENT '科室标识',
  `job` varchar(50) DEFAULT NULL COMMENT '职称',
  `expertise` varchar(300) DEFAULT NULL COMMENT '医生专长',
  `introduce` varchar(3000) DEFAULT NULL COMMENT '医生介绍',
  `level` int(11) DEFAULT '0' COMMENT '类型：1专科医生，2全科医生，3健康管理师',
  `czrq` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `iscertified` int(11) NOT NULL DEFAULT '0' COMMENT '资格是否认证通过，1是，0否',
  `qrcode` varchar(30) DEFAULT NULL COMMENT '二维码',
  `province_name` varchar(50) DEFAULT NULL COMMENT '省名称',
  `city_name` varchar(50) DEFAULT NULL COMMENT '市名称',
  `hospital_name` varchar(50) DEFAULT NULL COMMENT '医院名称',
  `dept_name` varchar(50) DEFAULT NULL COMMENT '科室名称',
  `job_name` varchar(50) DEFAULT NULL COMMENT '职称名称',
  `town` varchar(50) DEFAULT NULL COMMENT '区县标识',
  `town_name` varchar(50) DEFAULT NULL COMMENT '区县名称',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_doctor_info_uid` (`code`),
  UNIQUE KEY `idx_wlyy_doctor_info_2` (`mobile`,`password`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='医生信息表';

/*Data for the table `wlyy_doctor` */

insert  into `wlyy_doctor`(`id`,`code`,`name`,`sex`,`birthday`,`photo`,`mobile`,`password`,`salt`,`status`,`province`,`city`,`hospital`,`dept`,`job`,`expertise`,`introduce`,`level`,`czrq`,`iscertified`,`qrcode`,`province_name`,`city_name`,`hospital_name`,`dept_name`,`job_name`,`town`,`town_name`) values (1,'D20160322000001','徐小鹏',1,'1955-07-15','','13693066634','123456',NULL,1,'福建省','厦门市','厦门莲前街道社区卫生中心','心血管内科','主任医师','\"在高血压、冠心病、风心、心肌炎等领域具有较深造诣，尤其在高血压和冠心病的介入诊疗技术形成了自己的专业技术特色。 \n\"\r\n','能熟练内科操作，对常见的心脏病的超声特点和诊断较熟悉。近来担任\"诊断学\"及\"内科学\"的教学工作，取得较好成绩。已发表\"上海市部分居民高血压的调查\"、\"老年收缩期高血压患者超声心动图特点\"、\"西拉普利的降压疗效\"、\"24小时动态血压监测评估硝苯啶缓释片降压效果\"等学术论文。',1,'2016-04-28 01:31:50',0,'1','福建省','厦门市','厦门莲前街道社区卫生中心','心血管内科','主任医师',NULL,NULL),(2,'D20160322000002','聂青\r\n',1,'1955-07-15','','18512345678','123456',NULL,1,'福建省','厦门市','厦门中山医院','呼吸内科\r\n','主治医师\r\n','呼吸系统的常见病、多发病如上呼吸道感染、支气管哮喘、慢性阻塞性肺疾病、支气管扩张等能够较为熟练地结合中医辨证与西医辨病两套方法进行诊治\r\n','从事呼吸病临床及实验研究工作十年余，先后参加国家级、省部级多项课题的研究，在科室积极开展的中医特色疗法如穴位注射和敷贴、中药雾化等，疗效显著，对疑难疾病的诊治能坚持自己的观点，和科室同仁一道成功抢救许多肺心病、肺性脑病和呼吸衰竭等危重患者。\r\n',1,'2016-04-28 01:14:17',0,NULL,'福建省','厦门市','厦门中山医院','呼吸内科','主任医师',NULL,NULL),(3,'D20160322000003','江燕\r\n',1,'1955-07-15','','13245678978','123456',NULL,1,'福建省','厦门市','厦门大学附属第一医院\r\n','产科门诊\r\n','主任医师\r\n','多胎妊娠。高危产科。胎儿异常。母胎血型不合。优生咨询及孕期用药咨询。产前筛查、产前诊断、胎儿宫内健康评估、宫内治疗（宫内输血，激光手术，减胎，羊水减量，羊水灌注，胎儿引流，胎儿活检等）。\r\n','英国胎儿医学基金会评审专家及培训专家。中华围产医学会胎儿学组委员，广东省围产医学会产前诊断学组副组长。国内第一位赴英国接受规范化胎儿医学培训的专家。\r\n',1,'2016-04-28 01:14:14',0,NULL,'福建省','厦门市','厦门大学附属第一医院','产科门诊','主任医师',NULL,NULL);

/*Table structure for table `wlyy_doctor_address` */

DROP TABLE IF EXISTS `wlyy_doctor_address`;

CREATE TABLE `wlyy_doctor_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '地址标识',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识，关联wlyy_doctor表',
  `dept` varchar(50) NOT NULL COMMENT '所在科室',
  `province` varchar(50) DEFAULT NULL COMMENT '省标识',
  `city` varchar(50) DEFAULT NULL COMMENT '市标识',
  `town` varchar(50) DEFAULT NULL COMMENT '区县标识',
  `address` varchar(100) NOT NULL COMMENT '地址',
  `state` int(11) DEFAULT NULL COMMENT '当前所在位置，1是，0否',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_address_uid` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生工作地址';

/*Data for the table `wlyy_doctor_address` */

/*Table structure for table `wlyy_doctor_comment` */

DROP TABLE IF EXISTS `wlyy_doctor_comment`;

CREATE TABLE `wlyy_doctor_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '评价标识',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识，关联wlyy_doctor表',
  `team` varchar(50) DEFAULT NULL COMMENT '三师团队标识',
  `user` varchar(50) NOT NULL COMMENT '用户标识，关联wlyy_patient表',
  `uname` varchar(50) NOT NULL COMMENT '评价人姓名',
  `content` varchar(300) NOT NULL COMMENT '评价内容',
  `star` decimal(2,1) DEFAULT NULL COMMENT '星级',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '评价时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_comment_doctor` (`doctor`),
  KEY `wlyy_doctor_comment_user` (`user`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COMMENT='医生评价表';

/*Data for the table `wlyy_doctor_comment` */

insert  into `wlyy_doctor_comment`(`id`,`code`,`doctor`,`team`,`user`,`uname`,`content`,`star`,`czrq`,`del`) values (1,NULL,'123',NULL,'123','cms','好评','0.9','2016-03-26 17:13:43','1'),(2,NULL,'20160322000001',NULL,'20160322000001','张三','23142314234','4.0','2016-03-30 07:37:32','1'),(3,NULL,'20160322000001',NULL,'20160322000001','张三','32142341234','4.0','2016-03-30 07:40:13','1'),(4,NULL,'20160322000001',NULL,'20160322000001','张三','12341234123','3.0','2016-03-30 07:41:20','1'),(5,NULL,'20160322000001',NULL,'20160322000001','张三','','3.0','2016-03-30 13:00:22','1'),(6,NULL,'20160322000001',NULL,'20160322000001','张三','','5.0','2016-03-30 13:27:24','1'),(7,NULL,'20160322000001',NULL,'20160322000001','张三','fdgdfg','3.0','2016-03-31 19:37:50','1'),(8,NULL,'20160322000001',NULL,'20160322000001','张三','','5.0','2016-04-01 11:24:40','1'),(9,NULL,'20160322000001',NULL,'20160322000001','张三','','2.0','2016-04-01 15:13:12','1'),(10,NULL,'20160322000001',NULL,'20160322000001','张三','','4.0','2016-04-01 16:48:03','1'),(11,NULL,'20160322000001',NULL,'20160322000001','张三','','3.0','2016-04-01 19:43:47','1'),(12,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-05 17:24:15','1'),(13,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-05 17:24:54','1'),(14,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-05 17:39:18','1'),(15,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-05 17:41:02','1'),(16,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-05 17:42:03','1'),(17,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-05 17:42:47','1'),(18,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-05 17:43:00','1'),(19,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','3.0','2016-04-05 17:45:35','1'),(20,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-05 20:59:09','1'),(21,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-07 13:45:04','1'),(22,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','3.0','2016-04-07 21:36:02','1'),(23,NULL,'20160322000001',NULL,'20160322000001','李碧玉','非常感谢医生的建议，让我及时治疗，没有出现大问题','5.0','2016-04-08 13:27:51','1'),(24,NULL,'20160322000001',NULL,'20160322000001','李碧玉','非常感谢医生的建议，让我及时治疗，没有出现大问题','5.0','2016-04-08 13:27:52','1'),(25,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-12 14:37:37','1'),(26,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 14:40:18','1'),(27,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 14:41:04','1'),(28,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 15:06:53','1'),(29,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-12 15:44:21','1'),(30,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-12 15:45:54','1'),(31,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 15:56:32','1'),(32,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-12 15:59:21','1'),(33,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 16:02:55','1'),(34,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 16:06:01','1'),(35,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 16:06:53','1'),(36,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','4.0','2016-04-12 16:07:52','1'),(37,NULL,'20160322000001',NULL,'20160322000001','李碧玉','','5.0','2016-04-12 16:08:03','1');

/*Table structure for table `wlyy_doctor_focus` */

DROP TABLE IF EXISTS `wlyy_doctor_focus`;

CREATE TABLE `wlyy_doctor_focus` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `user` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '关注时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_focus_1` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生特别关注患者表';

/*Data for the table `wlyy_doctor_focus` */

/*Table structure for table `wlyy_doctor_followup_template` */

DROP TABLE IF EXISTS `wlyy_doctor_followup_template`;

CREATE TABLE `wlyy_doctor_followup_template` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '模板标识',
  `title` varchar(100) NOT NULL COMMENT '模板标题',
  `type` int(11) DEFAULT '2' COMMENT '系统模板，1系统模板，2医生自定义模板',
  `creater` varchar(50) DEFAULT NULL COMMENT '创建人，非系统模板对应wlyy_doctor表',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_doctor_followup_template_1` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='医生随访模板';

/*Data for the table `wlyy_doctor_followup_template` */

insert  into `wlyy_doctor_followup_template`(`id`,`code`,`title`,`type`,`creater`,`czrq`,`del`) values (1,'1','系统模板',1,NULL,'2016-03-23 09:55:04','1'),(2,'2','自定义模板',2,'20160322000001','2016-03-23 09:55:43','1');

/*Table structure for table `wlyy_doctor_followup_template_questions` */

DROP TABLE IF EXISTS `wlyy_doctor_followup_template_questions`;

CREATE TABLE `wlyy_doctor_followup_template_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '问题标识',
  `template` varchar(50) DEFAULT NULL COMMENT '问题对应的模板标识',
  `question` varchar(300) DEFAULT NULL COMMENT '问题描述',
  `type` int(11) DEFAULT NULL COMMENT '问题类型，1单选，2多选，3填空',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `del` varchar(1) DEFAULT NULL COMMENT '是否作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_followup_template_questions_1` (`template`),
  KEY `idx_wlyy_doctor_followup_template_questions_2` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生随访模板问题表';

/*Data for the table `wlyy_doctor_followup_template_questions` */

/*Table structure for table `wlyy_doctor_followup_template_questions_items` */

DROP TABLE IF EXISTS `wlyy_doctor_followup_template_questions_items`;

CREATE TABLE `wlyy_doctor_followup_template_questions_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '选项标识',
  `name` varchar(200) NOT NULL COMMENT '选项名称',
  `value` varchar(100) DEFAULT NULL COMMENT '选项值',
  `question` varchar(50) NOT NULL COMMENT '对应的问题标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_doctor_followup_template_questions_items_1` (`code`),
  KEY `idx_wlyy_doctor_followup_template_questions_items_2` (`question`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生随访模板问题选项表';

/*Data for the table `wlyy_doctor_followup_template_questions_items` */

/*Table structure for table `wlyy_doctor_friend` */

DROP TABLE IF EXISTS `wlyy_doctor_friend`;

CREATE TABLE `wlyy_doctor_friend` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `doctor1` varchar(50) NOT NULL COMMENT '医生标识，与wlyy_doctor表关联',
  `doctor2` varchar(50) NOT NULL COMMENT '医生标识，与wlyy_doctor表关联',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_friend_1` (`doctor1`),
  KEY `idx_wlyy_doctor_friend_2` (`doctor2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生好友表';

/*Data for the table `wlyy_doctor_friend` */

/*Table structure for table `wlyy_doctor_group` */

DROP TABLE IF EXISTS `wlyy_doctor_group`;

CREATE TABLE `wlyy_doctor_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '业务主键',
  `creater` varchar(50) NOT NULL COMMENT '创建人，与wlyy_doctor表关联',
  `name` varchar(50) NOT NULL COMMENT '群名称',
  `icon` varchar(100) DEFAULT NULL COMMENT '群LOGO',
  `status` int(11) NOT NULL DEFAULT '1' COMMENT '是否作废，1正常，0解散',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_group_1` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生群组/工作组';

/*Data for the table `wlyy_doctor_group` */

/*Table structure for table `wlyy_doctor_group_info` */

DROP TABLE IF EXISTS `wlyy_doctor_group_info`;

CREATE TABLE `wlyy_doctor_group_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `group` varchar(50) NOT NULL COMMENT '群组标识，与wlyy_doctor_group表关联',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识，与wlyy_doctor表关联',
  `admin` int(11) DEFAULT '0' COMMENT '管理员标识，1管理员，0普通组员',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_group_info_team` (`group`),
  KEY `idx_wlyy_doctor_group_info_uid` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生群组详情表';

/*Data for the table `wlyy_doctor_group_info` */

/*Table structure for table `wlyy_doctor_patient` */

DROP TABLE IF EXISTS `wlyy_doctor_patient`;

CREATE TABLE `wlyy_doctor_patient` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '业务主键',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `user` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `group` varchar(50) DEFAULT NULL COMMENT '组编号（wlyy_doctor_patient_group的业务主键code）',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `status` int(11) DEFAULT '1' COMMENT '状态（1正常，0删除）',
  `dqrq` date DEFAULT NULL COMMENT '到期时间',
  `qyrq` date DEFAULT NULL COMMENT '签约日期/已诊日期',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_patient_1` (`doctor`,`user`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='医生与患者关联关系';

/*Data for the table `wlyy_doctor_patient` */

insert  into `wlyy_doctor_patient`(`id`,`code`,`doctor`,`user`,`group`,`czrq`,`status`,`dqrq`,`qyrq`) values (1,'1','D20160322000001','U20160322000001','1','2016-04-27 08:34:33',1,NULL,'2016-04-27'),(2,'2','D20160322000001','U20160322000002','1','2016-04-27 09:48:45',1,NULL,'2016-04-27'),(3,'3','D20160322000001','U20160322000003','2','2016-04-27 09:49:15',1,NULL,'2016-04-27'),(4,'4','D20160322000001','U20160322000004','3','2016-04-28 03:06:24',1,NULL,'2016-04-27');

/*Table structure for table `wlyy_doctor_patient_group` */

DROP TABLE IF EXISTS `wlyy_doctor_patient_group`;

CREATE TABLE `wlyy_doctor_patient_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '业务主键',
  `name` varchar(20) NOT NULL COMMENT '组名',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `status` int(11) DEFAULT '1' COMMENT '状态（1正常，0删除）',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_patient_group_1` (`doctor`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

/*Data for the table `wlyy_doctor_patient_group` */

insert  into `wlyy_doctor_patient_group`(`id`,`code`,`name`,`doctor`,`czrq`,`status`) values (1,'1','三师共管',NULL,'2016-04-27 14:23:44',1),(2,'2','普通签约',NULL,'2016-04-27 14:24:17',1),(3,'3','已诊',NULL,'2016-04-27 14:24:42',1);

/*Table structure for table `wlyy_doctor_scheduling` */

DROP TABLE IF EXISTS `wlyy_doctor_scheduling`;

CREATE TABLE `wlyy_doctor_scheduling` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '排班标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `week` int(11) DEFAULT NULL COMMENT '星期几（1~7）',
  `hour_begin` time DEFAULT NULL COMMENT '排班开始时间',
  `hour_end` time DEFAULT NULL COMMENT '排班结束时间',
  `times` int(11) DEFAULT NULL COMMENT '可预约次数',
  `type` int(11) DEFAULT NULL COMMENT '排班类型：1视频预约',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '排班操作时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_doctor_scheduling_2` (`code`),
  KEY `idx_wlyy_doctor_scheduling_1` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生排班表';

/*Data for the table `wlyy_doctor_scheduling` */

/*Table structure for table `wlyy_doctor_scheduling_times` */

DROP TABLE IF EXISTS `wlyy_doctor_scheduling_times`;

CREATE TABLE `wlyy_doctor_scheduling_times` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `scheduling` varchar(50) DEFAULT NULL COMMENT '排班标识',
  `appo_date` date DEFAULT NULL COMMENT '预约日期：如2016-04-23',
  `times` int(11) DEFAULT NULL COMMENT '预约次数',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_doctor_scheduling_times_1` (`scheduling`,`appo_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生排班预约次数表';

/*Data for the table `wlyy_doctor_scheduling_times` */

/*Table structure for table `wlyy_doctor_statistics` */

DROP TABLE IF EXISTS `wlyy_doctor_statistics`;

CREATE TABLE `wlyy_doctor_statistics` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识，关联wlyy_doctor表',
  `patient` int(11) DEFAULT NULL COMMENT '患者总人数',
  `patient_ss` int(11) DEFAULT NULL COMMENT '三管共管人数',
  `patient_sign` int(11) DEFAULT NULL COMMENT '个人签约人数',
  `diabetes` int(11) DEFAULT NULL COMMENT '糖尿病总人数',
  `hypertension` int(11) DEFAULT NULL COMMENT '高血压总人数',
  `diabetes_hypertension` int(11) DEFAULT NULL COMMENT '糖尿病和高血压都有总人数',
  `followup_times` int(11) DEFAULT NULL COMMENT '随访总次数',
  `followup_members` int(11) DEFAULT NULL COMMENT '随访总人数',
  `followup_success` int(11) DEFAULT NULL COMMENT '随访成功次数',
  `intervene_times` int(11) DEFAULT NULL COMMENT '干预总次数',
  `intervene_members` int(11) DEFAULT NULL COMMENT '干预总人数',
  `consultation_times` int(11) DEFAULT NULL COMMENT '被咨询总次数',
  `consultation_members` int(11) DEFAULT NULL COMMENT '咨询总人次',
  `consultation_reply` int(11) DEFAULT NULL COMMENT '咨询回复次数',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_doctor_statistics_uid` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医生统计表';

/*Data for the table `wlyy_doctor_statistics` */

/*Table structure for table `wlyy_doctor_team` */

DROP TABLE IF EXISTS `wlyy_doctor_team`;

CREATE TABLE `wlyy_doctor_team` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '团队编码，业务主键',
  `name` varchar(50) NOT NULL COMMENT '团队名称',
  `icon` varchar(100) DEFAULT NULL COMMENT '团队LOGO',
  `members` int(11) DEFAULT '0' COMMENT '团队人员数',
  `doctor` varchar(50) NOT NULL COMMENT '创建人，关联wlyy_doctor表',
  `work_team` int(11) NOT NULL DEFAULT '0' COMMENT '是否为工作组，1是，0否',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='三师团队表';

/*Data for the table `wlyy_doctor_team` */

insert  into `wlyy_doctor_team`(`id`,`code`,`name`,`icon`,`members`,`doctor`,`work_team`,`czrq`,`del`) values (2,'2','心血管内科团队',NULL,3,'20160322000001',1,'2016-04-01 16:17:38','1');

/*Table structure for table `wlyy_doctor_team_info` */

DROP TABLE IF EXISTS `wlyy_doctor_team_info`;

CREATE TABLE `wlyy_doctor_team_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `team` varchar(50) NOT NULL COMMENT '团队编码，关联wlyy_doctor_team表',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识，关联wlyy_doctor表',
  `type` int(11) NOT NULL COMMENT '医生类型：1专科医生，2全科医生，3健康管理师，4营养师',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_doctor_team_info_uid` (`doctor`),
  KEY `idx_wlyy_doctor_team_info_team` (`team`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='医生团队详情表';

/*Data for the table `wlyy_doctor_team_info` */

insert  into `wlyy_doctor_team_info`(`id`,`team`,`doctor`,`type`,`czrq`,`del`) values (1,'2','20160322000002',1,'2016-03-25 14:41:38','1'),(2,'2','20160322000003',3,'2016-04-01 16:18:32','1'),(3,'2','20160322000001',2,'2016-04-01 16:18:27','1');

/*Table structure for table `wlyy_followup_chat` */

DROP TABLE IF EXISTS `wlyy_followup_chat`;

CREATE TABLE `wlyy_followup_chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `msgid` varchar(50) NOT NULL COMMENT '消息标识',
  `recode` varchar(50) NOT NULL COMMENT '随访记录标识',
  `sender` varchar(50) NOT NULL COMMENT '发送人',
  `receiver` varchar(50) NOT NULL COMMENT '接收人',
  `chat_type` int(11) NOT NULL COMMENT '消息类型',
  `content` varchar(3000) NOT NULL COMMENT '消息内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '消息时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_followup_chat_1` (`recode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='图文随访记录表';

/*Data for the table `wlyy_followup_chat` */

/*Table structure for table `wlyy_followup_plan` */

DROP TABLE IF EXISTS `wlyy_followup_plan`;

CREATE TABLE `wlyy_followup_plan` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '计划标识',
  `title` varchar(100) NOT NULL COMMENT '随访计划标题',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识',
  `type` int(11) NOT NULL COMMENT '随访类型，1问卷随访，2图文随访，3电话随访，4上门随访',
  `template` varchar(20) DEFAULT NULL COMMENT '问卷模板标识',
  `users` int(11) NOT NULL COMMENT '计划随访人数',
  `plan_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '计划时间',
  `alarm_time` int(11) NOT NULL COMMENT '提前提醒分钟数(分钟)',
  `cycle` int(11) DEFAULT NULL COMMENT '计划周期(如每周)',
  `unit` int(11) DEFAULT NULL COMMENT '计划周期单位（1天，2周，3月）',
  `status` int(11) DEFAULT NULL COMMENT '计划状态(1正常，2执行完成，0关闭)',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_followup_plan_1` (`doctor`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='随访计划表';

/*Data for the table `wlyy_followup_plan` */

insert  into `wlyy_followup_plan`(`id`,`code`,`title`,`doctor`,`type`,`template`,`users`,`plan_time`,`alarm_time`,`cycle`,`unit`,`status`,`czrq`) values (1,'1','我的随访计划','20160322000001',1,NULL,3,'2016-03-23 10:15:23',5,1,1,1,'2016-03-23 10:15:20');

/*Table structure for table `wlyy_followup_plan_user` */

DROP TABLE IF EXISTS `wlyy_followup_plan_user`;

CREATE TABLE `wlyy_followup_plan_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `plan` varchar(50) NOT NULL COMMENT '随访计划标识',
  `user` varchar(50) NOT NULL COMMENT '患者标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_followup_plan_user_1` (`plan`),
  KEY `idx_wlyy_followup_plan_user_2` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='随访计划涉及患者表';

/*Data for the table `wlyy_followup_plan_user` */

/*Table structure for table `wlyy_followup_record` */

DROP TABLE IF EXISTS `wlyy_followup_record`;

CREATE TABLE `wlyy_followup_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '随访记录标识',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `type` int(11) DEFAULT NULL COMMENT '随访类型，1问卷随访，2图文随访，3电话随访，4上门随访',
  `template` varchar(50) DEFAULT NULL COMMENT '问卷随访对应的模板标识，关联wlyy_doctor_followup_template表',
  `result` text COMMENT '电话随访/上门随访的结果',
  `status` int(11) DEFAULT NULL COMMENT '随访状态，0正在进行，1结束',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '随访日期',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_followup_recode_1` (`code`),
  KEY `idx_wlyy_followup_recode_2` (`doctor`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COMMENT='随访记录表';

/*Data for the table `wlyy_followup_record` */

insert  into `wlyy_followup_record`(`id`,`code`,`doctor`,`patient`,`type`,`template`,`result`,`status`,`czrq`,`del`) values (1,'1','20160322000001','20160322000001',1,'',NULL,1,'2016-03-23 09:30:10','1'),(14,'FUP2016032300000001','20160322000001','20160322000001',1,'2',NULL,0,'2016-03-23 11:52:44','1'),(15,'FUP2016032300000002','20160322000001','20160322000001',1,'2',NULL,0,'2016-03-23 11:53:01','1'),(21,'FUP2016032300000003','20160322000001','20160322000001',1,'2',NULL,0,'2016-03-23 12:36:34','1'),(22,'FUP2016032600000001','20160322000001','20160322000001',1,NULL,NULL,1,'2016-03-26 17:03:52','1');

/*Table structure for table `wlyy_followup_result` */

DROP TABLE IF EXISTS `wlyy_followup_result`;

CREATE TABLE `wlyy_followup_result` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `recode` varchar(50) NOT NULL COMMENT '随访记录标识',
  `question` varchar(50) NOT NULL COMMENT '问题标识',
  `item` varchar(50) DEFAULT NULL COMMENT '问题选项标识',
  `content` varchar(500) DEFAULT NULL COMMENT '填写内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_followup_result_1` (`recode`),
  KEY `idx_wlyy_followup_result_2` (`question`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='随访记录问卷答案表';

/*Data for the table `wlyy_followup_result` */

/*Table structure for table `wlyy_friends_log` */

DROP TABLE IF EXISTS `wlyy_friends_log`;

CREATE TABLE `wlyy_friends_log` (
  `n_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `applicant` varchar(50) NOT NULL COMMENT '申请人标识',
  `target` varchar(50) NOT NULL COMMENT '申请对象标识',
  `state` int(11) NOT NULL COMMENT '状态：0待处理，1同意，-1拒绝',
  `platform` int(11) NOT NULL COMMENT '消息平台：1微信端，2医生端',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '申请时间',
  PRIMARY KEY (`n_id`),
  KEY `idx_wlyy_friends_log_1` (`target`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='添加好友记录';

/*Data for the table `wlyy_friends_log` */

/*Table structure for table `wlyy_group_chat_log` */

DROP TABLE IF EXISTS `wlyy_group_chat_log`;

CREATE TABLE `wlyy_group_chat_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `msgid` varchar(50) NOT NULL COMMENT '消息ID',
  `group` varchar(50) NOT NULL COMMENT '群组标识',
  `receiver` varchar(50) NOT NULL COMMENT '接收人',
  `state` int(11) DEFAULT NULL COMMENT '消息状态（1已发送，2已接收，3已读）',
  `platform` int(11) DEFAULT NULL COMMENT '消息平台，1微信，2医生APP',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='群聊天记录状态表';

/*Data for the table `wlyy_group_chat_log` */

/*Table structure for table `wlyy_health_knowledge` */

DROP TABLE IF EXISTS `wlyy_health_knowledge`;

CREATE TABLE `wlyy_health_knowledge` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '文章标识',
  `title` varchar(100) DEFAULT NULL COMMENT '文章标题',
  `from` varchar(100) DEFAULT NULL COMMENT '文章来源',
  `url` varchar(100) DEFAULT NULL COMMENT '文章链接',
  `content` text COMMENT '文章内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '发布时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康知识表';

/*Data for the table `wlyy_health_knowledge` */

/*Table structure for table `wlyy_health_knowledge_read` */

DROP TABLE IF EXISTS `wlyy_health_knowledge_read`;

CREATE TABLE `wlyy_health_knowledge_read` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `knowledge` varchar(50) DEFAULT NULL COMMENT '文章标识',
  `user` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `dt_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '查看时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_health_knowledge_read_1` (`knowledge`),
  KEY `idx_wlyy_health_knowledge_read_2` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康知识查看记录表';

/*Data for the table `wlyy_health_knowledge_read` */

/*Table structure for table `wlyy_images` */

DROP TABLE IF EXISTS `wlyy_images`;

CREATE TABLE `wlyy_images` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '图片标识',
  `table_name` varchar(100) DEFAULT NULL COMMENT '图片资源对应的表名',
  `table_code` varchar(50) DEFAULT NULL COMMENT '图片资源对应表名的code',
  `path` varchar(300) NOT NULL COMMENT '图片咨询绝对路径',
  `url` varchar(300) NOT NULL COMMENT '图片资源http路径',
  `url_small` varchar(300) NOT NULL COMMENT '图片资源对应的缩略图http路径',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_images_1` (`table_name`,`table_code`)
) ENGINE=InnoDB AUTO_INCREMENT=121 DEFAULT CHARSET=utf8mb4 COMMENT='系统图像信息表';

/*Data for the table `wlyy_images` */

/*Table structure for table `wlyy_inspect` */

DROP TABLE IF EXISTS `wlyy_inspect`;

CREATE TABLE `wlyy_inspect` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '检验检查标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='患者检查检验记录表';

/*Data for the table `wlyy_inspect` */

insert  into `wlyy_inspect`(`id`,`code`,`doctor`,`patient`,`czrq`,`del`) values (1,'INS2016032600000001','20160322000001','20160322000001','2016-03-26 16:16:28','1');

/*Table structure for table `wlyy_inspect_info` */

DROP TABLE IF EXISTS `wlyy_inspect_info`;

CREATE TABLE `wlyy_inspect_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '检查项标识',
  `inspect` varchar(50) DEFAULT NULL COMMENT '检查检验标识',
  `kind` varchar(100) DEFAULT NULL COMMENT '类别',
  `name` varchar(100) DEFAULT NULL COMMENT '名称',
  `times` int(11) DEFAULT NULL COMMENT '次数',
  `unit` varchar(100) DEFAULT NULL COMMENT '单位',
  `part` varchar(100) DEFAULT NULL COMMENT '检查部位',
  `specimen` varchar(100) DEFAULT NULL COMMENT '检验标本',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '0' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_swlyy_inspect_info_1` (`inspect`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='患者检查检验细项表';

/*Data for the table `wlyy_inspect_info` */

insert  into `wlyy_inspect_info`(`id`,`code`,`inspect`,`kind`,`name`,`times`,`unit`,`part`,`specimen`,`czrq`,`del`) values (1,'INSI2016032600000001','INS2016032600000001','â1111â','â1111â',1,'â1111â','â1111â','â1111â','2016-03-26 16:16:28','1'),(2,'INSI2016032600000002','INS2016032600000001','â2222â','â2222â',1,'â2222â','â2222â','â2222â','2016-03-26 16:16:28','1');

/*Table structure for table `wlyy_intervene` */

DROP TABLE IF EXISTS `wlyy_intervene`;

CREATE TABLE `wlyy_intervene` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务有关主键',
  `code` varchar(50) NOT NULL COMMENT '干预标识',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识',
  `patient` varchar(50) NOT NULL COMMENT '患者标识',
  `title` varchar(20) NOT NULL COMMENT '干预标题',
  `cycle` int(11) NOT NULL COMMENT '执行周期(1每周，2每半个月，3每个月)',
  `begin_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '干预开始时间',
  `end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '干预结束时间',
  `bg` varchar(300) DEFAULT NULL COMMENT '血糖计划（json数组字符串，对应dm_intervene_item_type表的code，如：["001","002"]）',
  `bg_des` varchar(200) DEFAULT NULL COMMENT '血糖计划说明文字',
  `nibp` varchar(300) DEFAULT NULL COMMENT '血压计划（json数组字符串，对应dm_intervene_item_type表的code，如：["001","002"]）',
  `nibp_des` varchar(200) DEFAULT NULL COMMENT '血压计划文字说明',
  `weight` varchar(300) DEFAULT NULL COMMENT '体重计划（json数组字符串，对应dm_intervene_item_type表的code，如：["001","002"]）',
  `weight_des` varchar(200) DEFAULT NULL COMMENT '体重计划文字说明',
  `waistline` varchar(300) DEFAULT NULL COMMENT '腰围计划（json数组字符串，对应dm_intervene_item_type表的code，如：["001","002"]）',
  `waistline_des` varchar(200) DEFAULT NULL COMMENT '腰围计划文字说明',
  `sport` varchar(300) DEFAULT NULL COMMENT '运动计划（json数组字符串，对应dm_intervene_item_type表的code，如：["001","002"]）',
  `sport_des` varchar(200) DEFAULT NULL COMMENT '运动计划文字说明',
  `medicine` varchar(300) DEFAULT NULL COMMENT '用药计划（json数组字符串，对应dm_intervene_item_type表的code，如：["001","002"]）',
  `medicine_des` varchar(200) DEFAULT NULL COMMENT '用药计划文字说明',
  `diet` varchar(300) DEFAULT NULL COMMENT '饮食建议',
  `suggest` varchar(500) DEFAULT NULL COMMENT '健康指导建议',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建日期',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_intervene_1` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='干预记录表';

/*Data for the table `wlyy_intervene` */

/*Table structure for table `wlyy_medical_edu_article` */

DROP TABLE IF EXISTS `wlyy_medical_edu_article`;

CREATE TABLE `wlyy_medical_edu_article` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '文章标识',
  `category` varchar(50) DEFAULT NULL COMMENT '医学教育分类标识',
  `title` varchar(100) DEFAULT NULL COMMENT '文章标题',
  `logo` varchar(100) DEFAULT NULL COMMENT '文章LOGO',
  `url` varchar(100) DEFAULT NULL COMMENT '文章HTTP地址',
  `content` text COMMENT '文章内容',
  `oper` varchar(50) DEFAULT NULL COMMENT '操作员',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_medical_edu_article_1` (`category`),
  KEY `idx_wlyy_medical_edu_article_2` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医学教育文章信息表';

/*Data for the table `wlyy_medical_edu_article` */

/*Table structure for table `wlyy_medical_edu_article_read` */

DROP TABLE IF EXISTS `wlyy_medical_edu_article_read`;

CREATE TABLE `wlyy_medical_edu_article_read` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `article` varchar(50) DEFAULT NULL COMMENT '文章标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '查看时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_medical_edu_article_read_1` (`article`),
  KEY `idx_wlyy_medical_edu_article_read_2` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Data for the table `wlyy_medical_edu_article_read` */

/*Table structure for table `wlyy_medical_edu_category` */

DROP TABLE IF EXISTS `wlyy_medical_edu_category`;

CREATE TABLE `wlyy_medical_edu_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '分类标识',
  `name` varchar(50) DEFAULT NULL COMMENT '分类名称',
  `default` int(11) DEFAULT '0' COMMENT '是否为推荐类型,1是，0否',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT NULL COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医学教育分类表';

/*Data for the table `wlyy_medical_edu_category` */

/*Table structure for table `wlyy_medical_edu_setting` */

DROP TABLE IF EXISTS `wlyy_medical_edu_setting`;

CREATE TABLE `wlyy_medical_edu_setting` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `med_edu` varchar(50) DEFAULT NULL COMMENT '医学教育分类标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '设置时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_medical_edu_setting_1` (`med_edu`),
  KEY `idx_wlyy_medical_edu_setting_2` (`doctor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='医学教育设置表';

/*Data for the table `wlyy_medical_edu_setting` */

/*Table structure for table `wlyy_message` */

DROP TABLE IF EXISTS `wlyy_message`;

CREATE TABLE `wlyy_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '消息标识',
  `receiver` varchar(50) NOT NULL COMMENT '消息接收人（微信平台为患者标识，医生APP平台为医生标识）',
  `sender` varchar(50) DEFAULT NULL COMMENT '消息发送人标识',
  `data` varchar(100) DEFAULT NULL COMMENT '群组标识\\网络咨询标识\\问卷随访标识',
  `title` varchar(50) NOT NULL COMMENT '消息标题',
  `content` varchar(200) NOT NULL COMMENT '消息内容',
  `type` int(11) DEFAULT NULL COMMENT '消息类型（101患者申请取消签约、102患者同意取消签约、103患者拒绝取消签约、104患者填写了血糖记录、105患者填写了血压记录、106患者填写了体重记录、107患者填写了腰围记录、108患者填写了运动记录、109患者填写了用药记录、110患者填写了饮食记录、111患者提交了问卷随访、112请求添加好友消息、113入群消息、114群解散消息、115踢出群消息、116新的网络咨询、117网络咨询追问、201医生拒绝签约、202医生同意签约、203医生申请取消签约、204医生同意取消签约、205医生拒绝取消签约、206新的问卷随访、207新的健康干预、208请求添加好友消息、209入群消息、210群解散消息、211踢出群消息、212聊天消息提醒、213群聊天消息、214医生回复了网络咨询、215请求添加为家人、216电话随访，217、上门随访）',
  `platform` int(11) DEFAULT NULL COMMENT '消息平台，1微信端/患者端，2医生APP端',
  `state` int(11) DEFAULT '0' COMMENT '消息状态，1已发送，0待发送，-1发送失败',
  `has_read` int(11) DEFAULT '1' COMMENT '查看状态，1未读，0已读',
  `readonly` int(11) DEFAULT NULL COMMENT '只读消息：1否，0是',
  `czrq` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '消息时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_message_uid` (`receiver`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='消息表';

/*Data for the table `wlyy_message` */

insert  into `wlyy_message`(`id`,`code`,`receiver`,`sender`,`data`,`title`,`content`,`type`,`platform`,`state`,`has_read`,`readonly`,`czrq`,`del`) values (1,'MSG2016032300000003','20160322000001','20160322000001','FUP2016032300000003','系统消息','您有新的问卷随访！',206,1,0,1,1,NULL,'1');

/*Table structure for table `wlyy_orders` */

DROP TABLE IF EXISTS `wlyy_orders`;

CREATE TABLE `wlyy_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '订单标识',
  `pay_way` varchar(30) DEFAULT NULL COMMENT '支付方式 1 预交金 2支付宝 3微信 4其他',
  `status` int(2) NOT NULL COMMENT '支付状态 0未支付 1已支付 2已配药 3已复审 4已发货 5已接收 -1订单取消',
  `store` varchar(30) DEFAULT NULL COMMENT '店铺名称',
  `payable` varchar(20) DEFAULT NULL COMMENT '应付款',
  `czrq` timestamp NULL DEFAULT NULL COMMENT '下单时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `prescription` varchar(50) NOT NULL COMMENT '处方',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COMMENT='订单表';

/*Data for the table `wlyy_orders` */

insert  into `wlyy_orders`(`id`,`code`,`pay_way`,`status`,`store`,`payable`,`czrq`,`del`,`patient`,`prescription`) values (1,'20160322000004','1',1,'厦门','24','2016-03-28 20:11:23','1','20160322000001',''),(3,'ORD2016033000000003','1',2,'HOS2016032600000001','36.6','2016-03-30 20:19:35','1','20160322000001','PRE2016032600000001'),(7,'ORD2016033100000002','1',4,'HOS2016032600000001','36.6','2016-03-31 18:06:48','1','20160322000001','PRE2016033100000002'),(8,'ORD2016033100000003','1',4,'HOS2016032600000001','36.6','2016-04-01 00:35:56','1','20160322000001','PRE2016040100000003'),(9,'ORD2016033100000004','1',5,'HOS2016032600000001','36.6','2016-04-01 11:24:29','1','20160322000001','PRE2016040100000004'),(15,'ORD2016040600000006','1',5,'HOS2016032600000001','36.6','2016-04-06 17:05:57','1','20160322000001','PRE2016040100000002'),(19,'ORD2016040700000001','1',3,'HOS2016032600000001','36.6','2016-04-07 17:11:41','1','20160322000001','PRE2016040100000002'),(20,'ORD2016040700000002','1',3,'HOS2016032600000001','36.6','2016-04-07 19:09:31','1','20160322000001','PRE2016040100000003'),(21,'ORD2016040700000003','1',5,'HOS2016032600000001','36.6','2016-04-07 19:09:39','1','20160322000001','PRE2016040100000003'),(24,'ORD2016040700000006','1',5,'HOS2016032600000001','36.6','2016-04-07 19:16:59','1','20160322000001','PRE2016040100000003'),(25,'ORD2016040700000007','1',2,'HOS2016032600000001','36.6','2016-04-07 19:17:33','1','20160322000001','PRE2016040100000002'),(26,'ORD2016040700000008','1',1,'HOS2016032600000001','36.6','2016-04-07 19:33:31','1','20160322000001','PRE2016040100000002'),(31,'ORD2016040700000015','1',0,'HOS2016032600000001','36.6','2016-04-07 22:59:31','1','20160322000001','PRE2016040100000003'),(32,'ORD2016040800000001','1',0,'HOS2016032600000001','36.6','2016-04-12 13:45:57','1','20160322000001','PRE2016040100000003'),(33,'ORD2016040800000002','1',0,'HOS2016032600000001','36.6','2016-04-12 14:07:26','1','20160322000001','PRE2016040100000003'),(34,'ORD2016040800000003','1',0,'HOS2016032600000001','36.6','2016-04-12 14:09:35','1','20160322000001','PRE2016040100000003'),(35,'ORD2016040800000004','1',0,'HOS2016032600000001','36.6','2016-04-12 14:09:37','1','20160322000001','PRE2016040100000003'),(36,'ORD2016040800000005','1',0,'HOS2016032600000001','32.3','2016-04-12 14:11:45','1','20160322000001','PRE2016040100000003'),(37,'ORD2016040800000006','1',0,'HOS2016032600000001','32.3','2016-04-12 14:11:47','1','20160322000001','PRE2016040100000003'),(38,'ORD2016040800000007','1',0,'HOS2016032600000001','32.3','2016-04-12 14:13:20','1','20160322000001','PRE2016040100000003'),(39,'ORD2016040800000008','1',0,'HOS2016032600000001','32.3','2016-04-12 14:17:56','1','20160322000001','PRE2016040100000003'),(40,'ORD2016040800000009','1',1,'HOS2016032600000001','32.3','2016-04-12 14:20:03','1','20160322000001','PRE2016040100000003'),(41,'ORD2016040800000010','1',1,'HOS2016032600000001','32.3','2016-04-12 14:20:31','1','20160322000001','PRE2016040100000003'),(42,'ORD2016040800000011','1',1,'HOS2016032600000001','32.3','2016-04-12 14:22:53','1','20160322000001','PRE2016040100000003');

/*Table structure for table `wlyy_orders_detail` */

DROP TABLE IF EXISTS `wlyy_orders_detail`;

CREATE TABLE `wlyy_orders_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `orders` varchar(50) NOT NULL COMMENT '订单标识',
  `medicines` varchar(50) NOT NULL COMMENT '商品名称',
  `number` int(10) DEFAULT NULL COMMENT '数量',
  `price` varchar(20) DEFAULT NULL COMMENT '单价',
  `czrq` timestamp NULL DEFAULT NULL COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4;

/*Data for the table `wlyy_orders_detail` */

insert  into `wlyy_orders_detail`(`id`,`orders`,`medicines`,`number`,`price`,`czrq`,`del`) values (2,'ORD2016033000000003','[江中]复方草珊瑚含片',3,'12.2','2016-03-30 20:19:35','1'),(6,'ORD2016033100000002','[江中]复方草珊瑚含片',3,'12.2','2016-03-31 18:06:48','1'),(7,'ORD2016033100000003','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-01 00:35:56','1'),(8,'ORD2016033100000004','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-01 11:24:29','1'),(25,'ORD2016040600000001','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-06 14:14:15','1'),(26,'ORD2016040600000002','[江中]复方草珊瑚含片',3,'12.2','2016-04-06 16:22:58','1'),(28,'ORD2016040600000004','[江中]复方草珊瑚含片',3,'12.2','2016-04-06 16:49:34','1'),(29,'ORD2016040600000005','[江中]复方草珊瑚含片',3,'12.2','2016-04-06 16:56:36','1'),(30,'ORD2016040600000006','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-06 16:58:48','1'),(31,'ORD2016040600000006','[江中]复方草珊瑚含片',3,'12.2','2016-04-06 17:05:57','1'),(32,'ORD2016040600000007','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 13:51:44','1'),(33,'ORD2016040600000008','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 16:03:57','1'),(34,'ORD2016040600000009','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 16:04:07','1'),(35,'ORD2016040700000001','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 17:11:41','1'),(36,'ORD2016040700000002','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:09:31','1'),(37,'ORD2016040700000003','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:09:39','1'),(38,'ORD2016040700000004','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:13:34','1'),(39,'ORD2016040700000005','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:16:14','1'),(40,'ORD2016040700000006','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:16:59','1'),(41,'ORD2016040700000007','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:17:33','1'),(42,'ORD2016040700000008','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 19:33:31','1'),(43,'ORD2016040700000009','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 20:12:34','1'),(45,'ORD2016040700000011','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 21:45:14','1'),(46,'ORD2016040700000012','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 21:45:38','1'),(47,'ORD2016040700000013','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 21:45:42','1'),(49,'ORD2016040700000015','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-07 22:59:31','1'),(50,'ORD2016040800000001','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-12 13:45:57','1'),(51,'ORD2016040800000002','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-12 14:07:26','1'),(52,'ORD2016040800000003','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-12 14:09:35','1'),(53,'ORD2016040800000004','[æ±ä¸­]å¤æ¹èççå«ç',3,'12.2','2016-04-12 14:09:37','1'),(54,'ORD2016040800000005','å¡ææ®å©ç',3,'12.2','2016-04-12 14:11:45','1'),(55,'ORD2016040800000006','å¡ææ®å©ç',3,'12.2','2016-04-12 14:11:47','1'),(56,'ORD2016040800000007','å¡ææ®å©ç',3,'12.2','2016-04-12 14:13:20','1'),(57,'ORD2016040800000008','å¡ææ®å©ç',3,'12.2','2016-04-12 14:17:56','1'),(58,'ORD2016040800000009','å¡ææ®å©ç',3,'12.2','2016-04-12 14:20:03','1'),(59,'ORD2016040800000010','å¡ææ®å©ç',3,'12.2','2016-04-12 14:20:31','1'),(60,'ORD2016040800000011','å¡ææ®å©ç',3,'12.2','2016-04-12 14:22:53','1');

/*Table structure for table `wlyy_patient` */

DROP TABLE IF EXISTS `wlyy_patient`;

CREATE TABLE `wlyy_patient` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '业务主键',
  `idcard` varchar(20) NOT NULL COMMENT '身份证号',
  `password` varchar(50) NOT NULL COMMENT '登录密码',
  `salt` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `sex` int(11) DEFAULT NULL COMMENT '性别，1男，2女',
  `mobile` varchar(20) DEFAULT NULL COMMENT '手机号',
  `phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
  `ssc` varchar(50) DEFAULT NULL COMMENT '社保卡号',
  `photo` varchar(100) DEFAULT NULL COMMENT '头像http地址',
  `province` varchar(50) DEFAULT NULL COMMENT '省编码',
  `city` varchar(50) DEFAULT NULL COMMENT '市编码',
  `town` varchar(50) DEFAULT NULL COMMENT '区县编码',
  `street` varchar(10) DEFAULT NULL COMMENT '街道',
  `province_name` varchar(50) DEFAULT NULL COMMENT '省名称',
  `city_name` varchar(50) DEFAULT NULL COMMENT '城市名称',
  `town_name` varchar(50) DEFAULT NULL COMMENT '区县名称',
  `address` varchar(100) DEFAULT NULL COMMENT '详细地址',
  `disease` int(11) DEFAULT '0' COMMENT '疾病类型，0健康，1高血压，2糖尿病，3高血压+糖尿病',
  `disease_condition` int(11) DEFAULT NULL COMMENT '病情：0绿标，1黄标，2红标',
  `points` int(11) DEFAULT NULL COMMENT '总积分',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_patient_1` (`idcard`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='患者信息表';

/*Data for the table `wlyy_patient` */

insert  into `wlyy_patient`(`id`,`code`,`idcard`,`password`,`salt`,`name`,`birthday`,`sex`,`mobile`,`phone`,`ssc`,`photo`,`province`,`city`,`town`,`street`,`province_name`,`city_name`,`town_name`,`address`,`disease`,`disease_condition`,`points`,`czrq`) values (1,'U20160322000001','120000198306117740','123456',NULL,'李碧玉','1982-06-11',2,'15960208571','0592-5982816\r\n','D86125789\r\n','','1','01','0101',NULL,'福建省','厦门市','思明区','禾祥西路185号\r\n',1,0,0,'2016-04-28 03:04:30'),(2,'U20160322000002','350625199010211030','123456',NULL,'张华','1990-10-21',1,'15860758331','0592-5982866','D86124568\r\n','',NULL,NULL,NULL,NULL,'福建省','厦门市','思明区','太古宿舍1号',2,0,0,'2016-04-28 03:04:35'),(3,'U20160322000003','120000197109238661','123456',NULL,'窦怡宁','1971-09-23',2,'15060786011','0592-5982889\r\n','D86123214\r\n','',NULL,NULL,NULL,NULL,'福建省','厦门市','思明区','莲前街道752号',3,0,0,'2016-04-28 03:04:42'),(4,'U20160322000004','123654123655632263','123456',NULL,'赖小娜','1989-10-25',2,'18256233705','0592-5635633','D56325633','',NULL,NULL,NULL,NULL,'福建省','厦门市','湖里区','殿前街道120号',2,1,0,'2016-04-28 11:04:52');

/*Table structure for table `wlyy_patient_communication` */

DROP TABLE IF EXISTS `wlyy_patient_communication`;

CREATE TABLE `wlyy_patient_communication` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '病友互动标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `type` int(11) DEFAULT NULL COMMENT '类型：0未分类，1高血压，2糖尿病',
  `content` varchar(300) DEFAULT NULL COMMENT '提问内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '提问时间',
  `del` varchar(1) DEFAULT NULL COMMENT '作废标识：1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_communication_1` (`patient`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='病友圈';

/*Data for the table `wlyy_patient_communication` */

/*Table structure for table `wlyy_patient_communication_reply` */

DROP TABLE IF EXISTS `wlyy_patient_communication_reply`;

CREATE TABLE `wlyy_patient_communication_reply` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `communication` varchar(50) NOT NULL COMMENT '交流标识',
  `patient` varchar(50) NOT NULL COMMENT '患者标识',
  `at_patient` varchar(50) DEFAULT NULL COMMENT '@患者标识',
  `content` varchar(300) NOT NULL COMMENT '回复内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '回复时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识：1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_communication_reply_1` (`communication`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='病友交流记录表';

/*Data for the table `wlyy_patient_communication_reply` */

/*Table structure for table `wlyy_patient_course` */

DROP TABLE IF EXISTS `wlyy_patient_course`;

CREATE TABLE `wlyy_patient_course` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '历程标识',
  `user` varchar(50) NOT NULL COMMENT '患者标识',
  `title` varchar(100) NOT NULL COMMENT '健康历程标题',
  `content` varchar(500) DEFAULT NULL COMMENT '内容',
  `table` varchar(50) NOT NULL COMMENT '对应的表',
  `tid` varchar(20) NOT NULL COMMENT '对应的表的code字段值',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_course_1` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康历程表';

/*Data for the table `wlyy_patient_course` */

/*Table structure for table `wlyy_patient_device` */

DROP TABLE IF EXISTS `wlyy_patient_device`;

CREATE TABLE `wlyy_patient_device` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关键',
  `code` varchar(50) NOT NULL COMMENT '设备标识',
  `user` varchar(50) NOT NULL COMMENT '患者标识',
  `category` varchar(50) DEFAULT NULL COMMENT '设备类型标识',
  `sn` varchar(50) NOT NULL COMMENT '设备SN码',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_device_1` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者设备表';

/*Data for the table `wlyy_patient_device` */

/*Table structure for table `wlyy_patient_family` */

DROP TABLE IF EXISTS `wlyy_patient_family`;

CREATE TABLE `wlyy_patient_family` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '家人标识',
  `patient` varchar(50) NOT NULL COMMENT '患者标识',
  `relationship` varchar(50) NOT NULL COMMENT '关系标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_family_1` (`patient`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者家人信息表';

/*Data for the table `wlyy_patient_family` */

/*Table structure for table `wlyy_patient_friend` */

DROP TABLE IF EXISTS `wlyy_patient_friend`;

CREATE TABLE `wlyy_patient_friend` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `user1` varchar(50) NOT NULL COMMENT '患者标识，与wlyy_patient表关联',
  `user2` varchar(50) NOT NULL COMMENT '患者标识，与wlyy_patient表关联',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_friend_1` (`user1`),
  KEY `idx_wlyy_patient_friend_2` (`user2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者好友表';

/*Data for the table `wlyy_patient_friend` */

/*Table structure for table `wlyy_patient_gift` */

DROP TABLE IF EXISTS `wlyy_patient_gift`;

CREATE TABLE `wlyy_patient_gift` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `user` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `gift` varchar(50) DEFAULT NULL COMMENT '礼品标识',
  `posints` int(11) DEFAULT NULL COMMENT '消费的积分数',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '兑换时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者兑换的礼品记录表';

/*Data for the table `wlyy_patient_gift` */

/*Table structure for table `wlyy_patient_group` */

DROP TABLE IF EXISTS `wlyy_patient_group`;

CREATE TABLE `wlyy_patient_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '与业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '业务主键',
  `creater` varchar(50) NOT NULL COMMENT '创建人，与wlyy_patient表关联',
  `name` varchar(50) NOT NULL COMMENT '群名称',
  `icon` varchar(100) DEFAULT NULL COMMENT '群LOGO',
  `status` int(11) NOT NULL DEFAULT '1' COMMENT '是否作废，1正常，0解散',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_group_1` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者群组信息';

/*Data for the table `wlyy_patient_group` */

/*Table structure for table `wlyy_patient_group_info` */

DROP TABLE IF EXISTS `wlyy_patient_group_info`;

CREATE TABLE `wlyy_patient_group_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `team` varchar(50) NOT NULL COMMENT '群组标识，与wlyy_patient_group表关联',
  `user` varchar(50) NOT NULL COMMENT '患者标识，与wlyy_patient表关联',
  `admin` int(11) DEFAULT '0' COMMENT '管理员标识，1管理员，0普通组员',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_group_info_team` (`team`),
  KEY `idx_wlyy_patient_group_info_uid` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者群组详情表';

/*Data for the table `wlyy_patient_group_info` */

/*Table structure for table `wlyy_patient_health_index` */

DROP TABLE IF EXISTS `wlyy_patient_health_index`;

CREATE TABLE `wlyy_patient_health_index` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `user` varchar(50) DEFAULT NULL COMMENT '患者标识，与wlyy_patient关联',
  `intervene` varchar(50) DEFAULT NULL COMMENT '干预标识',
  `value1` decimal(6,2) DEFAULT NULL COMMENT '血糖/收缩压/体重/腰围/早餐前空腹',
  `value2` decimal(6,2) DEFAULT NULL COMMENT '舒张压/早餐后空腹',
  `value3` decimal(6,2) DEFAULT NULL COMMENT '午餐空腹',
  `value4` decimal(6,2) DEFAULT NULL COMMENT '午餐后',
  `value5` decimal(6,2) DEFAULT NULL COMMENT '晚餐空腹',
  `value6` decimal(6,2) DEFAULT NULL COMMENT '晚餐后',
  `value7` decimal(6,2) DEFAULT NULL COMMENT '睡前',
  `type` int(1) DEFAULT NULL COMMENT '健康指标类型（1血糖，2血压，3体重，4腰围）',
  `record_date` date DEFAULT NULL COMMENT '记录时间',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_patient_health_index_2` (`user`,`type`,`record_date`),
  KEY `idx_wlyy_patient_health_index_1` (`user`)
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4 COMMENT='患者健康指标表';

/*Data for the table `wlyy_patient_health_index` */

insert  into `wlyy_patient_health_index`(`id`,`user`,`intervene`,`value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`type`,`record_date`,`czrq`,`del`) values (1,'20160322000001',NULL,'96.00','80.00',NULL,NULL,NULL,NULL,NULL,2,'2016-03-28','2016-03-29 11:46:32','1'),(25,'20160322000001','','6.10','3.10','12.30','3.00','1.00','4.30','12.00',1,'2016-03-28','2016-03-30 05:51:46','1'),(34,'20160322000001','','211.00','124.00','0.00','0.00','0.00','0.00','0.00',2,'2016-03-29','2016-03-29 16:12:14','1'),(36,'20160322000001','','66.00','0.00','0.00','0.00','0.00','0.00','0.00',3,'2016-03-29','2016-03-29 16:13:32','1'),(37,'20160322000001','','14.00','0.00','0.00','0.00','0.00','0.00','0.00',4,'2016-03-29','2016-03-29 16:13:53','1'),(39,'20160322000001','','15.00','18.00','0.00','0.00','0.00','0.00','0.00',2,'2016-03-30','2016-03-30 11:06:49','1'),(40,'20160322000001','','69.00','80.00','0.00','0.00','0.00','0.00','0.00',2,'2016-03-27','2016-03-30 11:12:51','1'),(41,'20160322000001','','88.00','90.00','0.00','0.00','0.00','0.00','0.00',2,'2016-03-26','2016-03-30 11:14:32','1'),(42,'20160322000001','','5.00','0.00','0.00','0.00','0.00','0.00','0.00',1,'2016-03-30','2016-03-30 13:57:18','1'),(43,'20160322000001','','0.00','0.00','7.00','0.00','0.00','0.00','0.00',1,'2016-03-29','2016-03-30 13:58:37','1'),(44,'20160322000001','','0.00','0.00','0.00','0.00','6.00','0.00','0.00',1,'2016-03-27','2016-03-30 14:00:30','1'),(45,'20160322000001','','0.00','0.00','8.00','0.00','0.00','0.00','0.00',1,'2016-03-26','2016-03-30 14:03:44','1'),(46,'20160322000001','','90.00','0.00','0.00','0.00','0.00','0.00','0.00',4,'2016-03-30','2016-03-30 14:12:16','1'),(47,'20160322000001','','89.00','0.00','0.00','0.00','0.00','0.00','0.00',4,'2016-03-28','2016-03-30 14:13:18','1'),(48,'20160322000001','','100.00','0.00','0.00','0.00','0.00','0.00','0.00',4,'2016-03-27','2016-03-30 14:14:28','1'),(49,'20160322000001','','60.40','0.00','0.00','0.00','0.00','0.00','0.00',3,'2016-03-30','2016-03-30 14:17:07','1'),(50,'20160322000001','','50.00','0.00','0.00','0.00','0.00','0.00','0.00',4,'2016-04-01','2016-04-07 23:10:50','1'),(52,'20160322000001','','72.00','0.00','0.00','0.00','0.00','0.00','0.00',3,'2016-04-01','2016-04-01 14:48:25','1'),(53,'20160322000001','','120.00','78.00','0.00','0.00','0.00','0.00','0.00',2,'2016-04-01','2016-04-01 14:48:58','1'),(54,'20160322000001','','6.00','5.40','0.00','0.00','0.00','0.00','0.00',1,'2016-04-01','2016-04-01 15:39:37','1'),(55,'20160322000001','','70.00',NULL,NULL,NULL,NULL,NULL,NULL,4,'2016-04-06','2016-04-07 23:11:53','1'),(56,'20160322000001','','71.00',NULL,NULL,NULL,NULL,NULL,NULL,4,'2016-04-07','2016-04-07 23:12:06','1'),(57,'20160322000001','','51.00',NULL,NULL,NULL,NULL,NULL,NULL,3,'2016-04-07','2016-04-07 23:12:41','1'),(58,'20160322000001','','134.00','87.00',NULL,NULL,NULL,NULL,NULL,2,'2016-04-07','2016-04-07 23:13:31','1'),(59,'20160322000001','',NULL,NULL,NULL,NULL,NULL,NULL,'6.70',1,'2016-04-07','2016-04-07 23:14:22','1'),(60,'20160322000001','',NULL,NULL,NULL,NULL,NULL,NULL,'6.10',1,'2016-04-06','2016-04-07 23:15:05','1');

/*Table structure for table `wlyy_patient_health_record` */

DROP TABLE IF EXISTS `wlyy_patient_health_record`;

CREATE TABLE `wlyy_patient_health_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `user` varchar(50) NOT NULL COMMENT '患者标识',
  `intervene` varchar(50) DEFAULT NULL COMMENT '干预标识',
  `type` int(11) NOT NULL COMMENT '记录类型，1运动，2用药，3饮食',
  `value1` varchar(500) DEFAULT NULL COMMENT '运动时长（分）/药品名称/饮食内容',
  `value2` varchar(50) DEFAULT NULL COMMENT '运动强度',
  `value3` varchar(50) DEFAULT NULL COMMENT '运动类型',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_health_record_1` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者健康记录表';

/*Data for the table `wlyy_patient_health_record` */

/*Table structure for table `wlyy_patient_medical_records` */

DROP TABLE IF EXISTS `wlyy_patient_medical_records`;

CREATE TABLE `wlyy_patient_medical_records` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '病历标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `title` varchar(200) DEFAULT NULL COMMENT '病历标题',
  `content` varchar(1000) DEFAULT NULL COMMENT '病历文字说明',
  `hospital` varchar(100) DEFAULT NULL COMMENT '医院名称',
  `dept` varchar(100) DEFAULT NULL COMMENT '科室名称',
  `address` varchar(200) DEFAULT NULL COMMENT '地点',
  `record_date` varchar(20) DEFAULT NULL COMMENT '病历时间',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COMMENT='患者病历记录表';

/*Data for the table `wlyy_patient_medical_records` */

insert  into `wlyy_patient_medical_records`(`id`,`code`,`patient`,`title`,`content`,`hospital`,`dept`,`address`,`record_date`,`czrq`,`del`) values (20,'INS2016040600000001','20160322000001','厦门大学附属第一医院病例','2016年4月10日病例','厦门大学附属第一医院','内科',NULL,NULL,'2016-04-07 10:47:17','1'),(24,'INS2016040700000004','20160322000001','','','厦门大学附属中山医院','骨科','禾祥西路185号',NULL,'2016-04-07 11:46:31','1');

/*Table structure for table `wlyy_patient_orders` */

DROP TABLE IF EXISTS `wlyy_patient_orders`;

CREATE TABLE `wlyy_patient_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '医嘱标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `treatment` varchar(50) DEFAULT NULL COMMENT '就诊标识',
  `content` varchar(500) DEFAULT NULL COMMENT '医嘱内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_orders_1` (`patient`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='医嘱信息表';

/*Data for the table `wlyy_patient_orders` */

insert  into `wlyy_patient_orders`(`id`,`code`,`patient`,`doctor`,`treatment`,`content`,`czrq`,`del`) values (1,'1','20160322000001',NULL,'1','肌肉注射 头孢氨卞 一天一次 每次5mg','2016-04-08 12:50:43','1'),(2,'2','20160322000001',NULL,'2','口服 科素亚 氯沙坦钾片 一天二次 每次 50mg','2016-04-08 12:53:07','1'),(3,'POS2016032800000001','20160322000001','20160322000001','1','口服 头孢呋辛酯片 一天三次 每次2片 饭后服用','2016-04-07 23:57:31','1');

/*Table structure for table `wlyy_patient_remind` */

DROP TABLE IF EXISTS `wlyy_patient_remind`;

CREATE TABLE `wlyy_patient_remind` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '提醒标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `visit_code` varchar(50) DEFAULT NULL COMMENT '就诊记录标识',
  `type` int(11) DEFAULT NULL COMMENT '提醒类型，1用药，2复诊',
  `content` varchar(1000) DEFAULT NULL COMMENT '提醒内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_remind_1` (`patient`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COMMENT='患者提醒表';

/*Data for the table `wlyy_patient_remind` */

insert  into `wlyy_patient_remind`(`id`,`code`,`doctor`,`patient`,`visit_code`,`type`,`content`,`czrq`,`del`) values (17,'PAR2016040500000003','20160322000001','20160322000001',NULL,1,'记得每天饭后才能吃药','2016-04-05 16:59:09','1'),(18,'PAR2016040500000004','20160322000001','20160322000001',NULL,1,'低盐，远离辛辣食物','2016-04-05 16:59:45','1'),(19,'PAR2016040500000005','20160322000001','20160322000001',NULL,1,'每天起床测量血压','2016-04-05 17:00:06','1'),(22,'PAR2016040600000003','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/06到我处进行复诊，请准时过来。','2016-04-08 01:06:46','1'),(24,'PAR2016040600000005','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/03/20到我处进行复诊，请准时过来。','2016-04-08 01:07:12','1'),(25,'PAR2016040600000006','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/03/03到我处进行复诊，请准时过来。','2016-04-08 01:07:04','1'),(33,'PAR2016040700000007','20160322000001','20160322000001',NULL,1,'多吃青菜，多补充水分','2016-04-07 20:37:33','1'),(35,'PAR2016041100000001','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/11到我处进行复诊,请准时过来。','2016-04-11 11:36:39','1'),(36,'PAR2016041100000002','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/11到我处进行复诊,请准时过来。','2016-04-11 11:37:02','1'),(37,'PAR2016041100000003','20160322000001','20160322000001',NULL,1,'降压药每天一次用药','2016-04-11 11:43:12','1'),(38,'PAR2016041100000004','20160322000001','20160322000001',NULL,1,'','2016-04-11 11:43:16','1'),(39,'PAR2016041100000005','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/11到我处进行复诊,请准时过来。','2016-04-11 15:07:24','1'),(40,'PAR2016041100000006','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/11到我处进行复诊,请准时过来。','2016-04-11 15:11:40','1'),(41,'PAR2016041100000007','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/07到我处进行复诊,请准时过来。','2016-04-11 15:17:05','1'),(42,'PAR2016041100000008','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/04/10到我处进行复诊,请准时过来。','2016-04-11 15:17:24','1'),(43,'PAR2016041100000009','20160322000001','20160322000001','7123766',2,'李碧玉小姐您预约了2016/01/11到我处进行复诊,请准时过来。','2016-04-11 15:38:16','1'),(44,'PAR2016041200000001','20160322000001','20160322000001',NULL,1,'','2016-04-12 15:11:52','1');

/*Table structure for table `wlyy_patient_treatment` */

DROP TABLE IF EXISTS `wlyy_patient_treatment`;

CREATE TABLE `wlyy_patient_treatment` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '就诊标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `hospital` varchar(100) DEFAULT NULL COMMENT '医院名称',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '就诊日期',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_patient_treatment_1` (`patient`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='就诊记录表';

/*Data for the table `wlyy_patient_treatment` */

insert  into `wlyy_patient_treatment`(`id`,`code`,`patient`,`hospital`,`czrq`,`del`) values (1,'1','20160322000001','厦门中医院','2016-03-03 09:15:47','1'),(2,'2','20160322000001','厦门中医院','2016-02-10 09:16:07','1'),(3,'3','20160322000001','厦门中医院','2016-01-05 09:16:19','1');

/*Table structure for table `wlyy_pharmacist` */

DROP TABLE IF EXISTS `wlyy_pharmacist`;

CREATE TABLE `wlyy_pharmacist` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '药师标识',
  `mobile` varchar(20) NOT NULL COMMENT '登录手机号',
  `password` varchar(50) NOT NULL COMMENT '登录密码',
  `name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '注册时间',
  `status` int(11) DEFAULT '1' COMMENT '用户状态，1正常，0禁用',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_pharmacist_1` (`code`),
  UNIQUE KEY `idx_wlyy_pharmacist_2` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='药师信息表';

/*Data for the table `wlyy_pharmacist` */

insert  into `wlyy_pharmacist`(`id`,`code`,`mobile`,`password`,`name`,`czrq`,`status`) values (1,'PHA20160324000001','13693066634','123456','è¯å¸1','2016-03-24 09:31:17',0);

/*Table structure for table `wlyy_pharmacist_checked` */

DROP TABLE IF EXISTS `wlyy_pharmacist_checked`;

CREATE TABLE `wlyy_pharmacist_checked` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '审核标识',
  `pharmacist` varchar(50) DEFAULT NULL COMMENT '药师标识',
  `prescription` varchar(50) DEFAULT NULL COMMENT '处方标识',
  `status` int(11) DEFAULT NULL COMMENT '审核状态，-1审核未通过，0待审核，1审核通过，2复核通过',
  `content` varchar(1000) DEFAULT NULL COMMENT '审核结果说明内容',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '审核时间',
  `del` varchar(1) DEFAULT NULL COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COMMENT='药师处方审核记录表';

/*Data for the table `wlyy_pharmacist_checked` */

insert  into `wlyy_pharmacist_checked`(`id`,`code`,`pharmacist`,`prescription`,`status`,`content`,`czrq`,`del`) values (1,'CHK2016032800000001','20160322000001','PRE2016032600000002',1,'checked pass','2016-03-31 20:33:47','1'),(2,'CHK2016033100000001','20160322000001','PRE2016032600000003',1,'éå','2016-03-31 20:09:21','1'),(3,'CHK2016033100000002','20160322000001','PRE2016032600000003',-1,'éå','2016-03-31 20:14:15','1'),(4,'CHK2016033100000003','20160322000001','PRE2016033100000003',-1,'åå®¡éå','2016-03-31 20:15:43','1'),(5,'CHK2016033100000004','20160322000001','PRE2016033100000005',-1,'åå®¡éå2','2016-03-31 20:17:35','1'),(6,'CHK2016033100000005','20160322000001','PRE2016032600000003',1,'åå®¡éè¿2','2016-03-31 20:18:32','1'),(7,'CHK2016033100000006','20160322000001','PRE2016033100000002',-1,'å¤å®¡éå','2016-03-31 20:19:39','1'),(8,'CHK2016033100000007','20160322000001','PRE2016032600000003',2,'å¤å®¡éè¿','2016-03-31 20:20:07','1'),(9,'CHK2016033100000008','20160322000001','PRE2016033100000004',1,'check pass','2016-03-31 20:27:30','1'),(10,'CHK2016033100000009','20160322000001','PRE2016033100000004',2,'check fushen pass','2016-03-31 20:27:50','1'),(11,'CHK2016033100000010','20160322000001','PRE2016033100000005',1,'npass','2016-03-31 20:36:41','1'),(12,'CHK2016033100000011','20160322000001','PRE2016033100000004',1,'chushen pass','2016-03-31 20:46:45','1'),(13,'CHK2016033100000012','20160322000001','PRE2016032600000004',3,'fushen pass','2016-03-31 20:47:16','1'),(14,'CHK2016033100000013','20160322000001','PRE2016033100000003',-1,'tuihui','2016-03-31 20:47:47','1'),(15,'CHK2016040100000001','20160322000001','PRE2016040100000002',1,'','2016-04-01 10:23:46','1'),(16,'CHK2016040100000002','20160322000001','PRE2016032600000003',-1,'','2016-04-01 10:23:58','1'),(17,'CHK2016040100000003','20160322000001','PRE2016040100000001',1,'','2016-04-01 10:24:13','1'),(18,'CHK2016040100000004','20160322000001','PRE2016040100000004',1,'å¤æ¹å¯è¡','2016-04-01 11:13:53','1'),(19,'CHK2016040100000005','20160322000001','PRE2016040100000004',3,'å¤å®¡éè¿ï¼å®ç¾','2016-04-01 11:34:19','1'),(20,'CHK2016040100000006','20160322000001','PRE2016040100000004',3,'æ­£æ¯å¥½æ¶å','2016-04-01 12:01:45','1'),(21,'CHK2016040100000007','20160322000001','PRE2016032600000002',3,'checked pass','2016-04-01 12:02:58','1'),(25,'CHK2016040100000008','20160322000001','PRE2016032600000002',2,'checked pass','2016-04-01 12:30:51','1'),(26,'CHK2016040100000009','20160322000001','PRE2016040100000004',2,'checked pass','2016-04-01 12:31:55','1'),(27,'CHK2016040100000010','20160322000001','PRE2016040100000004',3,'checked pass','2016-04-01 12:36:33','1'),(28,'CHK2016040100000011','20160322000001','PRE2016040100000004',3,'checked pass','2016-04-01 12:37:06','1'),(29,'CHK2016040100000012','20160322000001','PRE2016040100000004',3,'éå±å','2016-04-01 12:53:38','1'),(30,'CHK2016040200000001','20160322000001','PRE2016040100000003',1,'','2016-04-02 10:50:13','1'),(31,'CHK2016040200000002','20160322000001','PRE2016040100000002',1,'','2016-04-02 12:36:18','1'),(32,'CHK2016040200000003','20160322000001','PRE2016040100000005',-1,'','2016-04-02 12:36:34','1'),(33,'CHK2016040200000004','20160322000001','PRE2016032600000002',-2,'','2016-04-02 12:39:58','1'),(34,'CHK2016040800000001','20160322000001','PRE2016040700000001',-1,'','2016-04-08 00:31:49','1'),(35,'CHK2016040800000002','20160322000001','PRE2016040200000001',1,'','2016-04-08 13:06:10','1');

/*Table structure for table `wlyy_points_gift` */

DROP TABLE IF EXISTS `wlyy_points_gift`;

CREATE TABLE `wlyy_points_gift` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '礼品标识',
  `name` varchar(50) DEFAULT NULL COMMENT '礼品名称',
  `points` int(11) DEFAULT NULL COMMENT '兑换积分数',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分礼品表';

/*Data for the table `wlyy_points_gift` */

/*Table structure for table `wlyy_points_record` */

DROP TABLE IF EXISTS `wlyy_points_record`;

CREATE TABLE `wlyy_points_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `user` varchar(50) NOT NULL COMMENT '患者标识',
  `points` int(11) DEFAULT NULL COMMENT '积分数',
  `table` varchar(100) DEFAULT NULL COMMENT '操作来源（对应数据库表名）',
  `oper_id` varchar(20) DEFAULT NULL COMMENT '操作来源标识',
  `des` varchar(500) DEFAULT NULL COMMENT '积分说明',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作日期',
  `del` varchar(1) DEFAULT '1' COMMENT '是否作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_points_record_1` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分明细表';

/*Data for the table `wlyy_points_record` */

/*Table structure for table `wlyy_prescription` */

DROP TABLE IF EXISTS `wlyy_prescription`;

CREATE TABLE `wlyy_prescription` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '处方标识',
  `patient` varchar(50) NOT NULL COMMENT '患者标识',
  `doctor` varchar(50) NOT NULL COMMENT '医生标识',
  `name` varchar(50) DEFAULT NULL COMMENT '患者姓名',
  `sex` int(11) DEFAULT NULL COMMENT '患者性别',
  `age` int(11) DEFAULT NULL COMMENT '患者年龄',
  `allergy` varchar(200) DEFAULT NULL COMMENT '过敏史',
  `diagnosis` varchar(500) DEFAULT NULL COMMENT '临床诊断',
  `status` int(11) DEFAULT NULL COMMENT '处方状态，-1初审未通过，-2复审未通过，0待审核，1审核通过，2待复审 3复核通过',
  `amount` int(11) DEFAULT '0' COMMENT '续方次数',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '出处方时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_prescription_1` (`code`),
  KEY `idx_wlyy_prescription_2` (`patient`),
  KEY `idx_wlyy_prescription_3` (`doctor`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COMMENT='患者处方记录表';

/*Data for the table `wlyy_prescription` */

insert  into `wlyy_prescription`(`id`,`code`,`patient`,`doctor`,`name`,`sex`,`age`,`allergy`,`diagnosis`,`status`,`amount`,`czrq`,`del`) values (11,'PRE2016040100000002','20160322000001','20160322000001','李碧玉',2,33,'','扁桃体发炎引起发烧',0,0,'2016-04-12 17:15:07','1'),(12,'PRE2016040100000003','20160322000001','20160322000001','李碧玉',2,33,'','身体虚弱冒冷汗',1,0,'2016-04-10 16:10:08','1'),(13,'PRE2016040100000004','20160322000003','20160322000001','窦怡宁',2,45,'','晚上梦多睡眠质量差',3,0,'2016-04-13 09:39:50','1'),(14,'PRE2016040100000005','20160322000003','20160322000001','窦怡宁',2,45,'','最近老感觉恶心，食欲不佳',0,0,'2016-04-13 09:39:51','1'),(15,'PRE2016040200000001','20160322000002','20160322000001','张华',1,26,'','手脚关节处咔咔响',0,0,'2016-04-01 11:26:40','1'),(16,'PRE2016040700000001','20160322000002','20160322000001','张华',1,26,'','感冒一个星期了还没好',0,0,'2016-03-24 10:33:42','1'),(17,'PRE2016041200000001','20160322000001','20160322000001','李碧玉',2,33,'','扁桃体发炎引起发热',0,0,'2016-03-16 15:15:00','1'),(18,'PRE2016041200000002','20160322000001','20160322000001','李碧玉',2,33,'','扁桃体发炎引起发热',0,0,'2016-03-12 14:50:20','1'),(19,'PRE2016041200000003','20160322000001','20160322000001','李碧玉',2,33,'','扁桃体发炎引起发热',0,0,'2016-03-06 16:21:17','1'),(20,'PRE2016041200000004','20160322000001','20160322000001','李碧玉',2,33,'','扁桃体发炎引起发热',0,0,'2016-03-02 15:33:13','1'),(21,'PRE2016041300000001','20160322000001','20160322000001','李碧玉',2,33,'','扁桃体发炎引起发热',0,0,'2016-04-13 09:43:54','1');

/*Table structure for table `wlyy_prescription_continue` */

DROP TABLE IF EXISTS `wlyy_prescription_continue`;

CREATE TABLE `wlyy_prescription_continue` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `prescription` varchar(50) DEFAULT NULL COMMENT '处方标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '续诊时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废，1正常，0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_prescription_continue_1` (`prescription`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='处方续方记录表';

/*Data for the table `wlyy_prescription_continue` */

insert  into `wlyy_prescription_continue`(`id`,`prescription`,`patient`,`doctor`,`czrq`,`del`) values (2,'PRE2016032600000001','20160322000001','20160322000001','2016-03-26 14:03:54','1'),(3,'PRE2016032600000001','20160322000001','20160322000001','2016-03-26 14:09:20','1'),(4,'PRE2016032600000002','20160322000001','20160322000001','2016-03-26 14:10:26','1');

/*Table structure for table `wlyy_prescription_info` */

DROP TABLE IF EXISTS `wlyy_prescription_info`;

CREATE TABLE `wlyy_prescription_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '药品标识',
  `prescription` varchar(50) DEFAULT NULL COMMENT '处方标识',
  `name` varchar(100) DEFAULT NULL COMMENT '药品名称',
  `standard` varchar(50) DEFAULT NULL COMMENT '药品规格',
  `dosage` double DEFAULT NULL COMMENT '次剂量',
  `dosage_unit` varchar(50) DEFAULT NULL COMMENT '次剂量单位',
  `frequency` int(11) DEFAULT NULL COMMENT '频次',
  `days` int(11) DEFAULT NULL COMMENT '天数',
  `total` double DEFAULT NULL COMMENT '总量',
  `total_unit` varchar(50) DEFAULT NULL COMMENT '总量单位',
  `method` varchar(500) DEFAULT NULL COMMENT '用药方法',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_prescription_info_2` (`code`),
  KEY `idx_wlyy_prescription_info_1` (`prescription`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COMMENT='处方明细表';

/*Data for the table `wlyy_prescription_info` */

insert  into `wlyy_prescription_info`(`id`,`code`,`prescription`,`name`,`standard`,`dosage`,`dosage_unit`,`frequency`,`days`,`total`,`total_unit`,`method`,`czrq`,`del`) values (1,'PRIN2016032600000001','PRE2016032600000003','âè¯ååç§°â','âxxxâ',50,'âxxâ',1,1,5,'âxxxâ','âxxxxxâ','2016-03-26 09:47:48','1'),(4,'PRIN2016033100000003','PRE2016033100000002','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-03-31 14:38:20','1'),(5,'PRIN2016033100000004','PRE2016033100000002','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-03-31 14:38:20','1'),(6,'PRIN2016040100000001','PRE2016040100000001','å¤æ¹é¿å¸å¹æé¢ç²','6ç',2,'ç',3,9,9,'ç','é¥­åæç¨','2016-04-01 00:31:22','1'),(7,'PRIN2016040100000002','PRE2016040100000001','999æåçµè½¯è¶å','12ç²',2,'ç²',3,9,5,'ç','é¥­åæç¨','2016-04-01 00:31:22','1'),(8,'PRIN2016040100000003','PRE2016040100000002','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-01 00:32:35','1'),(9,'PRIN2016040100000004','PRE2016040100000002','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-01 00:32:35','1'),(10,'PRIN2016040100000005','PRE2016040100000003','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-01 00:33:16','1'),(11,'PRIN2016040100000006','PRE2016040100000003','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-01 00:33:16','1'),(12,'PRIN2016040100000007','PRE2016040100000004','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-01 11:09:36','1'),(13,'PRIN2016040100000008','PRE2016040100000004','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-01 11:09:36','1'),(14,'PRIN2016040100000009','PRE2016040100000005','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-01 14:11:15','1'),(15,'PRIN2016040100000010','PRE2016040100000005','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-01 14:11:15','1'),(16,'PRIN2016040200000001','PRE2016040200000001','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-02 12:04:36','1'),(17,'PRIN2016040200000002','PRE2016040200000001','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-02 12:04:36','1'),(18,'PRIN2016040700000001','PRE2016040700000001','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-07 19:16:24','1'),(19,'PRIN2016040700000002','PRE2016040700000001','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-07 19:16:24','1'),(20,'PRIN2016041200000001','PRE2016041200000001','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-12 14:36:37','1'),(21,'PRIN2016041200000002','PRE2016041200000001','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-12 14:36:37','1'),(22,'PRIN2016041200000003','PRE2016041200000002','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-12 14:40:28','1'),(23,'PRIN2016041200000004','PRE2016041200000002','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-12 14:40:28','1'),(24,'PRIN2016041200000005','PRE2016041200000003','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-12 16:21:17','1'),(25,'PRIN2016041200000006','PRE2016041200000003','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-12 16:21:17','1'),(26,'PRIN2016041200000007','PRE2016041200000004','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-12 16:22:13','1'),(27,'PRIN2016041200000008','PRE2016041200000004','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-12 16:22:13','1'),(28,'PRIN2016041300000001','PRE2016041300000001','复方阿司匹林颗粒','6片',2,'片',3,9,9,'盒','饭后服用','2016-04-13 09:43:54','1'),(29,'PRIN2016041300000002','PRE2016041300000001','999感冒灵软胶囊','12粒',2,'粒',3,9,5,'盒','饭后服用','2016-04-13 09:43:54','1');

/*Table structure for table `wlyy_prescription_template` */

DROP TABLE IF EXISTS `wlyy_prescription_template`;

CREATE TABLE `wlyy_prescription_template` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '模板标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `name` varchar(100) DEFAULT NULL COMMENT '模板标题',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废，1正常 0作废',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_prescription_template_1` (`doctor`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='处方模板表';

/*Data for the table `wlyy_prescription_template` */

insert  into `wlyy_prescription_template`(`id`,`code`,`doctor`,`name`,`czrq`,`del`) values (1,'TEMP2016032600000001','20160322000001','this is title','2016-03-26 10:20:50','1');

/*Table structure for table `wlyy_prescription_template_info` */

DROP TABLE IF EXISTS `wlyy_prescription_template_info`;

CREATE TABLE `wlyy_prescription_template_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `template` varchar(50) DEFAULT NULL COMMENT '模板标识',
  `code` varchar(50) DEFAULT NULL COMMENT '药品标识',
  `name` varchar(100) DEFAULT NULL COMMENT '药品名称',
  `standard` varchar(50) DEFAULT NULL COMMENT '药品规格',
  `dosage` double DEFAULT NULL COMMENT '次剂量',
  `dosage_unit` varchar(50) DEFAULT NULL COMMENT '次剂量单位',
  `frequency` int(11) DEFAULT NULL COMMENT '频次',
  `days` int(11) DEFAULT NULL COMMENT '天数',
  `total` double DEFAULT NULL COMMENT '总量',
  `total_unit` varchar(50) DEFAULT NULL COMMENT '总量单位',
  `method` varchar(500) DEFAULT NULL COMMENT '用药方法',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废，1正常，0作废',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_prescription_template_info_2` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='处方模板明细表';

/*Data for the table `wlyy_prescription_template_info` */

insert  into `wlyy_prescription_template_info`(`id`,`template`,`code`,`name`,`standard`,`dosage`,`dosage_unit`,`frequency`,`days`,`total`,`total_unit`,`method`,`czrq`,`del`) values (1,'TEMP2016032600000001','PRIN2016032600000002','âè¯ååç§°â','âxxxâ',50,'âxxâ',1,1,5,'âxxxâ','âxxxxxâ','2016-03-26 10:07:22','1');

/*Table structure for table `wlyy_referral` */

DROP TABLE IF EXISTS `wlyy_referral`;

CREATE TABLE `wlyy_referral` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) DEFAULT NULL COMMENT '转诊标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `patient` varchar(50) DEFAULT NULL COMMENT '患者标识',
  `hospital` varchar(100) DEFAULT NULL COMMENT '医院名称',
  `dept` varchar(100) DEFAULT NULL COMMENT '科室名称',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加转诊时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='转疹信息表';

/*Data for the table `wlyy_referral` */

insert  into `wlyy_referral`(`id`,`code`,`doctor`,`patient`,`hospital`,`dept`,`czrq`,`del`) values (1,'REF2016032600000001','20160322000001','20160322000001','zhongyiyuan','neike','2016-03-26 15:12:56','1'),(2,'REF2016032600000002','20160322000001','20160322000001','zhongyiyuan','neike','2016-03-26 15:13:33','1');

/*Table structure for table `wlyy_sign_contract` */

DROP TABLE IF EXISTS `wlyy_sign_contract`;

CREATE TABLE `wlyy_sign_contract` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '签约标识',
  `team` varchar(50) DEFAULT NULL COMMENT '签约医生团队，关联wlyy_doctor表',
  `user` varchar(50) DEFAULT NULL COMMENT '签约患者，关联wlyy_patient表',
  `begin` date DEFAULT NULL COMMENT '开始时间',
  `end` date DEFAULT NULL COMMENT '结束时间',
  `months` int(11) DEFAULT NULL COMMENT '一共多少个月',
  `status` int(11) DEFAULT '1' COMMENT '签约状态，1正常，0取消',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='三师签约信息表';

/*Data for the table `wlyy_sign_contract` */

/*Table structure for table `wlyy_sign_web` */

DROP TABLE IF EXISTS `wlyy_sign_web`;

CREATE TABLE `wlyy_sign_web` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '签约标识',
  `doctor` varchar(50) NOT NULL COMMENT '签约医生',
  `user` varchar(50) NOT NULL COMMENT '签约用户',
  `oper` int(11) DEFAULT NULL COMMENT '操作人（1患者，2医生）',
  `status` int(11) DEFAULT NULL COMMENT '签约状态(0待签约，1已拒绝，2已签约，3患者申请取消签约，4医生申请取消签约，5已解约)',
  `begin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '签约开始时间',
  `end` timestamp NULL DEFAULT NULL COMMENT '签约结束时间',
  `months` int(11) DEFAULT '0' COMMENT '签约时长（如：12个月）',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_sign_web_1` (`doctor`),
  KEY `idx_wlyy_sign_web_2` (`user`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='网络签约信息表';

/*Data for the table `wlyy_sign_web` */

insert  into `wlyy_sign_web`(`id`,`code`,`doctor`,`user`,`oper`,`status`,`begin`,`end`,`months`) values (1,'S20160322000001','D20160322000001','U20160322000001',1,5,'2016-04-26 11:18:05','2016-04-26 19:53:53',1);

/*Table structure for table `wlyy_sms` */

DROP TABLE IF EXISTS `wlyy_sms`;

CREATE TABLE `wlyy_sms` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `mobile` varchar(20) DEFAULT NULL COMMENT '接收手机号',
  `type` int(11) DEFAULT NULL COMMENT '消息类型，1找回密码，注册验证码',
  `content` varchar(500) DEFAULT NULL COMMENT '消息内容',
  `deadline` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '过期时间',
  `czrq` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '发送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信记录表';

/*Data for the table `wlyy_sms` */

/*Table structure for table `wlyy_token` */

DROP TABLE IF EXISTS `wlyy_token`;

CREATE TABLE `wlyy_token` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `user` varchar(50) NOT NULL COMMENT '用户标识',
  `platform` int(11) DEFAULT NULL COMMENT '1患者，2医生',
  `timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '登录超时时间',
  `imei` varchar(30) NOT NULL COMMENT '登录手机的IMEI',
  `token` varchar(50) NOT NULL COMMENT '登录信息标识',
  `czrq` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
  `del` varchar(1) DEFAULT '1' COMMENT '数据是否作废（1正常，0作废）',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_token_1` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户登录信息表';

/*Data for the table `wlyy_token` */

/*Table structure for table `wlyy_wx_patient` */

DROP TABLE IF EXISTS `wlyy_wx_patient`;

CREATE TABLE `wlyy_wx_patient` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `openid` varchar(50) NOT NULL COMMENT '微信openid',
  `patient` varchar(50) NOT NULL COMMENT '患者标识',
  `status` int(11) DEFAULT '1' COMMENT '状态（1正常，0注销）',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_wlyy_user_3` (`openid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信与患者关联表/微信登录信息表';

/*Data for the table `wlyy_wx_patient` */

/*Table structure for table `wx_access_token` */

DROP TABLE IF EXISTS `wx_access_token`;

CREATE TABLE `wx_access_token` (
  `value` varchar(1000) DEFAULT NULL COMMENT '微信中控服务器access_token'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Data for the table `wx_access_token` */

/*Table structure for table `wx_menu` */

DROP TABLE IF EXISTS `wx_menu`;

CREATE TABLE `wx_menu` (
  `sup_menuid` varchar(50) DEFAULT NULL,
  `menuid` varchar(50) DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `key` varchar(50) DEFAULT NULL,
  `url` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信自定义菜单表';

/*Data for the table `wx_menu` */

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
