V1.0.sql 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. CREATE TABLE `toktok_stores`.`screen_projection` (
  2. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  3. `serial_number` varchar(20) NOT NULL COMMENT '序列号',
  4. `img_url` varchar(255) NULL COMMENT '图片地址',
  5. `status` tinyint(3) NULL COMMENT '状态0禁用,1正常',
  6. `create_time` timestamp(0) NULL COMMENT '创建时间',
  7. `update_time` timestamp(0) NULL COMMENT '更新时间',
  8. PRIMARY KEY (`id`)
  9. ) ENGINE = InnoDB AUTO_INCREMENT = 11001000 COMMENT = '投屏图片管理表';
  10. CREATE TABLE `admin_role` (
  11. `role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  12. `role_name` varchar(32) NOT NULL COMMENT '角色名称',
  13. `role_desc` varchar(255) NOT NULL COMMENT '角色描述',
  14. `create_uid` int(10) unsigned NOT NULL COMMENT '创建用户的id',
  15. `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否可用',
  16. `plateform` varchar(8) NOT NULL DEFAULT '' COMMENT '子系统标识',
  17. `create_time` datetime DEFAULT NULL,
  18. PRIMARY KEY (`role_id`)
  19. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  20. CREATE TABLE `admin_permission` (
  21. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  22. `user_id` int(10) unsigned NOT NULL COMMENT '用户ID',
  23. `role_id` int(10) unsigned NOT NULL COMMENT '角色ID',
  24. `create_uid` int(10) unsigned NOT NULL COMMENT '生成此权限的用户ID',
  25. `module_name` varchar(32) DEFAULT '' COMMENT '模块名称PModule.pname',
  26. `privilege` varchar(64) DEFAULT '' COMMENT '权限信息',
  27. `plateform` varchar(16) NOT NULL DEFAULT '' COMMENT '子系统标识',
  28. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  29. PRIMARY KEY (`id`),
  30. KEY `apermission_userid_idx` (`user_id`) USING BTREE
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户权限明细';
  32. CREATE TABLE `admin_user` (
  33. `id` int(20) unsigned NOT NULL AUTO_INCREMENT,
  34. `account` varchar(32) NOT NULL DEFAULT '' COMMENT '帐号',
  35. `password` varchar(64) NOT NULL DEFAULT '',
  36. `nameCn` varchar(16) NOT NULL DEFAULT '' COMMENT '中文名',
  37. `nameEn` varchar(16) NOT NULL DEFAULT '' COMMENT '英文名',
  38. `lockFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '锁定标识',
  39. `delFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标识',
  40. `genUid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建人',
  41. `createTime` datetime DEFAULT NULL COMMENT '创建时间',
  42. PRIMARY KEY (`id`),
  43. UNIQUE KEY `admin_user_acc_idx` (`account`)
  44. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='运营后台用户表';
  45. CREATE TABLE `toktok_stores`.`stores` (
  46. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  47. `name` varchar(64) NOT NULL COMMENT '门店名',
  48. `address` varchar(255) NULL COMMENT '地址',
  49. `manager` bigint(20) NULL COMMENT '店长',
  50. `opt_user` varchar(255) NULL COMMENT '操作用户',
  51. `create_time` timestamp(0) NULL,
  52. `update_time` timestamp(0) NULL,
  53. PRIMARY KEY (`id`)
  54. ) ENGINE = InnoDB AUTO_INCREMENT = 33003100 COMMENT = '门店表';
  55. ---------------------------------------------------------------------------------------------------------
  56. CREATE TABLE `toktok_stores`.`dishes_manage` (
  57. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  58. `name` varchar(32) NULL COMMENT '菜品名',
  59. `english_name` varchar(64) NULL COMMENT '英文名',
  60. `type` tinyint(3) NOT NULL COMMENT '类型',
  61. `status` tinyint(3) NULL COMMENT '上下架状态',
  62. `seq` int(10) NULL COMMENT '排序值',
  63. `create_time` timestamp(0) NULL,
  64. `update_time` timestamp(0) NULL,
  65. PRIMARY KEY (`id`)
  66. ) ENGINE = InnoDB AUTO_INCREMENT = 18008800;
  67. CREATE TABLE `toktok_stores`.`beer_properties` (
  68. `dishes_id` bigint(20) NOT NULL COMMENT '菜品id',
  69. `abv` integer(10) NULL COMMENT '酒精度',
  70. `ibu` integer(10) NULL COMMENT '苦度',
  71. `create_time` timestamp(0) NULL,
  72. `update_time` timestamp(0) NULL,
  73. PRIMARY KEY (`dishes_id`)
  74. );
  75. CREATE TABLE `toktok_stores`.`dishes_specification` (
  76. `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
  77. `dishes_id` bigint(20) NOT NULL COMMENT '菜品id',
  78. `specification` varchar(64) NULL COMMENT '规格名',
  79. `price` decimal(10, 2) NULL COMMENT '价格',
  80. `seq` int(10) NULL COMMENT '排序',
  81. `create_time` timestamp(0) NULL,
  82. `update_time` timestamp(0) NULL,
  83. PRIMARY KEY (`id`)
  84. );
  85. CREATE TABLE `toktok_stores`.`specification` (
  86. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  87. `name` varchar(32) NULL COMMENT '规格名',
  88. `create_time` timestamp(0) NULL,
  89. `update_time` timestamp(0) NULL,
  90. PRIMARY KEY (`id`)
  91. ) ENGINE = InnoDB AUTO_INCREMENT = 33003300 COMMENT = '规格表';
  92. CREATE TABLE `toktok_stores`.`stores_dishes` (
  93. `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  94. `store_id` bigint(20) NULL COMMENT '门店id',
  95. `dishes_id` bigint(20) NULL COMMENT '菜品id',
  96. `seq` int(10) NULL COMMENT '排序值,asc',
  97. `create_time` timestamp(0) NULL,
  98. `update_time` timestamp(0) NULL,
  99. PRIMARY KEY (`id`)
  100. ) COMMENT = '门店-菜品管理表(菜单表)';
  101. CREATE TABLE `toktok_stores`.`store_account` (
  102. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  103. `wx_nickname` varchar(64) NULL COMMENT '微信昵称',
  104. `openid` varchar(64) NULL,
  105. `wx_head_img` varchar(255) NULL COMMENT '微信头像',
  106. `unionid` varchar(255) NULL,
  107. `status` tinyint(2) NULL COMMENT '状态1开启,0禁止',
  108. `access_token` varchar(255) NULL COMMENT 'wx网页授权接口调用凭证',
  109. `refresh_token` varchar(255) NULL COMMENT 'wx填写通过access_token获取到的refresh_token参数',
  110. `token` varchar(255) NULL,
  111. `last_login_time` timestamp(0) NULL,
  112. `create_time` timestamp(0) NULL,
  113. `update_time` timestamp(0) NULL,
  114. PRIMARY KEY (`id`)
  115. ) ENGINE = InnoDB AUTO_INCREMENT = 22002100 COMMENT = '门店店员账户表';
  116. --------------------------------------------------------------------------------
  117. CREATE TABLE `toktok_stores`.`sys_config` (
  118. `id` bigint(10) NOT NULL AUTO_INCREMENT,
  119. `name` varchar(128) NOT NULL,
  120. `value` varchar(128) NULL,
  121. `des` varchar(128) NULL,
  122. `create_time` datetime(0) NULL,
  123. `update_time` datetime(0) NULL,
  124. PRIMARY KEY (`id`)
  125. );
  126. CREATE TABLE `department` (
  127. `id` bigint(20) NOT NULL COMMENT '创建的部门id',
  128. `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '部门名称',
  129. `parentid` bigint(20) DEFAULT NULL COMMENT '父部门id。根部门为1',
  130. `order_no` int(20) DEFAULT NULL COMMENT '在父部门中的次序值',
  131. PRIMARY KEY (`id`)
  132. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  133. CREATE TABLE `department_employee` (
  134. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  135. `employee_userid` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '企业微信用户id',
  136. `department_id` bigint(20) NOT NULL COMMENT '部门id',
  137. `is_leader_in_dept` int(10) DEFAULT NULL COMMENT '表示在所在的部门内是否为上级',
  138. `order_no` int(10) DEFAULT NULL COMMENT '部门内的排序值,默认为0,数值越大排序越前面',
  139. PRIMARY KEY (`id`),
  140. UNIQUE KEY `department_employee_index` (`employee_userid`,`department_id`) COMMENT '部门id与员工用户id唯一索引'
  141. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='企业微信员工与部门关系表';
  142. CREATE TABLE `employee` (
  143. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  144. `userid` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '企业微信用户id',
  145. `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '成员名称',
  146. `mobile` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号码',
  147. `position` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '职务信息',
  148. `gender` tinyint(3) DEFAULT NULL COMMENT '0表示未定义,1表示男性,2表示女性',
  149. `email` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '邮箱',
  150. `avatar` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像url',
  151. `thumb_avatar` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像缩略图url',
  152. `telephone` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座机',
  153. `alias` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '别名',
  154. `extattr` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '扩展属性',
  155. `status` tinyint(3) DEFAULT NULL COMMENT '激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业',
  156. `qr_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '员工个人二维码,扫描可添加为外部联系人',
  157. `open_userid` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '全局唯一',
  158. `main_department` bigint(20) DEFAULT NULL COMMENT '主部门',
  159. PRIMARY KEY (`id`),
  160. UNIQUE KEY `employee_user_id_index` (`userid`) COMMENT '企业微信用户id唯一索引'
  161. ) ENGINE=InnoDB AUTO_INCREMENT=11001121 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门成员详情';
  162. CREATE TABLE `toktok_stores`.`clock_group` (
  163. `groupid` bigint(0) NOT NULL,
  164. `groupname` varchar(64) NULL COMMENT '打卡规则名称',
  165. `type` tinyint(3) NOT NULL COMMENT '打卡规则类型,1:固定时间上下班;2:按班次上下班;3:自由上下班',
  166. PRIMARY KEY (`groupid`)
  167. );
  168. CREATE TABLE `toktok_stores`.`group_range` (
  169. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  170. `type` tinyint(3) NOT NULL COMMENT '目标id类型',
  171. `groupId` bigint(20) NOT NULL,
  172. `targtId` bigint(0) NOT NULL COMMENT '目标id',
  173. PRIMARY KEY (`id`)
  174. );
  175. CREATE TABLE `toktok_stores`.`schedule` (
  176. `schedule_id` bigint(20) NOT NULL,
  177. `groupid` bigint(20) NOT NULL COMMENT '打卡规则id',
  178. `schedule_name` varchar(255) NULL COMMENT '班次名称',
  179. PRIMARY KEY (`schedule_id`)
  180. );
  181. CREATE TABLE `toktok_stores`.`group_schedule` (
  182. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  183. `groupid` bigint(20) NULL COMMENT '打卡规则id',
  184. `schedule_id` bigint(20) NULL COMMENT '班次信息id',
  185. PRIMARY KEY (`id`)
  186. );
  187. CREATE TABLE `toktok_stores`.`work_schedule` (
  188. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  189. `worke_date` datetime(0) NOT NULL COMMENT '排班日期',
  190. `department_id` bigint(20) NOT NULL COMMENT '部门id',
  191. `department_name` varchar(36) NOT NULL COMMENT '部门名(店铺名)',
  192. `m_shift_emp_id` varchar(255) NULL COMMENT '早班员工id',
  193. `af_shift_emp_id` varchar(255) NULL COMMENT '午班员工id',
  194. `ev_shift_emp_id` varchar(255) NULL COMMENT '晚班员工id',
  195. `create_time` datetime(0) NULL COMMENT '创建时间',
  196. `update_time` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  197. PRIMARY KEY (`id`)
  198. );
  199. CREATE TABLE `toktok_stores`.`emp_tag` (
  200. `tagid` bigint(20) NOT NULL,
  201. `tagname` varchar(36) NULL COMMENT '标签名',
  202. PRIMARY KEY (`tagid`)
  203. );
  204. CREATE TABLE `tag_and_emp` (
  205. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  206. `tagid` bigint(20) NOT NULL COMMENT '标签id',
  207. `userid` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工id',
  208. PRIMARY KEY (`id`)
  209. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  210. CREATE TABLE `toktok_stores`.`attendance` (
  211. `Id` bigint(20) NOT NULL AUTO_INCREMENT,
  212. `work_schedule_id` bigint(20) NOT NULL,
  213. `employe_id` bigint(20) NOT NULL COMMENT '员工记录id',
  214. `name` varchar(32) NOT NULL COMMENT '员工的名称',
  215. `userid` varchar(64) NOT NULL COMMENT '员工的userid',
  216. `tag_name` varchar(32) NULL COMMENT '员工标签名',
  217. `type` tinyint(3) NOT NULL COMMENT '1:早班,2:中班,3:晚班,4:兼职',
  218. `start_part_time` datetime(0) NULL COMMENT '兼职开始时间',
  219. `end_part_time` datetime(0) NULL COMMENT '兼职结束时间',
  220. `remark` varchar(64) NULL COMMENT '备注',
  221. `create_time` datetime(0) NULL COMMENT '创建时间',
  222. `update_time` datetime(0) NULL COMMENT '更新时间',
  223. PRIMARY KEY (`Id`)
  224. );
  225. --------------------
  226. CREATE TABLE `toktok_stores`.`beer_material` (
  227. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  228. `name` varchar(64) NULL COMMENT '原料名',
  229. `place` varchar(64) NULL COMMENT '原产地',
  230. `introduce` varchar(64) NULL COMMENT '介绍',
  231. `create_time` datetime(0) NULL COMMENT '创建时间',
  232. `update_time` datetime(0) NULL COMMENT '更新时间',
  233. PRIMARY KEY (`id`)
  234. );
  235. CREATE TABLE `toktok_stores`.`factory_manage` (
  236. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  237. `name` varchar(64) NOT NULL COMMENT '厂家名',
  238. `place` varchar(64) NULL COMMENT '厂家地址',
  239. `introduce` varchar(255) NULL COMMENT '介绍',
  240. `create_time` datetime(0) NULL,
  241. `update_time` datetime(0) NULL,
  242. PRIMARY KEY (`id`)
  243. );
  244. CREATE TABLE `toktok_stores`.`beer_type_manage` (
  245. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  246. `type_name` varchar(32) NULL COMMENT '啤酒类型名',
  247. `introduce` varchar(255) NULL COMMENT '介绍',
  248. `create_time` datetime(0) NULL COMMENT '创建时间',
  249. `update_time` datetime(0) NULL COMMENT '更新时间',
  250. PRIMARY KEY (`id`)
  251. );
  252. CREATE TABLE `toktok_stores`.`beer_manage` (
  253. `dishes_id` bigint(20) NOT NULL AUTO_INCREMENT,
  254. `beer_name` varchar(32) NULL COMMENT '啤酒名',
  255. `type_id` bigint(20) NULL COMMENT '啤酒类型id',
  256. `original_name` varchar(32) NULL COMMENT '啤酒出厂时的原名',
  257. `factory_id` bigint(20) NULL COMMENT '啤酒厂家id',
  258. `material_id` bigint(20) NULL COMMENT '啤酒原料信息id',
  259. `introduce` varchar(255) NULL COMMENT '介绍',
  260. PRIMARY KEY (`dishes_id`)
  261. );
  262. ----------------------------------------------------------------------------------------------------------------------------------------------------------------
  263. CREATE TABLE `toktok_stores`.`stores_historical_dishes` (
  264. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  265. `store_id` bigint(20) NOT NULL,
  266. `dishes_id` bigint(20) NOT NULL COMMENT '菜品id',
  267. `change_time` datetime(0) NOT NULL COMMENT '更换时间',
  268. `create_time` datetime(0) NOT NULL COMMENT '创建时间',
  269. PRIMARY KEY (`id`),
  270. UNIQUE INDEX `stores_id_and_dishes_id_index`(`store_id`, `dishes_id`) COMMENT '门店id,菜品id唯一索引'
  271. ) COMMENT = '门店历史菜品';
  272. CREATE TABLE `toktok_stores`.`quanliang_account` (
  273. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  274. `robot_id` varchar(64) NULL COMMENT '扫码号id',
  275. `user_id` varchar(64) NULL COMMENT '用户id',
  276. `name` varchar(64) NULL COMMENT '名称',
  277. `real_name` varchar(64) NULL COMMENT '真实姓名',
  278. `avatar_url` varchar(128) NULL COMMENT '头像',
  279. `alias` varchar(64) NULL COMMENT '别名',
  280. `sex` tinyint(3) NULL COMMENT '用户性别:1男 2女',
  281. `is_online` tinyint(1) NULL COMMENT '是否在线',
  282. `status` tinyint(3) NULL COMMENT '状态1:正常,2:删除',
  283. `create_time` datetime(0) NULL COMMENT '创建时间',
  284. PRIMARY KEY (`id`)
  285. ) COMMENT = '圈量扫码号信息表';
  286. CREATE TABLE `toktok_stores`.`quanliang_group` (
  287. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  288. `group_id` varchar(64) NULL COMMENT '群id',
  289. `name` varchar(64) NULL COMMENT '群名称',
  290. `owner_name` varchar(64) NULL COMMENT '群主名称',
  291. `created_at` bigint(0) NULL COMMENT '建群时间戳',
  292. `member_count` int(0) NULL DEFAULT 0 COMMENT '群人数',
  293. `is_watch` tinyint(1) NULL COMMENT '是否关注',
  294. PRIMARY KEY (`id`)
  295. ) COMMENT = '圈量获取的企微群表';
  296. CREATE TABLE `toktok_stores`.`quanliang_account_and_group` (
  297. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  298. `account_id` bigint(20) NULL COMMENT '圈量扫码号id',
  299. `quanliang_group_id` bigint(20) NULL COMMENT '圈量获取的群的id',
  300. `create_time` datetime(0) NULL COMMENT '创建时间',
  301. PRIMARY KEY (`id`)
  302. ) COMMENT = '圈量扫码号和群聊中间表';
  303. CREATE TABLE `toktok_stores`.`stores_and_group` (
  304. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  305. `store_id` bigint(20) NOT NULL COMMENT '门店id',
  306. `quanliang_group_id` bigint(20) NOT NULL COMMENT '圈量获取的群的id',
  307. PRIMARY KEY (`id`)
  308. );
  309. ----------------------------------------------------------------------------------------------
  310. CREATE TABLE `toktok_stores`.`meal_standard` (
  311. `standard_id` bigint(20) NOT NULL AUTO_INCREMENT,
  312. `parent_id` bigint(20) NOT NULL DEFAULT 0,
  313. `name` varchar(36) NOT NULL DEFAULT '' COMMENT '节点名',
  314. `comment_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '内容id',
  315. `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  316. `update_time` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0),
  317. PRIMARY KEY (`standard_id`)
  318. ) COMMENT = '出餐规范表';
  319. CREATE TABLE `toktok_stores`.`meal_standard_comment` (
  320. `standard_comm_id` bigint(20) NOT NULL AUTO_INCREMENT,
  321. `comment` text NULL COMMENT '标准详情',
  322. `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
  323. `update_time` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0),
  324. PRIMARY KEY (`standard_comm_id`)
  325. ) COMMENT = '出餐标准详情表';
  326. -----------------------------------------------------------------------------------------
  327. CREATE TABLE `toktok_stores`.`group_chat_send_msg` (
  328. `msg_id` bigint(20) NOT NULL AUTO_INCREMENT,
  329. `content` varchar(500) NULL COMMENT '文本内容',
  330. `imgs` varchar(500) NULL,
  331. `sender_userid` varchar(255) NOT NULL DEFAULT '' COMMENT '发送企业群发消息的员工userid',
  332. `status` tinyint(3) NOT NULL DEFAULT 0,
  333. `send_status` tinyint(3) NOT NULL DEFAULT 0,
  334. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
  335. `send_time` datetime(0) NULL,
  336. PRIMARY KEY (`msg_id`)
  337. );
  338. ------------------------------------------------------------------------------------------------
  339. CREATE TABLE `toktok_stores`.`backlog` (
  340. `backlog_id` bigint(20) NOT NULL AUTO_INCREMENT,
  341. `tittle` varchar(30) NOT NULL DEFAULT '' COMMENT '事项标题',
  342. `des` varchar(255) NOT NULL DEFAULT '' COMMENT '事项描述',
  343. `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '事项状态',
  344. `type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '事项生效类型',
  345. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  346. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  347. PRIMARY KEY (`backlog_id`)
  348. ) ENGINE = InnoDB AUTO_INCREMENT = 11192381;
  349. CREATE TABLE `toktok_stores`.`backlog_bind` (
  350. `store_backlog_id` bigint(20) NOT NULL AUTO_INCREMENT,
  351. `store_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '门店id',
  352. `backlog_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '待办事项id',
  353. `imgs` varchar(512) NULL COMMENT '图片链接',
  354. `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态',
  355. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  356. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  357. PRIMARY KEY (`store_backlog_id`)
  358. ) ENGINE = InnoDB AUTO_INCREMENT = 12389121 COMMENT = '门店待办事项表';
  359. CREATE TABLE `toktok_stores`.`backlog_loop_bind` (
  360. `store_backlog_loop_id` bigint(20) NOT NULL AUTO_INCREMENT,
  361. `backlog_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '待办事项id',
  362. `store_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '门店id',
  363. `loop_type` tinyint(20) NOT NULL COMMENT '循环类型',
  364. `start_time` datetime(0) NOT NULL COMMENT '开始时间',
  365. `tip_time` datetime(0) NOT NULL COMMENT '提醒时间',
  366. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  367. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  368. PRIMARY KEY (`store_backlog_loop_id`)
  369. ) COMMENT = '门店绑定待办事项循环类型表';
  370. ------------------------------------------------------------------------------------------------
  371. CREATE TABLE `toktok_stores`.`question_bank` (
  372. `question_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '题目编号',
  373. `question_des` varchar(255) NOT NULL DEFAULT '' COMMENT '问题描述',
  374. `type` tinyint(5) NOT NULL DEFAULT 0 COMMENT '问题类型',
  375. `status` tinyint(5) NOT NULL DEFAULT 0 COMMENT '可用状态',
  376. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  377. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  378. PRIMARY KEY (`question_id`)
  379. ) ENGINE = InnoDB AUTO_INCREMENT = 10203320 COMMENT = '题库';
  380. CREATE TABLE `toktok_stores`.`question_option` (
  381. `option_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '选项编号',
  382. `option_des` varchar(255) NOT NULL DEFAULT '' COMMENT '选项描述',
  383. `question_id` bigint(20) NOT NULL COMMENT '问题编号',
  384. `right_opt` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否正确选项',
  385. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  386. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  387. PRIMARY KEY (`option_id`)
  388. ) ENGINE = InnoDB AUTO_INCREMENT = 10101100 COMMENT = '题库选项表';
  389. CREATE TABLE `toktok_stores`.`train_record` (
  390. `train_record_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '培训记录编号',
  391. `employee_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '员工编号',
  392. `score` varchar(255) NOT NULL DEFAULT 0 COMMENT '分数',
  393. `status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '状态',
  394. `finish_time` datetime(0) NULL COMMENT '完成时间',
  395. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  396. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  397. PRIMARY KEY (`train_record_id`)
  398. ) ENGINE = InnoDB AUTO_INCREMENT = 11001000 COMMENT = '培训记录表';
  399. CREATE TABLE `toktok_stores`.`train_plan` (
  400. `train_plan_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '培训计划编号',
  401. `name` varchar(80) NOT NULL DEFAULT '' COMMENT '培训计划名称',
  402. `loop_type` tinyint(3) NOT NULL DEFAULT 0 COMMENT '循环类型',
  403. `target_type` tinyint(3) NOT NULL DEFAULT 0 COMMENT '目标类型',
  404. `target_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '目标id',
  405. `question_num` int(10) NOT NULL DEFAULT 0 COMMENT '问题数量',
  406. `answer_time` int(0) NOT NULL DEFAULT 10 COMMENT '答题时间',
  407. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  408. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  409. PRIMARY KEY (`train_plan_id`)
  410. ) COMMENT = '培训计划表';
  411. CREATE TABLE `toktok_stores`.`answer_record` (
  412. `answer_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '答题id',
  413. `train_record_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '培训id',
  414. `question_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '问题id',
  415. `option_ids` varchar(60) NOT NULL DEFAULT '' COMMENT '选项id',
  416. `right_answer` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否正确',
  417. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  418. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  419. PRIMARY KEY (`answer_id`)
  420. ) COMMENT = '答题记录';
  421. --------------------------------------------------------------------------------------------------------------------------------
  422. CREATE TABLE `toktok_stores`.`meal_standard_permission` (
  423. `meal_standard_permission_id` bigint(20) NOT NULL AUTO_INCREMENT,
  424. `meal_standard_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '出餐规范节点id,用;分隔',
  425. `employee_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '员工id',
  426. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  427. `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  428. PRIMARY KEY (`meal_standard_permission_id`)
  429. ) COMMENT = '员工访问出餐规范权限表';
  430. CREATE TABLE `toktok_stores`.`employee_role` (
  431. `employee_role_id` bigint(20) NOT NULL AUTO_INCREMENT,
  432. `role_name` varchar(40) NOT NULL DEFAULT '' COMMENT '角色名',
  433. `role_desc` varchar(255) NOT NULL DEFAULT '' COMMENT '角色描述',
  434. `enable` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否可用',
  435. `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
  436. PRIMARY KEY (`employee_role_id`)
  437. ) COMMENT = '员工角色表';