/*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 8.0.14 : Database - xgl_oa
*********************************************************************
*/

/*!40101 SET NAMES utf8mb4 */;

/*!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*/`xgl_oa` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;

USE `xgl_oa`;

/*Table structure for table `ab_group_address_book` */

DROP TABLE IF EXISTS `ab_group_address_book`;

CREATE TABLE `ab_group_address_book` (
  `id` char(32) NOT NULL DEFAULT '',
  `gr_no` varchar(50) DEFAULT '' COMMENT '编号',
  `gr_name` varchar(50) DEFAULT '' COMMENT '分组名称',
  `gr_remark` varchar(50) DEFAULT NULL COMMENT '备注，说明',
  `gr_uid` char(32) DEFAULT '' COMMENT '所属用户，外键ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人通讯簿分租';

/*Table structure for table `ab_group_address_book_public` */

DROP TABLE IF EXISTS `ab_group_address_book_public`;

CREATE TABLE `ab_group_address_book_public` (
  `id` char(32) NOT NULL DEFAULT '',
  `ga_name` varchar(50) DEFAULT '' COMMENT '分组名',
  `ga_remark` varchar(9999) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共分组';

/*Table structure for table `ab_personal_address_book` */

DROP TABLE IF EXISTS `ab_personal_address_book`;

CREATE TABLE `ab_personal_address_book` (
  `id` char(32) NOT NULL DEFAULT '',
  `pe_name` varchar(50) DEFAULT '' COMMENT '姓名',
  `pe_sex` varchar(1) DEFAULT '' COMMENT '性别',
  `pe_email` varchar(50) DEFAULT '' COMMENT 'email地址',
  `pe_phone` varchar(50) DEFAULT '' COMMENT '手机号',
  `pe_other` varchar(50) DEFAULT '' COMMENT '其他联系',
  `pe_grouping` varchar(50) DEFAULT '' COMMENT '分组，调用字典',
  `pe_company` varchar(50) DEFAULT '' COMMENT '公司名称',
  `pe_officPhone` varchar(50) DEFAULT '' COMMENT '办公电话',
  `pe_officFax` varchar(50) DEFAULT '' COMMENT '办公传真',
  `pe_companyAddress` varchar(50) DEFAULT '' COMMENT '公司地址',
  `pe_zip` varchar(50) DEFAULT '' COMMENT '邮编',
  `pe_post` varchar(50) DEFAULT '' COMMENT '职位',
  `pe_homeAddress` varchar(50) DEFAULT '' COMMENT '家庭地址',
  `pe_homePhone` varchar(50) DEFAULT '' COMMENT '家庭电话',
  `pe_remark` varchar(2000) DEFAULT '' COMMENT '备注',
  `pe_uid` char(32) DEFAULT '' COMMENT '所属人员',
  PRIMARY KEY (`id`),
  KEY `pe_uid_fk` (`pe_uid`),
  KEY `pe_grouping_pk` (`pe_grouping`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人通讯簿';

/*Table structure for table `ab_public_address_book` */

DROP TABLE IF EXISTS `ab_public_address_book`;

CREATE TABLE `ab_public_address_book` (
  `id` char(32) NOT NULL DEFAULT '',
  `pu_name` varchar(50) DEFAULT '' COMMENT '姓名',
  `pu_sex` varchar(50) DEFAULT '' COMMENT '性别',
  `pu_email` varchar(50) DEFAULT '' COMMENT '邮箱',
  `pu_phone` varchar(50) DEFAULT '' COMMENT '手机号',
  `pu_other` varchar(50) DEFAULT '' COMMENT '其他联系',
  `pu_grouping` char(32) DEFAULT '' COMMENT '分组，外键，调字典',
  `pu_company` varchar(50) DEFAULT '' COMMENT '公司名称',
  `pu_officPhone` varchar(50) DEFAULT '' COMMENT '办公电话',
  `pu_officFax` varchar(50) DEFAULT '' COMMENT '办公传真',
  `pu_companyAddress` varchar(50) DEFAULT '' COMMENT '公司地址',
  `pu_zip` varchar(50) DEFAULT '' COMMENT '邮编',
  `pu_post` varchar(50) DEFAULT '' COMMENT '职位',
  `pu_homeAddress` varchar(50) DEFAULT '' COMMENT '家庭地址',
  `pu_homePhone` varchar(50) DEFAULT '' COMMENT '家庭电话',
  `pu_remark` varchar(2000) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司通讯薄';

/*Table structure for table `act_evt_log` */

DROP TABLE IF EXISTS `act_evt_log`;

CREATE TABLE `act_evt_log` (
  `LOG_NR_` bigint(20) NOT NULL AUTO_INCREMENT,
  `TYPE_` varchar(64) DEFAULT NULL,
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `TIME_STAMP_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
  `USER_ID_` varchar(255) DEFAULT NULL,
  `DATA_` longblob,
  `LOCK_OWNER_` varchar(255) DEFAULT NULL,
  `LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
  `IS_PROCESSED_` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`LOG_NR_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ge_bytearray` */

DROP TABLE IF EXISTS `act_ge_bytearray`;

CREATE TABLE `act_ge_bytearray` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `DEPLOYMENT_ID_` varchar(64) DEFAULT NULL,
  `BYTES_` longblob,
  `GENERATED_` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`),
  CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `act_re_deployment` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ge_property` */

DROP TABLE IF EXISTS `act_ge_property`;

CREATE TABLE `act_ge_property` (
  `NAME_` varchar(64) NOT NULL,
  `VALUE_` varchar(300) DEFAULT NULL,
  `REV_` int(11) DEFAULT NULL,
  PRIMARY KEY (`NAME_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_actinst` */

DROP TABLE IF EXISTS `act_hi_actinst`;

CREATE TABLE `act_hi_actinst` (
  `ID_` varchar(64) NOT NULL,
  `PROC_DEF_ID_` varchar(64) NOT NULL,
  `PROC_INST_ID_` varchar(64) NOT NULL,
  `EXECUTION_ID_` varchar(64) NOT NULL,
  `ACT_ID_` varchar(255) NOT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `CALL_PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `ACT_NAME_` varchar(255) DEFAULT NULL,
  `ACT_TYPE_` varchar(255) NOT NULL,
  `ASSIGNEE_` varchar(255) DEFAULT NULL,
  `START_TIME_` datetime(3) NOT NULL,
  `END_TIME_` datetime(3) DEFAULT NULL,
  `DURATION_` bigint(20) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`),
  KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`),
  KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`),
  KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_attachment` */

DROP TABLE IF EXISTS `act_hi_attachment`;

CREATE TABLE `act_hi_attachment` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `USER_ID_` varchar(255) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `DESCRIPTION_` varchar(4000) DEFAULT NULL,
  `TYPE_` varchar(255) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `URL_` varchar(4000) DEFAULT NULL,
  `CONTENT_ID_` varchar(64) DEFAULT NULL,
  `TIME_` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_comment` */

DROP TABLE IF EXISTS `act_hi_comment`;

CREATE TABLE `act_hi_comment` (
  `ID_` varchar(64) NOT NULL,
  `TYPE_` varchar(255) DEFAULT NULL,
  `TIME_` datetime(3) NOT NULL,
  `USER_ID_` varchar(255) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `ACTION_` varchar(255) DEFAULT NULL,
  `MESSAGE_` varchar(4000) DEFAULT NULL,
  `FULL_MSG_` longblob,
  PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_detail` */

DROP TABLE IF EXISTS `act_hi_detail`;

CREATE TABLE `act_hi_detail` (
  `ID_` varchar(64) NOT NULL,
  `TYPE_` varchar(255) NOT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `ACT_INST_ID_` varchar(64) DEFAULT NULL,
  `NAME_` varchar(255) NOT NULL,
  `VAR_TYPE_` varchar(255) DEFAULT NULL,
  `REV_` int(11) DEFAULT NULL,
  `TIME_` datetime(3) NOT NULL,
  `BYTEARRAY_ID_` varchar(64) DEFAULT NULL,
  `DOUBLE_` double DEFAULT NULL,
  `LONG_` bigint(20) DEFAULT NULL,
  `TEXT_` varchar(4000) DEFAULT NULL,
  `TEXT2_` varchar(4000) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_HI_DETAIL_PROC_INST` (`PROC_INST_ID_`),
  KEY `ACT_IDX_HI_DETAIL_ACT_INST` (`ACT_INST_ID_`),
  KEY `ACT_IDX_HI_DETAIL_TIME` (`TIME_`),
  KEY `ACT_IDX_HI_DETAIL_NAME` (`NAME_`),
  KEY `ACT_IDX_HI_DETAIL_TASK_ID` (`TASK_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_identitylink` */

DROP TABLE IF EXISTS `act_hi_identitylink`;

CREATE TABLE `act_hi_identitylink` (
  `ID_` varchar(64) NOT NULL,
  `GROUP_ID_` varchar(255) DEFAULT NULL,
  `TYPE_` varchar(255) DEFAULT NULL,
  `USER_ID_` varchar(255) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_HI_IDENT_LNK_USER` (`USER_ID_`),
  KEY `ACT_IDX_HI_IDENT_LNK_TASK` (`TASK_ID_`),
  KEY `ACT_IDX_HI_IDENT_LNK_PROCINST` (`PROC_INST_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_procinst` */

DROP TABLE IF EXISTS `act_hi_procinst`;

CREATE TABLE `act_hi_procinst` (
  `ID_` varchar(64) NOT NULL,
  `PROC_INST_ID_` varchar(64) NOT NULL,
  `BUSINESS_KEY_` varchar(255) DEFAULT NULL,
  `PROC_DEF_ID_` varchar(64) NOT NULL,
  `START_TIME_` datetime(3) NOT NULL,
  `END_TIME_` datetime(3) DEFAULT NULL,
  `DURATION_` bigint(20) DEFAULT NULL,
  `START_USER_ID_` varchar(255) DEFAULT NULL,
  `START_ACT_ID_` varchar(255) DEFAULT NULL,
  `END_ACT_ID_` varchar(255) DEFAULT NULL,
  `SUPER_PROCESS_INSTANCE_ID_` varchar(64) DEFAULT NULL,
  `DELETE_REASON_` varchar(4000) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  `NAME_` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  UNIQUE KEY `PROC_INST_ID_` (`PROC_INST_ID_`),
  KEY `ACT_IDX_HI_PRO_INST_END` (`END_TIME_`),
  KEY `ACT_IDX_HI_PRO_I_BUSKEY` (`BUSINESS_KEY_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_taskinst` */

DROP TABLE IF EXISTS `act_hi_taskinst`;

CREATE TABLE `act_hi_taskinst` (
  `ID_` varchar(64) NOT NULL,
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  `TASK_DEF_KEY_` varchar(255) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `PARENT_TASK_ID_` varchar(64) DEFAULT NULL,
  `DESCRIPTION_` varchar(4000) DEFAULT NULL,
  `OWNER_` varchar(255) DEFAULT NULL,
  `ASSIGNEE_` varchar(255) DEFAULT NULL,
  `START_TIME_` datetime(3) NOT NULL,
  `CLAIM_TIME_` datetime(3) DEFAULT NULL,
  `END_TIME_` datetime(3) DEFAULT NULL,
  `DURATION_` bigint(20) DEFAULT NULL,
  `DELETE_REASON_` varchar(4000) DEFAULT NULL,
  `PRIORITY_` int(11) DEFAULT NULL,
  `DUE_DATE_` datetime(3) DEFAULT NULL,
  `FORM_KEY_` varchar(255) DEFAULT NULL,
  `CATEGORY_` varchar(255) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_HI_TASK_INST_PROCINST` (`PROC_INST_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_hi_varinst` */

DROP TABLE IF EXISTS `act_hi_varinst`;

CREATE TABLE `act_hi_varinst` (
  `ID_` varchar(64) NOT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `NAME_` varchar(255) NOT NULL,
  `VAR_TYPE_` varchar(100) DEFAULT NULL,
  `REV_` int(11) DEFAULT NULL,
  `BYTEARRAY_ID_` varchar(64) DEFAULT NULL,
  `DOUBLE_` double DEFAULT NULL,
  `LONG_` bigint(20) DEFAULT NULL,
  `TEXT_` varchar(4000) DEFAULT NULL,
  `TEXT2_` varchar(4000) DEFAULT NULL,
  `CREATE_TIME_` datetime(3) DEFAULT NULL,
  `LAST_UPDATED_TIME_` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_HI_PROCVAR_PROC_INST` (`PROC_INST_ID_`),
  KEY `ACT_IDX_HI_PROCVAR_NAME_TYPE` (`NAME_`,`VAR_TYPE_`),
  KEY `ACT_IDX_HI_PROCVAR_TASK_ID` (`TASK_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_id_group` */

DROP TABLE IF EXISTS `act_id_group`;

CREATE TABLE `act_id_group` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `TYPE_` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_id_info` */

DROP TABLE IF EXISTS `act_id_info`;

CREATE TABLE `act_id_info` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `USER_ID_` varchar(64) DEFAULT NULL,
  `TYPE_` varchar(64) DEFAULT NULL,
  `KEY_` varchar(255) DEFAULT NULL,
  `VALUE_` varchar(255) DEFAULT NULL,
  `PASSWORD_` longblob,
  `PARENT_ID_` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_id_membership` */

DROP TABLE IF EXISTS `act_id_membership`;

CREATE TABLE `act_id_membership` (
  `USER_ID_` varchar(64) NOT NULL,
  `GROUP_ID_` varchar(64) NOT NULL,
  PRIMARY KEY (`USER_ID_`,`GROUP_ID_`),
  KEY `ACT_FK_MEMB_GROUP` (`GROUP_ID_`),
  CONSTRAINT `ACT_FK_MEMB_GROUP` FOREIGN KEY (`GROUP_ID_`) REFERENCES `act_id_group` (`ID_`),
  CONSTRAINT `ACT_FK_MEMB_USER` FOREIGN KEY (`USER_ID_`) REFERENCES `act_id_user` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_id_user` */

DROP TABLE IF EXISTS `act_id_user`;

CREATE TABLE `act_id_user` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `FIRST_` varchar(255) DEFAULT NULL,
  `LAST_` varchar(255) DEFAULT NULL,
  `EMAIL_` varchar(255) DEFAULT NULL,
  `PWD_` varchar(255) DEFAULT NULL,
  `PICTURE_ID_` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_procdef_info` */

DROP TABLE IF EXISTS `act_procdef_info`;

CREATE TABLE `act_procdef_info` (
  `ID_` varchar(64) NOT NULL,
  `PROC_DEF_ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `INFO_JSON_ID_` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  UNIQUE KEY `ACT_UNIQ_INFO_PROCDEF` (`PROC_DEF_ID_`),
  KEY `ACT_IDX_INFO_PROCDEF` (`PROC_DEF_ID_`),
  KEY `ACT_FK_INFO_JSON_BA` (`INFO_JSON_ID_`),
  CONSTRAINT `ACT_FK_INFO_JSON_BA` FOREIGN KEY (`INFO_JSON_ID_`) REFERENCES `act_ge_bytearray` (`ID_`),
  CONSTRAINT `ACT_FK_INFO_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_re_deployment` */

DROP TABLE IF EXISTS `act_re_deployment`;

CREATE TABLE `act_re_deployment` (
  `ID_` varchar(64) NOT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `CATEGORY_` varchar(255) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  `DEPLOY_TIME_` timestamp(3) NULL DEFAULT NULL,
  PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_re_model` */

DROP TABLE IF EXISTS `act_re_model`;

CREATE TABLE `act_re_model` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `KEY_` varchar(255) DEFAULT NULL,
  `CATEGORY_` varchar(255) DEFAULT NULL,
  `CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
  `LAST_UPDATE_TIME_` timestamp(3) NULL DEFAULT NULL,
  `VERSION_` int(11) DEFAULT NULL,
  `META_INFO_` varchar(4000) DEFAULT NULL,
  `DEPLOYMENT_ID_` varchar(64) DEFAULT NULL,
  `EDITOR_SOURCE_VALUE_ID_` varchar(64) DEFAULT NULL,
  `EDITOR_SOURCE_EXTRA_VALUE_ID_` varchar(64) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  PRIMARY KEY (`ID_`),
  KEY `ACT_FK_MODEL_SOURCE` (`EDITOR_SOURCE_VALUE_ID_`),
  KEY `ACT_FK_MODEL_SOURCE_EXTRA` (`EDITOR_SOURCE_EXTRA_VALUE_ID_`),
  KEY `ACT_FK_MODEL_DEPLOYMENT` (`DEPLOYMENT_ID_`),
  CONSTRAINT `ACT_FK_MODEL_DEPLOYMENT` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `act_re_deployment` (`ID_`),
  CONSTRAINT `ACT_FK_MODEL_SOURCE` FOREIGN KEY (`EDITOR_SOURCE_VALUE_ID_`) REFERENCES `act_ge_bytearray` (`ID_`),
  CONSTRAINT `ACT_FK_MODEL_SOURCE_EXTRA` FOREIGN KEY (`EDITOR_SOURCE_EXTRA_VALUE_ID_`) REFERENCES `act_ge_bytearray` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_re_procdef` */

DROP TABLE IF EXISTS `act_re_procdef`;

CREATE TABLE `act_re_procdef` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `CATEGORY_` varchar(255) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `KEY_` varchar(150) NOT NULL,
  `VERSION_` int(11) NOT NULL,
  `DEPLOYMENT_ID_` varchar(64) DEFAULT NULL,
  `RESOURCE_NAME_` varchar(4000) DEFAULT NULL,
  `DGRM_RESOURCE_NAME_` varchar(4000) DEFAULT NULL,
  `DESCRIPTION_` varchar(4000) DEFAULT NULL,
  `HAS_START_FORM_KEY_` tinyint(4) DEFAULT NULL,
  `HAS_GRAPHICAL_NOTATION_` tinyint(4) DEFAULT NULL,
  `SUSPENSION_STATE_` int(11) DEFAULT NULL,
  `TENANT_ID_` varchar(150) DEFAULT '',
  PRIMARY KEY (`ID_`),
  UNIQUE KEY `ACT_UNIQ_PROCDEF` (`KEY_`,`VERSION_`,`TENANT_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ru_event_subscr` */

DROP TABLE IF EXISTS `act_ru_event_subscr`;

CREATE TABLE `act_ru_event_subscr` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `EVENT_TYPE_` varchar(255) NOT NULL,
  `EVENT_NAME_` varchar(255) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `ACTIVITY_ID_` varchar(64) DEFAULT NULL,
  `CONFIGURATION_` varchar(255) DEFAULT NULL,
  `CREATED_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_EVENT_SUBSCR_CONFIG_` (`CONFIGURATION_`),
  KEY `ACT_FK_EVENT_EXEC` (`EXECUTION_ID_`),
  CONSTRAINT `ACT_FK_EVENT_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ru_execution` */

DROP TABLE IF EXISTS `act_ru_execution`;

CREATE TABLE `act_ru_execution` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `BUSINESS_KEY_` varchar(255) DEFAULT NULL,
  `PARENT_ID_` varchar(64) DEFAULT NULL,
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  `SUPER_EXEC_` varchar(64) DEFAULT NULL,
  `ACT_ID_` varchar(255) DEFAULT NULL,
  `IS_ACTIVE_` tinyint(4) DEFAULT NULL,
  `IS_CONCURRENT_` tinyint(4) DEFAULT NULL,
  `IS_SCOPE_` tinyint(4) DEFAULT NULL,
  `IS_EVENT_SCOPE_` tinyint(4) DEFAULT NULL,
  `SUSPENSION_STATE_` int(11) DEFAULT NULL,
  `CACHED_ENT_STATE_` int(11) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  `NAME_` varchar(255) DEFAULT NULL,
  `LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_EXEC_BUSKEY` (`BUSINESS_KEY_`),
  KEY `ACT_FK_EXE_PROCINST` (`PROC_INST_ID_`),
  KEY `ACT_FK_EXE_PARENT` (`PARENT_ID_`),
  KEY `ACT_FK_EXE_SUPER` (`SUPER_EXEC_`),
  KEY `ACT_FK_EXE_PROCDEF` (`PROC_DEF_ID_`),
  CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `act_ru_execution` (`ID_`),
  CONSTRAINT `ACT_FK_EXE_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`),
  CONSTRAINT `ACT_FK_EXE_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ACT_FK_EXE_SUPER` FOREIGN KEY (`SUPER_EXEC_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ru_identitylink` */

DROP TABLE IF EXISTS `act_ru_identitylink`;

CREATE TABLE `act_ru_identitylink` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `GROUP_ID_` varchar(255) DEFAULT NULL,
  `TYPE_` varchar(255) DEFAULT NULL,
  `USER_ID_` varchar(255) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_IDENT_LNK_USER` (`USER_ID_`),
  KEY `ACT_IDX_IDENT_LNK_GROUP` (`GROUP_ID_`),
  KEY `ACT_IDX_ATHRZ_PROCEDEF` (`PROC_DEF_ID_`),
  KEY `ACT_FK_TSKASS_TASK` (`TASK_ID_`),
  KEY `ACT_FK_IDL_PROCINST` (`PROC_INST_ID_`),
  CONSTRAINT `ACT_FK_ATHRZ_PROCEDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`),
  CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`),
  CONSTRAINT `ACT_FK_TSKASS_TASK` FOREIGN KEY (`TASK_ID_`) REFERENCES `act_ru_task` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ru_job` */

DROP TABLE IF EXISTS `act_ru_job`;

CREATE TABLE `act_ru_job` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `TYPE_` varchar(255) NOT NULL,
  `LOCK_EXP_TIME_` timestamp(3) NULL DEFAULT NULL,
  `LOCK_OWNER_` varchar(255) DEFAULT NULL,
  `EXCLUSIVE_` tinyint(1) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `PROCESS_INSTANCE_ID_` varchar(64) DEFAULT NULL,
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  `RETRIES_` int(11) DEFAULT NULL,
  `EXCEPTION_STACK_ID_` varchar(64) DEFAULT NULL,
  `EXCEPTION_MSG_` varchar(4000) DEFAULT NULL,
  `DUEDATE_` timestamp(3) NULL DEFAULT NULL,
  `REPEAT_` varchar(255) DEFAULT NULL,
  `HANDLER_TYPE_` varchar(255) DEFAULT NULL,
  `HANDLER_CFG_` varchar(4000) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  PRIMARY KEY (`ID_`),
  KEY `ACT_FK_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
  CONSTRAINT `ACT_FK_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `act_ge_bytearray` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ru_task` */

DROP TABLE IF EXISTS `act_ru_task`;

CREATE TABLE `act_ru_task` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `PROC_DEF_ID_` varchar(64) DEFAULT NULL,
  `NAME_` varchar(255) DEFAULT NULL,
  `PARENT_TASK_ID_` varchar(64) DEFAULT NULL,
  `DESCRIPTION_` varchar(4000) DEFAULT NULL,
  `TASK_DEF_KEY_` varchar(255) DEFAULT NULL,
  `OWNER_` varchar(255) DEFAULT NULL,
  `ASSIGNEE_` varchar(255) DEFAULT NULL,
  `DELEGATION_` varchar(64) DEFAULT NULL,
  `PRIORITY_` int(11) DEFAULT NULL,
  `CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
  `DUE_DATE_` datetime(3) DEFAULT NULL,
  `CATEGORY_` varchar(255) DEFAULT NULL,
  `SUSPENSION_STATE_` int(11) DEFAULT NULL,
  `TENANT_ID_` varchar(255) DEFAULT '',
  `FORM_KEY_` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_TASK_CREATE` (`CREATE_TIME_`),
  KEY `ACT_FK_TASK_EXE` (`EXECUTION_ID_`),
  KEY `ACT_FK_TASK_PROCINST` (`PROC_INST_ID_`),
  KEY `ACT_FK_TASK_PROCDEF` (`PROC_DEF_ID_`),
  CONSTRAINT `ACT_FK_TASK_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`),
  CONSTRAINT `ACT_FK_TASK_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `act_re_procdef` (`ID_`),
  CONSTRAINT `ACT_FK_TASK_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `act_ru_variable` */

DROP TABLE IF EXISTS `act_ru_variable`;

CREATE TABLE `act_ru_variable` (
  `ID_` varchar(64) NOT NULL,
  `REV_` int(11) DEFAULT NULL,
  `TYPE_` varchar(255) NOT NULL,
  `NAME_` varchar(255) NOT NULL,
  `EXECUTION_ID_` varchar(64) DEFAULT NULL,
  `PROC_INST_ID_` varchar(64) DEFAULT NULL,
  `TASK_ID_` varchar(64) DEFAULT NULL,
  `BYTEARRAY_ID_` varchar(64) DEFAULT NULL,
  `DOUBLE_` double DEFAULT NULL,
  `LONG_` bigint(20) DEFAULT NULL,
  `TEXT_` varchar(4000) DEFAULT NULL,
  `TEXT2_` varchar(4000) DEFAULT NULL,
  PRIMARY KEY (`ID_`),
  KEY `ACT_IDX_VARIABLE_TASK_ID` (`TASK_ID_`),
  KEY `ACT_FK_VAR_EXE` (`EXECUTION_ID_`),
  KEY `ACT_FK_VAR_PROCINST` (`PROC_INST_ID_`),
  KEY `ACT_FK_VAR_BYTEARRAY` (`BYTEARRAY_ID_`),
  CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `act_ge_bytearray` (`ID_`),
  CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`),
  CONSTRAINT `ACT_FK_VAR_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `act_ru_execution` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `bi_basicinformation` */

DROP TABLE IF EXISTS `bi_basicinformation`;

CREATE TABLE `bi_basicinformation` (
  `id` char(32) NOT NULL,
  `usingname` varchar(100) DEFAULT NULL COMMENT '用品名称',
  `type_id` char(32) DEFAULT NULL COMMENT '所属类别',
  `danwei` varchar(10) DEFAULT NULL COMMENT '单位',
  `currentinventory` int(11) DEFAULT NULL COMMENT '当前库存',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `userid` char(32) NOT NULL COMMENT '用户id',
  `createdate` datetime NOT NULL COMMENT '创建日期',
  `specificationstype` varchar(50) DEFAULT NULL COMMENT '规格型号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='物品管理';

/*Table structure for table `bi_goodsreceiving` */

DROP TABLE IF EXISTS `bi_goodsreceiving`;

CREATE TABLE `bi_goodsreceiving` (
  `id` char(32) NOT NULL,
  `usingnameid` char(32) DEFAULT NULL COMMENT '用品名称ID',
  `usenumber` int(11) DEFAULT NULL COMMENT '领用数量',
  `recipients` char(32) DEFAULT NULL COMMENT '领用人',
  `receive_time` datetime NOT NULL COMMENT '领取时间',
  `userid` char(32) DEFAULT NULL COMMENT '创建人',
  `createdate` datetime NOT NULL COMMENT '创建日期',
  PRIMARY KEY (`id`),
  KEY `usingnameid` (`usingnameid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='物品领用';

/*Table structure for table `bi_shopping` */

DROP TABLE IF EXISTS `bi_shopping`;

CREATE TABLE `bi_shopping` (
  `id` char(32) NOT NULL,
  `usingname_id` char(32) NOT NULL COMMENT '用品名称编号',
  `amount` int(11) DEFAULT NULL COMMENT '总数',
  `unitprice` double(11,2) DEFAULT NULL COMMENT '单价',
  `totalmonety` double(11,2) DEFAULT NULL COMMENT '总金额',
  `userid` char(32) NOT NULL COMMENT '操作人id ',
  `createdate` datetime NOT NULL COMMENT '创建日期',
  `purchaser` char(32) DEFAULT NULL COMMENT '购买人姓名',
  `buy_time` datetime NOT NULL COMMENT '购买时间',
  PRIMARY KEY (`id`),
  KEY `usingname_id` (`usingname_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='物品购买';

/*Table structure for table `crm_client_info` */

DROP TABLE IF EXISTS `crm_client_info`;

CREATE TABLE `crm_client_info` (
  `id` char(32) NOT NULL DEFAULT '',
  `cl_name` varchar(50) DEFAULT NULL COMMENT '客户名称',
  `cl_no` varchar(50) DEFAULT NULL COMMENT '客户编号',
  `cl_category` char(32) DEFAULT NULL COMMENT '客户类别',
  `cl_type` char(32) DEFAULT NULL COMMENT '客户类型',
  `cl_source` char(32) DEFAULT NULL COMMENT '客户来源',
  `cl_grade` char(32) DEFAULT NULL COMMENT '客户等级',
  `cl_status` char(32) DEFAULT NULL COMMENT '客户状态',
  `cl_staje` char(32) DEFAULT NULL COMMENT '客户阶段',
  `cl_relation` char(32) DEFAULT NULL COMMENT '客户关系',
  `cl_staff` char(32) DEFAULT NULL COMMENT '负责人',
  `cl_remark` varchar(5000) DEFAULT NULL COMMENT '备注',
  `cl_industry` char(32) DEFAULT '' COMMENT '所属行业',
  `cl_describe` varchar(5000) DEFAULT NULL COMMENT '行业描述',
  `cl_address` varchar(100) DEFAULT NULL COMMENT '公司地址',
  `cl_email` varchar(50) DEFAULT NULL COMMENT '电子邮件',
  `cl_phone` varchar(50) DEFAULT NULL COMMENT '电话',
  `cl_phoneNumeber` varchar(50) DEFAULT NULL COMMENT '手机号码',
  `cl_fax` varchar(50) DEFAULT NULL COMMENT '传真',
  `cl_zip` varchar(50) DEFAULT NULL COMMENT '邮编',
  `cl_wangwang` varchar(50) DEFAULT NULL COMMENT '旺旺',
  `cl_qq` varchar(50) DEFAULT NULL COMMENT 'QQ/MSN',
  `cl_website` varchar(50) DEFAULT NULL COMMENT '网址',
  `cl_receipt` varchar(100) DEFAULT NULL COMMENT '收货地址',
  `cl_bank` varchar(100) DEFAULT NULL COMMENT '开户行',
  `cl_people` varchar(50) DEFAULT NULL COMMENT '开户人',
  `cl_number` varchar(50) DEFAULT NULL COMMENT '帐号',
  `cl_create` char(32) DEFAULT NULL COMMENT '创建人',
  `cl_createTime` datetime DEFAULT NULL COMMENT '创建时间',
  `cl_uptade` char(32) DEFAULT NULL COMMENT '最后修改人',
  `cl_updateTime` datetime DEFAULT NULL COMMENT '最后修改人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户信息表';

/*Table structure for table `crm_client_linkman` */

DROP TABLE IF EXISTS `crm_client_linkman`;

CREATE TABLE `crm_client_linkman` (
  `id` char(32) NOT NULL,
  `li_name` varchar(30) NOT NULL COMMENT '联系人姓名',
  `customerId` char(32) NOT NULL COMMENT '客户ID',
  `li_sex` char(1) DEFAULT NULL COMMENT '联系人性别',
  `li_species` char(32) DEFAULT NULL COMMENT '联系人种类',
  `li_type` char(32) DEFAULT NULL COMMENT '联系人类型',
  `li_business` varchar(30) DEFAULT NULL COMMENT '负责业务',
  `li_dept` varchar(50) DEFAULT NULL COMMENT '联系人部门',
  `li_post` varchar(20) DEFAULT NULL COMMENT '联系人职务',
  `li_appellation` varchar(20) DEFAULT NULL COMMENT '联系人称谓',
  `li_telephone` varchar(15) DEFAULT NULL COMMENT '联系人电话',
  `li_email` varchar(35) DEFAULT NULL COMMENT '联系人邮箱',
  `li_fax` varchar(15) DEFAULT NULL COMMENT '联系人传真',
  `li_mobile_phone` varchar(11) DEFAULT NULL COMMENT '手机',
  `li_msn_qq` varchar(15) DEFAULT NULL COMMENT '联系人MSN或者QQ',
  `li_zip_code` varchar(8) DEFAULT NULL COMMENT '邮编',
  `li_homeaddress` varchar(50) DEFAULT NULL COMMENT '联系人家庭住址',
  `li_homephone` varchar(15) DEFAULT NULL COMMENT '联系人家庭电话',
  `li_birthday` datetime DEFAULT NULL COMMENT '联系人出生日期(yyyy-MM-dd)',
  `remark` varchar(30) DEFAULT NULL COMMENT '备注',
  `create_man` varchar(32) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `update_man` varchar(32) DEFAULT NULL COMMENT '最后修改人',
  `updatetime` datetime DEFAULT NULL COMMENT '最后修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户联系人';

/*Table structure for table `crm_client_share` */

DROP TABLE IF EXISTS `crm_client_share`;

CREATE TABLE `crm_client_share` (
  `id` char(32) NOT NULL DEFAULT '',
  `cs_clid` char(32) DEFAULT NULL COMMENT '客户信息外键id',
  `cs_fkid` char(32) DEFAULT NULL COMMENT '部门和联系人外键id',
  `cs_type` char(1) DEFAULT NULL COMMENT '1:部门id，2：用户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户共享表';

/*Table structure for table `crm_sell_activity` */

DROP TABLE IF EXISTS `crm_sell_activity`;

CREATE TABLE `crm_sell_activity` (
  `id` char(32) NOT NULL COMMENT '主键',
  `ac_title` varchar(50) NOT NULL COMMENT '活动主题',
  `ac_type` char(32) DEFAULT NULL COMMENT '活动方式',
  `ac_time` datetime DEFAULT NULL COMMENT '活动时间',
  `ac_danwei` char(50) NOT NULL COMMENT '单位（客户）',
  `ac_contacts` varchar(30) NOT NULL COMMENT '联系人(存名字，可选可填)',
  `ac_detail` varchar(500) DEFAULT NULL COMMENT '活动详情',
  `ac_our_staff` varchar(30) NOT NULL COMMENT '我方联系人（存名字可选可填）',
  `ac_place` varchar(50) DEFAULT NULL COMMENT '活动地点',
  `ac_duration` varchar(5) DEFAULT NULL COMMENT '持续时间',
  `ac_spend` float(10,2) DEFAULT NULL COMMENT '花费',
  `ac_give_gift` varchar(30) DEFAULT NULL COMMENT '赠送礼品',
  `ac_gift_num` int(8) DEFAULT NULL COMMENT '礼品数量',
  `ac_importance` char(1) DEFAULT NULL COMMENT '重要性(0一般1重要2非常重要)',
  `chanceid` char(32) DEFAULT NULL COMMENT '销售机会ID',
  `ac_create_man` char(32) NOT NULL COMMENT '创建人',
  `ac_create_time` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户活动';

/*Table structure for table `crm_sell_chance` */

DROP TABLE IF EXISTS `crm_sell_chance`;

CREATE TABLE `crm_sell_chance` (
  `id` char(32) NOT NULL DEFAULT '',
  `sc_info` char(32) DEFAULT NULL COMMENT '客户信息id',
  `sc_linkman` char(32) DEFAULT NULL COMMENT '联系人ID',
  `sc_name` varchar(50) DEFAULT NULL COMMENT '销售机会名称',
  `sc_source` char(32) DEFAULT NULL COMMENT '销售机会来源',
  `sc_status` char(32) DEFAULT NULL COMMENT '销售状态',
  `sc_picture` varchar(999) DEFAULT NULL COMMENT '销售机会描述',
  `sc_create` char(32) DEFAULT NULL COMMENT '录入人',
  `sc_createDate` datetime DEFAULT NULL COMMENT '录入时间',
  `sc_branch` varchar(3200) DEFAULT NULL COMMENT '负责部门',
  `sc_staff` varchar(3200) DEFAULT NULL COMMENT '负责人',
  `sc_date` datetime DEFAULT NULL COMMENT '分配时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='销售机会表';

/*Table structure for table `em_draftbox` */

DROP TABLE IF EXISTS `em_draftbox`;

CREATE TABLE `em_draftbox` (
  `id` char(32) NOT NULL DEFAULT '',
  `ed_inUid` varchar(9999) DEFAULT NULL COMMENT '收件人ID',
  `ed_name` varchar(50) DEFAULT NULL COMMENT '标题',
  `ed_detail` varchar(2000) DEFAULT NULL COMMENT '内容',
  `ed_outUid` char(32) DEFAULT NULL COMMENT '发件人ID',
  `ed_date` datetime DEFAULT NULL COMMENT '保存时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='草稿箱';

/*Table structure for table `em_draftbox_file` */

DROP TABLE IF EXISTS `em_draftbox_file`;

CREATE TABLE `em_draftbox_file` (
  `id` char(32) NOT NULL DEFAULT '',
  `df_edid` char(32) DEFAULT NULL COMMENT '草稿箱ID',
  `df_efid` char(32) DEFAULT NULL COMMENT '附件ID',
  PRIMARY KEY (`id`),
  KEY `df_edid_fk` (`df_edid`),
  KEY `df_efid_fk` (`df_efid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='草稿箱和附件的关联表';

/*Table structure for table `em_files` */

DROP TABLE IF EXISTS `em_files`;

CREATE TABLE `em_files` (
  `id` char(32) NOT NULL DEFAULT '',
  `ef_name` varchar(50) DEFAULT NULL COMMENT '原文件名',
  `ef_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称,UUID',
  `ef_ext` varchar(50) DEFAULT NULL COMMENT '后缀',
  `ef_size` int(50) DEFAULT NULL COMMENT '大小',
  `ef_num` int(11) DEFAULT '0' COMMENT '引用量',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='邮件附件';

/*Table structure for table `em_inbox` */

DROP TABLE IF EXISTS `em_inbox`;

CREATE TABLE `em_inbox` (
  `id` char(32) NOT NULL DEFAULT '',
  `ei_name` varchar(50) DEFAULT NULL COMMENT '标题',
  `ei_detail` varchar(2000) DEFAULT NULL COMMENT '内容',
  `ei_uid` char(32) DEFAULT NULL COMMENT '发件人',
  `ei_date` datetime DEFAULT NULL COMMENT '发送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收件箱';

/*Table structure for table `em_inbox_file` */

DROP TABLE IF EXISTS `em_inbox_file`;

CREATE TABLE `em_inbox_file` (
  `id` char(32) NOT NULL DEFAULT '',
  `if_eiid` char(32) DEFAULT NULL COMMENT '收件箱ID',
  `if_efid` char(32) DEFAULT NULL COMMENT '附件表ID',
  PRIMARY KEY (`id`),
  KEY `if_eiid_fk` (`if_eiid`),
  KEY `if_efid_fk` (`if_efid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收件箱和附件的关联表';

/*Table structure for table `em_inbox_outbox_user` */

DROP TABLE IF EXISTS `em_inbox_outbox_user`;

CREATE TABLE `em_inbox_outbox_user` (
  `id` char(32) NOT NULL DEFAULT '',
  `io_eoid` char(32) DEFAULT NULL COMMENT '发件箱ID',
  `io_eiid` char(32) DEFAULT NULL COMMENT '收件箱ID',
  `io_uid` char(32) DEFAULT NULL COMMENT '收件人ID',
  `io_status` varchar(5) DEFAULT NULL COMMENT '状态（已读未读）',
  PRIMARY KEY (`id`),
  KEY `io_uid_fk` (`io_uid`),
  KEY `io_eoid_fk` (`io_eoid`),
  KEY `io_eiid_fk` (`io_eiid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收件箱发件箱和人员的关联表';

/*Table structure for table `em_outbox` */

DROP TABLE IF EXISTS `em_outbox`;

CREATE TABLE `em_outbox` (
  `id` char(32) NOT NULL DEFAULT '',
  `eo_name` varchar(50) DEFAULT NULL COMMENT '标题',
  `eo_detail` varchar(2000) DEFAULT NULL COMMENT '内容',
  `eo_uid` char(32) DEFAULT NULL COMMENT '发件人ID',
  `eo_date` datetime DEFAULT NULL COMMENT '发送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发件箱';

/*Table structure for table `em_outbox_file` */

DROP TABLE IF EXISTS `em_outbox_file`;

CREATE TABLE `em_outbox_file` (
  `id` char(32) NOT NULL DEFAULT '',
  `of_eoid` char(32) DEFAULT NULL COMMENT '收件箱ID',
  `of_efid` char(32) DEFAULT NULL COMMENT '附件表ID',
  PRIMARY KEY (`id`),
  KEY `of_eoid_fk` (`of_eoid`),
  KEY `of_efid_fk` (`of_efid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发件箱和附件的关联表';

/*Table structure for table `em_recyclebox` */

DROP TABLE IF EXISTS `em_recyclebox`;

CREATE TABLE `em_recyclebox` (
  `id` varchar(32) NOT NULL,
  `er_table` int(11) DEFAULT NULL COMMENT '表类型（1:收件箱、2:发件箱、3:草稿箱）',
  `er_name` varchar(50) DEFAULT NULL COMMENT '标题',
  `er_detail` varchar(2000) DEFAULT NULL COMMENT '内容',
  `er_inuid` varchar(9999) DEFAULT NULL COMMENT '收件人ID',
  `er_outuid` varchar(32) DEFAULT NULL COMMENT '发件人id',
  `er_date` datetime DEFAULT NULL COMMENT '发送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `em_recyclebox_file` */

DROP TABLE IF EXISTS `em_recyclebox_file`;

CREATE TABLE `em_recyclebox_file` (
  `id` varchar(32) NOT NULL,
  `rf_efid` varchar(32) DEFAULT NULL COMMENT '附件表',
  `rf_erid` varchar(32) DEFAULT NULL COMMENT '草稿箱表',
  PRIMARY KEY (`id`),
  KEY `FK_iucqpgfjl8c66y0v22c65xtmr` (`rf_efid`),
  KEY `FK_yofi3xicdlalbxvxguf357tg` (`rf_erid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `idcard` */

DROP TABLE IF EXISTS `idcard`;

CREATE TABLE `idcard` (
  `uid` varchar(32) NOT NULL,
  `address` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`uid`),
  KEY `FK_ig7p62hvd1wgcifu60sdwtn5q` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `image_space` */

DROP TABLE IF EXISTS `image_space`;

CREATE TABLE `image_space` (
  `id` char(32) NOT NULL COMMENT '关联用户id',
  `_user_id` char(32) NOT NULL COMMENT '关联用户',
  `_name` varchar(50) NOT NULL COMMENT '相册名称',
  `_create_time` datetime NOT NULL COMMENT '创建时间',
  `_remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '类型：0：用户创建，1：word图片转存(系统创建)',
  PRIMARY KEY (`id`),
  KEY `image_space_ibfk_1` (`_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人图库--相册';

/*Table structure for table `image_space_img` */

DROP TABLE IF EXISTS `image_space_img`;

CREATE TABLE `image_space_img` (
  `id` char(32) NOT NULL,
  `_user_id` char(32) NOT NULL COMMENT '用户id',
  `_type` char(32) DEFAULT NULL COMMENT '图片类型id，关联image_space',
  `_name` varchar(255) DEFAULT NULL COMMENT '图片名称',
  `_ext` varchar(50) DEFAULT NULL COMMENT '后缀',
  `_size` int(11) DEFAULT NULL COMMENT '图片大小',
  `_create_time` datetime DEFAULT NULL COMMENT '上传时间',
  `_save_path` varchar(255) DEFAULT NULL COMMENT '保存地址',
  PRIMARY KEY (`id`),
  KEY `image_space_img_ibfk_1` (`_type`),
  KEY `_user_id` (`_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人图库--图片';

/*Table structure for table `list_values` */

DROP TABLE IF EXISTS `list_values`;

CREATE TABLE `list_values` (
  `id` char(32) CHARACTER SET utf8mb4 NOT NULL,
  `list_type` int(11) NOT NULL COMMENT '字典值类型',
  `list_value` varchar(50) CHARACTER SET utf8mb4 NOT NULL COMMENT '字典值',
  `list_desc` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '字典值说明',
  PRIMARY KEY (`id`),
  KEY `list_type` (`list_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典值';

/*Table structure for table `mt_mapping` */

DROP TABLE IF EXISTS `mt_mapping`;

CREATE TABLE `mt_mapping` (
  `id` char(32) NOT NULL DEFAULT '',
  `mp_mtid` char(32) DEFAULT NULL COMMENT '会议id',
  `mp_fkid` char(32) DEFAULT NULL COMMENT '部门ID,人员ID',
  `mp_type` char(32) DEFAULT NULL COMMENT '1部门ID,2人员ID',
  PRIMARY KEY (`id`),
  KEY `mp_mtid_fk` (`mp_mtid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会议--参与人员关联';

/*Table structure for table `mt_meeting` */

DROP TABLE IF EXISTS `mt_meeting`;

CREATE TABLE `mt_meeting` (
  `id` char(32) NOT NULL,
  `m_type` varchar(50) DEFAULT NULL COMMENT '会议类型',
  `m_name` varchar(50) DEFAULT NULL COMMENT '会议主题',
  `m_host` varchar(50) DEFAULT NULL COMMENT '主持人',
  `m_date` date DEFAULT NULL COMMENT '会议日期',
  `m_statime` varchar(50) DEFAULT NULL COMMENT '会议开始时间',
  `m_endtime` varchar(50) DEFAULT NULL COMMENT '会议结束时间',
  `m_rid` char(32) DEFAULT NULL COMMENT '会议室id',
  `m_summary` varchar(2000) DEFAULT NULL COMMENT '简介',
  `m_remark` varchar(2000) DEFAULT NULL COMMENT '备注',
  `m_published` varchar(50) DEFAULT NULL COMMENT '插入时间',
  `m_uid` char(32) DEFAULT NULL COMMENT '发布人员',
  PRIMARY KEY (`id`),
  KEY `fk` (`m_rid`),
  KEY `fk2` (`m_uid`),
  KEY `m_date` (`m_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会议管理';

/*Table structure for table `mt_room` */

DROP TABLE IF EXISTS `mt_room`;

CREATE TABLE `mt_room` (
  `id` char(32) NOT NULL,
  `mr_no` varchar(50) DEFAULT NULL COMMENT '会议室编号',
  `mr_name` varchar(50) DEFAULT NULL COMMENT '会议室名称',
  `mr_num` varchar(50) DEFAULT NULL COMMENT '容纳的人数',
  `mr_remark` varchar(9999) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会议室';

/*Table structure for table `newscomment` */

DROP TABLE IF EXISTS `newscomment`;

CREATE TABLE `newscomment` (
  `id` char(32) NOT NULL DEFAULT '' COMMENT '主键',
  `newscomments` text COMMENT '新闻评论内容',
  `conmmentsname_id` char(32) NOT NULL COMMENT '评论人姓名',
  `conmmentsdate` datetime NOT NULL COMMENT '评论日期',
  `newsid` char(64) NOT NULL COMMENT '新闻 id',
  `bycommentname_id` char(32) DEFAULT NULL COMMENT '被评论人姓名',
  PRIMARY KEY (`id`),
  KEY `newsid` (`newsid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='新闻评论表';

/*Table structure for table `newsmanagement` */

DROP TABLE IF EXISTS `newsmanagement`;

CREATE TABLE `newsmanagement` (
  `id` char(32) NOT NULL COMMENT '主键',
  `typeid` char(200) NOT NULL COMMENT '新闻类型',
  `newstitle` varchar(100) NOT NULL COMMENT '新闻标题',
  `plotsummary` varchar(200) DEFAULT NULL COMMENT '新闻简介',
  `newsplot` text COMMENT '新闻内容',
  `status` int(1) DEFAULT NULL COMMENT '状态',
  `promulgator` varchar(100) DEFAULT NULL COMMENT '发布人',
  `createdtime` datetime NOT NULL COMMENT '创建时间',
  `modifiedate` datetime NOT NULL COMMENT '修改时间',
  `hits` int(11) DEFAULT '0' COMMENT '点击数',
  `contents` int(11) DEFAULT '0' COMMENT '评论数',
  `allowcomment` int(1) DEFAULT NULL COMMENT '是否允许评论',
  `modifyByname` varchar(32) DEFAULT NULL COMMENT '修改人姓名',
  `stick` int(1) DEFAULT NULL COMMENT '是否置顶',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='新闻表';

/*Table structure for table `pe_deal` */

DROP TABLE IF EXISTS `pe_deal`;

CREATE TABLE `pe_deal` (
  `id` char(32) NOT NULL DEFAULT '',
  `pd_uid` varchar(999) DEFAULT NULL COMMENT '员工姓名(外键id)',
  `pd_idNo` varchar(50) DEFAULT NULL COMMENT '身份证号码',
  `pd_number` varchar(50) DEFAULT NULL,
  `pd_name` varchar(50) DEFAULT NULL COMMENT '合同名称',
  `pd_type` char(32) DEFAULT NULL COMMENT '合同类型',
  `pd_status` char(32) DEFAULT NULL COMMENT '合同状态',
  `pd_signDate` date DEFAULT NULL COMMENT '签订日期',
  `pd_signNumber` varchar(50) DEFAULT NULL COMMENT '签订次数',
  `pd_start` date DEFAULT NULL COMMENT '生效日期',
  `pd_end` date DEFAULT NULL COMMENT '结束日期',
  `pd_content` varchar(50) DEFAULT NULL COMMENT '合同内容',
  `pd_staffId` char(32) DEFAULT NULL COMMENT '创建人（外键ID）',
  `pd_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='合同信息';

/*Table structure for table `pe_file` */

DROP TABLE IF EXISTS `pe_file`;

CREATE TABLE `pe_file` (
  `id` char(32) NOT NULL DEFAULT '',
  `pe_name` varchar(50) DEFAULT NULL COMMENT '原文件名',
  `pe_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称,UUID',
  `pe_ext` varchar(50) DEFAULT NULL COMMENT '后缀',
  `pe_size` int(50) DEFAULT NULL COMMENT '大小',
  `pe_did` char(32) DEFAULT NULL COMMENT '关联合同表id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='合同附件表';

/*Table structure for table `pe_job` */

DROP TABLE IF EXISTS `pe_job`;

CREATE TABLE `pe_job` (
  `id` char(32) NOT NULL DEFAULT '',
  `pj_name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `pj_sex` varchar(50) DEFAULT NULL COMMENT '性别',
  `pj_birthdate` varchar(50) DEFAULT NULL COMMENT '出生日期',
  `pj_idNo` char(18) DEFAULT NULL COMMENT '身份证号',
  `pj_ethnic` varchar(50) DEFAULT NULL COMMENT '民族',
  `pj_marital` varchar(50) DEFAULT NULL COMMENT '婚姻状态',
  `pj_phone` varchar(50) DEFAULT NULL COMMENT '联系方式',
  `pj_height` varchar(50) DEFAULT NULL COMMENT '身高',
  `pj_qq` varchar(50) DEFAULT NULL COMMENT 'QQ号',
  `pj_education` varchar(50) DEFAULT NULL COMMENT '学历',
  `pj_degree` varchar(50) DEFAULT NULL COMMENT '学位',
  `pj_experience` varchar(50) DEFAULT NULL COMMENT '经验',
  `pj_address` varchar(500) DEFAULT NULL COMMENT '地址',
  `pj_hometown` varchar(500) DEFAULT NULL COMMENT '籍贯',
  `pj_post` varchar(50) DEFAULT NULL COMMENT '岗位',
  `pj_salary` varchar(50) DEFAULT NULL COMMENT '期望薪资',
  `pj_skill` varchar(500) DEFAULT NULL COMMENT '技能特长',
  `pj_jobStatus` varchar(50) DEFAULT NULL COMMENT '职位状态',
  `pj_eduTime1` varchar(50) DEFAULT NULL COMMENT '教育起止时间',
  `pj_school1` varchar(50) DEFAULT NULL COMMENT '毕业学校',
  `pj_specialty1` varchar(50) DEFAULT NULL COMMENT '专业',
  `pj_education1` varchar(50) DEFAULT NULL COMMENT '学历',
  `pj_eduTime2` varchar(50) DEFAULT NULL COMMENT '教育起止时间',
  `pj_school2` varchar(50) DEFAULT NULL COMMENT '毕业学校',
  `pj_specialty2` varchar(50) DEFAULT NULL COMMENT '专业',
  `pj_education2` varchar(50) DEFAULT NULL COMMENT '学历',
  `pj_eduTime3` varchar(50) DEFAULT NULL COMMENT '教育起止时间',
  `pj_school3` varchar(50) DEFAULT NULL COMMENT '毕业学校',
  `pj_specialty3` varchar(50) DEFAULT NULL COMMENT '专业',
  `pj_education3` varchar(50) DEFAULT NULL COMMENT '学历',
  `pj_workTime1` varchar(50) DEFAULT NULL COMMENT '工作起止时间',
  `pj_company1` varchar(50) DEFAULT NULL COMMENT '工作单位',
  `pj_position1` varchar(50) DEFAULT NULL COMMENT '职务',
  `pj_salary1` varchar(50) DEFAULT NULL COMMENT '薪资',
  `pj_leave1` varchar(500) DEFAULT NULL COMMENT '离职原因',
  `pj_workTime2` varchar(50) DEFAULT NULL COMMENT '工作起止时间',
  `pj_company2` varchar(50) DEFAULT NULL COMMENT '工作单位',
  `pj_position2` varchar(50) DEFAULT NULL COMMENT '职务',
  `pj_salary2` varchar(50) DEFAULT NULL COMMENT '薪资',
  `pj_leave2` varchar(500) DEFAULT NULL COMMENT '离职原因',
  `pj_workTime3` varchar(50) DEFAULT NULL COMMENT '工作起止时间',
  `pj_company3` varchar(50) DEFAULT NULL COMMENT '工作单位',
  `pj_position3` varchar(50) DEFAULT NULL COMMENT '职务',
  `pj_salary3` varchar(50) DEFAULT NULL COMMENT '薪资',
  `pj_leave3` varchar(500) DEFAULT NULL COMMENT '离职原因',
  `pj_workTime4` varchar(50) DEFAULT NULL COMMENT '工作起止时间',
  `pj_company4` varchar(50) DEFAULT NULL COMMENT '工作单位',
  `pj_position4` varchar(50) DEFAULT NULL COMMENT '职务',
  `pj_salary4` varchar(50) DEFAULT NULL COMMENT '薪资',
  `pj_leave4` varchar(500) DEFAULT NULL COMMENT '离职原因',
  `pj_workTime5` varchar(50) DEFAULT NULL COMMENT '工作起止时间',
  `pj_company5` varchar(50) DEFAULT NULL COMMENT '工作单位',
  `pj_position5` varchar(50) DEFAULT NULL COMMENT '职务',
  `pj_salary5` varchar(50) DEFAULT NULL COMMENT '薪资',
  `pj_leave5` varchar(500) DEFAULT NULL COMMENT '离职原因',
  `pj_call1` varchar(50) DEFAULT NULL COMMENT '称呼',
  `pj_name1` varchar(50) DEFAULT NULL COMMENT '姓名',
  `pj_unit1` varchar(50) DEFAULT NULL COMMENT '工作单位及职务',
  `pj_residence1` varchar(50) DEFAULT NULL COMMENT '住所',
  `pj_phone1` varchar(50) DEFAULT NULL COMMENT '联系电话',
  `pj_call2` varchar(50) DEFAULT NULL COMMENT '称呼',
  `pj_name2` varchar(50) DEFAULT NULL COMMENT '姓名',
  `pj_unit2` varchar(50) DEFAULT NULL COMMENT '工作单位及职务',
  `pj_residence2` varchar(50) DEFAULT NULL COMMENT '住所',
  `pj_phone2` varchar(50) DEFAULT NULL COMMENT '联系电话',
  `pj_call3` varchar(50) DEFAULT NULL COMMENT '称呼',
  `pj_name3` varchar(50) DEFAULT NULL COMMENT '姓名',
  `pj_unit3` varchar(50) DEFAULT NULL COMMENT '工作单位及职务',
  `pj_residence3` varchar(50) DEFAULT NULL COMMENT '住所',
  `pj_phone3` varchar(50) DEFAULT NULL COMMENT '联系电话',
  `pj_project` varchar(999) DEFAULT NULL COMMENT '项目介绍',
  `pj_plan` varchar(999) DEFAULT NULL COMMENT '职业规划',
  `pj_evaluate` varchar(999) DEFAULT NULL COMMENT '自我评价',
  `pj_result` varchar(999) DEFAULT NULL COMMENT '结果',
  `pj_date` date DEFAULT NULL COMMENT '填报日期',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='简历信息';

/*Table structure for table `pe_salary` */

DROP TABLE IF EXISTS `pe_salary`;

CREATE TABLE `pe_salary` (
  `id` char(32) NOT NULL,
  `s_id` char(32) DEFAULT NULL COMMENT '员工id',
  `salary` double(10,2) DEFAULT NULL COMMENT '薪资',
  `s_explain` varchar(500) DEFAULT NULL COMMENT '薪资说明',
  `userid` char(32) DEFAULT NULL COMMENT '操作人',
  `s_date` datetime DEFAULT NULL COMMENT '操作时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='薪资表';

/*Table structure for table `pe_staff` */

DROP TABLE IF EXISTS `pe_staff`;

CREATE TABLE `pe_staff` (
  `id` char(32) NOT NULL DEFAULT '',
  `ps_name` varchar(50) DEFAULT NULL COMMENT '员工姓名',
  `ps_sex` varchar(2) DEFAULT NULL COMMENT '性别',
  `ps_birthday` date DEFAULT NULL COMMENT '生日',
  `ps_age` int(11) DEFAULT NULL COMMENT '年龄',
  `ps_presentAddress` varchar(200) DEFAULT NULL COMMENT '现居住地',
  `ps_homePhone` varchar(15) DEFAULT NULL COMMENT '家庭电话',
  `ps_phone` varchar(50) DEFAULT NULL COMMENT '手机号',
  `ps_other` varchar(15) DEFAULT NULL COMMENT '其他联系人',
  `ps_accountAddress` varchar(200) DEFAULT NULL COMMENT '户口所在地',
  `ps_ethnic` varchar(50) DEFAULT NULL COMMENT '民族',
  `ps_card` varchar(50) DEFAULT NULL COMMENT '身份证号',
  `ps_homeTown` varchar(200) DEFAULT NULL COMMENT '籍贯',
  `ps_userId` char(32) DEFAULT NULL COMMENT '用户帐户',
  `ps_staffId` varchar(50) DEFAULT NULL COMMENT '员工编号',
  `ps_wage` varchar(50) DEFAULT NULL COMMENT '工资卡号',
  `ps_social` varchar(50) DEFAULT NULL COMMENT '社保号',
  `ps_edu` char(32) DEFAULT NULL COMMENT '学历',
  `ps_specialty` varchar(50) DEFAULT NULL COMMENT '专业',
  `ps_school` varchar(50) DEFAULT NULL COMMENT '毕业学校',
  `ps_graduation` date DEFAULT NULL COMMENT '毕业时间',
  `ps_status` varchar(50) DEFAULT NULL COMMENT '职位状态（在职，离职，退休）',
  `ps_type` char(32) DEFAULT NULL COMMENT '职位类型',
  `ps_post` char(32) DEFAULT NULL COMMENT '职位',
  `ps_entryDate` date DEFAULT NULL COMMENT '入职时间',
  `ps_resReason` char(32) DEFAULT NULL COMMENT '离职原因',
  `ps_resDate` date DEFAULT NULL COMMENT '离职时间',
  `ps_resRemark` varchar(500) DEFAULT NULL COMMENT '离职备注',
  `ps_retReason` char(32) DEFAULT NULL COMMENT '退休原因',
  `ps_retRemark` varchar(500) DEFAULT NULL COMMENT '退休备注',
  `ps_retDate` date DEFAULT NULL COMMENT '退休时间',
  `ps_uid` char(32) DEFAULT NULL COMMENT '录入人',
  `ps_inDate` date DEFAULT NULL COMMENT '录入时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='员工信息表';

/*Table structure for table `per_instant_message` */

DROP TABLE IF EXISTS `per_instant_message`;

CREATE TABLE `per_instant_message` (
  `id` char(32) NOT NULL,
  `send_uid` char(32) NOT NULL COMMENT '发送人id',
  `receive_uid` char(32) NOT NULL COMMENT '接收人id',
  `create_time` datetime NOT NULL COMMENT '发送时间',
  `message_content` text COMMENT '消息内容',
  `read_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '消息读取状态，1：已读，0：未读',
  PRIMARY KEY (`id`),
  KEY `per_instant_message_ibfk_2` (`receive_uid`),
  KEY `per_instant_message_ibfk_1` (`send_uid`),
  KEY `create_time` (`create_time`),
  KEY `read_state` (`read_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='即时消息';

/*Table structure for table `per_msg` */

DROP TABLE IF EXISTS `per_msg`;

CREATE TABLE `per_msg` (
  `id` char(32) NOT NULL,
  `user_id` char(32) NOT NULL COMMENT '用户id',
  `msg_type` tinyint(4) NOT NULL COMMENT '消息类型',
  `table_id` varchar(64) NOT NULL COMMENT '内容表id',
  `msg_time` datetime NOT NULL COMMENT '发送时间',
  `read_state` tinyint(1) NOT NULL COMMENT '消息读取状态，1：已读，0：未读',
  PRIMARY KEY (`id`),
  KEY `per_msg_ibfk_1` (`user_id`),
  KEY `msg_time` (`msg_time`),
  KEY `read_state` (`read_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息提醒';

/*Table structure for table `per_schedule` */

DROP TABLE IF EXISTS `per_schedule`;

CREATE TABLE `per_schedule` (
  `id` char(32) NOT NULL,
  `user_id` char(32) NOT NULL COMMENT '日程安排所属人',
  `sch_title` varchar(50) NOT NULL COMMENT '主题',
  `sch_type` char(32) DEFAULT NULL COMMENT '日程安排类型',
  `start_time` datetime NOT NULL COMMENT '开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `warn_time` datetime NOT NULL COMMENT '提醒时间',
  `sch_content` text NOT NULL COMMENT '详细内容',
  PRIMARY KEY (`id`),
  KEY `per_schedule_ibfk_1` (`user_id`),
  KEY `start_time` (`start_time`),
  KEY `warn_time` (`warn_time`),
  KEY `per_schedule_ibfk_2` (`sch_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日程安排';

/*Table structure for table `pm_file` */

DROP TABLE IF EXISTS `pm_file`;

CREATE TABLE `pm_file` (
  `id` varchar(32) NOT NULL,
  `create_date` datetime DEFAULT NULL,
  `create_employee_id` varchar(32) DEFAULT NULL,
  `last_date` datetime DEFAULT NULL,
  `last_employee_id` varchar(32) DEFAULT NULL,
  `length_id` varchar(32) DEFAULT NULL,
  `plan_id` varchar(32) DEFAULT NULL,
  `prj_id` varchar(32) DEFAULT NULL,
  `pm_did` varchar(100) NOT NULL,
  `pm_ext` varchar(100) NOT NULL,
  `pm_name` varchar(200) NOT NULL,
  `pm_new_name` varchar(100) NOT NULL,
  `pm_size` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目管理文件表';

/*Table structure for table `pm_project_flow` */

DROP TABLE IF EXISTS `pm_project_flow`;

CREATE TABLE `pm_project_flow` (
  `id` varchar(32) NOT NULL,
  `create_date` datetime DEFAULT NULL,
  `create_employee_id` varchar(32) DEFAULT NULL,
  `last_date` datetime DEFAULT NULL,
  `last_employee_id` varchar(32) DEFAULT NULL,
  `dept` varchar(100) DEFAULT NULL,
  `dept_id` varchar(32) DEFAULT NULL,
  `lx_date` datetime DEFAULT NULL,
  `prj_code` varchar(100) DEFAULT NULL,
  `prj_content` varchar(200) DEFAULT NULL,
  `prj_name` varchar(100) DEFAULT NULL,
  `prj_source` varchar(32) DEFAULT NULL,
  `prj_status` varchar(32) DEFAULT NULL,
  `prj_total` double DEFAULT NULL,
  `prj_type` varchar(32) DEFAULT NULL,
  `prj_bz` varchar(200) DEFAULT NULL,
  `prj_fzr` varchar(32) DEFAULT NULL,
  `prj_fzr_id` varchar(32) DEFAULT NULL,
  `prj_yjr` varchar(32) DEFAULT NULL,
  `prj_yjr_id` varchar(32) DEFAULT NULL,
  `subject` varchar(100) DEFAULT NULL,
  `subject_id` varchar(32) DEFAULT NULL,
  `syrs` int(11) DEFAULT NULL,
  `ygcb` double DEFAULT NULL,
  `yglr` double DEFAULT NULL,
  `yjjs_time` datetime DEFAULT NULL,
  `yjks_time` datetime DEFAULT NULL,
  `zj_source` varchar(32) DEFAULT NULL,
  `zycd` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目立项';

/*Table structure for table `pm_project_flow_file` */

DROP TABLE IF EXISTS `pm_project_flow_file`;

CREATE TABLE `pm_project_flow_file` (
  `id` varchar(32) NOT NULL,
  `create_date` datetime DEFAULT NULL,
  `create_employee_id` varchar(32) DEFAULT NULL,
  `pm_did` varchar(100) NOT NULL,
  `pm_ext` varchar(100) NOT NULL,
  `pm_name` varchar(200) NOT NULL,
  `pm_new_name` varchar(100) NOT NULL,
  `pm_size` int(11) DEFAULT NULL,
  `upload_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目立项-附件表';

/*Table structure for table `pm_subject_one` */

DROP TABLE IF EXISTS `pm_subject_one`;

CREATE TABLE `pm_subject_one` (
  `id` varchar(32) NOT NULL,
  `beizu` varchar(500) DEFAULT NULL,
  `code` varchar(32) DEFAULT NULL,
  `content` varchar(500) DEFAULT NULL,
  `name` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='科目1';

/*Table structure for table `pm_subject_two` */

DROP TABLE IF EXISTS `pm_subject_two`;

CREATE TABLE `pm_subject_two` (
  `id` varchar(32) NOT NULL,
  `beizu` varchar(500) DEFAULT NULL,
  `code` varchar(32) DEFAULT NULL,
  `content` varchar(500) DEFAULT NULL,
  `name` varchar(32) DEFAULT NULL,
  `pid` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='科目2';

/*Table structure for table `project` */

DROP TABLE IF EXISTS `project`;

CREATE TABLE `project` (
  `id` char(32) CHARACTER SET utf8mb4 NOT NULL,
  `_name` varchar(100) NOT NULL COMMENT '名称',
  `_type` char(32) DEFAULT NULL COMMENT '项目类型',
  `_importance` char(32) DEFAULT NULL COMMENT '重要程度',
  `_area` char(32) DEFAULT NULL COMMENT '项目地区',
  `_status` tinyint(4) NOT NULL COMMENT '状态,0:未开始,1:运行中,2:暂停,3:结束',
  `_start_time` datetime NOT NULL COMMENT '开始时间',
  `_end_time` datetime NOT NULL COMMENT '结束时间',
  `_create_user_id` char(32) DEFAULT NULL COMMENT '创建人',
  `_create_time` datetime NOT NULL COMMENT '创建时间',
  `_update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `_content` longtext COMMENT '项目内容',
  `_notify` smallint(6) DEFAULT '0' COMMENT '是否发送微信通知,0:未通知',
  `_customer` varchar(50) DEFAULT NULL COMMENT '客户接口人姓名+联系方式',
  `_contractno` varchar(30) NOT NULL COMMENT '合同编号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目管理';

/*Table structure for table `project_area` */

DROP TABLE IF EXISTS `project_area`;

CREATE TABLE `project_area` (
  `id` int(11) NOT NULL COMMENT 'ID',
  `area` varchar(30) CHARACTER SET utf8mb4 NOT NULL COMMENT '区域名称',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ukey` (`area`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目区域表，加这个主要是为了查询按区域排序';

/*Table structure for table `project_files` */

DROP TABLE IF EXISTS `project_files`;

CREATE TABLE `project_files` (
  `id` char(32) NOT NULL,
  `_project_id` char(32) NOT NULL COMMENT '关联项目id',
  `_title` varchar(50) NOT NULL COMMENT '标题',
  `_content` text COMMENT '内容',
  `_create_user_id` char(32) DEFAULT NULL COMMENT '创建人',
  `_create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `_update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `_files` text COMMENT '附件信息,json格式',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目 文档';

/*Table structure for table `project_task` */

DROP TABLE IF EXISTS `project_task`;

CREATE TABLE `project_task` (
  `id` char(32) CHARACTER SET utf8mb4 NOT NULL,
  `_project_id` char(32) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '关联项目id',
  `_name` varchar(100) NOT NULL COMMENT '任务名称',
  `_start_time` datetime NOT NULL COMMENT '开始时间',
  `_end_time` datetime NOT NULL COMMENT '结束时间',
  `_content` varchar(1000) DEFAULT NULL COMMENT '内容',
  `_create_user_id` char(32) NOT NULL COMMENT '创建人',
  `_create_time` datetime NOT NULL COMMENT '创建时间',
  `_update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `_speed` tinyint(4) DEFAULT NULL COMMENT '进度%数 范围:1-100',
  `_notify` smallint(6) DEFAULT '0' COMMENT '是否发送微信通知,0:未通知',
  PRIMARY KEY (`id`),
  KEY `project_task_ibfk_1` (`_project_id`),
  KEY `_name` (`_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目--任务';

/*Table structure for table `project_task_journal` */

DROP TABLE IF EXISTS `project_task_journal`;

CREATE TABLE `project_task_journal` (
  `id` char(32) NOT NULL,
  `_project_task_id` char(32) NOT NULL COMMENT '关联的任务id',
  `_start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `_end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `_content` varchar(255) NOT NULL COMMENT '进度说明 内容',
  `_journal` varchar(100) NOT NULL COMMENT '进度日志，由系统自动生成',
  `_create_user_id` char(32) NOT NULL COMMENT '创建人',
  `_create_time` datetime NOT NULL COMMENT '创建时间',
  `_update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目任务进度日志';

/*Table structure for table `project_task_journal_comment` */

DROP TABLE IF EXISTS `project_task_journal_comment`;

CREATE TABLE `project_task_journal_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID, 主键,自增',
  `_create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `_project_task_journal_id` char(32) NOT NULL COMMENT '关联的任务日志id',
  `_user_id` char(50) NOT NULL COMMENT '评论人id',
  `_content` varchar(200) NOT NULL COMMENT '评论内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目任务进度日志评论';

/*Table structure for table `project_task_user` */

DROP TABLE IF EXISTS `project_task_user`;

CREATE TABLE `project_task_user` (
  `id` char(32) CHARACTER SET utf8mb4 NOT NULL,
  `_project_id` char(32) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '关联项目id',
  `_project_task_id` char(32) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '关联的任务表id',
  `_user_id` char(32) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '任务负责人id',
  `_create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  KEY `_project_task_id` (`_project_task_id`),
  KEY `key_projectid` (`_project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目任务--负责人关联表';

/*Table structure for table `project_user` */

DROP TABLE IF EXISTS `project_user`;

CREATE TABLE `project_user` (
  `id` char(100) CHARACTER SET utf8mb4 NOT NULL,
  `_project_id` char(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '关联的项目id',
  `_type` tinyint(4) NOT NULL COMMENT '关联人类型,1:负责人，2:授权部门,3:授权人员',
  `_table_id` char(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '关联表id',
  `_create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `project_id_type_table_id` (`_project_id`,`_type`,`_table_id`),
  KEY `project_user_ibfk_1` (`_project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目--负责人 关联表';

/*Table structure for table `qywx_party` */

DROP TABLE IF EXISTS `qywx_party`;

CREATE TABLE `qywx_party` (
  `Id` int(11) NOT NULL COMMENT 'ID, 主键,部门Id',
  `createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `Name` varchar(100) DEFAULT NULL COMMENT '部门名称',
  `ParentId` int(11) DEFAULT NULL COMMENT '父部门id',
  `Order` int(11) DEFAULT NULL COMMENT '部门排序',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企业微信部门信息表';

/*Table structure for table `qywx_user` */

DROP TABLE IF EXISTS `qywx_user`;

CREATE TABLE `qywx_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID, 主键,自增',
  `createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `UserID` varchar(50) NOT NULL COMMENT '成员UserID',
  `Name` varchar(100) DEFAULT NULL COMMENT '成员名称',
  `Department` varchar(100) DEFAULT NULL COMMENT '成员部门列表',
  `Mobile` varchar(30) DEFAULT NULL COMMENT '手机号码',
  `Position` varchar(65) DEFAULT NULL COMMENT '职位信息',
  `Gender` smallint(6) DEFAULT NULL COMMENT '性别，1表示男性，2表示女性',
  `Email` varchar(50) DEFAULT NULL COMMENT '邮箱',
  `Status` smallint(6) DEFAULT NULL COMMENT '激活状态：1=已激活 2=已禁用 4=未激活 已激活代表已激活企业微信或已关注微工作台（原企业号）',
  `Avatar` varchar(255) DEFAULT NULL COMMENT '头像url。注：如果要获取小图将url最后的”/0”改成”/100”即可',
  `EnglishName` varchar(50) DEFAULT NULL COMMENT '英文名',
  `IsLeader` smallint(6) DEFAULT NULL COMMENT '上级字段，标识是否为上级。0表示普通成员，1表示上级',
  `Telephone` varchar(20) DEFAULT NULL COMMENT '座机',
  `ExtAttr` varchar(255) DEFAULT NULL COMMENT '扩展属性',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ukey_userid` (`UserID`)
) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=utf8mb4 COMMENT='企业微信成员信息表';

/*Table structure for table `rg_rulesregulations` */

DROP TABLE IF EXISTS `rg_rulesregulations`;

CREATE TABLE `rg_rulesregulations` (
  `id` char(32) NOT NULL COMMENT '主键',
  `typeid` char(32) NOT NULL COMMENT '规章类型',
  `contents` text NOT NULL COMMENT '内容',
  `promulgator` char(32) NOT NULL COMMENT '作者',
  `createdate` datetime NOT NULL COMMENT '创建日期',
  `modifiedate` datetime NOT NULL COMMENT '修改日期',
  `rulestitle` char(50) NOT NULL,
  `modifyByname` char(32) DEFAULT NULL COMMENT '修改人姓民',
  PRIMARY KEY (`id`),
  KEY `createdate` (`createdate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='规章管理';

/*Table structure for table `rm_rulesmanager` */

DROP TABLE IF EXISTS `rm_rulesmanager`;

CREATE TABLE `rm_rulesmanager` (
  `id` char(32) NOT NULL,
  `rules_title` varchar(50) NOT NULL COMMENT '法规标题',
  `rules_typeid` char(32) NOT NULL COMMENT '法规类型',
  `author` char(32) NOT NULL COMMENT '作者',
  `modyauthor` char(32) DEFAULT NULL COMMENT '修改人',
  `createdate` datetime NOT NULL COMMENT '创建日期',
  `Modydate` datetime NOT NULL COMMENT '修改日期',
  `contents` text NOT NULL COMMENT '内容',
  PRIMARY KEY (`id`),
  KEY `createdate` (`createdate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='法规管理';

/*Table structure for table `sy_action` */

DROP TABLE IF EXISTS `sy_action`;

CREATE TABLE `sy_action` (
  `id` char(32) NOT NULL,
  `menu_id` char(32) NOT NULL COMMENT '此操作关联的菜单ID,0代表系统公共权限',
  `action_sort` smallint(6) NOT NULL COMMENT 'action 排序，用于显示',
  `action_name` varchar(50) NOT NULL COMMENT '操作名称',
  `action_url` varchar(500) NOT NULL COMMENT '请求url,不需要参数，如果还有多个请求用，隔开',
  PRIMARY KEY (`id`),
  KEY `menu_id` (`menu_id`),
  KEY `action_sort` (`action_sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='action操作表';

/*Table structure for table `sy_company` */

DROP TABLE IF EXISTS `sy_company`;

CREATE TABLE `sy_company` (
  `id` char(32) NOT NULL,
  `c_name` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `c_code` varchar(20) DEFAULT NULL COMMENT '企业代码',
  `c_explain` varchar(500) DEFAULT NULL COMMENT '企业说明',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企业信息表';

/*Table structure for table `sy_data_permissions` */

DROP TABLE IF EXISTS `sy_data_permissions`;

CREATE TABLE `sy_data_permissions` (
  `id` char(32) NOT NULL DEFAULT '',
  `_name` varchar(50) NOT NULL COMMENT '模块名称',
  `_type` varchar(10) NOT NULL COMMENT '模块类型编码',
  `_rules` text COMMENT 'json格式的过滤规则',
  `_desc` varchar(255) DEFAULT NULL COMMENT '说明',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据权限';

/*Table structure for table `sy_dept` */

DROP TABLE IF EXISTS `sy_dept`;

CREATE TABLE `sy_dept` (
  `id` char(32) NOT NULL,
  `dept_sort` smallint(6) NOT NULL COMMENT '部门排序号,范围1-999',
  `dept_name` varchar(50) NOT NULL COMMENT '部门名称',
  `dept_phone` varchar(255) DEFAULT '' COMMENT '部门电话',
  `dept_fax` varchar(255) DEFAULT '' COMMENT '部门传真',
  `dept_address` varchar(100) DEFAULT '' COMMENT '部门地址',
  `super_id` char(32) NOT NULL DEFAULT '0' COMMENT '上级部门id,若无上级，则为0',
  `lead_uid` char(32) DEFAULT '0' COMMENT '部门主管，0为无主管',
  `dept_desc` varchar(200) DEFAULT '' COMMENT '部门表述',
  PRIMARY KEY (`id`),
  KEY `super_id` (`super_id`),
  KEY `dept_sort` (`dept_sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门表';

/*Table structure for table `sy_district` */

DROP TABLE IF EXISTS `sy_district`;

CREATE TABLE `sy_district` (
  `id` char(32) NOT NULL,
  `super_id` char(32) DEFAULT NULL COMMENT '上级id,0代表顶级',
  `dis_sort` smallint(6) NOT NULL COMMENT '排序号,用一级下数值越小越靠前',
  `dis_name` varchar(50) NOT NULL COMMENT '名称',
  `dis_desc` varchar(100) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `dis_sort` (`dis_sort`),
  KEY `dis_name` (`dis_name`),
  KEY `sy_district_ibfk_1` (`super_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='行政区划分表,用于省市县的选择';

/*Table structure for table `sy_log` */

DROP TABLE IF EXISTS `sy_log`;

CREATE TABLE `sy_log` (
  `id` char(32) NOT NULL,
  `user_id` char(32) NOT NULL COMMENT '用户id',
  `action_time` datetime NOT NULL COMMENT '操作时间',
  `action_content` varchar(20) DEFAULT '' COMMENT '操作内容',
  `action_ip` varchar(50) DEFAULT '' COMMENT 'ip地址',
  `action_ip_info` varchar(200) DEFAULT '' COMMENT 'ip地址信息',
  `action_desc` varchar(100) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `sy_log_ibfk_1` (`user_id`),
  KEY `action_time` (`action_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统重要操作日志';

/*Table structure for table `sy_login_log` */

DROP TABLE IF EXISTS `sy_login_log`;

CREATE TABLE `sy_login_log` (
  `id` char(32) NOT NULL,
  `user_id` char(32) NOT NULL COMMENT '用户id',
  `login_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '登录时间',
  `login_ip` varchar(50) DEFAULT '' COMMENT 'ip地址',
  `ip_info_country` varchar(50) DEFAULT '' COMMENT 'ip地址所在国家',
  `ip_info_region` varchar(30) DEFAULT '' COMMENT 'ip地址所在省份',
  `ip_info_city` varchar(30) DEFAULT '' COMMENT 'ip所属城市',
  `ip_info_isp` varchar(20) DEFAULT '' COMMENT 'ip地址所属运营商',
  `login_type` tinyint(4) DEFAULT NULL COMMENT '登录来源方式，1：web,2:android',
  `login_desc` varchar(50) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `sy_login_log_ibfk_1` (`user_id`),
  KEY `login_time` (`login_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统登录日志';

/*Table structure for table `sy_masinfo` */

DROP TABLE IF EXISTS `sy_masinfo`;

CREATE TABLE `sy_masinfo` (
  `id` char(32) NOT NULL,
  `url` varchar(200) DEFAULT NULL COMMENT '数据库连接',
  `user` varchar(50) DEFAULT NULL COMMENT 'mas账户',
  `pw` varchar(50) DEFAULT NULL COMMENT 'mas密码',
  `luser` varchar(50) DEFAULT NULL COMMENT '登录用户',
  `lpw` varchar(50) DEFAULT NULL COMMENT '登录密码',
  `orgcode` varchar(50) DEFAULT NULL COMMENT '短信的源地址',
  `serviceid` varchar(50) DEFAULT NULL COMMENT '业务代码',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='mas信息表';

/*Table structure for table `sy_menu` */

DROP TABLE IF EXISTS `sy_menu`;

CREATE TABLE `sy_menu` (
  `id` char(32) NOT NULL,
  `menu_super_id` char(32) DEFAULT '' COMMENT '上级菜单id',
  `menu_status` tinyint(4) DEFAULT '1' COMMENT '菜单状态：1：可用，0：不可用',
  `menu_sort` smallint(6) DEFAULT '1' COMMENT '菜单排序号，范围1-999',
  `menu_name` varchar(20) DEFAULT NULL COMMENT '菜单名称',
  `menu_icon` varchar(100) DEFAULT NULL COMMENT '菜单显示的图片路径',
  `menu_url` varchar(255) DEFAULT NULL COMMENT '链接url',
  `menu_target` varchar(10) DEFAULT 'navTab' COMMENT '打开位置',
  `menu_rel` varchar(20) DEFAULT '' COMMENT 'dwz 标签id,指定在哪个标签打开',
  `menu_open` char(5) DEFAULT 'false' COMMENT '是否打开true;false',
  `menu_external` char(5) DEFAULT 'false' COMMENT 'dwz参数,是否以iframe方式引入,',
  `menu_fresh` char(5) DEFAULT 'true' COMMENT 'dwz参数，表示重复打开navTab时是否重新加载数据',
  PRIMARY KEY (`id`),
  KEY `menu_status` (`menu_status`),
  KEY `menu_super_id` (`menu_super_id`),
  KEY `menu_sort` (`menu_sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统菜单';

/*Table structure for table `sy_menu_my` */

DROP TABLE IF EXISTS `sy_menu_my`;

CREATE TABLE `sy_menu_my` (
  `id` char(32) NOT NULL,
  `_user_id` char(32) NOT NULL COMMENT '关联用户',
  `_menu_id` char(32) NOT NULL COMMENT '关联菜单id',
  `_sort` smallint(6) NOT NULL COMMENT '菜单排序号，范围1-999',
  PRIMARY KEY (`id`),
  KEY `sy_menu_my_ibfk_1` (`_user_id`),
  KEY `_menu_id` (`_menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统菜单--我的快捷菜单';

/*Table structure for table `sy_role` */

DROP TABLE IF EXISTS `sy_role`;

CREATE TABLE `sy_role` (
  `id` char(32) NOT NULL,
  `role_name` varchar(20) NOT NULL COMMENT '角色名称',
  `role_desc` varchar(255) DEFAULT '' COMMENT '角色描述',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_name` (`role_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';

/*Table structure for table `sy_role_action` */

DROP TABLE IF EXISTS `sy_role_action`;

CREATE TABLE `sy_role_action` (
  `id` char(32) NOT NULL,
  `role_id` char(32) NOT NULL COMMENT '角色id',
  `action_id` char(32) NOT NULL COMMENT '权限id',
  PRIMARY KEY (`id`),
  KEY `sy_role_action_ibfk_1` (`role_id`),
  KEY `action_id` (`action_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色--操作  关联表';

/*Table structure for table `sy_role_menu` */

DROP TABLE IF EXISTS `sy_role_menu`;

CREATE TABLE `sy_role_menu` (
  `id` char(32) NOT NULL,
  `role_id` char(32) NOT NULL COMMENT '角色ID',
  `menu_id` char(32) NOT NULL COMMENT '菜单ID',
  PRIMARY KEY (`id`),
  KEY `sy_role_menu_ibfk_1` (`role_id`),
  KEY `sy_role_menu_ibfk_2` (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色--权限  关联表';

/*Table structure for table `sy_sms_history` */

DROP TABLE IF EXISTS `sy_sms_history`;

CREATE TABLE `sy_sms_history` (
  `id` char(32) NOT NULL COMMENT 'uuid',
  `sms_content` varchar(200) NOT NULL COMMENT '短信内容',
  `sms__send_id` char(32) DEFAULT NULL COMMENT '发送人id',
  `sms_create_time` datetime DEFAULT NULL COMMENT '短信发送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信发送记录表';

/*Table structure for table `sy_sms_receive` */

DROP TABLE IF EXISTS `sy_sms_receive`;

CREATE TABLE `sy_sms_receive` (
  `id` char(32) NOT NULL,
  `sms_id` char(32) DEFAULT NULL COMMENT '短信历史记录id',
  `receive_phone` char(11) DEFAULT NULL COMMENT '接收人手机号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信接收人表\r\n';

/*Table structure for table `sy_table_custom` */

DROP TABLE IF EXISTS `sy_table_custom`;

CREATE TABLE `sy_table_custom` (
  `id` char(32) NOT NULL,
  `tb_type` tinyint(4) NOT NULL COMMENT '类型，不同类型对应不同表',
  `field_sort` smallint(6) NOT NULL DEFAULT '1' COMMENT '顺序号',
  `field_name` varchar(30) NOT NULL COMMENT '表字段对应的javaBean属性名称',
  `field_type` tinyint(4) NOT NULL COMMENT '属性类型',
  `field_title` varchar(20) NOT NULL COMMENT '默认的显示名',
  `field_another_title` varchar(20) DEFAULT NULL COMMENT '显示的别名，如果没有则显示默认名称',
  `is_export` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否导出，1：导出，0：不导出',
  `is_print` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否打印,1:打印，0,不打印',
  `is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否显示，1：显示，0：不显示',
  PRIMARY KEY (`id`),
  KEY `tb_type` (`tb_type`),
  KEY `field_name` (`field_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='导入导出,表的自定义设置';

/*Table structure for table `sy_user_role` */

DROP TABLE IF EXISTS `sy_user_role`;

CREATE TABLE `sy_user_role` (
  `id` char(32) NOT NULL,
  `user_id` char(32) NOT NULL COMMENT '用户id',
  `role_id` char(32) NOT NULL COMMENT '角色id',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `sy_user_role_ibfk_2` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户--角色  关联表';

/*Table structure for table `sy_users` */

DROP TABLE IF EXISTS `sy_users`;

CREATE TABLE `sy_users` (
  `id` char(32) CHARACTER SET utf8mb4 NOT NULL,
  `user_name` varchar(40) CHARACTER SET utf8mb4 NOT NULL COMMENT '登陆账号',
  `true_name` varchar(40) CHARACTER SET utf8mb4 NOT NULL COMMENT '真实姓名',
  `user_password` char(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '密码',
  `register_time` datetime NOT NULL COMMENT '注册时间',
  `last_login_time` datetime DEFAULT NULL COMMENT '最后登陆时间',
  `last_login_ip` varchar(50) CHARACTER SET utf8mb4 DEFAULT 'x.x.x.x' COMMENT '最后登录IP',
  `error_time` datetime DEFAULT NULL COMMENT '登录错误时间',
  `error_count` int(11) NOT NULL DEFAULT '0' COMMENT '登录错误次数',
  `user_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '账号状态 1:正常 0 禁止登陆',
  `dept_id` char(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '所属部门id',
  `user_desc` varchar(50) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '用户说明',
  `user_sex` tinyint(1) NOT NULL DEFAULT '0' COMMENT '性别，1表示男性，2表示女性',
  `register_uid` char(32) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '注册人',
  `mobile_phone_number` char(11) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '手机号',
  `isleader` tinyint(1) DEFAULT '0' COMMENT '上级字段，标识是否为上级。0表示普通成员，1表示上级',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_name` (`user_name`),
  KEY `user_status` (`user_status`),
  KEY `register_time` (`register_time`),
  KEY `sy_users_ibfk_1` (`dept_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统用户表; ';

/*Table structure for table `tp_correlation` */

DROP TABLE IF EXISTS `tp_correlation`;

CREATE TABLE `tp_correlation` (
  `id` char(32) NOT NULL COMMENT '主键',
  `fkid` char(32) DEFAULT NULL COMMENT '部门、人员ID',
  `voteid` char(32) DEFAULT NULL COMMENT '投票id',
  `type` char(32) DEFAULT NULL COMMENT '0 部门id  1人员id',
  PRIMARY KEY (`id`),
  KEY `voteid` (`voteid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投票发布范围关联表';

/*Table structure for table `tp_count` */

DROP TABLE IF EXISTS `tp_count`;

CREATE TABLE `tp_count` (
  `id` char(32) NOT NULL,
  `userid` char(32) DEFAULT NULL COMMENT '用户id',
  `titleid` char(32) DEFAULT NULL COMMENT '题目id',
  `voteid` char(32) DEFAULT NULL COMMENT '投票id',
  `votedetailid` char(32) DEFAULT NULL COMMENT '选项id',
  `votetime` datetime DEFAULT NULL COMMENT '投票日期',
  `textarea` varchar(1000) DEFAULT NULL COMMENT '文本投票存入值',
  PRIMARY KEY (`id`),
  KEY `voteid` (`voteid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投票统计';

/*Table structure for table `tp_question` */

DROP TABLE IF EXISTS `tp_question`;

CREATE TABLE `tp_question` (
  `id` char(32) NOT NULL COMMENT '主键',
  `title` varchar(200) DEFAULT NULL COMMENT '题目',
  `voteid` char(32) DEFAULT NULL COMMENT '投票id',
  `seqnum` int(10) DEFAULT NULL COMMENT '排序号',
  `type` tinyint(4) DEFAULT NULL COMMENT '题目类型  0 单选 1 多选 2 文本',
  PRIMARY KEY (`id`),
  KEY `voteid` (`voteid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='子投票';

/*Table structure for table `tp_vote` */

DROP TABLE IF EXISTS `tp_vote`;

CREATE TABLE `tp_vote` (
  `id` char(32) NOT NULL COMMENT '主键',
  `tp_title` varchar(100) NOT NULL COMMENT '标题',
  `tp_describe` varchar(200) DEFAULT NULL COMMENT '投票描述',
  `tp_seeresult` tinyint(4) DEFAULT NULL COMMENT '查看投票结果 0 投票后可看1投票前可看2不允许查看',
  `tp_anonymous` tinyint(4) DEFAULT '0' COMMENT '是否匿名投票  0不允许 1允许',
  `tp_validity` date NOT NULL COMMENT '生效日期   yyyy_mm_dd    控制用户可以投票',
  `tp_expiry` date DEFAULT NULL COMMENT '终止日期  yyyy_mm_dd   控制用户可以投票',
  `tp_stick` tinyint(4) NOT NULL COMMENT '是否置顶  0 不置顶  1置顶',
  `userid` char(32) DEFAULT NULL COMMENT '发布人',
  `tp_createtime` datetime NOT NULL COMMENT '创建时间',
  `tp_publishtime` datetime DEFAULT NULL COMMENT '发布时间   控制投票谁可以看到',
  `stuts` tinyint(4) DEFAULT '0' COMMENT '状态  0 未发布 1生效   2终止         新建投票默认0未发布',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投票表';

/*Table structure for table `tp_votedetail` */

DROP TABLE IF EXISTS `tp_votedetail`;

CREATE TABLE `tp_votedetail` (
  `id` char(32) NOT NULL COMMENT '主键',
  `optiondesc` varchar(200) DEFAULT NULL COMMENT '选项',
  `titleid` char(32) DEFAULT NULL COMMENT '题目id和表tp_question关联',
  PRIMARY KEY (`id`),
  KEY `titleid` (`titleid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投票选项';

/*Table structure for table `user` */

DROP TABLE IF EXISTS `user`;

CREATE TABLE `user` (
  `id` varchar(32) NOT NULL,
  `name` varchar(50) NOT NULL COMMENT '名称',
  PRIMARY KEY (`id`),
  KEY `FK_8qtpnv06elxuryeuv1ac4ximm` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `vm_accident` */

DROP TABLE IF EXISTS `vm_accident`;

CREATE TABLE `vm_accident` (
  `id` char(32) NOT NULL,
  `happendate` date DEFAULT NULL COMMENT '发生日期',
  `summary` text COMMENT '事故概要',
  `byname` varchar(10) DEFAULT NULL COMMENT '对方姓名 ',
  `byaddress` varchar(50) DEFAULT NULL COMMENT '对方地址',
  `byphone` varchar(50) DEFAULT NULL COMMENT '对方电话',
  `insurancecompensation` float(11,0) DEFAULT NULL COMMENT '保险理陪金额',
  `indemnitycompensation` float(11,0) DEFAULT NULL COMMENT '对方赔偿金额',
  `happenplace` varchar(50) DEFAULT NULL COMMENT '发生地点',
  `licenseno` char(32) DEFAULT NULL COMMENT '车牌号',
  `createdate` datetime DEFAULT NULL COMMENT '制作日期',
  `promulgator` char(32) DEFAULT NULL,
  `drivingno` char(32) DEFAULT NULL COMMENT '司机编号',
  `accidentconfirm` varchar(10) DEFAULT NULL COMMENT '事故确认者',
  `contentreconciliation` text COMMENT '和解内容',
  `cgmoney` float(11,2) DEFAULT NULL COMMENT '公司暂负金额',
  `selfgmomey` float(11,2) DEFAULT NULL COMMENT '本人暂负金额',
  `bylicensenumber_id` char(32) DEFAULT NULL COMMENT '对方车牌号码',
  `remark` text,
  PRIMARY KEY (`id`),
  KEY `drivingno` (`drivingno`),
  KEY `licenseno` (`licenseno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事故管理';

/*Table structure for table `vm_drivertable` */

DROP TABLE IF EXISTS `vm_drivertable`;

CREATE TABLE `vm_drivertable` (
  `id` char(32) NOT NULL,
  `drivingno` varchar(30) DEFAULT NULL COMMENT '驾驶证号',
  `drivingage` varchar(5) DEFAULT NULL COMMENT '驾龄',
  `allowdriving` varchar(20) DEFAULT NULL COMMENT '准驾车型',
  `registerdate` date DEFAULT NULL COMMENT '领证时间',
  `papervaliddate` date DEFAULT NULL COMMENT '到期时间',
  `gender` char(1) DEFAULT NULL COMMENT '性别',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `phone` char(50) DEFAULT NULL COMMENT '电话',
  `address` varchar(50) DEFAULT NULL COMMENT '地址',
  `checkrecord` text COMMENT '年检记录',
  `remark` text COMMENT ' 备注 ',
  `promulgator` char(32) NOT NULL COMMENT '添加人',
  `drivingname` varchar(20) NOT NULL COMMENT '姓名',
  `createdate` datetime DEFAULT NULL COMMENT '创建日期',
  `modydate` datetime DEFAULT NULL COMMENT '修改日期',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='驾驶员';

/*Table structure for table `vm_vehiclemanagement` */

DROP TABLE IF EXISTS `vm_vehiclemanagement`;

CREATE TABLE `vm_vehiclemanagement` (
  `id` char(32) NOT NULL,
  `vehicletype_id` char(32) NOT NULL COMMENT '车辆类型id',
  `buydate` date DEFAULT NULL COMMENT '购买日期',
  `weight` varchar(4) DEFAULT NULL COMMENT '载重',
  `status` char(4) NOT NULL COMMENT '状态',
  `usingunit` varchar(50) DEFAULT NULL COMMENT '使用单位',
  `insurancetime` date DEFAULT NULL COMMENT '保险时间',
  `cinsurancetime` date DEFAULT NULL COMMENT '强制保险时间',
  `promulgator` char(32) NOT NULL COMMENT '添加人',
  `price` decimal(14,2) DEFAULT NULL COMMENT '价格',
  `pono` varchar(30) DEFAULT NULL COMMENT '出厂编号',
  `remark` text COMMENT '备注',
  `enginenumber` char(32) NOT NULL COMMENT '发动机编号',
  `seat` tinyint(2) DEFAULT NULL COMMENT '座位',
  `createdate` datetime NOT NULL COMMENT '创建日期',
  `modydate` datetime NOT NULL COMMENT '修改日期',
  `licenseno` char(32) NOT NULL COMMENT '车牌号',
  `usingpersonal` varchar(10) DEFAULT NULL COMMENT '使用者',
  `drivingno` char(32) DEFAULT NULL COMMENT ' 驾驶员编号',
  `bypromulgator` char(32) DEFAULT NULL COMMENT '  修改人',
  PRIMARY KEY (`id`),
  KEY `drivingno` (`drivingno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='车辆管理';

/*Table structure for table `wd_cf_type` */

DROP TABLE IF EXISTS `wd_cf_type`;

CREATE TABLE `wd_cf_type` (
  `id` varchar(32) NOT NULL,
  `_super_id` char(32) NOT NULL COMMENT '上级id',
  `_sort_number` smallint(6) NOT NULL COMMENT '顺序号',
  `_name` varchar(50) NOT NULL COMMENT '类别名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司文档类型，相当于文件夹';

/*Table structure for table `wd_cf_type_powers` */

DROP TABLE IF EXISTS `wd_cf_type_powers`;

CREATE TABLE `wd_cf_type_powers` (
  `id` char(32) NOT NULL,
  `_cf_type_id` char(32) NOT NULL COMMENT '文档类型id',
  `_table_ids` text NOT NULL COMMENT '关联的ids,多个用，隔开',
  `_type` tinyint(4) NOT NULL COMMENT '类型:1:部门,2:用户',
  `_power_add` tinyint(4) DEFAULT NULL COMMENT '新增权限,1：有',
  `_power_update` tinyint(4) DEFAULT NULL COMMENT '编辑权限,1：有',
  `_power_delete` tinyint(4) DEFAULT NULL COMMENT '删除权限,1：有',
  PRIMARY KEY (`id`),
  KEY `wd_cf_type_powers_ibfk_1` (`_cf_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司文档类型 授权权限';

/*Table structure for table `wd_cf_type_users` */

DROP TABLE IF EXISTS `wd_cf_type_users`;

CREATE TABLE `wd_cf_type_users` (
  `id` char(32) NOT NULL,
  `_cf_type_id` char(32) NOT NULL COMMENT '文档类型id',
  `_cf_type_power_id` char(32) NOT NULL COMMENT '文档管理权限表id，',
  `_type` tinyint(4) NOT NULL COMMENT '类型:1:部门,2:用户',
  `_table_id` char(32) NOT NULL COMMENT '关联的id，用户id，或部门id',
  PRIMARY KEY (`id`),
  KEY `wd_cf_type_users_ibfk_2` (`_cf_type_power_id`),
  KEY `wd_cf_type_users_ibfk_1` (`_cf_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司文档类型关联的用户,部门';

/*Table structure for table `wd_company_files` */

DROP TABLE IF EXISTS `wd_company_files`;

CREATE TABLE `wd_company_files` (
  `id` char(32) NOT NULL,
  `wd_super_id` char(32) DEFAULT NULL COMMENT '公司文档类型id',
  `wd_name` varchar(50) NOT NULL COMMENT '文件名',
  `wd_user_id` char(32) DEFAULT NULL COMMENT '创建人id',
  `wd_create_time` datetime NOT NULL COMMENT '创建时间',
  `wd_type` tinyint(1) NOT NULL COMMENT '类型；0：目录，1：文件',
  `wd_desc` varchar(50) DEFAULT '' COMMENT '文件说明',
  `wd_new_name` varchar(32) DEFAULT '' COMMENT '保存时的文件名称',
  `wd_ext` varchar(50) DEFAULT '' COMMENT '文件后缀',
  `wd_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`),
  KEY `wd_create_time` (`wd_create_time`),
  KEY `wd_super_id` (`wd_super_id`),
  KEY `wd_company_files_ibfk_1` (`wd_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司文档';

/*Table structure for table `wd_personal_files` */

DROP TABLE IF EXISTS `wd_personal_files`;

CREATE TABLE `wd_personal_files` (
  `id` char(32) NOT NULL,
  `wd_super_id` char(32) NOT NULL COMMENT '上级文件id，0代表最顶层',
  `wd_name` varchar(50) NOT NULL COMMENT '文件名',
  `wd_user_id` char(32) NOT NULL COMMENT '创建人id',
  `wd_create_time` datetime NOT NULL COMMENT '创建时间',
  `wd_type` tinyint(1) NOT NULL COMMENT '类型；0：目录，1：文件',
  `wd_desc` varchar(50) DEFAULT '' COMMENT '文件说明',
  `wd_new_name` char(32) DEFAULT '' COMMENT '保存时的文件名称,UUID',
  `wd_ext` varchar(50) DEFAULT '' COMMENT '文件后缀',
  `wd_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`),
  KEY `wd_personal_files_ibfk_1` (`wd_user_id`),
  KEY `wd_create_time` (`wd_create_time`),
  KEY `wd_type` (`wd_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人文档';

/*Table structure for table `wd_share_files` */

DROP TABLE IF EXISTS `wd_share_files`;

CREATE TABLE `wd_share_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID, 主键,自增',
  `wd_create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建(分享)时间',
  `wd_user_id` char(32) NOT NULL COMMENT '创建(分享)人id',
  `wd_file_id` char(32) NOT NULL COMMENT '文件id，对应个人文档表id',
  `wd_share_users` varchar(200) NOT NULL COMMENT '分享给用户的id,多个以逗号","分隔',
  PRIMARY KEY (`id`),
  KEY `wd_create_time` (`wd_create_time`),
  KEY `wd_user_id` (`wd_user_id`),
  KEY `wd_file_id` (`wd_file_id`),
  KEY `wd_share_users` (`wd_share_users`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分享文档';

/*Table structure for table `wf_flow_assignment` */

DROP TABLE IF EXISTS `wf_flow_assignment`;

CREATE TABLE `wf_flow_assignment` (
  `id` char(32) NOT NULL,
  `flow_key` varchar(255) NOT NULL COMMENT '流程定义key',
  `flow_deployment_id` varchar(20) NOT NULL COMMENT '流程定义部署id',
  `flow_node_name` varchar(255) DEFAULT NULL COMMENT '节点名称',
  `userids` varchar(255) DEFAULT NULL COMMENT '任务分配用户ids,多个,隔开',
  `groupids` varchar(255) DEFAULT NULL COMMENT '任务分配组(角色)id,多个，隔开',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程定义任务分配';

/*Table structure for table `wf_form` */

DROP TABLE IF EXISTS `wf_form`;

CREATE TABLE `wf_form` (
  `id` char(32) NOT NULL,
  `_type` tinyint(4) DEFAULT NULL COMMENT '表单类型，1:工作表单，2：任务表单',
  `form_name` varchar(50) DEFAULT NULL COMMENT '表单名称',
  `update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
  `update_user_id` char(32) DEFAULT NULL COMMENT '最后修改人',
  `complete_page_url` varchar(255) DEFAULT NULL COMMENT '获取任务处理页面url',
  `complete_url` varchar(255) DEFAULT NULL COMMENT '提交 任务处理 url',
  `form_html` longtext COMMENT '表单内容',
  `form_desc` varchar(255) DEFAULT NULL COMMENT '备注',
  `flow_type` varchar(255) DEFAULT NULL COMMENT '流程表单类型，对应菜单id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作流--表单';

/*Table structure for table `wf_task` */

DROP TABLE IF EXISTS `wf_task`;

CREATE TABLE `wf_task` (
  `id` varchar(64) NOT NULL COMMENT '任务id,同流程定义任务id,程序设置',
  `work_id` varchar(64) NOT NULL COMMENT '工作id，同流程实例id',
  `task_assignee` char(32) DEFAULT NULL COMMENT '任务执行人',
  `task_name` varchar(255) DEFAULT NULL COMMENT '任务名称',
  `task_owner` char(32) DEFAULT NULL COMMENT '任务委托人',
  `form_html` longtext COMMENT '任务表单',
  `complete_time` datetime DEFAULT NULL COMMENT '完成任务时间',
  PRIMARY KEY (`id`),
  KEY `work_id` (`work_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作流程--任务';

/*Table structure for table `wf_task_files` */

DROP TABLE IF EXISTS `wf_task_files`;

CREATE TABLE `wf_task_files` (
  `id` char(32) NOT NULL,
  `work_id` varchar(64) DEFAULT NULL COMMENT '流程id',
  `task_id` varchar(64) DEFAULT NULL COMMENT '任务id',
  `file_name` varchar(255) DEFAULT NULL COMMENT '文件名',
  `file_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称,UUID',
  `file_ext` varchar(50) DEFAULT '' COMMENT '文件后缀',
  `file_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程任务附件';

/*Table structure for table `wf_work` */

DROP TABLE IF EXISTS `wf_work`;

CREATE TABLE `wf_work` (
  `id` varchar(64) NOT NULL COMMENT '流程实例ID,程序设置',
  `process_definition_id` varchar(255) NOT NULL COMMENT '流程定义id',
  `workflow_id` char(32) NOT NULL COMMENT 'wf_workflow表id',
  `work_title` varchar(255) DEFAULT NULL COMMENT '工作标题',
  `flow_name` varchar(255) DEFAULT NULL COMMENT '流程名称',
  `user_id` char(32) NOT NULL COMMENT '创建人',
  `start_time` datetime DEFAULT NULL COMMENT '创建时间',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `form_html` longtext COMMENT '工作表单',
  `work_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0:运行中，1:结束',
  `work_url` varchar(255) DEFAULT NULL COMMENT '工作表单',
  `fid` varchar(255) DEFAULT NULL COMMENT '发起流程的表id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作流程--新建工作';

/*Table structure for table `wf_work_files` */

DROP TABLE IF EXISTS `wf_work_files`;

CREATE TABLE `wf_work_files` (
  `id` char(32) NOT NULL,
  `work_id` varchar(64) NOT NULL COMMENT '流程id',
  `file_name` varchar(255) DEFAULT NULL COMMENT '文件名',
  `file_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称,UUID',
  `file_ext` varchar(50) DEFAULT '' COMMENT '文件后缀',
  `file_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程附件';

/*Table structure for table `wf_workflow` */

DROP TABLE IF EXISTS `wf_workflow`;

CREATE TABLE `wf_workflow` (
  `id` char(32) NOT NULL,
  `is_enable` tinyint(4) DEFAULT NULL COMMENT '是否可用，1：可用，0:禁用',
  `flow_id` varchar(255) DEFAULT NULL COMMENT '同流程定义id(key)一致',
  `flow_type` char(32) DEFAULT NULL COMMENT '流程类型',
  `flow_name` varchar(255) DEFAULT NULL COMMENT '流程名称',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user_id` char(32) DEFAULT NULL COMMENT '创建人',
  `flow_desc` varchar(255) DEFAULT NULL COMMENT '备注',
  `release_state` tinyint(4) NOT NULL COMMENT '发布状态,0 未发布，1已发布,2:已发布，有更新',
  `version_num` int(11) NOT NULL DEFAULT '0' COMMENT '现存的版本数量',
  `update_user_id` char(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_desc` varchar(255) DEFAULT NULL COMMENT '更新原因',
  `flow_xml` longtext COMMENT '流程定义xml',
  `dept_type` varchar(32) DEFAULT NULL COMMENT '菜单类型',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作流--流程定义';

/*Table structure for table `wf_workflow_listener` */

DROP TABLE IF EXISTS `wf_workflow_listener`;

CREATE TABLE `wf_workflow_listener` (
  `_id` char(32) NOT NULL,
  `_name` varchar(255) DEFAULT NULL COMMENT '监听器名称',
  `_type` tinyint(4) DEFAULT NULL COMMENT '监听器类型，1:执行监听器,2:任务监听器',
  `_event` varchar(20) DEFAULT NULL COMMENT '监听器事件',
  `_value_type` tinyint(4) DEFAULT NULL COMMENT '执行的类型，1:class;2:expression',
  `_value` varchar(255) DEFAULT NULL COMMENT '执行内容,类名称或表达式',
  `_fields_json` varchar(4000) DEFAULT NULL COMMENT '字段注入,json格式,例:[{"name":"u","stringValue":"123","expression":"${exp}"}]',
  `_desc` varchar(255) DEFAULT NULL COMMENT '说明',
  PRIMARY KEY (`_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程监听器';

/*Table structure for table `wf_workflow_powers` */

DROP TABLE IF EXISTS `wf_workflow_powers`;

CREATE TABLE `wf_workflow_powers` (
  `id` char(32) NOT NULL,
  `work_id` char(32) NOT NULL COMMENT 'wf_workflow表id',
  `power_id` char(32) DEFAULT NULL COMMENT '关联的id',
  `power_type` tinyint(4) DEFAULT NULL COMMENT '类型,0:所有人都可使用,1:部门,2:用户',
  PRIMARY KEY (`id`),
  KEY `wf_workflow_powers_ibfk_1` (`work_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程--用户 权限关联表';

/*Table structure for table `xt_affiche` */

DROP TABLE IF EXISTS `xt_affiche`;

CREATE TABLE `xt_affiche` (
  `id` char(32) NOT NULL,
  `affiche_title` varchar(50) NOT NULL COMMENT '标题',
  `affiche_type` char(32) DEFAULT '' COMMENT '公告类型',
  `create_time` datetime NOT NULL COMMENT '发布时间',
  `user_id` char(32) DEFAULT '' COMMENT '发布人',
  `affiche_content` text NOT NULL COMMENT '公告内容',
  `is_top` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶, 1:置顶，0，不置顶',
  PRIMARY KEY (`id`),
  KEY `xt_affiche_ibfk_1` (`affiche_type`),
  KEY `xt_affiche_ibfk_2` (`user_id`),
  KEY `create_time` (`create_time`),
  KEY `is_top` (`is_top`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统公告';

/*Table structure for table `xt_affiche_dept` */

DROP TABLE IF EXISTS `xt_affiche_dept`;

CREATE TABLE `xt_affiche_dept` (
  `id` char(32) NOT NULL,
  `affiche_title` varchar(50) NOT NULL COMMENT '标题',
  `affiche_type` char(32) DEFAULT '' COMMENT '公告类型',
  `create_time` datetime NOT NULL COMMENT '发布时间',
  `user_id` char(32) DEFAULT '' COMMENT '发布人',
  `affiche_content` text NOT NULL COMMENT '公告内容',
  `dept_id` char(32) NOT NULL COMMENT '部门id',
  `is_top` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶, 1:置顶，0，不置顶',
  PRIMARY KEY (`id`),
  KEY `xt_affiche_dept_ibfk_1` (`dept_id`),
  KEY `xt_affiche_dept_ibfk_2` (`affiche_type`),
  KEY `user_id` (`user_id`),
  KEY `create_time` (`create_time`),
  KEY `is_top` (`is_top`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门公告';

/*Table structure for table `xt_att` */

DROP TABLE IF EXISTS `xt_att`;

CREATE TABLE `xt_att` (
  `id` char(32) NOT NULL DEFAULT '',
  `name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `att_time` datetime DEFAULT NULL COMMENT '登记时间',
  `state` char(1) DEFAULT NULL COMMENT '状态 0 上班 1 下班  2 早退或迟到 3其他',
  `imptime` datetime DEFAULT NULL COMMENT '导入时间',
  `impuser` char(32) DEFAULT NULL COMMENT '导入人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考勤机考勤数据';

/*Table structure for table `xt_attendance_close` */

DROP TABLE IF EXISTS `xt_attendance_close`;

CREATE TABLE `xt_attendance_close` (
  `id` char(32) NOT NULL,
  `xtatimeid` varchar(500) DEFAULT NULL COMMENT '考勤登记时间设置表id',
  `name` varchar(100) DEFAULT NULL COMMENT '名称',
  `startdate` datetime DEFAULT NULL COMMENT '开始时间',
  `enddate` datetime DEFAULT NULL COMMENT '结束时间',
  `createtime` datetime DEFAULT NULL,
  `createuser` char(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设置休息日';

/*Table structure for table `xt_attendance_sign` */

DROP TABLE IF EXISTS `xt_attendance_sign`;

CREATE TABLE `xt_attendance_sign` (
  `id` char(32) NOT NULL,
  `att_type` char(1) DEFAULT NULL COMMENT '考勤登记类型 1 第一次上班 2第一次下班 3 第二次上班 4 第二次下班 5 第三次上班 6 第三次下班',
  `signtime` varchar(10) DEFAULT NULL COMMENT '登记时间 HH:mm:ss',
  `signdate` varchar(20) DEFAULT NULL COMMENT '签到日期yyyy-MM-dd',
  `signuser` char(32) DEFAULT NULL COMMENT '签到人',
  `islate` char(1) DEFAULT NULL COMMENT '是否迟到 0表示正常考勤 1 表示迟到 2 表示早退 3 请假 4 旷工 5外出 6 其他',
  `repairtime` datetime DEFAULT NULL COMMENT '补录时间',
  `repairuser` char(32) DEFAULT NULL COMMENT '补录人',
  `repairexplain` varchar(150) DEFAULT NULL COMMENT '补录说明',
  `creattime` datetime DEFAULT NULL COMMENT '操作时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考勤登记记录';

/*Table structure for table `xt_attendance_time` */

DROP TABLE IF EXISTS `xt_attendance_time`;

CREATE TABLE `xt_attendance_time` (
  `id` char(32) NOT NULL,
  `name` varchar(100) DEFAULT NULL COMMENT '设考勤时间类型名称',
  `firstup` varchar(10) DEFAULT NULL COMMENT '第一次上班时间',
  `firstdown` varchar(10) DEFAULT NULL COMMENT '第一次下班',
  `secondup` varchar(10) DEFAULT NULL COMMENT '第二次上班',
  `seconddown` varchar(10) DEFAULT NULL COMMENT '第二次下班时间',
  `thirdup` varchar(10) DEFAULT NULL COMMENT '第三次上班时间',
  `thirddown` varchar(10) DEFAULT NULL COMMENT '第三次下班时间',
  `upstart` int(4) DEFAULT NULL COMMENT '上班开始打卡时间(分钟)',
  `upend` int(4) DEFAULT NULL COMMENT '上班结束打卡时间(分钟)',
  `downstart` int(4) DEFAULT NULL COMMENT '下班开始打卡时间(分钟)',
  `downend` int(4) DEFAULT NULL COMMENT '下班班结束打卡时间(分钟)',
  `worktime` varchar(50) DEFAULT NULL COMMENT '保存工作时间,如周一周二上班 则存1:1,2,3;2:1,2,3',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `createuser` char(32) DEFAULT NULL COMMENT '创建人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设置上下班时间';

/*Table structure for table `xt_attendance_time_user` */

DROP TABLE IF EXISTS `xt_attendance_time_user`;

CREATE TABLE `xt_attendance_time_user` (
  `id` char(32) NOT NULL DEFAULT '',
  `attime_id` char(32) DEFAULT NULL COMMENT '考勤登记时间设置id',
  `user_id` char(32) DEFAULT NULL COMMENT '用户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考勤登记时间与用户关联表';

/*Table structure for table `xt_journal` */

DROP TABLE IF EXISTS `xt_journal`;

CREATE TABLE `xt_journal` (
  `id` char(32) NOT NULL,
  `journal_type` char(32) DEFAULT '' COMMENT '日志类型,字典值ID',
  `journal_title` varchar(100) NOT NULL COMMENT '日志主题',
  `journal_content` text COMMENT '日志内容',
  `user_id` char(32) NOT NULL COMMENT '创建者',
  `journal_time` datetime NOT NULL COMMENT '日志时间',
  PRIMARY KEY (`id`),
  KEY `xt_journal_ibfk_1` (`journal_type`),
  KEY `xt_journal_ibfk_2` (`user_id`),
  KEY `journal_time` (`journal_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作日志;';

/*Table structure for table `xt_journal_user` */

DROP TABLE IF EXISTS `xt_journal_user`;

CREATE TABLE `xt_journal_user` (
  `id` char(32) NOT NULL,
  `journal_id` char(32) NOT NULL COMMENT '日志id',
  `user_id` char(32) NOT NULL COMMENT '指定共享用户id',
  PRIMARY KEY (`id`),
  KEY `xt_journal_user_ibfk_2` (`user_id`),
  KEY `xt_journal_user_ibfk_1` (`journal_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志--共享人';

/*Table structure for table `xt_notice` */

DROP TABLE IF EXISTS `xt_notice`;

CREATE TABLE `xt_notice` (
  `id` char(32) NOT NULL COMMENT 'uuid',
  `notice_title` varchar(100) NOT NULL COMMENT '标题',
  `notice_type` char(32) DEFAULT '' COMMENT '通知类型,字典值id',
  `notice_send_id` char(32) NOT NULL COMMENT '发送人id',
  `notice_create_time` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `notice_send_id` (`notice_send_id`),
  KEY `notice_create_time` (`notice_create_time`),
  KEY `notice_type` (`notice_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知公告; ';

/*Table structure for table `xt_notice_content` */

DROP TABLE IF EXISTS `xt_notice_content`;

CREATE TABLE `xt_notice_content` (
  `notice_id` char(32) NOT NULL COMMENT 'notice主表id,',
  `notice_content` text NOT NULL COMMENT '通知详细内容',
  `userIds` text COMMENT '接收用户id,多个，隔开',
  `deptIds` text COMMENT '接收部门id,多个，隔开',
  PRIMARY KEY (`notice_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知内容表';

/*Table structure for table `xt_notice_files` */

DROP TABLE IF EXISTS `xt_notice_files`;

CREATE TABLE `xt_notice_files` (
  `id` char(32) NOT NULL,
  `notice_id` char(32) NOT NULL COMMENT 'notice 通知表id',
  `file_name` varchar(255) DEFAULT NULL COMMENT '文件名',
  `file_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称,UUID',
  `file_ext` varchar(50) DEFAULT '' COMMENT '文件后缀',
  `file_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`),
  KEY `notice_id` (`notice_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知附件';

/*Table structure for table `xt_notice_receive` */

DROP TABLE IF EXISTS `xt_notice_receive`;

CREATE TABLE `xt_notice_receive` (
  `id` char(32) NOT NULL,
  `notice_id` char(32) NOT NULL COMMENT '公告通知主表ID',
  `user_id` char(32) NOT NULL COMMENT '接收者id',
  `read_time` datetime DEFAULT NULL COMMENT '阅读时间,null代表还未阅读',
  PRIMARY KEY (`id`),
  KEY `xt_notice_receive_ibfk_1` (`notice_id`),
  KEY `xt_notice_receive_ibfk_2` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=' 通知接收人关联表';

/*Table structure for table `xt_onduty` */

DROP TABLE IF EXISTS `xt_onduty`;

CREATE TABLE `xt_onduty` (
  `id` char(32) NOT NULL,
  `userid` char(32) DEFAULT NULL COMMENT '值班人',
  `type` char(32) DEFAULT NULL COMMENT '值班类型',
  `title` varchar(100) DEFAULT NULL COMMENT '标题',
  `content` text COMMENT '内容',
  `starttime` datetime DEFAULT NULL COMMENT '值班开始时间',
  `endtime` datetime DEFAULT NULL COMMENT '值班结束时间',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  `createuser` char(32) DEFAULT NULL COMMENT '创建人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='值班记录';

/*Table structure for table `xt_onduty_files` */

DROP TABLE IF EXISTS `xt_onduty_files`;

CREATE TABLE `xt_onduty_files` (
  `id` char(32) NOT NULL,
  `dutyid` char(32) NOT NULL COMMENT '值班记录id',
  `file_name` varchar(255) DEFAULT NULL COMMENT '文件名',
  `file_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称UUID',
  `file_ext` varchar(50) DEFAULT NULL COMMENT '文件后缀',
  `file_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`),
  KEY `dutyid` (`dutyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='值班记录附件';

/*Table structure for table `xt_sellers_locus` */

DROP TABLE IF EXISTS `xt_sellers_locus`;

CREATE TABLE `xt_sellers_locus` (
  `id` char(32) NOT NULL,
  `userid` char(32) DEFAULT NULL COMMENT '销售员登录id',
  `title` varchar(200) DEFAULT NULL COMMENT '标题',
  `longitude` double(10,6) DEFAULT NULL COMMENT '地理纬度',
  `latitude` double(10,6) DEFAULT NULL COMMENT '地理纬度。 ',
  `address` varchar(200) DEFAULT NULL COMMENT '地址',
  `ltime` varchar(20) DEFAULT NULL COMMENT '记录时间',
  `modifytime` varchar(20) DEFAULT NULL COMMENT '修改时间',
  `modifyuser` char(32) DEFAULT NULL COMMENT '修改人',
  `createuser` char(32) DEFAULT NULL COMMENT '创建人',
  `createtime` varchar(20) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='销售人员位置信息表';

/*Table structure for table `xt_up_image` */

DROP TABLE IF EXISTS `xt_up_image`;

CREATE TABLE `xt_up_image` (
  `id` char(32) NOT NULL,
  `title` varchar(200) DEFAULT NULL COMMENT '标题',
  `content` text COMMENT '内容',
  `longitude` double(10,6) DEFAULT NULL COMMENT '经度',
  `latitude` double(10,6) DEFAULT NULL COMMENT '纬度',
  `address` varchar(100) DEFAULT NULL COMMENT '上传地址',
  `uptime` varchar(20) DEFAULT NULL COMMENT '记录时间',
  `modifytime` datetime DEFAULT NULL COMMENT '修改时间',
  `modifyuser` char(32) DEFAULT NULL COMMENT '修改人',
  `createuser` char(32) DEFAULT NULL COMMENT '创建人',
  `createtime` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `up_image_mtime` (`modifytime`),
  KEY `up_image_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='上传图片管理';

/*Table structure for table `xt_up_image_files` */

DROP TABLE IF EXISTS `xt_up_image_files`;

CREATE TABLE `xt_up_image_files` (
  `id` char(32) NOT NULL,
  `image_id` char(32) DEFAULT NULL COMMENT '上传图片id',
  `file_name` varchar(255) DEFAULT NULL COMMENT '文件名',
  `file_new_name` char(32) DEFAULT NULL COMMENT '保存时的文件名称UUID',
  `file_ext` varchar(50) DEFAULT NULL COMMENT '文件后缀',
  `file_size` int(11) DEFAULT NULL COMMENT '文件大小',
  PRIMARY KEY (`id`),
  KEY `up_image_files_id` (`id`),
  KEY `up_image_file_iid` (`image_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='上传图片位置保存信息';

/*Table structure for table `xt_work_plan` */

DROP TABLE IF EXISTS `xt_work_plan`;

CREATE TABLE `xt_work_plan` (
  `id` char(100) NOT NULL,
  `_name` varchar(100) DEFAULT NULL COMMENT '计划名称',
  `_type` char(32) DEFAULT NULL COMMENT '类型',
  `_status` tinyint(4) DEFAULT NULL COMMENT '状态:0:未开始，1:进行中,2:暂停,3:结束',
  `_start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `_end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `_create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `_create_user_id` char(32) DEFAULT NULL COMMENT '创建人',
  `_remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `_content` longtext COMMENT '计划内容',
  `_files` text COMMENT '附件信息,json格式',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作计划';

/*Table structure for table `xt_work_plan_comment` */

DROP TABLE IF EXISTS `xt_work_plan_comment`;

CREATE TABLE `xt_work_plan_comment` (
  `id` char(32) NOT NULL,
  `_work_plan_id` char(32) DEFAULT NULL COMMENT '关联工作计划',
  `_content` varchar(255) DEFAULT NULL COMMENT '批注内容',
  `_create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `_user_id` char(32) DEFAULT NULL COMMENT '创建人',
  PRIMARY KEY (`id`),
  KEY `_work_plan_id` (`_work_plan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作计划 批注';

/*Table structure for table `xt_work_plan_task` */

DROP TABLE IF EXISTS `xt_work_plan_task`;

CREATE TABLE `xt_work_plan_task` (
  `id` char(32) NOT NULL,
  `_work_plan_id` char(32) DEFAULT NULL COMMENT '关联工作计划',
  `_start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `_end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `_user_id` char(32) DEFAULT NULL COMMENT '创建人',
  `_content` varchar(255) DEFAULT NULL COMMENT '计划内容',
  `_files` text COMMENT '附件',
  PRIMARY KEY (`id`),
  KEY `_work_plan_id` (`_work_plan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作任务';

/*Table structure for table `xt_work_plan_user` */

DROP TABLE IF EXISTS `xt_work_plan_user`;

CREATE TABLE `xt_work_plan_user` (
  `id` char(32) NOT NULL,
  `_work_plan_id` char(32) DEFAULT NULL COMMENT '关联工作计划',
  `_type` tinyint(4) DEFAULT NULL COMMENT '关联人类型,1:负责人，2:参与人.3:批注领导,4:发布部门,5:发布人员',
  `_table_id` char(32) DEFAULT NULL COMMENT '关联表的id',
  PRIMARY KEY (`id`),
  KEY `xt_work_plan_user_ibfk_1` (`_work_plan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作计划--用户关联表';

/* Function  structure for function  `queryDeptIdsByDeptId` */

/*!50003 DROP FUNCTION IF EXISTS `queryDeptIdsByDeptId` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`%` FUNCTION `queryDeptIdsByDeptId`(deptId VARCHAR(50)) RETURNS varchar(500) CHARSET utf8mb4
BEGIN
DECLARE sTemp VARCHAR(500);
DECLARE sTempChd VARCHAR(200);

SET sTemp='';
SET sTempChd = deptId;

WHILE sTempChd IS NOT NULL DO
 IF sTemp='' THEN SET sTemp = sTempChd;
 ELSE SET sTemp = CONCAT(sTemp,',',sTempChd);
 END IF;
 
 SELECT GROUP_CONCAT(Id) INTO sTempChd FROM qywx_party WHERE FIND_IN_SET(ParentId, sTempChd)>0;
END WHILE;
RETURN sTemp;
END */$$
DELIMITER ;

/*!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 */;
