CREATE TABLE `toktok_stores`.`screen_projection`  (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`serial_number` varchar(20) NOT NULL COMMENT '序列号',
`img_url` varchar(255) NULL COMMENT '图片地址',
`status` tinyint(3) NULL COMMENT '状态0禁用，1正常',
`create_time` timestamp(0) NULL COMMENT '创建时间',
`update_time` timestamp(0) NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 11001000 COMMENT = '投屏图片管理表';


CREATE TABLE `admin_role` (
`role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`role_name` varchar(32) NOT NULL COMMENT '角色名称',
`role_desc` varchar(255) NOT NULL COMMENT '角色描述',
`create_uid` int(10) unsigned NOT NULL COMMENT '创建用户的id',
`enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否可用',
`plateform` varchar(8) NOT NULL DEFAULT '' COMMENT '子系统标识',
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

CREATE TABLE `admin_permission` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL COMMENT '用户ID',
`role_id` int(10) unsigned NOT NULL COMMENT '角色ID',
`create_uid` int(10) unsigned NOT NULL COMMENT '生成此权限的用户ID',
`module_name` varchar(32) DEFAULT '' COMMENT '模块名称PModule.pname',
`privilege` varchar(64) DEFAULT '' COMMENT '权限信息',
`plateform` varchar(16) NOT NULL DEFAULT '' COMMENT '子系统标识',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `apermission_userid_idx` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户权限明细';


CREATE TABLE `admin_user` (
`id` int(20) unsigned NOT NULL AUTO_INCREMENT,
`account` varchar(32) NOT NULL DEFAULT '' COMMENT '帐号',
`password` varchar(64) NOT NULL DEFAULT '',
`nameCn` varchar(16) NOT NULL DEFAULT '' COMMENT '中文名',
`nameEn` varchar(16) NOT NULL DEFAULT '' COMMENT '英文名',
`lockFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '锁定标识',
`delFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标识',
`genUid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建人',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `admin_user_acc_idx` (`account`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='运营后台用户表';

CREATE TABLE `toktok_stores`.`stores`  (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL COMMENT '门店名',
`address` varchar(255) NULL COMMENT '地址',
`manager` bigint(20) NULL COMMENT '店长',
`opt_user` varchar(255) NULL COMMENT '操作用户',
`create_time` timestamp(0) NULL,
`update_time` timestamp(0) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 33003100 COMMENT = '门店表';

---------------------------------------------------------------------------------------------------------

CREATE TABLE `toktok_stores`.`dishes_manage`  (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NULL COMMENT '菜品名',
`english_name` varchar(64) NULL COMMENT '英文名',
`type` tinyint(3) NOT NULL COMMENT '类型',
`status` tinyint(3) NULL COMMENT '上下架状态',
`seq` int(10) NULL COMMENT '排序值',
`create_time` timestamp(0) NULL,
`update_time` timestamp(0) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 18008800;

CREATE TABLE `toktok_stores`.`beer_properties`  (
`dishes_id` bigint(20) NOT NULL COMMENT '菜品id',
`abv` integer(10) NULL COMMENT '酒精度',
`ibu` integer(10) NULL COMMENT '苦度',
`create_time` timestamp(0) NULL,
`update_time` timestamp(0) NULL,
PRIMARY KEY (`dishes_id`)
);

CREATE TABLE `toktok_stores`.`dishes_specification`  (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`dishes_id` bigint(20) NOT NULL COMMENT '菜品id',
`specification` varchar(64) NULL COMMENT '规格名',
`price` decimal(10, 2) NULL COMMENT '价格',
`seq` int(10) NULL COMMENT '排序',
`create_time` timestamp(0) NULL,
`update_time` timestamp(0) NULL,
PRIMARY KEY (`id`)
);

CREATE TABLE `toktok_stores`.`specification`  (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NULL COMMENT '规格名',
`create_time` timestamp(0) NULL,
`update_time` timestamp(0) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 33003300 COMMENT = '规格表';

CREATE TABLE `toktok_stores`.`stores_dishes`  (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`store_id` bigint(20) NULL COMMENT '门店id',
`dishes_id` bigint(20) NULL COMMENT '菜品id',
`seq` int(10) NULL COMMENT '排序值，asc',
`create_time` timestamp(0) NULL,
`update_time` timestamp(0) NULL,
PRIMARY KEY (`id`)
) COMMENT = '门店-菜品管理表（菜单表）';


CREATE TABLE `toktok_stores`.`store_account`  (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `wx_nickname` varchar(64) NULL COMMENT '微信昵称',
    `openid` varchar(64) NULL,
    `wx_head_img` varchar(255) NULL COMMENT '微信头像',
    `unionid` varchar(255) NULL,
    `status` tinyint(2) NULL COMMENT '状态1开启，0禁止',
    `access_token` varchar(255) NULL COMMENT 'wx网页授权接口调用凭证',
    `refresh_token` varchar(255) NULL COMMENT 'wx填写通过access_token获取到的refresh_token参数',
    `token` varchar(255) NULL,
    `last_login_time` timestamp(0) NULL,
    `create_time` timestamp(0) NULL,
    `update_time` timestamp(0) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 22002100 COMMENT = '门店店员账户表';

--------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`sys_config`  (
        `id` bigint(10) NOT NULL AUTO_INCREMENT,
        `name` varchar(128) NOT NULL,
        `value` varchar(128) NULL,
        `des` varchar(128) NULL,
        `create_time` datetime(0) NULL,
        `update_time` datetime(0) NULL,
PRIMARY KEY (`id`)
);


CREATE TABLE `department` (
        `id` bigint(20) NOT NULL COMMENT '创建的部门id',
        `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '部门名称',
        `parentid` bigint(20) DEFAULT NULL COMMENT '父部门id。根部门为1',
        `order_no` int(20) DEFAULT NULL COMMENT '在父部门中的次序值',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `department_employee` (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `employee_userid` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '企业微信用户id',
        `department_id` bigint(20) NOT NULL COMMENT '部门id',
        `is_leader_in_dept` int(10) DEFAULT NULL COMMENT '表示在所在的部门内是否为上级',
        `order_no` int(10) DEFAULT NULL COMMENT '部门内的排序值,默认为0,数值越大排序越前面',
        PRIMARY KEY (`id`),
        UNIQUE KEY `department_employee_index` (`employee_userid`,`department_id`) COMMENT '部门id与员工用户id唯一索引'
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='企业微信员工与部门关系表';


CREATE TABLE `employee` (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `userid` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '企业微信用户id',
        `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '成员名称',
        `mobile` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号码',
        `position` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '职务信息',
        `gender` tinyint(3) DEFAULT NULL COMMENT '0表示未定义，1表示男性，2表示女性',
        `email` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '邮箱',
        `avatar` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像url',
        `thumb_avatar` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像缩略图url',
        `telephone` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座机',
        `alias` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '别名',
        `extattr` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '扩展属性',
        `status` tinyint(3) DEFAULT NULL COMMENT '激活状态: 1=已激活，2=已禁用，4=未激活，5=退出企业',
        `qr_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '员工个人二维码，扫描可添加为外部联系人',
        `open_userid` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '全局唯一',
        `main_department` bigint(20) DEFAULT NULL COMMENT '主部门',
        PRIMARY KEY (`id`),
        UNIQUE KEY `employee_user_id_index` (`userid`) COMMENT '企业微信用户id唯一索引'
) ENGINE=InnoDB AUTO_INCREMENT=11001121 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门成员详情';


CREATE TABLE `toktok_stores`.`clock_group`  (
        `groupid` bigint(0) NOT NULL,
        `groupname` varchar(64) NULL COMMENT '打卡规则名称',
        `type` tinyint(3) NOT NULL COMMENT '打卡规则类型，1：固定时间上下班；2：按班次上下班；3：自由上下班',
        PRIMARY KEY (`groupid`)
);

CREATE TABLE `toktok_stores`.`group_range`  (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `type` tinyint(3) NOT NULL COMMENT '目标id类型',
        `groupId` bigint(20) NOT NULL,
        `targtId` bigint(0) NOT NULL COMMENT '目标id',
        PRIMARY KEY (`id`)
);

CREATE TABLE `toktok_stores`.`schedule`  (
        `schedule_id` bigint(20) NOT NULL,
        `groupid` bigint(20) NOT NULL COMMENT '打卡规则id',
        `schedule_name` varchar(255) NULL COMMENT '班次名称',
        PRIMARY KEY (`schedule_id`)
);

CREATE TABLE `toktok_stores`.`group_schedule`  (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `groupid` bigint(20) NULL COMMENT '打卡规则id',
        `schedule_id` bigint(20) NULL COMMENT '班次信息id',
        PRIMARY KEY (`id`)
);


CREATE TABLE `toktok_stores`.`work_schedule`  (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `worke_date` datetime(0) NOT NULL COMMENT '排班日期',
        `department_id` bigint(20) NOT NULL COMMENT '部门id',
        `department_name` varchar(36) NOT NULL COMMENT '部门名（店铺名）',
        `m_shift_emp_id` varchar(255) NULL COMMENT '早班员工id',
        `af_shift_emp_id` varchar(255) NULL COMMENT '午班员工id',
        `ev_shift_emp_id` varchar(255) NULL COMMENT '晚班员工id',
        `create_time` datetime(0) NULL COMMENT '创建时间',
        `update_time` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
        PRIMARY KEY (`id`)
);

CREATE TABLE `toktok_stores`.`emp_tag`  (
        `tagid` bigint(20) NOT NULL,
        `tagname` varchar(36) NULL COMMENT '标签名',
        PRIMARY KEY (`tagid`)
);

CREATE TABLE `tag_and_emp` (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `tagid` bigint(20) NOT NULL COMMENT '标签id',
        `userid` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工id',
        PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `toktok_stores`.`attendance`  (
        `Id` bigint(20) NOT NULL AUTO_INCREMENT,
        `work_schedule_id` bigint(20) NOT NULL,
        `employe_id` bigint(20) NOT NULL COMMENT '员工记录id',
        `name` varchar(32) NOT NULL COMMENT '员工的名称',
        `userid` varchar(64) NOT NULL COMMENT '员工的userid',
        `tag_name` varchar(32) NULL COMMENT '员工标签名',
        `type` tinyint(3) NOT NULL COMMENT '1:早班，2:中班，3:晚班，4:兼职',
        `start_part_time` datetime(0) NULL COMMENT '兼职开始时间',
        `end_part_time` datetime(0) NULL COMMENT '兼职结束时间',
        `remark` varchar(64) NULL COMMENT '备注',
        `create_time` datetime(0) NULL COMMENT '创建时间',
        `update_time` datetime(0) NULL COMMENT '更新时间',
        PRIMARY KEY (`Id`)
);

--------------------
CREATE TABLE `toktok_stores`.`beer_material`  (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `name` varchar(64) NULL COMMENT '原料名',
        `place` varchar(64) NULL COMMENT '原产地',
        `introduce` varchar(64) NULL COMMENT '介绍',
        `create_time` datetime(0) NULL COMMENT '创建时间',
        `update_time` datetime(0) NULL COMMENT '更新时间',
        PRIMARY KEY (`id`)
);

CREATE TABLE `toktok_stores`.`factory_manage`  (
         `id` bigint(20) NOT NULL AUTO_INCREMENT,
         `name` varchar(64) NOT NULL COMMENT '厂家名',
         `place` varchar(64) NULL COMMENT '厂家地址',
         `introduce` varchar(255) NULL COMMENT '介绍',
         `create_time` datetime(0) NULL,
         `update_time` datetime(0) NULL,
         PRIMARY KEY (`id`)
);

CREATE TABLE `toktok_stores`.`beer_type_manage`  (
         `id` bigint(20) NOT NULL AUTO_INCREMENT,
         `type_name` varchar(32) NULL COMMENT '啤酒类型名',
         `introduce` varchar(255) NULL COMMENT '介绍',
         `create_time` datetime(0) NULL COMMENT '创建时间',
         `update_time` datetime(0) NULL COMMENT '更新时间',
         PRIMARY KEY (`id`)
);

CREATE TABLE `toktok_stores`.`beer_manage`  (
          `dishes_id` bigint(20) NOT NULL AUTO_INCREMENT,
          `beer_name` varchar(32) NULL COMMENT '啤酒名',
          `type_id` bigint(20) NULL COMMENT '啤酒类型id',
          `original_name` varchar(32) NULL COMMENT '啤酒出厂时的原名',
          `factory_id` bigint(20) NULL COMMENT '啤酒厂家id',
          `material_id` bigint(20) NULL COMMENT '啤酒原料信息id',
          `introduce` varchar(255) NULL COMMENT '介绍',
          PRIMARY KEY (`dishes_id`)
);

----------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`stores_historical_dishes`  (
          `id` bigint(20) NOT NULL AUTO_INCREMENT,
          `store_id` bigint(20) NOT NULL,
          `dishes_id` bigint(20) NOT NULL COMMENT '菜品id',
          `change_time` datetime(0) NOT NULL COMMENT '更换时间',
          `create_time` datetime(0) NOT NULL COMMENT '创建时间',
          PRIMARY KEY (`id`),
          UNIQUE INDEX `stores_id_and_dishes_id_index`(`store_id`, `dishes_id`) COMMENT '门店id，菜品id唯一索引'
) COMMENT = '门店历史菜品';

CREATE TABLE `toktok_stores`.`quanliang_account`  (
          `id` bigint(20) NOT NULL AUTO_INCREMENT,
          `robot_id` varchar(64) NULL COMMENT '扫码号id',
          `user_id` varchar(64) NULL COMMENT '用户id',
          `name` varchar(64) NULL COMMENT '名称',
          `real_name` varchar(64) NULL COMMENT '真实姓名',
          `avatar_url` varchar(128) NULL COMMENT '头像',
          `alias` varchar(64) NULL COMMENT '别名',
          `sex` tinyint(3) NULL COMMENT '用户性别:1男 2女',
          `is_online` tinyint(1) NULL COMMENT '是否在线',
          `status` tinyint(3) NULL COMMENT '状态1:正常，2:删除',
          `create_time` datetime(0) NULL COMMENT '创建时间',
          PRIMARY KEY (`id`)
) COMMENT = '圈量扫码号信息表';



CREATE TABLE `toktok_stores`.`quanliang_group`  (
          `id` bigint(20) NOT NULL AUTO_INCREMENT,
          `group_id` varchar(64) NULL COMMENT '群id',
          `name` varchar(64) NULL COMMENT '群名称',
          `owner_name` varchar(64) NULL COMMENT '群主名称',
          `created_at` bigint(0) NULL COMMENT '建群时间戳',
          `member_count` int(0) NULL DEFAULT 0 COMMENT '群人数',
          `is_watch` tinyint(1) NULL COMMENT '是否关注',
          PRIMARY KEY (`id`)
) COMMENT = '圈量获取的企微群表';


CREATE TABLE `toktok_stores`.`quanliang_account_and_group`  (
          `id` bigint(20) NOT NULL AUTO_INCREMENT,
          `account_id` bigint(20) NULL COMMENT '圈量扫码号id',
          `quanliang_group_id` bigint(20) NULL COMMENT '圈量获取的群的id',
          `create_time` datetime(0) NULL COMMENT '创建时间',
          PRIMARY KEY (`id`)
) COMMENT = '圈量扫码号和群聊中间表';

CREATE TABLE `toktok_stores`.`stores_and_group`  (
          `id` bigint(20) NOT NULL AUTO_INCREMENT,
          `store_id` bigint(20) NOT NULL COMMENT '门店id',
          `quanliang_group_id` bigint(20) NOT NULL COMMENT '圈量获取的群的id',
          PRIMARY KEY (`id`)
);
----------------------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`meal_standard`  (
          `standard_id` bigint(20) NOT NULL AUTO_INCREMENT,
          `parent_id` bigint(20) NOT NULL DEFAULT 0,
          `name` varchar(36) NOT NULL DEFAULT '' COMMENT '节点名',
          `comment_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '内容id',
          `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
          `update_time` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0),
          PRIMARY KEY (`standard_id`)
) COMMENT = '出餐规范表';

CREATE TABLE `toktok_stores`.`meal_standard_comment`  (
          `standard_comm_id` bigint(20) NOT NULL AUTO_INCREMENT,
          `comment` text NULL COMMENT '标准详情',
          `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
          `update_time` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0),
          PRIMARY KEY (`standard_comm_id`)
) COMMENT = '出餐标准详情表';

-----------------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`group_chat_send_msg`  (
           `msg_id` bigint(20) NOT NULL AUTO_INCREMENT,
           `content` varchar(500) NULL COMMENT '文本内容',
           `imgs` varchar(500) NULL,
           `sender_userid` varchar(255) NOT NULL DEFAULT '' COMMENT '发送企业群发消息的员工userid',
           `status` tinyint(3) NOT NULL DEFAULT 0,
           `send_status` tinyint(3) NOT NULL DEFAULT 0,
           `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
           `send_time` datetime(0) NULL,
           PRIMARY KEY (`msg_id`)
);
------------------------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`backlog`  (
           `backlog_id` bigint(20) NOT NULL AUTO_INCREMENT,
           `tittle` varchar(30) NOT NULL DEFAULT '' COMMENT '事项标题',
           `des` varchar(255) NOT NULL DEFAULT '' COMMENT '事项描述',
           `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '事项状态',
           `type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '事项生效类型',
           `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
           `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
           PRIMARY KEY (`backlog_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 11192381;

CREATE TABLE `toktok_stores`.`backlog_bind`  (
           `store_backlog_id` bigint(20) NOT NULL AUTO_INCREMENT,
           `store_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '门店id',
           `backlog_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '待办事项id',
           `imgs` varchar(512) NULL COMMENT '图片链接',
           `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态',
           `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
           `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
           PRIMARY KEY (`store_backlog_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 12389121 COMMENT = '门店待办事项表';

CREATE TABLE `toktok_stores`.`backlog_loop_bind`  (
           `store_backlog_loop_id` bigint(20) NOT NULL AUTO_INCREMENT,
           `backlog_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '待办事项id',
           `store_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '门店id',
           `loop_type` tinyint(20) NOT NULL COMMENT '循环类型',
           `start_time` datetime(0) NOT NULL COMMENT '开始时间',
           `tip_time` datetime(0) NOT NULL COMMENT '提醒时间',
           `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
           `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
           PRIMARY KEY (`store_backlog_loop_id`)
) COMMENT = '门店绑定待办事项循环类型表';

------------------------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`question_bank`  (
       `question_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '题目编号',
       `question_des` varchar(255) NOT NULL DEFAULT '' COMMENT '问题描述',
       `type` tinyint(5) NOT NULL DEFAULT 0 COMMENT '问题类型',
       `status` tinyint(5) NOT NULL DEFAULT 0 COMMENT '可用状态',
       `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
       `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
       PRIMARY KEY (`question_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 10203320 COMMENT = '题库';

CREATE TABLE `toktok_stores`.`question_option`  (
       `option_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '选项编号',
       `option_des` varchar(255) NOT NULL DEFAULT '' COMMENT '选项描述',
       `question_id` bigint(20) NOT NULL COMMENT '问题编号',
       `right_opt` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否正确选项',
       `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
       `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
       PRIMARY KEY (`option_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 10101100 COMMENT = '题库选项表';

CREATE TABLE `toktok_stores`.`train_record`  (
       `train_record_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '培训记录编号',
       `employee_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '员工编号',
       `score` varchar(255) NOT NULL DEFAULT 0 COMMENT '分数',
       `status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '状态',
       `finish_time` datetime(0) NULL COMMENT '完成时间',
       `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
       `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
       PRIMARY KEY (`train_record_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 11001000 COMMENT = '培训记录表';


CREATE TABLE `toktok_stores`.`train_plan`  (
       `train_plan_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '培训计划编号',
       `name` varchar(80) NOT NULL DEFAULT '' COMMENT '培训计划名称',
       `loop_type` tinyint(3) NOT NULL DEFAULT 0 COMMENT '循环类型',
       `target_type` tinyint(3) NOT NULL DEFAULT 0 COMMENT '目标类型',
       `target_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '目标id',
       `question_num` int(10) NOT NULL DEFAULT 0 COMMENT '问题数量',
       `answer_time` int(0) NOT NULL DEFAULT 10 COMMENT '答题时间',
       `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
       `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
       PRIMARY KEY (`train_plan_id`)
) COMMENT = '培训计划表';

CREATE TABLE `toktok_stores`.`answer_record`  (
       `answer_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '答题id',
       `train_record_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '培训id',
       `question_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '问题id',
       `option_ids` varchar(60) NOT NULL DEFAULT '' COMMENT '选项id',
       `right_answer` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否正确',
       `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
       `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
       PRIMARY KEY (`answer_id`)
) COMMENT = '答题记录';

--------------------------------------------------------------------------------------------------------------------------------
CREATE TABLE `toktok_stores`.`meal_standard_permission`  (
        `meal_standard_permission_id` bigint(20) NOT NULL AUTO_INCREMENT,
        `meal_standard_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '出餐规范节点id，用;分隔',
        `employee_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '员工id',
        `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
        `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
        PRIMARY KEY (`meal_standard_permission_id`)
) COMMENT = '员工访问出餐规范权限表';

CREATE TABLE `toktok_stores`.`employee_role`  (
        `employee_role_id` bigint(20) NOT NULL AUTO_INCREMENT,
        `role_name` varchar(40) NOT NULL DEFAULT '' COMMENT '角色名',
        `role_desc` varchar(255) NOT NULL DEFAULT '' COMMENT '角色描述',
        `enable` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否可用',
        `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
        PRIMARY KEY (`employee_role_id`)
) COMMENT = '员工角色表';