/*==============================================================*/
/* DBMS name:      MySQL 5.0                                    */
/* Created on:     2018/6/13 11:38:18                           */
/*==============================================================*/


drop table if exists account_flow;

drop table if exists account_info;

drop table if exists activity_base;

drop table if exists activity_group;

drop table if exists activity_group_member;

drop table if exists activity_log;

drop table if exists address;

drop table if exists admin_info;

drop table if exists book;

drop table if exists book_detail;

drop table if exists book_log;

drop table if exists channel;

drop table if exists cleaner_district;

drop table if exists cleaner_info;

drop table if exists cleaner_pool;

drop table if exists cleaner_pool_log;

drop table if exists code_region;

drop table if exists consumer_evaluated;

drop table if exists consumer_info;

drop table if exists coupon;

drop table if exists coupon_batch;

drop table if exists coupon_log;

drop table if exists coupon_version_history;

drop table if exists distribution_config;

drop table if exists enchashment_record;

drop table if exists merchant;

drop table if exists merchant_auth_area;

drop table if exists merchant_log;

drop table if exists merchant_mall_img;

drop table if exists order_log;

drop table if exists permission_info;

drop table if exists refund_process;

drop table if exists refund_process_log;

drop table if exists rel_cleaner_district_auth_area;

drop table if exists role_info;

drop table if exists role_permission;

drop table if exists service_card;

drop table if exists sms_template;

drop table if exists system_config;

drop table if exists trans;

drop table if exists user;

drop table if exists user_location;

drop table if exists user_log;

drop table if exists user_other_oauth;

drop table if exists user_recommend;

drop table if exists user_role;

drop table if exists verify_code;

drop table if exists vgoods;

drop table if exists vgoods_log;

drop table if exists vgoods_template;

drop table if exists vorder;

drop table if exists wechat_tmplmsg;

/*==============================================================*/
/* Table: account_flow                                          */
/*==============================================================*/
create table account_flow
(
   id                   bigint not null comment '主键ID',
   user_recommend_id    bigint,
   account_info_id      bigint not null comment '主键ID',
   flow_no              varchar(32) not null comment '流水编号',
   create_time          bigint default 0 comment '创建时间',
   flow_title           varchar(32) comment '流水标题',
   flow_type            tinyint default 0 comment '流水类型 0 购买服务 1 推荐保洁师 2 推荐用户 3 提现 4 转账前冻结金额 5 抹平冻结金额 6 退还冻结金额',
   flow_status          tinyint default 0 comment '流水状态 0默认 审核成功 1 处理中 2 审核失败',
   flow_amount          bigint default 0 comment '流水额度',
   before_amount        bigint default 0 comment '流水执行前额度',
   after_amount         bigint default 0 comment '流水执行后额度',
   execute_time         bigint default 0 comment '执行时间',
   remark               varchar(64) comment '备注',
   merchant_no          varchar(32) comment '商家编号',
   primary key (id)
);

alter table account_flow comment '账户流水表';

/*==============================================================*/
/* Table: account_info                                          */
/*==============================================================*/
create table account_info
(
   id                   bigint unsigned not null comment '主键ID',
   user_id2             bigint not null,
   user_id              varchar(32) not null comment '用户ID',
   account_name         varchar(8) comment '账号名称',
   type                 tinyint default 0 comment '账号类型 0 普通账号  1 系统账号',
   total_amount         bigint unsigned default 0 comment '总额度',
   current_amount       bigint unsigned default 0 comment '可提现额度',
   freeze_amount        bigint unsigned default 0 comment '冻结额度',
   create_time          bigint default 0 comment '创建时间',
   status               tinyint default 0 comment '状态 0 可用 1 不可用',
   primary key (id)
);

alter table account_info comment '用户账号';

/*==============================================================*/
/* Table: activity_base                                         */
/*==============================================================*/
create table activity_base
(
   id                   bigint not null,
   vgoods_id            bigint,
   activity_no          varchar(32),
   activity_name        varchar(32),
   merchant_no          varchar(32),
   activity_version     int,
   type                 tinyint,
   goods_no             varchar(32),
   goods_type           tinyint,
   start_time           bigint,
   end_time             bigint,
   created_at           bigint,
   created_by           varchar(32),
   updated_by           varchar(32),
   updated_at           bigint,
   limit_num            int,
   status               tinyint,
   show_url             varchar(255),
   rule_url             varchar(255),
   activity_content     text,
   activity_desc        text,
   activity_hour        int,
   limit_type           tinyint,
   originator_price     bigint,
   participant_price    bigint,
   share_title          varchar(255),
   share_subtitle       varchar(255),
   share_photo          varchar(255),
   sequence_num         int,
   del_flag             tinyint,
   primary key (id)
);

alter table activity_base comment '存放活动基本信息及历史版本';

/*==============================================================*/
/* Table: activity_group                                        */
/*==============================================================*/
create table activity_group
(
   id                   bigint not null,
   activity_base_id     bigint,
   group_no             varchar(32),
   activity_no          varchar(32),
   activity_version     int,
   activity_type        tinyint,
   merchant_no          varchar(32),
   created_by           varchar(32),
   created_at           bigint,
   updated_by           varchar(32),
   updated_at           bigint,
   status               tinyint,
   del_flag             tinyint,
   invalid_at           bigint,
   primary key (id)
);

alter table activity_group comment '活动团记录表，记录所有的活动团记录';

/*==============================================================*/
/* Table: activity_group_member                                 */
/*==============================================================*/
create table activity_group_member
(
   id                   bigint not null,
   vorder_id            bigint,
   activity_group_id    bigint,
   activity_no          varchar(32),
   group_no             varchar(32),
   subgroup_no          varchar(32),
   user_id              varchar(32),
   member_type          tinyint,
   created_at           bigint,
   price                bigint,
   status               tinyint,
   trans_no             varchar(32),
   primary key (id)
);

alter table activity_group_member comment '详细记录每个团的参与人的信息';

