/*==============================================================*/ /* DBMS name: MySQL 5.0 */ /* Created on: 2018/8/24 21:10:53 */ /*==============================================================*/ 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 address_ext; 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 book_serve; drop table if exists book_serve_attachment; drop table if exists book_serve_log; drop table if exists channel; drop table if exists cleaner_attendance_appeal; drop table if exists cleaner_attendance_appeal_log; drop table if exists cleaner_blacklists; drop table if exists cleaner_district; drop table if exists cleaner_info; drop table if exists cleaner_leave_application; drop table if exists cleaner_leave_application_log; 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_follow_overview; 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 enchashment_record2; drop table if exists feedback_order; drop table if exists follow_detail; drop table if exists function_permission; 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 message_info; drop table if exists notice_desc; 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_admin_follow_consumer; 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 service_card_operate; drop table if exists service_evaluation; 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, relation_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: address_ext */ /*==============================================================*/ create table address_ext ( id bigint not null comment '主键', book_serve_id2 bigint, book_serve_id bigint comment '主键', address_id bigint not null default 0 comment '地址id', version_id int not null default 0 comment '版本号', user_id varchar(32) not null comment '用户id', building_type tinyint default 0 comment '房屋类型', room_type tinyint default 0 comment '房间数量', parlour_num_type tinyint default 0 comment '客厅数量', kitchen_num_type tinyint default 0 comment '厨房数量', toilet_num_type tinyint default 0 comment '卫生间数量', balcony_num_type tinyint default 0 comment '阳台数量', member_num_type tinyint default 0 comment '成员数量类型', square_type tinyint default 0 comment '面积范围', disposition_type tinyint default 0 comment '户主性格类型', sofa_type tinyint default 0 comment '沙发类型', pet_plant varchar(255) comment '宠物和盆栽情况', valuables_desc varchar(255) comment '贵重物情况', hygiene_type tinyint default 0 comment '卫生程度', clean_level tinyint default 0 comment '服务需求', consumer_desc varchar(255) comment '用户兴趣和生活习惯', created_by varchar(32) comment '创建人', created_at bigint default 0 comment '创建时间', updated_by varchar(32) comment '更新人', updated_at bigint default 0 comment '更新时间', del_flag tinyint default 0 comment '删除标识', primary key (id) ); alter table address_ext comment '地址附加信息'; /*==============================================================*/ /* Table: admin_info */ /*==============================================================*/ create table admin_info ( id bigint unsigned not null, user_id2 bigint, merchant_id bigint not null, 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, default_cleaner_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_id bigint unsigned not null, 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 '房屋面积', district_id int default 0 comment '区域id', 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是', default_cleaner_name varchar(50) comment '默认保洁师名称', amap_lng decimal(10,6) default 0.000000 comment '高德经度', amap_lat decimal(10,6) default 0.000000 comment '高德纬度', push_status tinyint comment '推送标识:0-未推送,1-已推送', push_at datetime comment '推送时间', 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: book_serve */ /*==============================================================*/ create table book_serve ( book_detail_id bigint not null, id bigint not null comment '主键', cleaner_pool_id bigint not null, serve_no varchar(32) not null comment '服务单号', region_id int not null default 0 comment '服务区域id', user_id varchar(32) not null comment '用户id', card_no varchar(32) comment '服务卡编号', linkman varchar(32) not null comment '联系人姓名', address_telephone varchar(16) not null comment '联系人电话', full_address varchar(255) not null comment '服务地址', address_id bigint not null default 0 comment '住址区域id', district_id int not null default 0 comment '服务区域id', lng decimal(10,6) default 0.000000 comment '经度', lat decimal(10,6) default 0.000000 comment '纬度', status tinyint default 0 comment '状态', evaluation_of_consumer tinyint default 0 comment '对客户评价', remark_of_consumer varchar(255) comment '对客户备注', remark varchar(255) comment '备注', created_by varchar(32) not null comment '创建人id', created_at bigint not null default 0 comment '创建时间', updated_by varchar(32) not null comment '更新人id', updated_at bigint not null default 0 comment '更新时间', del_flag tinyint default 0 comment '删除标识', has_log tinyint default 0 comment '保洁师是否评价 0否1是', has_send tinyint default 0 comment '是否已发送短信 0否 1是', work_start bigint default 0 comment '开始工作时间', work_start_status tinyint default 0 comment '上班卡状态 AttendanceStatusEnum', work_start_distance int default -1 comment '上班卡距离', work_stop bigint default 0 comment '结束工作时间', work_stop_status tinyint default 0 comment '下班卡状态 AttendanceStatusEnum', work_attendance tinyint default 0 comment '打卡情况 AttendanceStatusEnum', primary key (book_detail_id, id) ); alter table book_serve comment '服务订单详情'; /*==============================================================*/ /* Table: book_serve_attachment */ /*==============================================================*/ create table book_serve_attachment ( id bigint not null comment '主键', book_serve_id2 bigint not null, book_serve_id bigint not null comment '主键', attachment_no varchar(32) not null comment '附件编号', merchant_no varchar(32) not null comment '商户号', name varchar(128) not null comment '附件名', type tinyint not null default 0 comment '附件类型', attachment_url varchar(255) not null comment '附件地址', created_by varchar(32) not null comment '创建人', created_at bigint not null default 0 comment '创建时间', status tinyint default 0 comment '状态', del_flag tinyint default 0 comment '删除标识', primary key (id) ); alter table book_serve_attachment comment '服务单附件表'; /*==============================================================*/ /* Table: book_serve_log */ /*==============================================================*/ create table book_serve_log ( book_serve_id2 bigint, book_serve_id bigint comment '主键', id bigint, merchant_no varchar(32), user_id char(32), client_type tinyint, opt_type int, created_at bigint, created_by varchar(32), status tinyint, del_flag tinyint, client_ip varchar(50), remark text, lng decimal(10,6), lat decimal(10,6) ); alter table book_serve_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 '备注', del_flag tinyint comment '删除标志:0-有效,1-已删除', primary key (id) ); /*==============================================================*/ /* Table: cleaner_attendance_appeal */ /*==============================================================*/ create table cleaner_attendance_appeal ( id bigint not null comment '主键', book_serve_id2 bigint not null, book_serve_id bigint not null comment '主键', appeal_no varchar(32) not null comment '申诉编号', merchant_no varchar(32) not null comment '商户编号', book_time date not null comment '服务日期', time_type tinyint not null default 0 comment '服务时间', full_address varchar(255) not null comment '服务地址', linkman varchar(255) not null comment '联系人', address_telephone varchar(16) not null comment '联系号码', created_by varchar(32) not null comment '用户id', created_at bigint not null default 0 comment '发起申诉时间', appeal_reason varchar(255) not null comment '申诉原因', appeal_img varchar(255) comment '申诉图片', status tinyint default 0 comment '状态', type tinyint default 0 comment '申诉类型', attendance_time_type tinyint default 0 comment '0上班卡 1下班卡 AttendanceTimeEnum', updated_by varchar(32) comment '更新人', updated_at bigint default 0 comment '更新时间', del_flag tinyint default 0 comment '删除标识', primary key (id) ); alter table cleaner_attendance_appeal comment '保洁师考勤申诉记录'; /*==============================================================*/ /* Table: cleaner_attendance_appeal_log */ /*==============================================================*/ create table cleaner_attendance_appeal_log ( id bigint not null comment '主键', cleaner_attendance_appeal_id bigint not null comment '主键', merchant_no varchar(32) not null comment '商户编号', serve_no varchar(32) not null comment '服务单号', opt_user_id varchar(32) not null comment '审核人id', opt_type tinyint not null default 0 comment '操作类型', appeal_type tinyint not null default 0 comment '申诉类型', client_type tinyint default 0 comment '用户类型', status tinyint not null default 0 comment '状态', created_at bigint not null default 0 comment '审核时间', review_comment varchar(255) not null comment '审核内容', client_id varchar(64) not null comment '审核人ip', primary key (id) ); alter table cleaner_attendance_appeal_log comment '保洁师考勤申诉审核记录'; /*==============================================================*/ /* Table: cleaner_blacklists */ /*==============================================================*/ create table cleaner_blacklists ( id int not null auto_increment comment 'id', cleaner_id bigint not null, consumer_id bigint not null, cp_cleaner_name varchar(32) comment '保洁师名称', create_at bigint comment '创建时间', create_by varchar(32) comment '创建人', update_at bigint comment '更新时间', update_by varchar(32) comment '更新人', status tinyint comment '状态:0-正常,1-解除', remark varchar(100) comment '备注', del_flag tinyint comment '删除标识:0-未删除,1-已删除', primary key (id) ); alter table cleaner_blacklists comment '保洁师黑名单'; /*==============================================================*/ /* 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 '登录标识', departure_at bigint comment '离职时间,默认0,大于0为已离职', amap_lng decimal(10,6) comment '高德经度', amap_lat decimal(10,6) comment '高德纬度', primary key (id) ); alter table cleaner_info comment '保洁师'; /*==============================================================*/ /* Table: cleaner_leave_application */ /*==============================================================*/ create table cleaner_leave_application ( id bigint not null, cleaner_pool_id bigint not null, apply_no varchar(32) not null comment '申请编号', merchant_no varchar(32) not null comment '商户编号', begin_time bigint not null default 0 comment '请假开始时间', end_time bigint not null default 0 comment '请假结束时间', leave_reason varchar(255) not null comment '请假理由', leave_days float not null default 0 comment '请假天数', swap_user_id varchar(32) not null comment '调班对象id', swap_remark varchar(255) not null comment '调班备注', created_by varchar(32) not null comment '创建人', created_at bigint not null default 0 comment '创建时间', updated_by varchar(32) not null comment '更新人', updated_at bigint not null default 0 comment '更新时间', status tinyint not null default 0 comment '状态', del_flag tinyint not null default 0 comment '删除标识', primary key (id) ); alter table cleaner_leave_application comment '保洁师请假申请'; /*==============================================================*/ /* Table: cleaner_leave_application_log */ /*==============================================================*/ create table cleaner_leave_application_log ( id bigint not null comment '主键', cleaner_leave_application_id bigint not null, merchant_no varchar(32) not null comment '商户编号', opt_user_id varchar(32) not null comment '审核/操作人id', opt_type tinyint not null default 0 comment '操作类型', created_at bigint not null default 0 comment '操作时间', opt_remark varchar(255) not null comment '操作备注', client_id varchar(64) not null comment '操作者ip', client_type tinyint, primary key (id) ); alter table cleaner_leave_application_log 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_follow_overview */ /*==============================================================*/ create table consumer_follow_overview ( id int not null auto_increment, user_id bigint not null, feedback_num int default 0 comment '回访次数', follow_num int default 0 comment '跟进次数', last_follow_at bigint default 0 comment '最近跟进时间', status tinyint default 1 comment '状态:0-待跟进,1-跟进中', create_source tinyint comment '来源:1-回访工单,2-用户跟进', create_at bigint comment '创建时间', create_by varchar(32) comment '创建人', update_at bigint comment '更新时间', update_by varchar(32) comment '更新人', primary key (id) ); alter table consumer_follow_overview comment '消费者跟进状况'; /*==============================================================*/ /* Table: consumer_info */ /*==============================================================*/ create table consumer_info ( id bigint unsigned not null, channel_id int comment 'id', 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: enchashment_record2 */ /*==============================================================*/ create table enchashment_record2 ( 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_record2 comment '提现记录'; /*==============================================================*/ /* Table: feedback_order */ /*==============================================================*/ create table feedback_order ( id int not null auto_increment, feedback_user_id bigint, book_detail_id bigint not null, feedback_no varchar(32) comment '回访编号', book_no varchar(32) comment '预约编号', user_id char(10) comment '用户id', merchant_no national varchar(32) not null comment '商家编号', card_type tinyint default 0 comment '服务卡类型', book_time date comment '预约日期', book_week tinyint default 0 comment '预约星期', time_type tinyint default 0 comment '时间类型', address_telephone national varchar(16) comment '联系人号码', linkman national varchar(16) comment '联系人姓名', cleaner_name national varchar(32) comment '保洁师名称', address_id bigint unsigned not null comment '地址id', full_address national varchar(128) comment '服务地址', channel_id bigint 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 '更新者', attitude_score int comment '服务态度评分', quality_score int comment '服务质量评分', efficiency_score int comment '服务速度评分', answers_status tinyint default 0 comment '应答状态:0-未接听,1-正常', feedback_status tinyint default 0 comment '回访状态:0-未回访,1-已回访', feedback_content varchar(255) comment '回访内容', feedback_by varchar(32) comment '回访人', feedback_at bigint comment '回访时间', primary key (id) ); alter table feedback_order comment '回访工单'; /*==============================================================*/ /* Table: follow_detail */ /*==============================================================*/ create table follow_detail ( id int not null auto_increment, follow_overview_id int not null, level varchar(10) comment '用户等级', follow_context varchar(255) comment '跟进内容', create_at bigint comment '创建时间', create_by varchar(32) comment '创建人', primary key (id) ); alter table follow_detail comment '跟进明细'; /*==============================================================*/ /* Table: function_permission */ /*==============================================================*/ create table function_permission ( id int not null auto_increment comment 'id', name varchar(50) comment '名称', url varchar(200) comment 'url', method varchar(20) comment '请求方式:GET,POST,PUT,DELETE', create_time bigint comment '创建时间', del_flag tinyint, primary key (id) ); alter table function_permission 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: message_info */ /*==============================================================*/ create table message_info ( id bigint not null, notice_desc_id bigint not null, cleaner_leave_application_id bigint not null, cleaner_leave_application_id2 bigint not null, message_no national varchar(32) not null comment '消息编号', merchant_no national varchar(32) not null comment '商户编号', user_id national varchar(32) not null comment '用户id', type tinyint not null default 0 comment '消息类型', created_by national varchar(32) not null comment '创建人', created_at bigint not null default 0 comment '创建时间', status tinyint not null default 0 comment '状态', del_flag tinyint not null default 0 comment '删除标识', primary key (id) ); alter table message_info comment '消息列表'; /*==============================================================*/ /* Table: notice_desc */ /*==============================================================*/ create table notice_desc ( id bigint not null, merchant_no varchar(32) not null comment '商户编号', notice_no varchar(32) not null comment '公告编号', notice_type tinyint not null default 0 comment '公告类型', notice_title varchar(64) not null comment '公告标题', notice_img varchar(255) not null comment '公告配图', notice_content text not null comment '公告内容', created_by varchar(32) not null comment '创建人', created_at bigint not null default 0 comment '创建时间', updated_by varchar(32) not null comment '更新人', updated_at bigint not null default 0 comment '更新时间', status tinyint default 0 comment '状态', del_flag tinyint default 0 comment '删除标识', primary key (id) ); alter table notice_desc comment '公告信息表'; /*==============================================================*/ /* 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 '权限名称', permission_url varchar(200) comment 'URL', parent_id bigint comment '父级菜单', level int comment '级别', icon varchar(50) comment '图标', sort bigint comment '排序', type tinyint comment '权限类型:1-菜单,2-菜单组', create_by varchar(32) comment '创建人', create_time bigint default 0 comment '创建时间', update_by varchar(32) comment '更新人', update_at bigint comment '更新时间', fids varchar(200) comment '功能权限id集合:逗号分隔', 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_admin_follow_consumer */ /*==============================================================*/ create table rel_admin_follow_consumer ( follow_overview_id int not null, admin_id bigint not null, status tinyint default 0 comment '跟进状态:1-跟进中,2-已移除', feedback_num int default 0 comment '回访次数', follow_num int default 0 comment '跟进次数', create_source tinyint comment '来源:1-回访工单,2-用户跟进', create_at bigint comment '创建时间', create_by varchar(32) comment '创建人', update_by varchar(32) comment '更新人', update_at bigint comment '更新时间', primary key (follow_overview_id, admin_id) ); alter table rel_admin_follow_consumer 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 '角色名', status tinyint default 0 comment '状态:0-正常,1-禁止', create_time bigint comment '创建时间', create_by varchar(32) comment '创建人', update_time bigint comment '更新时间', update_by varchar(32) 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 ( permission_id int(20) not null comment '权限ID', role_id int(20) not null comment '角色ID', role_name national varchar(100) comment '角色名', permission_name national varchar(32) comment '权限名', del_flag tinyint default 0 comment '删除标志', primary key (permission_id, role_id) ); /*==============================================================*/ /* Table: service_card */ /*==============================================================*/ create table service_card ( id bigint not null comment '主键ID', 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 '房屋面积', amap_lng decimal(10,6) default 0.000000 comment '高德经度', amap_lat decimal(10,6) default 0.000000 comment '高德纬度', primary key (id) ); alter table service_card comment '服务卡'; /*==============================================================*/ /* Table: service_card_operate */ /*==============================================================*/ create table service_card_operate ( id int not null auto_increment, card_id bigint comment '主键ID', card_no varchar(32), operate_content varchar(255), create_at bigint, create_by varchar(32), primary key (id) ); alter table service_card_operate comment '服务卡操作记录'; /*==============================================================*/ /* Table: service_evaluation */ /*==============================================================*/ create table service_evaluation ( id int not null auto_increment comment 'id', book_id bigint not null, user_id bigint not null, book_no varchar(32) comment '预约编号', evaluation_no varchar(32) comment '评价编号', time_score int comment '准时到达评分', service_score int comment '洁净标准评分', profession_score int comment '专业高效评分', create_at bigint comment '创建时间', content varchar(255) comment '评价内容', primary key (id) ); alter table service_evaluation 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 ( user_id bigint not null, role_id int(20) not null comment '角色ID', nick_name national varchar(20) comment '用户昵称', role_name national varchar(100) comment '角色名', create_time bigint comment '创建时间', open_time bigint comment '开通时间', close_time bigint comment '关闭时间', del_flag tinyint default 0 comment '删除标志', primary key (user_id, role_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-展示', sale_type tinyint comment '分销类型:1-实付比例,2-固定金额', 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 '订单类型', sale_type tinyint comment '分销类型:1-实付比例,2-固定金额', 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 '微信推送消息模板';