易公会数据库表结构

  • 更新日期:2021/11/24 16:00
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 */;

--
-- Table structure for table `address`
--

DROP TABLE IF EXISTS `address`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `address` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `user_id` varchar(128) NOT NULL COMMENT '用户id',
  `name` varchar(32) NOT NULL COMMENT '收货人姓名',
  `phone_num` varchar(16) NOT NULL COMMENT '收货人手机号',
  `province` varchar(32) NOT NULL COMMENT '所在省',
  `city` varchar(32) NOT NULL COMMENT '所在城市',
  `district` varchar(32) NOT NULL COMMENT '所在县/区',
  `detail` varchar(64) NOT NULL COMMENT '详细地址',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_address_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_privilege`
--

DROP TABLE IF EXISTS `api_privilege`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_privilege` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `func_title` varchar(64) NOT NULL COMMENT '二级功能编号',
  `api_title` varchar(64) NOT NULL COMMENT 'API编号',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bank_account`
--

DROP TABLE IF EXISTS `bank_account`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bank_account` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT 'id',
  `type` tinyint(4) UNSIGNED NOT NULL COMMENT '1银行卡 3支付宝',
  `name` varchar(32) NOT NULL COMMENT '账户姓名',
  `number` varchar(32) NOT NULL COMMENT '账户号码',
  `id_card_num` varchar(32) NOT NULL COMMENT '身份证号码',
  `phone_num` varchar(16) NOT NULL COMMENT '账户绑定的手机号',
  `user_id` varchar(128) NOT NULL COMMENT '绑定的用户id',
  `is_default` tinyint(4) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否是默认账户',
  `status` tinyint(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态 0禁用 1 启用',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_bank_account_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bank_card`
--

DROP TABLE IF EXISTS `bank_card`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bank_card` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `acct_id` varchar(128) NOT NULL COMMENT '收款账户id',
  `bank` varchar(64) NOT NULL COMMENT '开户行',
  `location` varchar(64) NOT NULL COMMENT '开户地址',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `biz_acct_info`
--

DROP TABLE IF EXISTS `biz_acct_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biz_acct_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '部门id',
  `plf_biz_id`  varchar(64) NOT NULL COMMENT '平台业务部门id',
  `user_id` varchar(64) NOT NULL COMMENT '业务账号绑定用户id',
  `alias` varchar(64) NOT NULL COMMENT '业务账号昵称',
  `number` varchar(64) NOT NULL COMMENT '业务账号id',
  `update_allowed` tinyint(4) UNSIGNED NOT NULL COMMENT '允许修改次数:默认为1次',
  `frz_reasons` varchar(64) DEFAULT NULL COMMENT '冻结原因',
  `status` tinyint(4) UNSIGNED NOT NULL COMMENT '业务账号状态',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '数据可用状态',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据可用状态',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `biz_dept_info`
--

DROP TABLE IF EXISTS `biz_dept_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biz_dept_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '部门id',
  `biz_id` varchar(64) NOT NULL COMMENT '业务id',
  `plf_id` varchar(64) NOT NULL COMMENT '平台id',
  `room_invitation_code` varchar(32) DEFAULT NULL COMMENT '厅邀请码',
  `room_number` varchar(32) DEFAULT NULL COMMENT '厅房间号',
  `start_stl_date` int(11) UNSIGNED DEFAULT NULL COMMENT '开始结算日期(此参数只针对厅部门)',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `business`
--

DROP TABLE IF EXISTS `business`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `business` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '业务id',
  `name` varchar(32) NOT NULL COMMENT '业务名称',
  `status` tinyint(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0-禁用 1-启用',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_business_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dept_node`
--

DROP TABLE IF EXISTS `dept_node`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dept_node` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `name` varchar(32) NOT NULL COMMENT '部门名称',
  `head` varchar(128) DEFAULT NULL COMMENT '部门负责人',
  `type` tinyint(4) UNSIGNED NOT NULL COMMENT '部门类型:1-业务部门 2-职能部门',
  `scope` tinyint(4) UNSIGNED NOT NULL COMMENT '层级范围:5-业务部门 10-平台业务 15-公会 20-组 25-厅 30-业务账号 60-职能部门 65-所属职能部门',
  `prev_node_id` varchar(64) DEFAULT NULL COMMENT '上级部门ID',
  `root_node_id` varchar(64) DEFAULT NULL COMMENT '根部门ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_dept_node_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `func_dept_user`
--

DROP TABLE IF EXISTS `func_dept_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `func_dept_user` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `user_id` varchar(128) NOT NULL COMMENT '用户id',
  `dept_id` varchar(64) NOT NULL COMMENT '部门id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `logs`
--

DROP TABLE IF EXISTS `logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `logs` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `user_id` varchar(128) NOT NULL COMMENT '用户id',
  `alias` varchar(32) DEFAULT NULL COMMENT '用户昵称/花名',
  `phone_num` varchar(16) DEFAULT NULL COMMENT '手机号码',
  `role_ids` varchar(256) DEFAULT NULL COMMENT '用户头像',
  `role_names` varchar(256) DEFAULT NULL COMMENT '用户头像',
  `ip` varchar(16) DEFAULT NULL COMMENT '姓名',
  `operate_time` int(11) DEFAULT NULL COMMENT '操作时间',
  `operate_type` varchar(64) DEFAULT NULL COMMENT '操作内容/类型',
  `contents` varchar(256) DEFAULT NULL COMMENT '操作详情',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `platform`
--

DROP TABLE IF EXISTS `platform`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `platform` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '平台id',
  `name` varchar(32) NOT NULL COMMENT '平台名称',
  `status` tinyint(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0-禁用 1-启用',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_platform_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `process`
--

DROP TABLE IF EXISTS `process`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `process` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '流程id',
  `name` varchar(32) NOT NULL COMMENT '流程名称',
  `process_num` varchar(32) NOT NULL COMMENT '流程编号',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_process_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `process_action`
--

DROP TABLE IF EXISTS `process_action`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `process_action` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `process_node_id` varchar(64) NOT NULL COMMENT '流程节点id',
  `user_id` varchar(128) NOT NULL COMMENT '用户id',
  `status` tinyint(4) UNSIGNED NOT NULL COMMENT '状态',
  `prev_action_id` varchar(64) DEFAULT NULL COMMENT '上一个节点信息',
  `next_action_id` varchar(64) DEFAULT NULL COMMENT '下一个节点信息',
  `fail_time` int(11) UNSIGNED DEFAULT NULL COMMENT '失效时间',
  `pid` varchar(64) NOT NULL COMMENT '流程发起后唯一识别ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_process_action_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `process_data`
--

DROP TABLE IF EXISTS `process_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `process_data` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `process_field_id` varchar(64) NOT NULL COMMENT '流程字段id',
  `value` varchar(128) DEFAULT NULL COMMENT '数据信息',
  `pid` varchar(64) NOT NULL COMMENT '流程发起后唯一识别ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_process_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `process_field`
--

DROP TABLE IF EXISTS `process_field`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `process_field` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `process_id` varchar(64) NOT NULL COMMENT '流程表id',
  `name` varchar(32) NOT NULL COMMENT '名称',
  `type` tinyint(4) UNSIGNED NOT NULL COMMENT '类型',
  `is_not_null` tinyint(4) UNSIGNED NOT NULL COMMENT '是否为空',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_process_field_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `process_node`
--

DROP TABLE IF EXISTS `process_node`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `process_node` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `type` tinyint(4) UNSIGNED NOT NULL COMMENT '1-application 2-approve',
  `process_id` varchar(64) NOT NULL COMMENT '流程表id',
  `func_title` varchar(64) DEFAULT NULL COMMENT '权限功能',
  `prev_node_id` varchar(64) DEFAULT NULL COMMENT '上一个节点信息',
  `next_node_id` varchar(64) DEFAULT NULL COMMENT '下一个节点信息',
  `fail_time` int(11) UNSIGNED DEFAULT NULL COMMENT '失效时间',
  `is_available` tinyint(1) NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_process_node_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rec_biz_acct_info`
--

DROP TABLE IF EXISTS `rec_biz_acct_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rec_biz_acct_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '关联厅部门ID',
  `room_id` varchar(64) DEFAULT NULL COMMENT '业务账号部门id',
  `alias` varchar(32) NOT NULL COMMENT '业务账号昵称',
  `number` varchar(64) NOT NULL COMMENT '业务账号',
  `effe_date` int(11) UNSIGNED NOT NULL COMMENT '生效时间',
  `is_available` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据可用状态',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据可用状态',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rec_biz_dept_stl_info`
--

DROP TABLE IF EXISTS `rec_biz_dept_stl_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rec_biz_dept_stl_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '部门外键id\r\n',
  `stl_method` tinyint(3) UNSIGNED NOT NULL COMMENT '结算方式',
  `stl_cycle` tinyint(3) UNSIGNED NOT NULL COMMENT '结算周期',
  `stl_prop` decimal(3,2) NOT NULL COMMENT '分成比例',
  `effe_date` int(10) UNSIGNED NOT NULL COMMENT '生效时间',
  `exp_date` int(10) UNSIGNED NOT NULL COMMENT '失效时间',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rec_biz_dept_stl_rule`
--

DROP TABLE IF EXISTS `rec_biz_dept_stl_rule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rec_biz_dept_stl_rule` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '部门外键id\r\n',
  `stl_rule_id` varchar(64) NOT NULL COMMENT '结算计算规则ID',
  `stl_cycle` tinyint(4) UNSIGNED NOT NULL COMMENT '结算周期',
  `effe_date` int(11) UNSIGNED NOT NULL COMMENT '    生效时间',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rec_biz_plf_info`
--

DROP TABLE IF EXISTS `rec_biz_plf_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rec_biz_plf_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `biz_id` varchar(64) NOT NULL COMMENT '业务id',
  `plf_id` varchar(64) NOT NULL COMMENT '平台id',
  `room_min` decimal(5,4) NOT NULL DEFAULT '0.00' COMMENT '厅分成范围 最小值',
  `room_max` decimal(5,4) NOT NULL DEFAULT '0.00' COMMENT '厅分成范围 最大值',
  `etr_min` decimal(5,4) NOT NULL COMMENT '艺人分成范围最小值',
  `etr_max` decimal(5,4) NOT NULL DEFAULT '0.00' COMMENT '艺人分成范围最大值',
  `daily_charges` decimal(5,4) NOT NULL DEFAULT '0.00' COMMENT '日结手续费',
  `weekly_charges` decimal(5,4) NOT NULL DEFAULT '0.00' COMMENT '周结手续费',
  `effe_date` int(11) UNSIGNED NOT NULL COMMENT '生效时间',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rec_biz_plf_stl_info`
--

DROP TABLE IF EXISTS `rec_biz_plf_stl_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rec_biz_plf_stl_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `biz_id` varchar(64) NOT NULL COMMENT '业务id',
  `plf_id` varchar(64) NOT NULL COMMENT '平台id',
  `type` tinyint(4) UNSIGNED NOT NULL COMMENT '结算周期的类型 1厅结算周期 2 艺人结算周期',
  `stl_cycle` tinyint(4) UNSIGNED NOT NULL COMMENT '结算周期',
  `effe_date` int(11) UNSIGNED NOT NULL COMMENT '生效时间',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role`
--

DROP TABLE IF EXISTS `role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '角色id',
  `name` varchar(32) NOT NULL COMMENT '角色名称',
  `role_group` varchar(64) NOT NULL COMMENT '角色组',
  `status` tinyint(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0-禁用 1-启用',
  `rank` tinyint(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '角色等级',
  `is_available` tinyint(1) NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_role_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role_privilege`
--

DROP TABLE IF EXISTS `role_privilege`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_privilege` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `func_title` varchar(64) NOT NULL COMMENT '权限功能',
  `role_id` varchar(64) NOT NULL COMMENT '角色外键id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `room_info`
--

DROP TABLE IF EXISTS `room_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `room_info` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '部门id',
  `user_id` varchar(128) DEFAULT NULL COMMENT '厅负责人',
  `number` varchar(32) DEFAULT NULL COMMENT '厅房间号',
  `name` varchar(32) NOT NULL COMMENT '厅名',
  `invitation_code` varchar(32) DEFAULT NULL COMMENT '厅邀请码',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '数据可用状态',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据可用状态',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `timing_task`
--

DROP TABLE IF EXISTS `timing_task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `timing_task` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` bigint(20) UNSIGNED NOT NULL COMMENT 'id',
  `task_id` varchar(64) DEFAULT NULL COMMENT 'celery task id',
  `exc_time` int(11) UNSIGNED NOT NULL COMMENT '执行时间',
  `executor` varchar(256) NOT NULL COMMENT '执行者',
  `exc_operation` blob NOT NULL COMMENT '执行操作',
  `exc_data` blob NOT NULL COMMENT '执行数据',
  `exc_result` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '执行结果',
  `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '执行状态',
  `pid` varchar(64) NOT NULL COMMENT '流程发起后唯一识别id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_timing_task_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '用户id',
  `phone_num` varchar(16) NOT NULL COMMENT '手机号码(账号)',
  `profile_pic` varchar(256) DEFAULT NULL COMMENT '用户头像',
  `alias` varchar(32) DEFAULT NULL COMMENT '花名',
  `name` varchar(32) DEFAULT NULL COMMENT '姓名',
  `gender` tinyint(4) UNSIGNED DEFAULT '1' COMMENT '1-未知 2-男 3-女',
  `status` tinyint(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0-禁用 1-启用 ',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_user_id` (`id`) USING BTREE,
  UNIQUE KEY `uk_user_phone_num` (`phone_num`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_and_role`
--

DROP TABLE IF EXISTS `user_and_role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_and_role` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `user_id` varchar(128) NOT NULL COMMENT '用户id',
  `role_id` varchar(64) NOT NULL COMMENT '角色id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_auth_rel`
--

DROP TABLE IF EXISTS `user_auth_rel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_auth_rel` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `user_id` varchar(128) NOT NULL COMMENT '用户表外键id',
  `auth_id` varchar(64) NOT NULL COMMENT '鉴权id,外键',
  `auth_type` tinyint(4) UNSIGNED DEFAULT NULL COMMENT '鉴权方式',
  `token` varchar(256) DEFAULT NULL COMMENT 'token',
  `expire_at` int(11) UNSIGNED DEFAULT NULL COMMENT '时间过期',
  `try_times` tinyint(4) UNSIGNED DEFAULT '0' COMMENT '错误方式',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_local_auth`
--

DROP TABLE IF EXISTS `user_local_auth`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_local_auth` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '鉴权id',
  `password` varchar(128) NOT NULL COMMENT '用户密码',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_user_local_auth_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_privilege`
--

DROP TABLE IF EXISTS `user_privilege`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_privilege` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `user_id` varchar(128) NOT NULL COMMENT '用户外键id',
  `role_id` varchar(64) NOT NULL COMMENT '角色外键id',
  `dept_id` varchar(64) NOT NULL COMMENT '部门外键id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_third_auth`
--

DROP TABLE IF EXISTS `user_third_auth`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_third_auth` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '鉴权id',
  `openid` varchar(128) NOT NULL COMMENT '第三方id',
  `login_type` tinyint(4) UNSIGNED NOT NULL COMMENT '登录类型',
  `access_token` varchar(512) DEFAULT NULL COMMENT 'access_token',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_user_third_auth_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2021-08-28 17:58:05


-- ------------ NEW TABLES ------------

DROP TABLE IF EXISTS `rec_biz_acct_freeze`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rec_biz_acct_freeze` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '账号冻结记录id',
  `dept_id` varchar(64) NOT NULL COMMENT '部门id',
  `alias` varchar(32) NOT NULL COMMENT '业务账号昵称',
  `number` varchar(64) NOT NULL COMMENT '业务账号',
  `category` tinyint(4) UNSIGNED NOT NULL COMMENT '记录类型:冻结、解冻',
  `frz_reasons` varchar(64) NOT NULL COMMENT '原因说明',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_rec_biz_acct_freeze_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `tmpl_table`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tmpl_table` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(32) NOT NULL COMMENT '模板表ID',
  `tmpl_id` varchar(32) NOT NULL COMMENT '关联模板ID',
  `cls` tinyint(4) UNSIGNED NOT NULL COMMENT '模板表系统类型',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_table_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `tmpl_field`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tmpl_field` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(32) NOT NULL COMMENT '模板字段ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `name` varchar(32) NOT NULL COMMENT '字段名称',
  `type` tinyint(4) UNSIGNED NOT NULL COMMENT '字段类型',
  `cls` tinyint(4) UNSIGNED NOT NULL COMMENT '字段系统类型',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_field_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `tmpl_key`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tmpl_key` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(32) NOT NULL COMMENT '模板键ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `cls` tinyint(4) UNSIGNED NOT NULL COMMENT '模板键系统类型',
  `content` json COMMENT '关联模板ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_key_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `key_and_field`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `key_and_field` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `field_id` varchar(32) NOT NULL COMMENT '关联模板字段ID',
  `key_id` varchar(32) NOT NULL COMMENT '关联模板键ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `tmpl`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tmpl` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(32) NOT NULL COMMENT '模板ID',
  `plf_id` varchar(64) NOT NULL COMMENT '关联平台ID',
  `biz_id` varchar(64) NOT NULL COMMENT '关联业务ID',
  `cls` tinyint(4) UNSIGNED NOT NULL COMMENT '模板系统类型',
  `name` varchar(64) NOT NULL COMMENT '模板名称',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_tmpl_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `error_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `error_data` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT '错误信息ID',
  `bat_id` varchar(128) NOT NULL COMMENT '关联原始数据批次号',
  `field_id` varchar(32) NOT NULL COMMENT '关联模板字段ID',
  `data_id` varchar(128) NOT NULL COMMENT '关联原始数据流水ID',
  `err_type` tinyint(4) UNSIGNED NOT NULL COMMENT '异常类型',
  `err_code` tinyint(4) UNSIGNED NOT NULL COMMENT '异常代码',
  `err_info` varchar(32) NOT NULL COMMENT '异常原因',
  `is_ignored` tinyint(4) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否忽略异常,默认不忽略异常',
  `is_cleared` tinyint(4) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否解除异常,默认不解除异常',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_error_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `raw_data_bat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `raw_data_bat` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '原始数据批次ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `tab_conf_id` varchar(32) NOT NULL COMMENT '关联模板表配置ID',
  `user_id` varchar(128) NOT NULL COMMENT '导入人用户ID',
  `room_id` varchar(64) NOT NULL COMMENT '关联厅部门ID',
  `status` tinyint(4) NOT NULL COMMENT '批次状态',
  `err_status` tinyint(4) UNSIGNED NOT NULL COMMENT '批次异常状态',
  `begin_date` int(11) UNSIGNED NOT NULL COMMENT '结算周期开始日期',
  `end_date` int(11) UNSIGNED NOT NULL COMMENT '结算周期结束日期',
  `stl_date` int(11) UNSIGNED NOT NULL COMMENT '结算日期',
  `summary` decimal(13, 4) NOT NULL COMMENT '汇总计算',
  `total`  int(11) NOT NULL COMMENT '汇总计数',
  `plf_biz_id` varchar(64) NOT NULL COMMENT '平台业务部门id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_raw_data_bat_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `stm_data_bat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stm_data_bat` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '流水数据批次ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `tab_conf_id` varchar(32) NOT NULL COMMENT '关联模板表配置ID',
  `dept_id` varchar(64) NOT NULL COMMENT '关联部门ID',
  `status` tinyint(4) UNSIGNED NOT NULL COMMENT '批次状态',
  `scope` tinyint(4) UNSIGNED NOT NULL COMMENT '关联部门的层级',
  `begin_date` int(11) UNSIGNED NOT NULL COMMENT '结算周期开始日期',
  `end_date` int(11) UNSIGNED NOT NULL COMMENT '结算周期结束日期',
  `summary` decimal(13, 2) NOT NULL COMMENT '汇总计算',
  `total`  int(11) NOT NULL COMMENT '汇总计数',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_stm_data_bat_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `raw_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `raw_data` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '原始数据ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `bat_id` varchar(128) NOT NULL COMMENT '关联原始数据批次号',
  `room_id` varchar(64) NOT NULL COMMENT '关联厅部门ID',
  `biz_acct_id` varchar(64) NOT NULL COMMENT '关联业务账号部门ID',
  `room_num` varchar(32) DEFAULT NULL COMMENT '房间号',
  `biz_acct_num` varchar(64) DEFAULT NULL COMMENT '业务账号',
  `date` int(11) UNSIGNED NOT NULL COMMENT '流水发生日期',
  `cus_fields` json COMMENT '可变字段',
  `other_fields` json COMMENT '无用字',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_raw_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `biz_acct_stm_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biz_acct_stm_data` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '艺人流水数据ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `bat_id` varchar(128) NOT NULL COMMENT '关联流水数据批次号',
  `room_id` varchar(64) DEFAULT NULL COMMENT '内置, 厅ID',
  `biz_acct_id` varchar(64) DEFAULT NULL COMMENT '内置, 业务账号id',
  `biz_amount` decimal(13, 2) NOT NULL COMMENT '业务账号真实流水',
  `date` int(11) unsigned NOT NULL COMMENT '流水发生日期',
  `cus_fields` json DEFAULT NULL COMMENT '可变字段',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_biz_acct_stm_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `room_stm_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `room_stm_data` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '厅流水数据ID',
  `tab_id` varchar(32) NOT NULL COMMENT '关联模板表ID',
  `bat_id` varchar(128) DEFAULT NULL COMMENT '关联流水数据批次号',
  `room_id` varchar(64) NOT NULL COMMENT '关联厅部门ID',
  `group_id` varchar(64) NOT NULL COMMENT '运营组部门ID',
  `biz_amount` decimal(13, 2) NOT NULL COMMENT '厅真实流水',
  `date` int(11) UNSIGNED NOT NULL COMMENT '流水发生日期',
  `cus_fields` json COMMENT '可变字段',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_room_stm_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `biz_acct_stl_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biz_acct_stl_data` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '日结结算数据ID',
  `tab_id` varchar(64) NOT NULL COMMENT '关联模板表ID',
  `biz_acct_id` varchar(64) NOT NULL COMMENT '业务账号部门ID',
  `room_id` varchar(64) NOT NULL COMMENT '关联厅部门id',
  `stm_amount` decimal(13, 2) NOT NULL COMMENT '流水金额',
  `stl_amount` decimal(13, 2) NOT NULL COMMENT '结算金额',
  `stl_prop` decimal(5,2) NOT NULL COMMENT '结算比例',
  `date` int(11) unsigned NOT NULL COMMENT '结算日期',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_biz_acct_stl_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `room_stl_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `room_stl_data` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '日结结算数据ID',
  `tab_id` varchar(64) NOT NULL COMMENT '关联模板表ID',
  `room_id` varchar(64) NOT NULL COMMENT '关联厅部门id',
  `group_id` varchar(64) NOT NULL COMMENT '运营组部门ID',
  `stm_amount` decimal(13, 2) NOT NULL COMMENT '流水金额',
  `stl_amount` decimal(13, 2) NOT NULL COMMENT '结算金额',
  `stl_prop` decimal(5,2) DEFAULT NULL COMMENT '结算比例',
  `date` int(11) unsigned NOT NULL COMMENT '结算日期',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_room_stl_data_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;


DROP TABLE IF EXISTS `stl_tab_conf`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stl_tab_conf` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(32) NOT NULL COMMENT '月结结算数据ID',
  `dept_id` varchar(64) NOT NULL COMMENT '关联平台业务部门ID',
  `raw_data_tab_id` varchar(32) NOT NULL COMMENT '原始数据模板表ID',
  `etr_stm_data_tab_id` varchar(32) NOT NULL COMMENT '艺人流水数据模板表ID',
  `room_stm_data_tab_id` varchar(32) NOT NULL COMMENT '厅流水数据模板表ID',
  `group_stm_data_tab_id` varchar(32) NOT NULL COMMENT '运营组流水数据模板表ID',
  `agency_stm_data_tab_id` varchar(32) NOT NULL COMMENT '公会流水数据模板表ID',
  `biz_acct_stl_free_tab_id` varchar(32) DEFAULT NULL COMMENT '艺人自由结算数据模板表ID',
  `biz_acct_stl_protect_tab_id` varchar(32) DEFAULT NULL COMMENT '艺人保护结算数据模板表ID',
  `biz_acct_stl_surplus_tab_id` varchar(32) DEFAULT NULL COMMENT '艺人剩余结算数据模板表ID',
  `room_stl_free_tab_id` varchar(32) DEFAULT NULL COMMENT '厅流水剩余结算表ID',
  `room_stl_protect_tab_id` varchar(32) DEFAULT NULL COMMENT '厅保护比例结算表ID',
  `room_stl_surplus_tab_id` varchar(32) DEFAULT NULL COMMENT '厅比例剩余结算表ID',
  `room_stl_free_prop_tab_id` varchar(32) DEFAULT NULL COMMENT '厅自由比例结算表ID',
  `effe_date` int(11) unsigned NOT NULL COMMENT '生效时间',
  `exp_date` int(11) unsigned DEFAULT NULL COMMENT '失效时间',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_stl_tab_conf_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `company`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `company` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `id` varchar(64) NOT NULL,
  `alias` varchar(32) NULL DEFAULT NULL COMMENT '公司简称',
  `name` varchar(64) NULL DEFAULT NULL COMMENT '公司全称',
  `uscc` varchar(64) NULL DEFAULT NULL COMMENT '纳税人识别码',
  `address` varchar(64) NULL DEFAULT NULL COMMENT '公司地址',
  `bank` varchar(64) NULL DEFAULT NULL COMMENT '公司一般户开户行',
  `account` varchar(64) NULL DEFAULT NULL COMMENT '公司银行账号',
  `phone_num` varchar(64) NULL DEFAULT NULL COMMENT '公司电话号码',
  `status` tinyint(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '公司主体状态',
  `is_stl_entity` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否是当前结算主体',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `creation_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
  `update_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '自动更新最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE INDEX `uk_co_id`(`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;


DROP TABLE IF EXISTS `withdrawl_bat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `withdrawl_bat` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '日结结算数据ID',
  `company_id` varchar(32) NOT NULL COMMENT '关联公司ID',
  `third_bat_num` varchar(128)  COMMENT '发放平台批次号',
  `total_count` int(11) NOT NULL COMMENT '总笔数',
  `total_amount` decimal(13, 2) NOT NULL COMMENT '总金额',
  `withdrawl_method` tinyint(4) UNSIGNED NOT NULL COMMENT '提现方式',
  `withdrawl_date` int(11) UNSIGNED NOT NULL COMMENT '提现日期',
  `withdrawl_status` tinyint(4) UNSIGNED NOT NULL COMMENT '提现结果',
  `push_time` int(11) UNSIGNED COMMENT '最新推送时间',
  `push_status` tinyint(4) UNSIGNED COMMENT '最新推送状态',
  `push_failure` varchar(256) NULL DEFAULT NULL COMMENT '最新推送失败原因',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_withdrawl_bat_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `withdrawl_stm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `withdrawl_stm` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '日结结算数据ID',
  `account_id` varchar(128) NOT NULL COMMENT '关联钱包账户ID',
  `wallet_stm_id` varchar(128) NOT NULL COMMENT '关联钱包流水ID',
  `withdrawl_bat_id` varchar(128) COMMENT '关联提现批次ID',
  `company_id` varchar(32) NOT NULL COMMENT '关联公司ID',
  `amount` decimal(13, 2) NOT NULL COMMENT '流水金额',
  `fee` decimal(13, 2) NOT NULL COMMENT '流水手续费',
  `remark` varchar(32) COMMENT '流水备注',
  `withdrawl_time` int(11) UNSIGNED NOT NULL COMMENT '提现时间',
  `withdrawl_method` tinyint(4) UNSIGNED NOT NULL COMMENT '提现方式',
  `withdrawl_status` tinyint(4) UNSIGNED NOT NULL COMMENT '提现结果',
  `payment_time` int(11) UNSIGNED COMMENT '支付时间',
  `result_code` varchar(8) COMMENT '支付结果代码',
  `result_detail` varchar(256)  COMMENT '支付结果说明',
  `result_sn` varchar(128) COMMENT '支付平台流水号',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_withdrawl_stm_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `wallet_account`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wallet_account` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '钱包账户ID',
  `number` varchar(64) NOT NULL COMMENT '钱包账号',
  `available` decimal(13, 2) COMMENT '可用余额',
  `frozen` decimal(13, 2) COMMENT '冻结金额',
  `user_id` varchar(128) NOT NULL COMMENT '用户外键id',
  `account_id` varchar(32) COMMENT '默认提现账户id',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_wallet_account_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `wallet_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wallet_detail` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '钱包流水ID',
  `wallet_num` varchar(128) NOT NULL COMMENT '钱包账号',
  `amount_before` decimal(13, 2) COMMENT '流水发生前余额',
  `direction` tinyint(1) COMMENT ' 1-提现 2-收入',
  `amount` decimal(13, 2) COMMENT '流水发生金额',
  `fee` decimal(13, 2) COMMENT '流水手续费',
  `title` varchar(128) COMMENT '流水说明',
  `create_time` int(11) UNSIGNED COMMENT '流水发生时间',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_wallet_detail_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `stl_account`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stl_account` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '钱包流水ID',
  `status` tinyint(1) NOT NULL COMMENT '钱包账号',
  `dept_id` varchar(128) COMMENT '部门ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_stl_account_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;


CREATE TABLE `stl_stm_bat` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '结算数据批次ID',
  `tab_id` varchar(32) COMMENT '关联模板表ID',
  `tab_conf_id` varchar(32) COMMENT '关联模板表配置ID',
  `room_id` varchar(64) NOT NULL COMMENT '关联厅部门ID',
  `plf_biz_id` varchar(64) NOT NULL COMMENT '内置平台业务ID',
  `status` tinyint(4) unsigned NOT NULL COMMENT '批次状态',
  `stl_cycle` tinyint(3) unsigned NOT NULL COMMENT '批次结算周期',
  `room_stm_amount` decimal(13, 2) NOT NULL COMMENT '厅流水金额',
  `room_stl_amount` decimal(13, 2) NOT NULL COMMENT '厅结算金额',
  `room_manage_amount` decimal(13, 2) NOT NULL COMMENT '厅管金额',
  `begin_date` int(11) unsigned NOT NULL COMMENT '结算周期开始日期',
  `end_date` int(11) unsigned NOT NULL COMMENT '结算周期结束日期',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_stl_data_bat_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

DROP TABLE IF EXISTS `stl_stm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stl_stm` (
  `no_` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '结算流水ID',
  `stm_amount` decimal(13, 2) COMMENT '流水金额',
  `stl_amount` decimal(13, 2) COMMENT '结算金额',
  `status` tinyint(4) COMMENT '结算流水状态 0-未知状态 1-已冻结 2-已提现',
  `create_time` int(11) COMMENT '流水发生时间',
  `bat_id` varchar(128) COMMENT '计算批次ID',
  `stl_date` int(11) COMMENT '结算日期',
  `dept_scope` int(1) COMMENT '部门层级',
  `stl_mode` int(1) COMMENT '结算方式',
  `dept_id` varchar(64) COMMENT '本级部门ID(业务账户/厅)',
  `superior_dept_id` varchar(64) COMMENT '上级部门ID(厅/运营组)',
  `stl_acct_id` varchar(128) DEFAULT NULL COMMENT '结算账户ID',
  `stl_acct_dept_id` varchar(128) DEFAULT NULL COMMENT '结算账户部门ID',
  `is_available` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_stl_stm_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `new_rec_biz_dept_stl_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `new_rec_biz_dept_stl_info` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(64) NOT NULL COMMENT 'id',
  `dept_id` varchar(64) NOT NULL COMMENT '部门id',
  `prev_dept_id` varchar(64) NOT NULL COMMENT '上级部门id',
  `stl_method` tinyint(3) unsigned NOT NULL COMMENT '结算方式',
  `stl_mode` tinyint(3) unsigned NOT NULL COMMENT '结算周期',
  `stl_prop` decimal(3,2) NOT NULL COMMENT '分成比例',
  `prop_cls` tinyint(3) NOT NULL COMMENT '比例类型',
  `effe_date` int(10) unsigned NOT NULL COMMENT '生效时间',
  `exp_date` int(10) unsigned NOT NULL COMMENT '失效时间',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

DROP TABLE IF EXISTS `dept_and_company`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dept_and_company` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `dept_id` varchar(64) NOT NULL COMMENT '部门ID',
  `company_id` varchar(64) NOT NULL COMMENT '公司ID',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;


DROP TABLE IF EXISTS `withdrawl_astrict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `withdrawl_astrict` (
  `no_` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `id` varchar(128) NOT NULL COMMENT '提现限制ID',
  `daily_withdrawl_time` int(32) NOT NULL COMMENT '每日累计提现次数',
  `monthly_withdrawl_limit` decimal(13, 2) DEFAULT NULL COMMENT '每月提现累计额度',
  `is_available` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最新修改时间',
  PRIMARY KEY (`no_`) USING BTREE,
  UNIQUE KEY `uk_wallet_detail_id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;