/*==============================================================*/
/* Table: activity_log                                          */
/*==============================================================*/
create table activity_log
(
   id                   bigint not null,
   activity_base_id     bigint,
   merchant_no          varchar(32),
   activity_no          varchar(32),
   activity_version     int,
   group_no             varchar(32),
   user_id              varchar(32),
   client_type          tinyint,
   opt_type             int,
   created_by           varchar(32),
   created_at           bigint,
   status               tinyint,
   client_ip            varchar(32),
   remark               text,
   primary key (id)
);

alter table activity_log comment '记录活动的操作日志';

/*==============================================================*/
/* Table: address                                               */
/*==============================================================*/
create table address
(
   id                   bigint unsigned not null,
   consumer_info_id     bigint,
   "label"              national varchar(16) comment '地址标签',
   province_id          int default 0 comment '省id',
   city_id              int default 0 comment '城市id',
   district_id          int default 0 comment '区id',
   town_id              int unsigned default 0 comment '街道id',
   lat                  decimal(10,6) default 0.000000 comment '纬度',
   lng                  decimal(10,6) default 0.000000 comment '经度',
   detail               national varchar(255) comment '地址明细',
   full_name            national varchar(255) not null comment '地址全称',
   telephone            national varchar(255) not null comment '地址电话',
   linkman              national varchar(32) not null comment '联系人',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(20) comment '创建者',
   updated_at           bigint unsigned default 0 comment '更新时间',
   updated_by           national varchar(20) comment '更新者',
   is_default           tinyint unsigned default 0 comment '默认地址 0否 1是',
   status               tinyint unsigned not null default 0 comment '状态',
   square               tinyint default 0,
   location_address     national varchar(255),
   remark               national varchar(255),
   primary key (id)
);

alter table address comment '地址';

/*==============================================================*/
/* Table: admin_info                                            */
/*==============================================================*/
create table admin_info
(
   id                   bigint unsigned not null,
   user_id2             bigint,
   merchant_no          national varchar(32) comment '商户编号',
   user_id              national varchar(32) comment '用户id',
   nick_name            national varchar(20) comment '昵称',
   mobile               national varchar(20) comment '手机号',
   type                 tinyint default 0 comment '类型',
   status               tinyint default 0 comment '状态',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(20) comment '创建者',
   updated_at           bigint default 0 comment '更新时间',
   updated_by           national varchar(20) comment '更新者',
   del_flag             tinyint default 0 comment '删除标志',
   init_pwd             national varchar(50) comment '初始密码',
   primary key (id)
);

alter table admin_info comment '员工';

