From b853edcfdee473cd38a184cbcfb4b32e51a415f9 Mon Sep 17 00:00:00 2001 From: "ran.shang" Date: Mon, 29 Dec 2025 16:01:39 +0800 Subject: [PATCH] init sql --- db/init-table.sql | 1271 +++++++++++++++++++++++++++++++++++++++++++ db/聊天通知功能.sql | 408 -------------- 2 files changed, 1271 insertions(+), 408 deletions(-) create mode 100644 db/init-table.sql delete mode 100644 db/聊天通知功能.sql diff --git a/db/init-table.sql b/db/init-table.sql new file mode 100644 index 0000000..9a7c1df --- /dev/null +++ b/db/init-table.sql @@ -0,0 +1,1271 @@ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + + +-- ---------------------------- +-- Table structure for async_task_notice +-- ---------------------------- +DROP TABLE IF EXISTS `async_task_notice`; +CREATE TABLE `async_task_notice` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `union_type` varchar(32) NOT NULL COMMENT '关联类型:common_import等', + `union_id` bigint(20) NOT NULL COMMENT '关联id', + `content` varchar(255) NOT NULL COMMENT '内容', + `biz_status_str` varchar(32) DEFAULT NULL COMMENT '业务状态', + `biz_param_data` varchar(512) DEFAULT NULL COMMENT '业务参数', + `flow_status` tinyint(4) DEFAULT '1' COMMENT '流程状态:1开启,2结束', + `notice_status` tinyint(4) DEFAULT '1' COMMENT '通知状态:1未读,2已读', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_create_by` (`create_by`), + KEY `idx_union` (`union_type`,`union_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异步任务通知'; + + +-- ---------------------------- +-- Table structure for notice_content_template +-- ---------------------------- +DROP TABLE IF EXISTS `notice_content_template`; +CREATE TABLE `notice_content_template` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `template_id` bigint(20) DEFAULT NULL COMMENT '通知模版id', + `channel_type` tinyint(4) DEFAULT NULL COMMENT '消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)', + `title` varchar(64) DEFAULT NULL COMMENT '标题', + `content_template` text COMMENT '内容模版', + `enabled` bit(1) DEFAULT b'1' COMMENT '是否启用', + `link` varchar(128) DEFAULT NULL COMMENT '链接', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知消息体模版'; + +-- ---------------------------- +-- Table structure for notice_receiver_setting +-- ---------------------------- +DROP TABLE IF EXISTS `notice_receiver_setting`; +CREATE TABLE `notice_receiver_setting` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `template_id` bigint(20) DEFAULT NULL COMMENT '通知模版id', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `receiver_union_type` tinyint(4) DEFAULT NULL COMMENT '接收人关联类型:1用户id,2角色,3标准角色(见notice_receiver_type)', + `receiver_union_id` bigint(20) DEFAULT NULL COMMENT '接收人关联id:用户id,角色id,标准角色id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知接收人设置'; + +-- ---------------------------- +-- Table structure for notice_send_record +-- ---------------------------- +DROP TABLE IF EXISTS `notice_send_record`; +CREATE TABLE `notice_send_record` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `template_id` bigint(20) DEFAULT NULL COMMENT '通知模版id', + `sender_org_id` bigint(20) DEFAULT NULL COMMENT '发送方机构id', + `receiver_org_id` bigint(20) DEFAULT NULL COMMENT '接收方机构id', + `content_template_id` bigint(20) DEFAULT NULL COMMENT '消息体模版id', + `content_param_data` varchar(512) DEFAULT NULL COMMENT '消息体参数', + `content` text COMMENT '消息体', + `appointed` bit(1) DEFAULT NULL COMMENT '是否指定接收方(非预先设定)', + `link` varchar(128) DEFAULT NULL COMMENT '链接', + `content_template` text COMMENT '内容模版', + `title` varchar(64) DEFAULT NULL COMMENT '标题', + `channel_type` tinyint(4) DEFAULT NULL COMMENT '消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)', + `status` tinyint(4) DEFAULT NULL COMMENT '状态:1待处理,2已处理 等(见notice_send_status)', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知发送记录(内容模版级)'; + +-- ---------------------------- +-- Table structure for notice_send_record_detail +-- ---------------------------- +DROP TABLE IF EXISTS `notice_send_record_detail`; +CREATE TABLE `notice_send_record_detail` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `record_id` bigint(20) DEFAULT NULL COMMENT '发送记录id', + `user_id` bigint(20) DEFAULT NULL COMMENT '接收人id', + `receiver_account_no` varchar(32) DEFAULT NULL COMMENT '接收方帐号', + `receiver_status` tinyint(4) DEFAULT NULL COMMENT '接收状态:1待发送,2已发送,3发送失败,4接收已读(见notice_receiver_status)', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知发送记录明细(接收人)'; + +-- ---------------------------- +-- Table structure for notice_template +-- ---------------------------- +DROP TABLE IF EXISTS `notice_template`; +CREATE TABLE `notice_template` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `template_code` varchar(32) DEFAULT NULL COMMENT '通知模版code', + `template_name` varchar(64) DEFAULT NULL COMMENT '通知模版名称', + `module_type` tinyint(4) DEFAULT NULL COMMENT '模块分类:1业务,2监控/预警(见notice_module_type)', + `biz_type` tinyint(4) DEFAULT NULL COMMENT '业务分类:', + `level` tinyint(4) DEFAULT NULL COMMENT '级别:1平台,2机构(见notice_level)', + `enabled` bit(1) DEFAULT b'1' COMMENT '是否启用', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知模版'; + + + +-- ---------------------------- +-- Table structure for uc_action +-- ---------------------------- +DROP TABLE IF EXISTS `uc_action`; +CREATE TABLE `uc_action` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `union_type` varchar(32) DEFAULT NULL COMMENT '关联类型', + `union_id` bigint(20) DEFAULT NULL COMMENT '关联id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='操作记录'; + +-- ---------------------------- +-- Table structure for uc_action_detail +-- ---------------------------- +DROP TABLE IF EXISTS `uc_action_detail`; +CREATE TABLE `uc_action_detail` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `action_id` bigint(20) DEFAULT NULL COMMENT '操作记录id', + `field` varchar(32) DEFAULT NULL COMMENT '属性', + `field_alias` varchar(32) DEFAULT NULL COMMENT '属性别名', + `field_dict_code` varchar(32) DEFAULT NULL COMMENT '属性字典', + `old_value` varchar(255) DEFAULT NULL COMMENT '旧值', + `new_value` varchar(255) DEFAULT NULL COMMENT '新值', + `diff` text COMMENT '差异', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='操作记录明细'; + +-- ---------------------------- +-- Table structure for uc_auth_client +-- ---------------------------- +DROP TABLE IF EXISTS `uc_auth_client`; +CREATE TABLE `uc_auth_client` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_type_code` tinyint(4) DEFAULT NULL COMMENT '授权类型标识', + `client_name` varchar(32) DEFAULT NULL COMMENT '授权应用名称', + `param_data` varchar(256) DEFAULT NULL COMMENT '配置数据', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='授权客户端'; + +-- ---------------------------- +-- Table structure for uc_auth_detail +-- ---------------------------- +DROP TABLE IF EXISTS `uc_auth_detail`; +CREATE TABLE `uc_auth_detail` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_client_id` bigint(20) DEFAULT NULL COMMENT '授权客户端id', + `auth_type_code` tinyint(4) DEFAULT NULL COMMENT '授权类型标识', + `nickname` varchar(32) DEFAULT NULL COMMENT '昵称', + `avatar` varchar(256) DEFAULT NULL COMMENT '头像', + `gender` varchar(2) DEFAULT NULL COMMENT '性别', + `country` varchar(32) DEFAULT NULL COMMENT '国家', + `province` varchar(32) DEFAULT NULL COMMENT '省份', + `city` varchar(32) DEFAULT NULL COMMENT '城市', + `open_id` varchar(32) DEFAULT NULL COMMENT 'open_id', + `unique_id` varchar(32) DEFAULT NULL COMMENT '授权唯一id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='授权明细表'; + +-- ---------------------------- +-- Table structure for uc_auth_detail_entrypoint +-- ---------------------------- +DROP TABLE IF EXISTS `uc_auth_detail_entrypoint`; +CREATE TABLE `uc_auth_detail_entrypoint` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_detail_id` bigint(20) DEFAULT NULL COMMENT '授权客户端id', + `union_id` bigint(20) DEFAULT NULL COMMENT '关联id(小程序码id)', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_union_id` (`union_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='授权明细入口'; + +-- ---------------------------- +-- Table structure for uc_auth_subscribe_detail +-- ---------------------------- +DROP TABLE IF EXISTS `uc_auth_subscribe_detail`; +CREATE TABLE `uc_auth_subscribe_detail` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_client_id` bigint(20) DEFAULT NULL COMMENT '授权客户端id', + `open_id` varchar(32) DEFAULT NULL COMMENT 'open_id', + `unique_id` varchar(32) DEFAULT NULL COMMENT '授权唯一id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='授权订阅明细表'; + +-- ---------------------------- +-- Table structure for uc_auth_type +-- ---------------------------- +DROP TABLE IF EXISTS `uc_auth_type`; +CREATE TABLE `uc_auth_type` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_main_type` tinyint(4) DEFAULT NULL COMMENT '授权大类:1微信,2支付宝', + `auth_type_code` tinyint(4) DEFAULT NULL COMMENT '授权类型标识', + `name` varchar(32) DEFAULT NULL COMMENT '名称', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='授权类型'; + + + +-- ---------------------------- +-- Table structure for uc_domain +-- ---------------------------- +DROP TABLE IF EXISTS `uc_domain`; +CREATE TABLE `uc_domain` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `domain_name` varchar(32) DEFAULT NULL COMMENT '域名', + `ip_port` varchar(32) DEFAULT NULL COMMENT 'ip:port', + `publiced` bit(1) DEFAULT NULL COMMENT '是否公共', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='域名表'; + +-- ---------------------------- +-- Table structure for uc_domain_auth +-- ---------------------------- +DROP TABLE IF EXISTS `uc_domain_auth`; +CREATE TABLE `uc_domain_auth` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `domain_id` bigint(20) DEFAULT NULL COMMENT '域名id', + `auth_type_code` tinyint(4) DEFAULT NULL COMMENT '授权类型标识', + `auth_client_id` bigint(20) DEFAULT NULL COMMENT '授权客户端id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='域名授权表'; + +-- ---------------------------- +-- Table structure for uc_domain_setting +-- ---------------------------- +DROP TABLE IF EXISTS `uc_domain_setting`; +CREATE TABLE `uc_domain_setting` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `domain_id` bigint(20) DEFAULT NULL COMMENT '域名id', + `type` tinyint(4) DEFAULT NULL COMMENT '类型', + `remark` varchar(32) DEFAULT '' COMMENT '配置备注', + `data` text COMMENT '配置数据', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='域名配置表'; + +-- ---------------------------- +-- Table structure for uc_dynamic_table +-- ---------------------------- +DROP TABLE IF EXISTS `uc_dynamic_table`; +CREATE TABLE `uc_dynamic_table` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `table_type` varchar(32) DEFAULT NULL, + `user_id` bigint(20) DEFAULT NULL, + `column_data` text, + `deleted` bit(1) DEFAULT b'0', + `create_by` bigint(20) DEFAULT NULL, + `create_time` datetime DEFAULT CURRENT_TIMESTAMP, + `update_by` bigint(20) DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + `proxy_by` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- ---------------------------- +-- Table structure for uc_faq +-- ---------------------------- +DROP TABLE IF EXISTS `uc_faq`; +CREATE TABLE `uc_faq` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `faq_order` int(11) DEFAULT '0' COMMENT '排序', + `faq_type` varchar(2) DEFAULT NULL COMMENT '类型', + `question` varchar(512) DEFAULT NULL COMMENT '问题', + `answer` text COMMENT '回答', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='常见问题表'; + +-- ---------------------------- +-- Table structure for uc_faq_file +-- ---------------------------- +DROP TABLE IF EXISTS `uc_faq_file`; +CREATE TABLE `uc_faq_file` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `question_id` bigint(20) DEFAULT NULL COMMENT '常见问题ID', + `file_name` varchar(256) DEFAULT NULL COMMENT '文件名称', + `file_code` varchar(32) DEFAULT NULL COMMENT '文件编码', + `file_suffix` varchar(32) DEFAULT NULL COMMENT '文件后缀', + `sort` bigint(20) DEFAULT NULL COMMENT '排序', + `description` varchar(256) DEFAULT NULL COMMENT '文件描述', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='常见问题附件关系表'; + +-- ---------------------------- +-- Table structure for uc_feedback +-- ---------------------------- +DROP TABLE IF EXISTS `uc_feedback`; +CREATE TABLE `uc_feedback` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `type` varchar(2) DEFAULT NULL COMMENT '反馈类型', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `phone` varchar(32) DEFAULT NULL COMMENT '手机号', + `content` varchar(255) DEFAULT NULL COMMENT '反馈内容', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `source_type` varchar(2) DEFAULT NULL COMMENT '来源', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='反馈表'; + +-- ---------------------------- +-- Table structure for uc_import_main +-- ---------------------------- +DROP TABLE IF EXISTS `uc_import_main`; +CREATE TABLE `uc_import_main` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `import_no` varchar(64) DEFAULT NULL COMMENT '批次号', + `type` varchar(32) DEFAULT NULL COMMENT '导入类型', + `import_status` tinyint(4) DEFAULT NULL COMMENT '导入状态:1新建,2解析失败,3校验中,4校验失败,5校验成功,6执行导入', + `total_num` int(11) DEFAULT NULL COMMENT '总数', + `success_num` int(11) DEFAULT NULL COMMENT '成功数', + `fail_msg` varchar(255) DEFAULT NULL COMMENT '失败原因', + `finish_time` datetime DEFAULT NULL COMMENT '完成时间时间', + `execute_type` tinyint(4) DEFAULT NULL COMMENT '执行类型:1.普通,2.指定外部id', + `extra_id` bigint(20) DEFAULT NULL COMMENT '外部生成id', + `file_code` varchar(32) DEFAULT NULL COMMENT '文件CODE', + `file_name` varchar(128) DEFAULT NULL COMMENT '文件名称', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构ID', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_import_no` (`import_no`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通用导入批次表'; + +-- ---------------------------- +-- Table structure for uc_lite_code +-- ---------------------------- +DROP TABLE IF EXISTS `uc_lite_code`; +CREATE TABLE `uc_lite_code` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `lite_code_config_id` bigint(20) DEFAULT NULL COMMENT '小程序码配置id', + `unique_code` varchar(32) DEFAULT NULL COMMENT '唯一码-uuid', + `param_value` varchar(255) DEFAULT NULL COMMENT '参数值(按参数键升序排列)(格式:**&**)', + `query_value` varchar(255) DEFAULT NULL COMMENT 'query参数值(格式:**=**&**=**)', + `file_code` varchar(32) DEFAULT NULL COMMENT '小程序码文件编码', + `url_scheme` varchar(64) DEFAULT NULL COMMENT '小程序scheme码', + `name` varchar(32) DEFAULT NULL COMMENT '名称', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小程序码'; + +-- ---------------------------- +-- Table structure for uc_lite_code_config +-- ---------------------------- +DROP TABLE IF EXISTS `uc_lite_code_config`; +CREATE TABLE `uc_lite_code_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_client_id` bigint(20) DEFAULT NULL COMMENT '授权客户端id', + `biz_type` tinyint(4) DEFAULT NULL COMMENT '小程序码业务类型', + `path` varchar(64) DEFAULT NULL COMMENT '路径', + `param_key` varchar(64) DEFAULT NULL COMMENT '参数键-逗号分隔', + `env_param_key` varchar(64) DEFAULT NULL COMMENT '内置环境参数键-逗号分隔', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小程序码配置'; + + +-- ---------------------------- +-- Table structure for uc_org_relation +-- ---------------------------- +DROP TABLE IF EXISTS `uc_org_relation`; +CREATE TABLE `uc_org_relation` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `org_type` tinyint(4) DEFAULT NULL COMMENT '类型', + `parent_id` bigint(20) DEFAULT NULL COMMENT '上级id', + `path` varchar(255) DEFAULT NULL COMMENT '路径', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `platform_name` varchar(32) DEFAULT NULL COMMENT '平台名称', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_org_id` (`org_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='机构关系表'; + +-- ---------------------------- +-- Table structure for uc_org_user +-- ---------------------------- +DROP TABLE IF EXISTS `uc_org_user`; +CREATE TABLE `uc_org_user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `administrator` bit(1) DEFAULT NULL COMMENT '是否管理员', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `INDEX12378548369700` (`user_id`), + KEY `INDEX12378670651400` (`org_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='机构用户表'; + +-- ---------------------------- +-- Table structure for uc_platform +-- ---------------------------- +DROP TABLE IF EXISTS `uc_platform`; +CREATE TABLE `uc_platform` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `name` varchar(32) DEFAULT NULL COMMENT '名称', + `full_name` varchar(32) DEFAULT NULL COMMENT '全称', + `short_name` varchar(32) DEFAULT NULL COMMENT '简称', + `business` bit(1) DEFAULT NULL COMMENT '是否业务系统', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='系统应用表'; + +-- ---------------------------- +-- Table structure for uc_slick_param +-- ---------------------------- +DROP TABLE IF EXISTS `uc_slick_param`; +CREATE TABLE `uc_slick_param` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `unique_code` varchar(32) DEFAULT NULL COMMENT '唯一码-uuid', + `query_value` varchar(255) DEFAULT NULL COMMENT 'query升序值(格式:**=**&**=**)', + `param_data` varchar(255) DEFAULT NULL COMMENT 'json', + `hash_code` int(11) DEFAULT NULL COMMENT '哈希值', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_hash_code` (`hash_code`), + KEY `idx_unique_code` (`unique_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='圆滑的参数'; + +-- ---------------------------- +-- Table structure for uc_user +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user`; +CREATE TABLE `uc_user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `username` varchar(32) DEFAULT NULL COMMENT '账号', + `password` varchar(128) DEFAULT NULL COMMENT '密码', + `type` tinyint(4) DEFAULT NULL COMMENT '用户类型:1企业用户,2个人用户', + `supeiror` bit(1) DEFAULT NULL COMMENT '是否超管', + `security_code` varchar(128) DEFAULT NULL COMMENT '安全码', + `nickname` varchar(32) DEFAULT NULL COMMENT '昵称', + `avatar` varchar(256) DEFAULT NULL COMMENT '头像', + `phone` varchar(32) DEFAULT NULL COMMENT '手机号码', + `phone_binding` bit(1) DEFAULT NULL COMMENT '手机号绑定状态', + `real_name` varchar(32) DEFAULT NULL COMMENT '真实姓名', + `card_no` varchar(18) DEFAULT NULL COMMENT '身份证号', + `authenticated` bit(1) DEFAULT NULL COMMENT '是否实名', + `status` tinyint(4) DEFAULT NULL COMMENT '状态:1.待激活,2已激活,3已注销', + `email` varchar(32) DEFAULT NULL COMMENT '邮箱', + `address` varchar(32) DEFAULT NULL COMMENT '用户所在地', + `education` tinyint(4) DEFAULT NULL COMMENT '1博士、2硕士、3本科、4大专、5高中、6中专/中技、7初中及以下、8不限', + `init_user_id` bigint(20) DEFAULT NULL COMMENT '初始(推荐)用户id', + `enabled` bit(1) DEFAULT NULL COMMENT '是否启用', + `account_non_expired` bit(1) DEFAULT NULL COMMENT '账号是否未过期', + `account_non_locked` bit(1) DEFAULT NULL COMMENT '是否未锁定', + `credentials_non_expired` bit(1) DEFAULT NULL COMMENT '凭据是否未过期', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `gender` tinyint(4) DEFAULT NULL COMMENT '性别:1男2女', + `birthday` date DEFAULT NULL COMMENT '生日', + PRIMARY KEY (`id`), + KEY `idx_card_no` (`card_no`), + KEY `idx_phone` (`phone`), + KEY `idx_real_name` (`real_name`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; + + + +-- ---------------------------- +-- Table structure for uc_user_auth +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_auth`; +CREATE TABLE `uc_user_auth` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `auth_main_type` tinyint(4) DEFAULT NULL COMMENT '授权大类', + `unique_id` varchar(32) DEFAULT NULL COMMENT '授权唯一id', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_unique_id` (`unique_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户授权中间表'; + +-- ---------------------------- +-- Table structure for uc_user_bank_account +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_bank_account`; +CREATE TABLE `uc_user_bank_account` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `account_no` varchar(32) DEFAULT NULL COMMENT '卡号', + `account_name` varchar(32) DEFAULT NULL COMMENT '户名', + `bank_name` varchar(64) DEFAULT NULL COMMENT '银行名', + `bank_branch_name` varchar(64) DEFAULT NULL COMMENT '开户行名', + `default_account` bit(1) DEFAULT NULL COMMENT '是否默认账户', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `INDEX12379426737700` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户银行卡表'; + + +-- ---------------------------- +-- Table structure for uc_user_cancel +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_cancel`; +CREATE TABLE `uc_user_cancel` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户表ID', + `status` tinyint(4) DEFAULT '1' COMMENT '申请状态 1:已申请 2:已注销', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `cancellation_type` varchar(2) DEFAULT NULL COMMENT '注销原因类型 数据字典', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户申请注销表'; + + +-- ---------------------------- +-- Table structure for uc_user_config +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_config`; +CREATE TABLE `uc_user_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `config_code` varchar(64) DEFAULT NULL COMMENT '编码', + `config_value` varchar(1024) DEFAULT NULL COMMENT '配置值', + `remark` varchar(128) DEFAULT NULL COMMENT '备注', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户配置表'; + +-- ---------------------------- +-- Table structure for uc_user_extension +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_extension`; +CREATE TABLE `uc_user_extension` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `technique_tag` varchar(256) DEFAULT NULL COMMENT '技能标签', + `residence_address` varchar(128) DEFAULT NULL COMMENT '常住地区', + `file_code` varchar(255) DEFAULT NULL COMMENT '简历附件编码', + `file_name` varchar(255) DEFAULT NULL COMMENT '简历附件名称', + `covid_vaccine` tinyint(4) DEFAULT NULL COMMENT '新冠疫苗:1.未接种,2.1针,3.2针,4.3针', + `wechat_qr_code` varchar(32) DEFAULT NULL COMMENT '微信二维码', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户扩展表'; + +-- ---------------------------- +-- Table structure for uc_user_face +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_face`; +CREATE TABLE `uc_user_face` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', + `type` tinyint(4) DEFAULT NULL COMMENT '类型 1:照片 2:视频', + `file_code` varchar(32) DEFAULT NULL COMMENT '文件编码', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `INDEX12379510213700` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户活体信息表'; + +-- ---------------------------- +-- Table structure for uc_user_identity_photo +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_identity_photo`; +CREATE TABLE `uc_user_identity_photo` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `front_file_code` varchar(32) DEFAULT NULL COMMENT '正面照', + `back_file_code` varchar(32) DEFAULT NULL COMMENT '反面照', + `status` tinyint(4) DEFAULT NULL COMMENT '状态', + `fail_reason` varchar(128) DEFAULT NULL COMMENT '失败原因', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `INDEX12379555691300` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户身份证正反面'; + + +-- ---------------------------- +-- Table structure for uc_user_postal_info +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_postal_info`; +CREATE TABLE `uc_user_postal_info` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `defaulted` bit(1) DEFAULT NULL COMMENT '是否默认', + `name` varchar(50) DEFAULT NULL COMMENT '收货人', + `phone` varchar(50) DEFAULT NULL COMMENT '手机号', + `address_code` varchar(50) DEFAULT NULL COMMENT '地区编码', + `address_name` varchar(50) DEFAULT NULL COMMENT '地址名称', + `address_detail` varchar(100) DEFAULT NULL COMMENT '详细地址', + `deleted` bit(1) DEFAULT NULL COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户邮寄信息'; + +-- ---------------------------- +-- Table structure for uc_user_real_name_two_verification +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_real_name_two_verification`; +CREATE TABLE `uc_user_real_name_two_verification` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `config_code` varchar(64) DEFAULT NULL COMMENT '编码', + `config_value` varchar(1024) DEFAULT NULL COMMENT '配置值', + `remark` varchar(128) DEFAULT NULL COMMENT '备注', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户配置表'; + +-- ---------------------------- +-- Table structure for uc_user_register +-- ---------------------------- +DROP TABLE IF EXISTS `uc_user_register`; +CREATE TABLE `uc_user_register` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `inviter_id` bigint(20) DEFAULT NULL COMMENT '邀请人id', + `inviter_type` tinyint(4) DEFAULT NULL COMMENT '邀请人用户类型', + `inviter_org_id` bigint(20) DEFAULT NULL COMMENT '邀请人机构id', + `entrypoint` varchar(32) DEFAULT NULL COMMENT '入口点', + `union_id` bigint(20) DEFAULT NULL COMMENT '关联id(小程序码id)', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='用户注册表'; + + + +-- ---------------------------- +-- Table structure for xs_chat +-- ---------------------------- +DROP TABLE IF EXISTS `xs_chat`; +CREATE TABLE `xs_chat` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `org_user_id` bigint(20) DEFAULT NULL COMMENT '机构用户id', + `person_user_id` bigint(20) DEFAULT NULL COMMENT '个人用户id', + `type` varchar(32) DEFAULT NULL COMMENT '类型(chat_type)', + `status` tinyint(4) DEFAULT NULL COMMENT '状态:1有效,2关闭', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='聊天表'; + +-- ---------------------------- +-- Table structure for xs_chat_msg +-- ---------------------------- +DROP TABLE IF EXISTS `xs_chat_msg`; +CREATE TABLE `xs_chat_msg` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `chat_id` bigint(20) DEFAULT NULL COMMENT '聊天id', + `sender_id` bigint(20) DEFAULT NULL COMMENT '发送用户id', + `msg_type` varchar(16) DEFAULT NULL COMMENT '消息类型(chat_msg_type):text等', + `content` varchar(1024) DEFAULT NULL COMMENT '个人用户id', + `msg_status` tinyint(4) DEFAULT NULL COMMENT '消息状态:1未读,2已读', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='聊天消息表'; + +-- ---------------------------- +-- Table structure for xs_code_setting +-- ---------------------------- +DROP TABLE IF EXISTS `xs_code_setting`; +CREATE TABLE `xs_code_setting` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `code` varchar(64) DEFAULT NULL COMMENT '编码', + `name` varchar(128) DEFAULT NULL COMMENT '名称', + `remark` varchar(128) DEFAULT NULL COMMENT '备注', + `type` varchar(2) DEFAULT NULL COMMENT '类型 模板编码、配置编码', + `data_type` varchar(2) DEFAULT NULL COMMENT '数据类型', + `data_format` varchar(128) DEFAULT NULL COMMENT '数据格式编号', + `level` varchar(20) DEFAULT NULL COMMENT '级别 平台、渠道、定制机构、普通机构', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='编码表'; + +-- ---------------------------- +-- Table structure for xs_company_extend +-- ---------------------------- +DROP TABLE IF EXISTS `xs_company_extend`; +CREATE TABLE `xs_company_extend` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `seller_id` bigint(20) DEFAULT NULL COMMENT '销售', + `org_id` bigint(20) DEFAULT NULL COMMENT '所属机构ID', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `INDEX173651263650200` (`org_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企业的扩展信息'; + +-- ---------------------------- +-- Table structure for xs_component +-- ---------------------------- +DROP TABLE IF EXISTS `xs_component`; +CREATE TABLE `xs_component` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `url_id` bigint(20) DEFAULT NULL COMMENT '菜单id', + `code` varchar(32) DEFAULT NULL COMMENT '组件编码', + `name` varchar(64) DEFAULT NULL COMMENT '组件名称', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组件'; + +-- ---------------------------- +-- Table structure for xs_config +-- ---------------------------- +DROP TABLE IF EXISTS `xs_config`; +CREATE TABLE `xs_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `config_code` varchar(64) DEFAULT NULL COMMENT '编码', + `config_value` text COMMENT '配置值', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构', + `remark` varchar(128) DEFAULT NULL COMMENT '备注', + `enable` bit(1) DEFAULT NULL COMMENT '是否启用', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='配置表'; + +-- ---------------------------- +-- Table structure for xs_dict +-- ---------------------------- +DROP TABLE IF EXISTS `xs_dict`; +CREATE TABLE `xs_dict` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `dict_code` varchar(32) DEFAULT NULL COMMENT '字典编码', + `dict_name` varchar(64) DEFAULT NULL COMMENT '字典名称', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_dict_code` (`dict_code`) +) ENGINE=InnoDB AUTO_INCREMENT=206 DEFAULT CHARSET=utf8mb4 COMMENT='数据字典主信息'; + +-- ---------------------------- +-- Table structure for xs_dict_detail +-- ---------------------------- +DROP TABLE IF EXISTS `xs_dict_detail`; +CREATE TABLE `xs_dict_detail` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `dict_id` bigint(20) DEFAULT NULL COMMENT '字典ID', + `dict_detail_code` varchar(64) DEFAULT NULL COMMENT '子项编码', + `dict_detail_name` varchar(128) DEFAULT NULL COMMENT '子项名称', + `dict_order` int(11) DEFAULT NULL COMMENT '排序', + `parent_id` bigint(20) DEFAULT NULL COMMENT '父子项ID', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_dict_id` (`dict_id`) +) ENGINE=InnoDB AUTO_INCREMENT=1583 DEFAULT CHARSET=utf8mb4 COMMENT='数据字典明细信息'; + +-- ---------------------------- +-- Table structure for xs_district +-- ---------------------------- +DROP TABLE IF EXISTS `xs_district`; +CREATE TABLE `xs_district` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `name` varchar(32) DEFAULT NULL COMMENT '城市名称', + `parent_id` bigint(20) DEFAULT NULL COMMENT '上级城市ID', + `initial` varchar(32) DEFAULT NULL COMMENT '首字母', + `initials` varchar(32) DEFAULT NULL COMMENT '简拼', + `pinyin` varchar(32) DEFAULT NULL COMMENT '全拼', + `extra` varchar(32) DEFAULT NULL COMMENT '特别行政区', + `suffix` varchar(32) DEFAULT NULL COMMENT '后缀', + `code` varchar(32) DEFAULT NULL COMMENT '城市编码', + `area_code` varchar(32) DEFAULT NULL COMMENT '区域编码', + `district_order` int(11) DEFAULT NULL COMMENT '排序', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `level` int(11) DEFAULT NULL COMMENT '层级', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='省份城市'; + +-- ---------------------------- +-- Table structure for xs_file_record +-- ---------------------------- +DROP TABLE IF EXISTS `xs_file_record`; +CREATE TABLE `xs_file_record` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `file_code` varchar(64) DEFAULT NULL COMMENT '文件编码', + `file_path` varchar(512) DEFAULT NULL COMMENT '文件路径', + `file_name` varchar(128) DEFAULT NULL COMMENT '文件名', + `file_size` int(11) DEFAULT NULL COMMENT '文件大小', + `md5_code` varchar(64) DEFAULT NULL COMMENT '文件MD5', + `file_suffix` varchar(32) DEFAULT NULL COMMENT '文件后缀', + `org_id` bigint(20) DEFAULT NULL COMMENT '所属机构', + `storage_type` varchar(32) DEFAULT NULL COMMENT '储存器类型', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_file_code` (`file_code`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='附件信息'; + +-- ---------------------------- +-- Table structure for xs_org +-- ---------------------------- +DROP TABLE IF EXISTS `xs_org`; +CREATE TABLE `xs_org` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `org_name` varchar(32) DEFAULT NULL COMMENT '机构名称', + `org_code` varchar(64) DEFAULT NULL COMMENT '机构编号', + `type` varchar(2) DEFAULT NULL COMMENT '机构类型(1.平台 2.渠道代理商 3.普通机构 4.定制机构 5.散户机构 6.产品机构)', + `address_code` varchar(16) DEFAULT NULL COMMENT '任务地点编码', + `address_name` varchar(128) DEFAULT NULL COMMENT '任务地点全称', + `description` varchar(1024) DEFAULT NULL COMMENT '机构描述', + `quality` bit(1) DEFAULT b'0' COMMENT '是否优质企业', + `enable` bit(1) DEFAULT NULL COMMENT '是否启用', + `activated` bit(1) DEFAULT b'0' COMMENT '是否激活', + `parent_id` bigint(20) DEFAULT NULL COMMENT '父机构ID', + `credit_code` varchar(64) DEFAULT NULL COMMENT '统一社会信用代码', + `trade` varchar(2) DEFAULT NULL COMMENT '所属行业', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `activation_code` varchar(32) DEFAULT NULL COMMENT '机构账号激活码', + `phone` varchar(32) DEFAULT NULL COMMENT '手机号码', + `query_children` bit(1) DEFAULT NULL COMMENT '是否能查看下级数据', + `org_logo` varchar(64) DEFAULT NULL COMMENT '企业logo', + `registered_address` varchar(128) DEFAULT NULL COMMENT '注册地址', + `company_size` varchar(32) DEFAULT NULL COMMENT '规模 数据字典', + `business_license` varchar(64) DEFAULT NULL COMMENT '营业执照', + `recruit_position_type` varchar(2) NOT NULL DEFAULT '1' COMMENT '招聘岗位类型', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='机构'; + +-- ---------------------------- +-- Table structure for xs_org_user +-- ---------------------------- +DROP TABLE IF EXISTS `xs_org_user`; +CREATE TABLE `xs_org_user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机构用户'; + +-- ---------------------------- +-- Table structure for xs_permission +-- ---------------------------- +DROP TABLE IF EXISTS `xs_permission`; +CREATE TABLE `xs_permission` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `role_id` bigint(20) DEFAULT NULL COMMENT '角色id', + `resource_type` varchar(2) DEFAULT NULL COMMENT '资源类型:1菜单 2组件 3接口', + `resource_id` bigint(20) DEFAULT NULL COMMENT '资源id', + `attribute` varchar(32) DEFAULT NULL COMMENT '权限鉴别属性,默认格式:ROLE_{roleId},可以扩展', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码 1.业务系统 2.运营中台 3.用户中心 4.支付系统 5.在线培训 6.转发器 7.风控 8.网关 9.发号器 10.基础框架', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限表'; + +-- ---------------------------- +-- Table structure for xs_permission_organization +-- ---------------------------- +DROP TABLE IF EXISTS `xs_permission_organization`; +CREATE TABLE `xs_permission_organization` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `permission_package_id` bigint(20) DEFAULT NULL COMMENT '权限包id', + `allocation_org_id` bigint(20) DEFAULT NULL COMMENT '分配机构orgid', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_allocation_org_id` (`allocation_org_id`), + KEY `idx_permission_package_id` (`permission_package_id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='权限包-机构关系表'; + +-- ---------------------------- +-- Table structure for xs_permission_package +-- ---------------------------- +DROP TABLE IF EXISTS `xs_permission_package`; +CREATE TABLE `xs_permission_package` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `permission_package_name` varchar(64) DEFAULT NULL COMMENT '权限包名称', + `permission_package_type` tinyint(4) DEFAULT '1' COMMENT '类型 1.基础包 2.其他类型', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码 1.业务系统 2.运营中台 3.用户中心 4.支付系统 5.在线培训 6.转发器 7.风控 8.网关 9.发号器 10.基础框架', + `status` tinyint(4) DEFAULT '1' COMMENT '状态 1.有效 2.失效', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='标准权限包'; + +-- ---------------------------- +-- Table structure for xs_permission_resources +-- ---------------------------- +DROP TABLE IF EXISTS `xs_permission_resources`; +CREATE TABLE `xs_permission_resources` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `permission_package_id` bigint(20) DEFAULT NULL COMMENT '权限包id', + `resource_id` bigint(20) DEFAULT NULL COMMENT '资源id', + `resource_type` tinyint(4) DEFAULT '1' COMMENT '类型 1.菜单 2.组件 3.接口', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_resource_id` (`resource_id`), + KEY `INDEX12372582404500` (`permission_package_id`) +) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COMMENT='权限包-资源关系表'; + +-- ---------------------------- +-- Table structure for xs_real_name_two_verification +-- ---------------------------- +DROP TABLE IF EXISTS `xs_real_name_two_verification`; +CREATE TABLE `xs_real_name_two_verification` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) DEFAULT NULL, + `person_name` varchar(64) DEFAULT NULL, + `identity_no` varchar(32) DEFAULT NULL, + `status` varchar(2) DEFAULT '0', + `authentication_source` tinyint(4) DEFAULT NULL, + `err_msg` varchar(64) DEFAULT NULL, + `deleted` bit(1) DEFAULT b'0', + `create_by` bigint(20) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_by` bigint(20) DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + `proxy_by` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- ---------------------------- +-- Table structure for xs_role +-- ---------------------------- +DROP TABLE IF EXISTS `xs_role`; +CREATE TABLE `xs_role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构id', + `name` varchar(128) DEFAULT NULL COMMENT '名称', + `type` varchar(2) DEFAULT '0' COMMENT '类型:0业务角色、1系统角色-渠道代理商、2系统角色-普通机构', + `enabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否启用', + `description` varchar(128) DEFAULT NULL COMMENT '描述', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `standard_type` varchar(2) DEFAULT '1' COMMENT '标准角色类型:见role_standard_type', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色'; + +-- ---------------------------- +-- Table structure for xs_role_allocation +-- ---------------------------- +DROP TABLE IF EXISTS `xs_role_allocation`; +CREATE TABLE `xs_role_allocation` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `role_id` bigint(20) DEFAULT NULL COMMENT '角色id', + `allocation_type` varchar(2) DEFAULT NULL COMMENT '角色分配类型:1个人2部门3组', + `allocation_id` bigint(20) DEFAULT NULL COMMENT '角色具体分配类型对应的id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + PRIMARY KEY (`id`), + KEY `idx_allocation_id` (`allocation_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色分配表'; + +-- ---------------------------- +-- Table structure for xs_role_standard_type +-- ---------------------------- +DROP TABLE IF EXISTS `xs_role_standard_type`; +CREATE TABLE `xs_role_standard_type` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `role_code` varchar(32) DEFAULT NULL COMMENT '编码', + `name` varchar(64) DEFAULT NULL COMMENT '名称', + `platform_code` varchar(32) DEFAULT NULL COMMENT '平台编码', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否逻辑删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `type_order` int(11) DEFAULT NULL COMMENT '排序', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='标准角色类型'; + +-- ---------------------------- +-- Table structure for xs_url +-- ---------------------------- +DROP TABLE IF EXISTS `xs_url`; +CREATE TABLE `xs_url` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `name` varchar(128) DEFAULT NULL COMMENT '名称', + `link` varchar(256) DEFAULT NULL COMMENT '链接', + `icon` varchar(32) DEFAULT NULL COMMENT 'icon', + `parent_id` bigint(20) DEFAULT NULL COMMENT '父级', + `resource_order` int(11) DEFAULT NULL COMMENT '排序', + `type` tinyint(4) DEFAULT NULL COMMENT '资源类型 1:菜单 2:接口', + `visible` bit(1) DEFAULT NULL COMMENT '是否可见', + `description` varchar(128) DEFAULT NULL COMMENT '描述', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `proxy_by` bigint(20) DEFAULT NULL COMMENT '代理人', + `platform_code` tinyint(4) DEFAULT NULL COMMENT '平台编码', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COMMENT='菜单地址'; + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/db/聊天通知功能.sql b/db/聊天通知功能.sql deleted file mode 100644 index f51a53d..0000000 --- a/db/聊天通知功能.sql +++ /dev/null @@ -1,408 +0,0 @@ -CREATE TABLE "xs_chat" -( - "id" BIGINT IDENTITY(1, 1) NOT NULL PRIMARY KEY, - "org_id" BIGINT, - "org_user_id" BIGINT, - "person_user_id" BIGINT, - "type" VARCHAR(32), - "status" TINYINT, - "deleted" BIT DEFAULT 0 NOT NULL, - "create_by" BIGINT NOT NULL, - "create_time" TIMESTAMP(0) NOT NULL, - "update_by" BIGINT, - "update_time" TIMESTAMP(0), - "proxy_by" BIGINT - ) ; - -COMMENT ON TABLE "xs_chat" IS '聊天表'; -COMMENT ON COLUMN "xs_chat"."org_id" IS '机构id'; -COMMENT ON COLUMN "xs_chat"."org_user_id" IS '机构用户id'; -COMMENT ON COLUMN "xs_chat"."person_user_id" IS '个人用户id'; -COMMENT ON COLUMN "xs_chat"."type" IS '类型(chat_type)'; -COMMENT ON COLUMN "xs_chat"."status" IS '状态:1有效,2关闭'; -COMMENT ON COLUMN "xs_chat"."create_by" IS '创建人'; -COMMENT ON COLUMN "xs_chat"."create_time" IS '创建时间'; -COMMENT ON COLUMN "xs_chat"."deleted" IS '是否逻辑删除'; -COMMENT ON COLUMN "xs_chat"."proxy_by" IS '代理人'; -COMMENT ON COLUMN "xs_chat"."update_by" IS '更新人'; -COMMENT ON COLUMN "xs_chat"."update_time" IS '更新时间'; - - - -CREATE TABLE "xs_chat_msg" -( - "id" BIGINT IDENTITY(1, 1) NOT NULL PRIMARY KEY, - "chat_id" BIGINT, - "sender_id" BIGINT, - "msg_type" VARCHAR(16), - "content" VARCHAR(1024), - "msg_status" TINYINT, - "deleted" BIT DEFAULT 0 NOT NULL, - "create_by" BIGINT NOT NULL, - "create_time" TIMESTAMP(0) NOT NULL, - "update_by" BIGINT, - "update_time" TIMESTAMP(0), - "proxy_by" BIGINT -) ; -COMMENT ON TABLE "xs_chat_msg" IS '聊天消息表'; -COMMENT ON COLUMN "xs_chat_msg"."chat_id" IS '聊天id'; -COMMENT ON COLUMN "xs_chat_msg"."sender_id" IS '发送用户id'; -COMMENT ON COLUMN "xs_chat_msg"."msg_type" IS '消息类型(chat_msg_type):text等'; -COMMENT ON COLUMN "xs_chat_msg"."content" IS '个人用户id'; -COMMENT ON COLUMN "xs_chat_msg"."msg_status" IS '消息状态:1未读,2已读'; -COMMENT ON COLUMN "xs_chat_msg"."create_by" IS '创建人'; -COMMENT ON COLUMN "xs_chat_msg"."create_time" IS '创建时间'; -COMMENT ON COLUMN "xs_chat_msg"."deleted" IS '是否逻辑删除'; -COMMENT ON COLUMN "xs_chat_msg"."proxy_by" IS '代理人'; -COMMENT ON COLUMN "xs_chat_msg"."update_by" IS '更新人'; -COMMENT ON COLUMN "xs_chat_msg"."update_time" IS '更新时间'; - -CREATE TABLE "notice_content_template" - -( - - "id" BIGINT AUTO_INCREMENT NOT NULL, - - "template_id" BIGINT, - - "channel_type" TINYINT, - - "title" VARCHAR(64), - - "content_template" TEXT, - - "enabled" BIT DEFAULT 1, - - "link" VARCHAR(128), - - "deleted" BIT DEFAULT 0, - - "create_by" BIGINT, - - "create_time" TIMESTAMP(0), - - "update_by" BIGINT, - - "update_time" TIMESTAMP(0), - - "proxy_by" BIGINT, - - NOT CLUSTER PRIMARY KEY("id")) STORAGE(ON "MAIN", CLUSTERBTR); - - - -COMMENT ON TABLE "notice_content_template" IS '通知消息体模版'; - -COMMENT ON COLUMN "notice_content_template"."channel_type" IS '消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)'; - -COMMENT ON COLUMN "notice_content_template"."content_template" IS '内容模版'; - -COMMENT ON COLUMN "notice_content_template"."create_by" IS '创建人'; - -COMMENT ON COLUMN "notice_content_template"."create_time" IS '创建时间'; - -COMMENT ON COLUMN "notice_content_template"."deleted" IS '是否逻辑删除'; - -COMMENT ON COLUMN "notice_content_template"."enabled" IS '是否启用'; - -COMMENT ON COLUMN "notice_content_template"."id" IS '主键'; - -COMMENT ON COLUMN "notice_content_template"."proxy_by" IS '代理人'; - -COMMENT ON COLUMN "notice_content_template"."template_id" IS '通知模版id'; - -COMMENT ON COLUMN "notice_content_template"."title" IS '标题'; - -COMMENT ON COLUMN "notice_content_template"."update_by" IS '更新人'; - -COMMENT ON COLUMN "notice_content_template"."update_time" IS '更新时间'; - - - - - - - - -CREATE TABLE "notice_receiver_setting" - -( - - "id" BIGINT AUTO_INCREMENT NOT NULL, - - "template_id" BIGINT, - - "org_id" BIGINT, - - "receiver_union_type" TINYINT, - - "receiver_union_id" BIGINT, - - "deleted" BIT DEFAULT 0, - - "create_by" BIGINT, - - "create_time" TIMESTAMP(0), - - "update_by" BIGINT, - - "update_time" TIMESTAMP(0), - - "proxy_by" BIGINT, - - NOT CLUSTER PRIMARY KEY("id")) STORAGE(ON "MAIN", CLUSTERBTR) ; - - - -COMMENT ON TABLE "notice_receiver_setting" IS '通知接收人设置'; - -COMMENT ON COLUMN "notice_receiver_setting"."create_by" IS '创建人'; - -COMMENT ON COLUMN "notice_receiver_setting"."create_time" IS '创建时间'; - -COMMENT ON COLUMN "notice_receiver_setting"."deleted" IS '是否逻辑删除'; - -COMMENT ON COLUMN "notice_receiver_setting"."id" IS '主键'; - -COMMENT ON COLUMN "notice_receiver_setting"."org_id" IS '机构id'; - -COMMENT ON COLUMN "notice_receiver_setting"."proxy_by" IS '代理人'; - -COMMENT ON COLUMN "notice_receiver_setting"."receiver_union_id" IS '接收人关联id:用户id,角色id,标准角色id'; - -COMMENT ON COLUMN "notice_receiver_setting"."receiver_union_type" IS '接收人关联类型:1用户id,2角色,3标准角色(见notice_receiver_type)'; - -COMMENT ON COLUMN "notice_receiver_setting"."template_id" IS '通知模版id'; - -COMMENT ON COLUMN "notice_receiver_setting"."update_by" IS '更新人'; - -COMMENT ON COLUMN "notice_receiver_setting"."update_time" IS '更新时间'; - - - - - - - -CREATE TABLE "notice_send_record" - -( - - "id" BIGINT AUTO_INCREMENT NOT NULL, - - "template_id" BIGINT, - - "sender_org_id" BIGINT, - - "receiver_org_id" BIGINT, - - "content_template_id" BIGINT, - - "content_param_data" VARCHAR(512), - - "content" TEXT, - - "appointed" BIT, - - "link" VARCHAR(128), - - "content_template" TEXT, - - "title" VARCHAR(64), - - "channel_type" TINYINT, - - "status" TINYINT, - - "deleted" BIT DEFAULT 0, - - "create_by" BIGINT, - - "create_time" TIMESTAMP(0), - - "update_by" BIGINT, - - "update_time" TIMESTAMP(0), - - "proxy_by" BIGINT, - - NOT CLUSTER PRIMARY KEY("id")) STORAGE(ON "MAIN", CLUSTERBTR) ; - - - -COMMENT ON TABLE "notice_send_record" IS '通知发送记录(内容模版级)'; - -COMMENT ON COLUMN "notice_send_record"."appointed" IS '是否指定接收方(非预先设定)'; - -COMMENT ON COLUMN "notice_send_record"."channel_type" IS '消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)'; - -COMMENT ON COLUMN "notice_send_record"."content" IS '消息体'; - -COMMENT ON COLUMN "notice_send_record"."content_param_data" IS '消息体参数'; - -COMMENT ON COLUMN "notice_send_record"."content_template" IS '内容模版'; - -COMMENT ON COLUMN "notice_send_record"."content_template_id" IS '消息体模版id'; - -COMMENT ON COLUMN "notice_send_record"."create_by" IS '创建人'; - -COMMENT ON COLUMN "notice_send_record"."create_time" IS '创建时间'; - -COMMENT ON COLUMN "notice_send_record"."deleted" IS '是否逻辑删除'; - -COMMENT ON COLUMN "notice_send_record"."id" IS '主键'; - -COMMENT ON COLUMN "notice_send_record"."proxy_by" IS '代理人'; - -COMMENT ON COLUMN "notice_send_record"."receiver_org_id" IS '接收方机构id'; - -COMMENT ON COLUMN "notice_send_record"."sender_org_id" IS '发送方机构id'; - -COMMENT ON COLUMN "notice_send_record"."status" IS '状态:1待处理,2已处理 等(见notice_send_status)'; - -COMMENT ON COLUMN "notice_send_record"."template_id" IS '通知模版id'; - -COMMENT ON COLUMN "notice_send_record"."title" IS '标题'; - -COMMENT ON COLUMN "notice_send_record"."update_by" IS '更新人'; - -COMMENT ON COLUMN "notice_send_record"."update_time" IS '更新时间'; - - - - - - -CREATE TABLE "notice_send_record_detail" - -( - - "id" BIGINT AUTO_INCREMENT NOT NULL, - - "record_id" BIGINT, - - "user_id" BIGINT, - - "receiver_account_no" VARCHAR(32), - - "receiver_status" TINYINT, - - "deleted" BIT DEFAULT 0, - - "create_by" BIGINT, - - "create_time" TIMESTAMP(0), - - "update_by" BIGINT, - - "update_time" TIMESTAMP(0), - - "proxy_by" BIGINT, - - NOT CLUSTER PRIMARY KEY("id")) STORAGE(ON "MAIN", CLUSTERBTR) ; - - - -COMMENT ON TABLE "notice_send_record_detail" IS '通知发送记录明细(接收人)'; - -COMMENT ON COLUMN "notice_send_record_detail"."create_by" IS '创建人'; - -COMMENT ON COLUMN "notice_send_record_detail"."create_time" IS '创建时间'; - -COMMENT ON COLUMN "notice_send_record_detail"."deleted" IS '是否逻辑删除'; - -COMMENT ON COLUMN "notice_send_record_detail"."id" IS '主键'; - -COMMENT ON COLUMN "notice_send_record_detail"."proxy_by" IS '代理人'; - -COMMENT ON COLUMN "notice_send_record_detail"."receiver_account_no" IS '接收方帐号'; - -COMMENT ON COLUMN "notice_send_record_detail"."receiver_status" IS '接收状态:1待发送,2已发送,3发送失败,4接收已读(见notice_receiver_status)'; - -COMMENT ON COLUMN "notice_send_record_detail"."record_id" IS '发送记录id'; - -COMMENT ON COLUMN "notice_send_record_detail"."update_by" IS '更新人'; - -COMMENT ON COLUMN "notice_send_record_detail"."update_time" IS '更新时间'; - -COMMENT ON COLUMN "notice_send_record_detail"."user_id" IS '接收人id'; - - - - - - - - -CREATE TABLE "notice_template" - -( - - "id" BIGINT AUTO_INCREMENT NOT NULL, - - "template_code" VARCHAR(32), - - "template_name" VARCHAR(64), - - "module_type" TINYINT, - - "biz_type" TINYINT, - - "level" TINYINT, - - "enabled" BIT DEFAULT 1, - - "deleted" BIT DEFAULT 0, - - "create_by" BIGINT, - - "create_time" TIMESTAMP(0), - - "update_by" BIGINT, - - "update_time" TIMESTAMP(0), - - "proxy_by" BIGINT, - - NOT CLUSTER PRIMARY KEY("id")) STORAGE(ON "MAIN", CLUSTERBTR) ; - - - -COMMENT ON TABLE "notice_template" IS '通知模版'; - -COMMENT ON COLUMN "notice_template"."biz_type" IS '业务分类:'; - -COMMENT ON COLUMN "notice_template"."create_by" IS '创建人'; - -COMMENT ON COLUMN "notice_template"."create_time" IS '创建时间'; - -COMMENT ON COLUMN "notice_template"."deleted" IS '是否逻辑删除'; - -COMMENT ON COLUMN "notice_template"."enabled" IS '是否启用'; - -COMMENT ON COLUMN "notice_template"."id" IS '主键'; - -COMMENT ON COLUMN "notice_template"."level" IS '级别:1平台,2机构(见notice_level)'; - -COMMENT ON COLUMN "notice_template"."module_type" IS '模块分类:1业务,2监控/预警(见notice_module_type)'; - -COMMENT ON COLUMN "notice_template"."proxy_by" IS '代理人'; - -COMMENT ON COLUMN "notice_template"."template_code" IS '通知模版code'; - -COMMENT ON COLUMN "notice_template"."template_name" IS '通知模版名称'; - -COMMENT ON COLUMN "notice_template"."update_by" IS '更新人'; - -COMMENT ON COLUMN "notice_template"."update_time" IS '更新时间'; - - - - - - - - - - -