/*==============================================================*/
/* Table: book                                                  */
/*==============================================================*/
create table book
(
   id                   bigint unsigned not null comment '预约时间',
   merchant_id          bigint not null,
   cleaner_pool_id      bigint,
   merchant_book_no     national varchar(32) comment '商户预约记录统计编号',
   type                 tinyint default 0 comment '类型 0合计 1细分区县',
   province_id          int default 0 comment '服务城市',
   city_id              int default 0 comment '服务省份',
   district_id          int default 0 comment '服务区县',
   merchant_no          national varchar(32) not null default '' comment '商家编号',
   book_time            date comment '时间',
   time_type            tinyint default 0 comment '时间类型',
   bookable_count       int default 0 comment '可预约次数',
   extra_bookable_count int default 0 comment '运营手动增加的可预约次数',
   reserved_count       int default 0 comment '预留预约次数',
   booked_count         int default 0 comment '已预订次数',
   created_at           bigint unsigned default 0 comment '创建时间',
   updated_at           bigint default 0 comment '更新时间',
   status               tinyint unsigned default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table book comment '预约日历';

/*==============================================================*/
/* Table: book_detail                                           */
/*==============================================================*/
create table book_detail
(
   id                   bigint unsigned not null,
   cleaner_info_id      bigint,
   service_card_id      bigint not null comment '主键ID',
   merchant_no          national varchar(32) not null comment '商家编号',
   card_type            tinyint default 0 comment '服务卡类型',
   book_no              national varchar(32) comment '预约编号',
   user_id              national varchar(32) default '0' comment '用户id',
   type                 tinyint default 0 comment '类型',
   book_time            date comment '预约日期',
   book_week            tinyint default 0 comment '预约星期',
   time_type            tinyint default 0 comment '时间类型',
   cleaner_name         national varchar(32) comment '保洁师名称',
   full_address         national varchar(128) comment '服务地址',
   address_telephone    national varchar(16) comment '联系人号码',
   linkman              national varchar(16) comment '联系人姓名',
   lng                  decimal(10,6) default 0.000000 comment '经度',
   lat                  decimal(10,6) default 0.000000 comment '纬度',
   square               int default 0 comment '房屋面积',
   region_id            int default 0 comment '区域id',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint unsigned default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   remark               national varchar(255) comment '备注',
   status               tinyint default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   cleaner_comment      national varchar(255) comment '保洁师评价',
   has_check            tinyint default 0 comment '保洁师是否已查看 0否1是',
   has_send             tinyint default 0 comment '是否已发送短信 只有待服务的状态下才体现 0否 1是',
   primary key (id)
);

alter table book_detail comment '预约明细';

/*==============================================================*/
/* Table: book_log                                              */
/*==============================================================*/
create table book_log
(
   id                   bigint unsigned not null,
   book_detail_id       bigint,
   merchant_no          national varchar(32) not null default '' comment '商家编号',
   user_id              national varchar(32) comment '用户id',
   client_type          tinyint default 0 comment '用户类型',
   opt_type             int default 0 comment '操作类型',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(20) comment '创建者',
   status               tinyint unsigned default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table book_log comment '预约日志';

/*==============================================================*/
/* Table: channel                                               */
/*==============================================================*/
create table channel
(
   id                   int not null auto_increment comment 'id',
   merchant_id          bigint,
   merchant_no          varchar(32) comment '商户编号',
   merchant_name        varchar(32) comment '商户名称',
   channel_no           varchar(32) comment '渠道编号',
   channel_name         varchar(32) comment '渠道名称',
   channel_type         tinyint comment '渠道类型',
   create_at            bigint comment '创建时间',
   create_by           varchar(32) comment '创建者',
   update_at            bigint comment '更新时间',
   update_by            varchar(32) comment '更新者',
   remark               text comment '备注',
   primary key (id)
);

/*==============================================================*/
/* Table: cleaner_district                                      */
/*==============================================================*/
create table cleaner_district
(
   id                   int not null auto_increment,
   merchant_id          bigint not null,
   merchant_no          varchar(32),
   province_id          int,
   province_name        varchar(20),
   city_id              int,
   city_name            varchar(20),
   district_id          int,
   district_name        varchar(255),
   del_flag             tinyint,
   primary key (id)
);

/*==============================================================*/
/* Table: cleaner_info                                          */
/*==============================================================*/
create table cleaner_info
(
   id                   bigint not null,
   merchant_id          bigint,
   user_id2             bigint,
   cleaner_district_id  int not null,
   user_id              national varchar(32) comment '用户id',
   type                 tinyint default 0 comment '类型',
   status               tinyint default 0 comment '状态',
   nick_name            varchar(255) comment '昵称',
   age                  int default 0 comment '年龄',
   mobile               national varchar(16) comment '手机号',
   service_district     national varchar(255) comment '服务区县id集,例如4401010000,4401020000',
   province_id          int default 0 comment '省id',
   city_id              int default 0 comment '市id',
   district_id          int default 0 comment '区id',
   detail_address       national varchar(128) comment '详细地址',
   full_address         national varchar(128) comment '完整住址',
   lat                  decimal(10,6) default 0.000000 comment '纬度',
   lng                  decimal(10,6) default 0.000000 comment '经度',
   head_url             national varchar(50) comment '头像',
   entry_date           date comment '入职时间',
   last_arrange_date    date comment '最后排班时间',
   evaluate_score       bigint default 0 comment '评价总分数',
   evaluate_count       int default 0 comment '评价总人数',
   evaluate_rate        double default 0.0 comment '好评率',
   create_at            bigint default 0 comment '创建时间',
   create_by            national varchar(20) comment '创建者',
   update_at            bigint default 0 comment '更新时间',
   update_by            national varchar(20) comment '更新者',
   del_flag             tinyint default 0 comment '删除标志',
   token                national varchar(32) comment '登录标识',
   primary key (id)
);

alter table cleaner_info comment '保洁师';

/*==============================================================*/
/* Table: cleaner_pool                                          */
/*==============================================================*/
create table cleaner_pool
(
   id                   bigint unsigned not null,
   cleaner_info_id      bigint,
   cleaner_pool_no      national varchar(32) comment '保洁师池编号',
   merchant_no          national varchar(32) comment '所属商户',
   book_no              national varchar(32) comment '安排的预约记录',
   type                 tinyint default 0 comment '保洁人员类型',
   book_time            date comment '预约日期',
   book_week            tinyint default 0 comment '预约星期',
   time_type            tinyint default 0 comment '时间类型',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint unsigned default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   status               tinyint unsigned default 0 comment '状态',
   primary key (id)
);

alter table cleaner_pool comment '保洁师池';

/*==============================================================*/
/* Table: cleaner_pool_log                                      */
/*==============================================================*/
create table cleaner_pool_log
(
   id                   bigint unsigned not null,
   cleaner_pool_id      bigint not null,
   time_type            tinyint not null default 0 comment '时间类型',
   cleaner_id           varchar(32) not null comment '保洁人员用户id',
   book_time            date not null comment '预约日期',
   merchant_no          national varchar(32) not null comment '商户编号',
   client_type          tinyint default 0 comment '用户类型',
   opt_type             tinyint default 0 comment '操作类型',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   status               tinyint unsigned default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table cleaner_pool_log comment '保洁师池操作日志';

/*==============================================================*/
/* Table: code_region                                           */
/*==============================================================*/
create table code_region
(
   id                   int not null comment '主键ID',
   pid                  int not null comment '父节点ID',
   name                 varchar(32) not null comment '名称',
   grade                tinyint not null comment '行政级别',
   is_last              tinyint not null comment '是否最后一级,0否 1是',
   path                 varchar(128) not null comment '地址详情',
   primary key (id)
);

alter table code_region comment '省、市、区、街道数据';

/*==============================================================*/
/* Table: consumer_evaluated                                    */
/*==============================================================*/
create table consumer_evaluated
(
   id                   bigint not null comment '自增主键',
   consumer_info_id     bigint not null,
   merchant_no          national varchar(32) comment '评价者所属商户',
   opt_user_id          national varchar(32) not null comment '评价者',
   grade                national char(50) not null comment '评级 A-B-C-D',
   evaluate_content     national varchar(255) comment '评价内容',
   created_at           bigint default 0 comment '评价时间',
   primary key (id)
);

alter table consumer_evaluated comment '销售对客户评价';

/*==============================================================*/
/* Table: consumer_info                                         */
/*==============================================================*/
create table consumer_info
(
   id                   bigint unsigned not null,
   user_id              bigint,
   nick_name            varchar(255) comment '昵称',
   mobile               national varchar(20) comment '手机号',
   head_url             national varchar(255) comment '头像',
   level                int default 0 comment '等级',
   growth_value         int default 0 comment '成长值',
   type                 tinyint default 0 comment '类型',
   status               tinyint default 0 comment '状态',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table consumer_info comment '消费者';

/*==============================================================*/
/* Table: coupon                                                */
/*==============================================================*/
create table coupon
(
   id                   bigint unsigned not null,
   consumer_info_id     bigint,
   channel_id           int not null comment 'id',
   coupon_batch_id      int(20) comment '主键',
   merchant_no          national varchar(32) not null default '' comment '商家编号',
   batch_name           national varchar(128) comment '批次名,商城展示',
   coupon_no            national varchar(32) comment '优惠券编号',
   order_no             national varchar(32) comment '订单编号',
   type                 tinyint default 0 comment '类型',
   batch_type           tinyint default 0 comment '批次类型',
   status               tinyint default 0 comment '状态',
   amount               bigint default 0 comment '优惠额度',
   full_amount          bigint default 0 comment '满减',
   discount             bigint default 0 comment '折扣',
   created_at           bigint default 0 comment '创建时间',
   voucher              national varchar(255) comment '兑换凭证',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   use_at               bigint default 0 comment '使用时间',
   invalid_at           bigint default 0 comment '过期时间',
   goods_no             national varchar(256) comment '适用商品id',
   goods_type           tinyint default 0 comment '商品类型限制 0为不限制',
   source_type          tinyint default 0 comment '来源类型',
   primary key (id)
);

alter table coupon comment '优惠券';

/*==============================================================*/
/* Table: coupon_batch                                          */
/*==============================================================*/
create table coupon_batch
(
   id                   int(20) unsigned not null auto_increment comment '主键',
   channel_id           int not null comment 'id',
   merchant_no          national varchar(32) comment '商户编号',
   project_name         national varchar(128) comment '方案名,后台展示',
   batch_name           national varchar(128) comment '批次名,商城展示',
   coupon_batch_no      national varchar(32) comment '优惠券批次编号',
   batch_type           tinyint default 0 comment '批次类型',
   type                 tinyint default 0 comment '类型',
   status               tinyint default 0 comment '状态',
   amount               bigint default 0 comment '优惠额度',
   full_amount          bigint default 0 comment '满减券的满减额度,如满99减20的99',
   discount             bigint default 0 comment '折扣',
   num                  int default 0 comment '数量',
   received_num         int default 0 comment '已领取数量',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   time_type            tinyint default 0 comment '时间类型',
   invalid_at           bigint default 0 comment '失效时间',
   duration_day         int default 0 comment '有效天数',
   del_flag             tinyint default 0 comment '删除标志',
   goods_no             national varchar(256) comment '适用商品id',
   goods_type           tinyint default 0 comment '商品类型限制 0为不限制',
   use_limit            tinyint comment '使用限制 0为不限制,1为限新用户',
   version              tinyint comment '编辑更新版本号',
   primary key (id)
);

alter table coupon_batch comment '优惠券批次';

/*==============================================================*/
/* Table: coupon_log                                            */
/*==============================================================*/
create table coupon_log
(
   id                   bigint unsigned not null,
   coupon_id            bigint,
   coupon_batch_id      int(20) not null comment '主键',
   merchant_no          national varchar(32) not null default '' comment '商户编号',
   order_no             national varchar(32) comment '订单编号',
   user_id              national varchar(32) comment '用户id',
   client_type          tinyint default 0 comment '类型',
   opt_type             int default 0 comment '操作类型',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(32) default '' comment '创建者',
   status               tinyint unsigned default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   client_ip            national varchar(50) default '' comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table coupon_log comment '优惠券日志';

/*==============================================================*/
/* Table: coupon_version_history                                */
/*==============================================================*/
create table coupon_version_history
(
   id                   int(20) unsigned not null auto_increment comment '主键',
   coupon_batch_id      int(20) not null comment '主键',
   merchant_no          national varchar(32) comment '商户编号',
   create_at            bigint comment '创建时间',
   create_by            varchar(32) comment '创建者',
   version_detail       text comment '版本明细',
   version              tinyint comment '版本号',
   primary key (id)
);

alter table coupon_version_history comment '优惠券模版历史版本';

/*==============================================================*/
/* Table: distribution_config                                   */
/*==============================================================*/
create table distribution_config
(
   id                   bigint not null,
   merchant_id          bigint,
   merchant_no          national varchar(32) comment '商家编号',
   updated_by           national varchar(32) comment '操作用户id',
   rate                 int default 10 comment '抽成比例',
   coupon_batch_no      national varchar(32) default '0' comment '券码',
   commission           int default 50000 comment '佣金',
   create_time          bigint default 0 comment '创建时间',
   update_time          bigint default 0 comment '修改时间',
   primary key (id)
);

alter table distribution_config comment '分销配置';

/*==============================================================*/
/* Table: enchashment_record                                    */
/*==============================================================*/
create table enchashment_record
(
   id                   bigint not null,
   user_id              bigint not null,
   enchashment_no       national varchar(32) not null comment '提现记录编号',
   trans_amount         bigint default 0 comment '提现金额',
   bank_name            national varchar(20) default '0' comment '开户银行',
   bank_account         national varchar(50) default '0' comment '银行账号',
   account_name         national varchar(20) default '0' comment '开户名称',
   create_time          bigint default 0 comment '创建时间',
   status               tinyint default 0 comment '状态 0 未审核 1 审核通过 2 审核不通过',
   remark               national varchar(50) default '0' comment '描述信息',
   del_flag             tinyint default 0 comment '删除标志 0正常 1删除',
   update_at            bigint default 0 comment '更新时间',
   update_by            national varchar(32) default '0' comment '更新人',
   primary key (id)
);

alter table enchashment_record comment '提现记录表';

/*==============================================================*/
/* Table: merchant                                              */
/*==============================================================*/
create table merchant
(
   id                   bigint unsigned not null,
   user_id              bigint,
   merchant_no          national varchar(32) comment '商家编号',
   name                 national varchar(20) comment '名称',
   type                 tinyint default 0 comment '类型',
   status               tinyint default 0 comment '状态',
   address_detail       national varchar(50) comment '地址明细',
   address_full_name    national varchar(50) comment '地址全称',
   address_telephone    national varchar(20) comment '地址电话',
   linkman_name         national varchar(20) comment '联系人名称',
   linkman_mobile       national varchar(20) comment '联系人电话',
   desc_str             national varchar(255) comment '描述',
   district_id          int default 0 comment '地区id',
   district_name        national varchar(255) comment '地区名',
   province_id          int default 0 comment '省id',
   province_name        national varchar(20) comment '省名字',
   city_id              int default 0 comment '城市id',
   city_name            national varchar(20) comment '城市名',
   service_city_id      national varchar(255) comment '服务的城市id，以逗号相隔',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   del_flag             tinyint default 0 comment '删除标志',
   remark               national text comment '备注',
   primary key (id)
);

alter table merchant comment '商户';

/*==============================================================*/
/* Table: merchant_auth_area                                    */
/*==============================================================*/
create table merchant_auth_area
(
   id                   int not null auto_increment,
   merchant_id          bigint not null,
   merchant_no          varchar(32),
   province_id          int,
   province_name        varchar(20),
   city_id              int,
   city_name            varchar(20),
   district_id          int,
   district_name        varchar(255),
   is_open              tinyint comment '是否开放：0-不开放，1-开放',
   is_auth              tinyint comment '是否授权：0-未授权，1-已授权',
   created_at           bigint,
   created_by           varchar(32),
   updated_at           bigint,
   updated_by           varchar(32),
   del_flag             tinyint,
   primary key (id)
);

/*==============================================================*/
/* Table: merchant_log                                          */
/*==============================================================*/
create table merchant_log
(
   id                   int(10) unsigned not null auto_increment,
   merchant_id          bigint,
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   status               tinyint default 0 comment '状态',
   opt_type             int default 0 comment '操作类型',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table merchant_log comment '商户日志';

/*==============================================================*/
/* Table: merchant_mall_img                                     */
/*==============================================================*/
create table merchant_mall_img
(
   id                   bigint not null,
   merchant_id          bigint not null,
   type                 tinyint not null default 0 comment '类型 0banner 1广告图',
   sequence_number      tinyint not null default 0 comment '排序序号',
   img_url              national varchar(255) not null comment '图片地址',
   link_url             national varchar(255) comment '跳转链接地址',
   del_flag             tinyint default 0 comment '删除标识',
   status               tinyint default 0 comment '状态',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建人',
   updated_at           bigint default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新人',
   primary key (id)
);

alter table merchant_mall_img comment '商户对应的商城banner、广告图配置';

/*==============================================================*/
/* Table: order_log                                             */
/*==============================================================*/
create table order_log
(
   id                   bigint unsigned not null,
   vorder_id            bigint,
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   status               tinyint default 0 comment '状态',
   opt_type             int default 0 comment '操作类型',
   "label"              national varchar(20) comment '标签',
   is_finished          national char(1) default N comment '是否完成',
   step                 int unsigned default 0 comment '第几步',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table order_log comment '订单日志';

/*==============================================================*/
/* Table: permission_info                                       */
/*==============================================================*/
create table permission_info
(
   id                   int(20) not null auto_increment comment '权限ID',
   permission_name      national varchar(32) comment '权限名称',
   create_time          bigint default 0 comment '创建时间',
   remark               national varchar(64) comment '备注',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table permission_info comment '权限';

/*==============================================================*/
/* Table: refund_process                                        */
/*==============================================================*/
create table refund_process
(
   id                   bigint not null comment '主键',
   trans_id             bigint not null,
   vorder_id            bigint not null,
   refund_no            national varchar(32) not null comment '退款编号',
   card_no              national varchar(32) not null comment '服务卡号',
   merchant_no          national varchar(32) not null comment '商户号',
   user_id              national varchar(32) not null comment '退款用户id',
   goods_name           national varchar(32) comment '退款商品名称',
   goods_type           tinyint default 0 comment '退款商品类型',
   total_service_cnt    int default 0 comment '总服务次数',
   serviced_cnt         int default 0 comment '已服务次数',
   pay_price            bigint default 0 comment '实付价格',
   payment_type         tinyint default 0 comment '支付方式',
   total_price          bigint default 0 comment '商品原价',
   refund_price         bigint default 0 comment '退款金额',
   status               tinyint default 0 comment '退款申请状态',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建人',
   updated_by           national varchar(32) comment '更新人',
   updated_at           bigint default 0 comment '更新时间',
   primary key (id)
);

alter table refund_process comment '用户退款记录';

/*==============================================================*/
/* Table: refund_process_log                                    */
/*==============================================================*/
create table refund_process_log
(
   id                   bigint unsigned not null,
   refund_process_id    bigint not null comment '主键',
   order_no             national varchar(32) comment '订单号',
   created_at           bigint default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   status               tinyint default 0 comment '状态',
   opt_type             int default 0 comment '操作类型',
   refund_price         bigint default 0 comment '退款金额',
   review_comment       national text comment '审核内容',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table refund_process_log comment '退款流程日志记录';

/*==============================================================*/
/* Table: rel_cleaner_district_auth_area                        */
/*==============================================================*/
create table rel_cleaner_district_auth_area
(
   merchant_auth_area_id int not null,
   cleaner_district_id  int not null,
   primary key (merchant_auth_area_id, cleaner_district_id)
);

/*==============================================================*/
/* Table: role_info                                             */
/*==============================================================*/
create table role_info
(
   id                   int(20) not null auto_increment comment '角色ID',
   role_name            national varchar(100) comment '角色名',
   create_time          bigint default 0 comment '创建时间',
   remark               national varchar(64) comment '备注',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table role_info comment '角色';

/*==============================================================*/
/* Table: role_permission                                       */
/*==============================================================*/
create table role_permission
(
   id                   bigint not null comment '主键ID',
   role_info_id         int(20) comment '角色ID',
   permission_info_id   int(20) comment '权限ID',
   role_name            national varchar(100) comment '角色名',
   permission_id        bigint default 0 comment '权限ID',
   permission_name      national varchar(32) comment '权限名',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table role_permission comment '角色与权限';

/*==============================================================*/
/* Table: service_card                                          */
/*==============================================================*/
create table service_card
(
   id                   bigint not null comment '主键ID',
   vorder_id            bigint not null,
   consumer_info_id     bigint not null,
   user_id              national varchar(32) not null comment '用户id',
   merchant_no          national varchar(32) not null comment '商户编号',
   card_no              varchar(32),
   goods_no             national varchar(32) not null comment '对应的商品编号',
   card_name            national varchar(32) not null comment '服务卡名称',
   show_img             national varchar(255) not null comment '服务卡展示图片',
   card_type            tinyint unsigned default 0 comment '服务卡类型',
   cycle_mode           tinyint unsigned default 0 comment '周期模式',
   cycle_freq           tinyint unsigned default 0 comment '周期频率',
   create_at            bigint unsigned default 0 comment '创建时间',
   create_by            national varchar(32) comment '创建者',
   update_at            bigint unsigned default 0 comment '更新时间',
   update_by            national varchar(32) comment '更新者',
   status               tinyint unsigned default 0 comment '服务卡状态',
   del_flag             tinyint unsigned default 0 comment '删除标识 0否 1是',
   active_invalid_at    bigint unsigned default 0 comment '激活有效期限',
   use_invalid_at       bigint unsigned default 0 comment '使用有效期限',
   active_at            bigint unsigned default 0 comment '激活时间',
   total_service_cnt    int unsigned not null default 0 comment '总服务次数',
   booked_cnt           int unsigned default 0 comment '已预约次数',
   serviced_cnt         int unsigned default 0 comment '已服务次数',
   region_id            int unsigned default 0 comment '地区id',
   full_address         national varchar(128) comment '全地址',
   address_telephone    national varchar(16) comment '联系电话',
   linkman              national varchar(32) comment '联系人',
   lat                  decimal(10,6) default 0.000000 comment '纬度',
   lng                  decimal(10,6) default 0.000000 comment '经度',
   remark               national varchar(255) not null comment '服务备注',
   address_id           bigint default 0 comment '地址id',
   square               int default 0 comment '房屋面积',
   primary key (id)
);

alter table service_card comment '服务卡';

/*==============================================================*/
/* Table: sms_template                                          */
/*==============================================================*/
create table sms_template
(
   id                   int(20) not null auto_increment comment '自增编号',
   client_type          tinyint default 0 comment '发送用户类型（ClientTypeEnum）',
   sms_sp               national varchar(10) comment '短信服务商（EnumSmsServiceProvider）',
   sms_key              national varchar(50) comment '代码调用（EnumSmsKeyTmpl）',
   sms_code             national varchar(20) comment '短信平台模板编码（EnumSmsKeyTmpl）',
   sms_tmpl             national text comment '短信模板内容',
   tmpl_params          national text comment '短信模板参数',
   tmpl_status          tinyint default 0 comment '模版状态（EnumWechatTmplStatus）',
   create_at            bigint default 0 comment '创建时间',
   update_at            bigint default 0 comment '更新时间',
   primary key (id)
);

alter table sms_template comment '短信模版';

/*==============================================================*/
/* Table: system_config                                         */
/*==============================================================*/
create table system_config
(
   id                   int(20) not null auto_increment,
   title                national varchar(32) comment '标题',
   type                 tinyint default 0 comment '类型',
   status               tinyint default 0 comment '状态',
   created_at           bigint default 0 comment '更新时间',
   updated_at           bigint default 0 comment '更新时间',
   config_key           national varchar(64) comment '配置key',
   config_value         national text comment '配置value',
   primary key (id)
);

alter table system_config comment '系统配置';

/*==============================================================*/
/* Table: trans                                                 */
/*==============================================================*/
create table trans
(
   id                   bigint not null,
   vorder_id            bigint,
   merchant_no          national varchar(32) comment '商家编号',
   trans_no             national varchar(32) comment '交易号',
   payer_user_id        national varchar(32) comment '付款人userID',
   payee_user_id        national varchar(32) comment '收款人userID',
   status               tinyint default 0 comment '交易状态',
   payment_type         tinyint default 1 comment '支付方式 1-支付宝 2-微信APP 3-余额 4-支付宝扫码 5-微信扫码 6-微信公众号支付',
   trans_type           tinyint default 1 comment '交易类型 1-支付 2-充值 3-收款 4-提现',
   channel_id           tinyint default 0 comment '我方为合作商分配的渠道号 0-官方渠道 其他值由逻辑决定',
   channel_trade_number national varchar(128) comment '渠道方的交易序列号',
   channel_user_id      national varchar(64) comment '渠道方的用户ID(唯一标志)',
   channel_user_name    national varchar(64) comment '渠道方用户名',
   trans_amount         bigint default 0 comment '交易总价 单位：分',
   create_time          bigint default 0 comment '记录创建时间',
   trans_create_time    bigint default 0 comment '交易创建时间（第三方响应的支付创建时间）',
   payment_time         bigint default 0 comment '交易成功时间',
   refund_status        tinyint default 0 comment '退款状态，默认为0无退款',
   invalid_time         bigint default 0 comment '失效时间，微信所有支付和支付宝扫码支付用，默认2小时',
   refund_time          bigint default 0 comment '退款时间，默认为0无退款',
   internal_callback_url national varchar(256) comment '产品的回调接口，用于支付回调',
   qr_code              national varchar(256) comment '扫码支付链接，用于生成二维码',
   qr_url               national varchar(512) comment '通过第三方api生成的支付二维码',
   extend_parameter     national varchar(1024) comment '扩展信息，用于存储预生成数据，失效前重复调用',
   remark               varchar(256) comment '备注内容',
   primary key (id)
);

alter table trans comment '交易流水';

/*==============================================================*/
/* Table: user                                                  */
/*==============================================================*/
create table user
(
   id                   bigint not null,
   user_id              national varchar(32) comment '用户id',
   user_name            national varchar(100) comment '登录用户名',
   nick_name            varchar(255) comment '昵称',
   password             national varchar(50) comment '登录密码',
   salt                 national varchar(128) comment '加密用的盐',
   mobile               national varchar(11) comment '手机号',
   sex                  national char(1) default M comment '性别F/M',
   status               tinyint default 0 comment '状态',
   create_at            bigint default 0 comment '创建时间',
   update_at            bigint default 0 comment '更新时间',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table user comment '用户基础';

/*==============================================================*/
/* Table: user_location                                         */
/*==============================================================*/
create table user_location
(
   id                   bigint not null,
   user_id              bigint not null,
   client_ip            national varchar(50) comment 'ip',
   client_type          tinyint default 0 comment '客户端',
   created_at           bigint default 0 comment '上报时间',
   lng                  decimal(10,6) default 0.000000 comment '纬度',
   lat                  decimal(10,6) default 0.000000 comment '经度',
   primary key (id)
);

alter table user_location comment '用户上报定位信息(目前只有保洁师端有上报)';

/*==============================================================*/
/* Table: user_log                                              */
/*==============================================================*/
create table user_log
(
   id                   bigint unsigned not null,
   user_id              bigint,
   client_type          tinyint default 0 comment '类型',
   opt_type             int default 0 comment '操作类型',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(32) comment '创建者',
   status               tinyint unsigned default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table user_log comment '用户日志';

/*==============================================================*/
/* Table: user_other_oauth                                      */
/*==============================================================*/
create table user_other_oauth
(
   id                   bigint not null comment '主键',
   user_id              bigint not null,
   oauth_key            national varchar(32) not null comment '授权类型key如--wechat_app_open_id',
   oauth_value          national varchar(64) not null comment '第三方id',
   status               tinyint default 0 comment '当前记录的状态',
   create_at            bigint not null default 0 comment '创建时间',
   update_at            bigint default 0 comment '更新时间',
   primary key (id)
);

alter table user_other_oauth comment '用户第三方授权信息';

/*==============================================================*/
/* Table: user_recommend                                        */
/*==============================================================*/
create table user_recommend
(
   id                   bigint not null,
   merchant_id          bigint,
   user_id              bigint not null,
   recommend_no         national varchar(32) not null comment '推荐编号',
   order_no             national varchar(32) comment '订单编号',
   source_nick_name     national varchar(32) comment '推荐人名称',
   source_user_phone    national varchar(11) comment '推荐人电话',
   target_user_id       national varchar(32) comment '被推荐人id',
   target_nick_name     national varchar(32) comment '被推荐人名称',
   target_user_phone    national varchar(11) not null comment '被推荐人手机号码',
   type                 tinyint default 0 comment '推荐类型 0保洁师 1用户',
   status               tinyint default 3 comment '状态 0 审核中 1 审核通过 2 审核不通过 3 默认，不被查找',
   commission           bigint default 0 comment '佣金',
   remark               national varchar(50) comment '描述',
   create_at            bigint default 0 comment '创建时间',
   update_at            bigint default 0 comment '更新时间',
   update_by            national varchar(32) comment '更新人',
   primary key (id)
);

alter table user_recommend comment '推荐表';

/*==============================================================*/
/* Table: user_role                                             */
/*==============================================================*/
create table user_role
(
   admin_info_id        bigint not null,
   id                   bigint not null comment '主键id',
   role_info_id         int(20) comment '角色ID',
   nick_name            national varchar(20) comment '用户昵称',
   role_name            national varchar(100) comment '角色名',
   create_time          bigint default 0 comment '创建时间',
   open_time            bigint default 0 comment '开通时间',
   close_time           bigint default 0 comment '关闭时间',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (admin_info_id, id)
);

alter table user_role comment '用户角色';

/*==============================================================*/
/* Table: verify_code                                           */
/*==============================================================*/
create table verify_code
(
   id                   int(20) not null auto_increment,
   type                 tinyint default 0 comment '类型',
   mobile_number        national varchar(16) comment '手机号码',
   verify_code          national varchar(8) comment '验证码',
   send_at              bigint default 0 comment '发送时间',
   invalid_at           bigint default 0 comment '失效时间',
   client_ip            national varchar(20) comment 'ip地址',
   primary key (id)
);

alter table verify_code comment '短信验证码';

/*==============================================================*/
/* Table: vgoods                                                */
/*==============================================================*/
create table vgoods
(
   id                   bigint unsigned not null,
   coupon_batch_id      int(20) comment '主键',
   merchant_id          bigint,
   vgoods_template_id   int(20),
   goods_no             national varchar(32) comment '商品编号',
   goods_version        tinyint default 0 comment '商品版本',
   template_version     tinyint default 0 comment '商品模板版本',
   name                 national varchar(50) comment '商品名称',
   type                 tinyint default 0 comment '商品类型',
   is_show_countdown    national char(1) default N comment '是否显示倒计时,Y:是,N:否',
   original_price       bigint default 0 comment '原价',
   price                bigint default 0 comment '现价',
   service_count        int default 0 comment '服务次数',
   cycle_mode           tinyint default 0 comment '周期模式',
   cycle_freq           tinyint default 0 comment '周期频率',
   active_period        int default 0 comment '激活天数',
   use_period           int default 0 comment '使用天数',
   created_at           bigint unsigned default 0 comment '创建日期',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint unsigned default 0 comment '更新时间',
   updated_by           national varchar(32) comment '更新者',
   started_at           bigint default 0 comment '开售时间',
   ended_at             bigint default 0 comment '结束时间',
   total_num            int default 0 comment '商品总数量',
   sold_num             int default 0 comment '已售数量',
   focused_num          int default 0 comment '被关注人数',
   short_desc           national varchar(100) comment '简短描述',
   show_img             national varchar(255) comment '展示图片',
   service_desc         national text comment '服务描述',
   banner_imgs          national varchar(1000) comment 'banner图片',
   evaluate_num         int default 0 comment '评价个数',
   evaluate_score       bigint default 0 comment '评价分数',
   evaluate_rate        double default 0.00 comment '好评率',
   status               tinyint unsigned default 0 comment '商品状态',
   notice               national text comment '下单须知',
   small_label          national varchar(255) comment '小标签，以逗号相隔',
   big_label            national varchar(255) comment '大标签图片地址',
   limit_type           tinyint default 0 comment '限购方式 0不限购 1限新 2每人单次',
   del_flag             tinyint default 0 comment '删除标志',
   sale_profit          int default 0 comment '分销提成，万分比',
   sequence_num         int default 0 comment '排序',
   is_show_coupon       tinyint comment '优惠券展示：0-不展示，1-展示',
   primary key (id)
);

alter table vgoods comment '虚拟商品';

/*==============================================================*/
/* Table: vgoods_log                                            */
/*==============================================================*/
create table vgoods_log
(
   id                   bigint unsigned not null,
   vgoods_id            bigint,
   merchant_no          national varchar(32) not null comment '商户编号',
   user_id              national varchar(32) comment '用户id',
   client_type          tinyint default 0 comment '类型',
   opt_type             int default 0 comment '操作类型',
   created_at           bigint unsigned default 0 comment '创建时间',
   status               tinyint unsigned default 0 comment '状态',
   del_flag             tinyint default 0 comment '删除标志',
   client_ip            national varchar(50) comment '客户端ip',
   remark               national text comment '备注',
   primary key (id)
);

alter table vgoods_log comment '商品日志';

/*==============================================================*/
/* Table: vgoods_template                                       */
/*==============================================================*/
create table vgoods_template
(
   id                   int(20) unsigned not null auto_increment,
   template_no          national varchar(32) not null comment '商品模版编号',
   template_version     tinyint default 0 comment '商品模版版本',
   name                 national varchar(50) comment '商品名称',
   type                 tinyint default 0 comment '商品类型',
   original_price       bigint default 0 comment '原价',
   price                bigint default 0 comment '现价',
   service_count        int default 0 comment '服务次数',
   cycle_mode           tinyint default 0 comment '周期模式',
   cycle_freq           tinyint default 0 comment '周期频率',
   active_period        int default 0 comment '激活天数',
   use_period           int default 0 comment '使用天数',
   created_at           bigint unsigned default 0 comment '创建日期',
   created_by           national varchar(32) comment '创建者',
   updated_at           bigint unsigned default 0 comment '更新日期',
   updated_by           national varchar(32) comment '更新者',
   short_desc           national varchar(100) comment '简短描述',
   show_img             national varchar(255) comment '展示图片',
   service_desc         national text comment '服务描述',
   banner_imgs          national varchar(1000) comment 'banner图片',
   status               tinyint unsigned default 0 comment '商品状态',
   notice               national text comment '下单须知',
   small_label          national varchar(255) comment '小标签，以逗号相隔',
   big_label            national varchar(255) comment '大标签图片地址',
   limit_type           tinyint default 0 comment '限购方式 0不限购 1限新 2每人单次',
   del_flag             tinyint default 0 comment '删除标志',
   sale_profit          int default 0 comment '分销提成',
   primary key (id)
);

alter table vgoods_template comment '虚拟商品模版';

/*==============================================================*/
/* Table: vorder                                                */
/*==============================================================*/
create table vorder
(
   id                   bigint unsigned not null,
   address_id           bigint,
   coupon_id            bigint not null,
   consumer_info_id     bigint,
   channel_id           int comment 'id',
   vgoods_id            bigint,
   service_card_id      bigint comment '主键ID',
   merchant_no          national varchar(32) comment '商家编号',
   order_no             national varchar(32) comment '订单编号',
   address_full_name    national varchar(100) comment '地址全称',
   address_telephone    national varchar(20) comment '地址电话',
   region_id            int default 0 comment '地区id',
   linkman              national varchar(32) comment '联系人',
   lat                  decimal(10,6) default 0.000000 comment '纬度',
   lng                  decimal(10,6) default 0.000000 comment '经度',
   remark               national varchar(255) comment '留言',
   goods_version        tinyint default 0 comment '商品版本',
   goods_name           national varchar(50) comment '商品名称',
   goods_img_url        national varchar(255) comment '商品图片地址',
   goods_num            int default 0 comment '商品数量',
   origin_total_price   bigint default 0 comment '商品总原价',
   total_price          bigint unsigned default 0 comment '商品现总价',
   coupon_price         bigint default 0 comment '优惠金额',
   pay_price            bigint default 0 comment '支付金额',
   pay_type             tinyint default 0 comment '支付类型',
   pay_time             bigint default 0 comment '支付时间',
   order_source         tinyint default 0 comment '订单来源',
   status               tinyint default 0 comment '订单状态',
   voucher              national varchar(255) comment '兑换凭证',
   created_at           bigint unsigned default 0 comment '创建时间',
   created_by           national varchar(20) comment '创建者',
   updated_at           bigint unsigned default 0 comment '更新时间',
   updated_by           national varchar(20) comment '更新者',
   del_flag             tinyint default 0 comment '删除标志',
   sale_profit          int default 0 comment '分销',
   order_type           tinyint comment '订单类型',
   primary key (id)
);

alter table vorder comment '虚拟订单';

/*==============================================================*/
/* Table: wechat_tmplmsg                                        */
/*==============================================================*/
create table wechat_tmplmsg
(
   id                   int(20) not null auto_increment comment '自增编号',
   tmpl_id              national varchar(32) comment '模版编号',
   tmpl_key             national varchar(50) comment '代码调用（EnumWechatTmplKey）',
   tmpl_title           national varchar(50) comment '模版标题',
   tmpl_status          tinyint default 0 comment '模版状态（EnumWechatTmplStatus）',
   tmpl_call_id         national varchar(100) comment '调用模版消息ID',
   tmpl_msg             national text comment '模板消息参数与赋值内容',
   tmpl_params          national text comment '模板参数',
   create_at            bigint default 0 comment '创建时间',
   update_at            bigint default 0 comment '更新时间',
   del_flag             tinyint default 0 comment '删除标志',
   primary key (id)
);

alter table wechat_tmplmsg comment '微信推送消息模板';

