lottery_02.sql 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. use lottery;
  2. SET NAMES utf8mb4;
  3. SET FOREIGN_KEY_CHECKS = 0;
  4. -- ----------------------------
  5. -- Table structure for user_strategy_export_000
  6. -- ----------------------------
  7. DROP TABLE IF EXISTS `user_strategy_export_000`;
  8. CREATE TABLE `user_strategy_export_000` (
  9. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  10. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  11. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  12. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  13. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  14. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  15. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  16. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  17. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  18. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  19. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  20. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  21. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  22. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  23. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  24. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  25. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  26. PRIMARY KEY (`id`),
  27. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  28. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  29. -- ----------------------------
  30. -- Records of user_strategy_export_000
  31. -- ----------------------------
  32. BEGIN;
  33. INSERT INTO `user_strategy_export_000` VALUES (1, 'fustack', 100001, 1444540456057864192, 10001, 2, 1, NULL, 1, '3', 1, 'ipad', 'Code', '1444540456057864192', 0, '2021-10-03 13:50:57', '2021-10-30 12:59:44');
  34. INSERT INTO `user_strategy_export_000` VALUES (2, 'fustack', 100001, 1444541565086367744, 10001, 2, 1, NULL, 0, '5', 1, 'Book', 'Code', '1444541565086367744', 0, '2021-10-03 13:55:22', '2021-10-03 13:55:22');
  35. INSERT INTO `user_strategy_export_000` VALUES (3, 'fustack', 100001, 1444810184030633984, 10001, 2, 1, NULL, 0, '4', 1, 'AirPods', 'Code', '1444810184030633984', 0, '2021-10-04 07:42:45', '2021-10-04 07:42:45');
  36. INSERT INTO `user_strategy_export_000` VALUES (4, 'fustack', 100001, 1444820311156670464, 10001, 2, 1, NULL, 0, '2', 1, 'iphone', 'Code', '1444820311156670464', 0, '2021-10-04 08:23:00', '2021-10-04 08:23:00');
  37. INSERT INTO `user_strategy_export_000` VALUES (5, 'fustack', 100001, 1454313513303539712, 10001, 2, 1, NULL, 0, '4', 1, 'AirPods', 'Code', '1454313490931122176', 1, '2021-10-30 13:05:36', '2021-10-30 13:05:45');
  38. INSERT INTO `user_strategy_export_000` VALUES (6, 'fustack', 100001, 1454313878879076352, 10001, 2, 1, '2021-10-30 13:07:52', 1, '3', 1, 'ipad', 'Code', '1454313878132490240', 1, '2021-10-30 13:07:03', '2021-10-30 13:07:52');
  39. INSERT INTO `user_strategy_export_000` VALUES (7, 'fustack', 100001, 1454314085880561664, 10001, 2, 1, '2021-10-30 13:07:57', 1, '4', 1, 'AirPods', 'Code', '1454314085456936960', 1, '2021-10-30 13:07:52', '2021-10-30 13:07:57');
  40. INSERT INTO `user_strategy_export_000` VALUES (8, 'fustack', 100001, 1454314251442323456, 10001, 2, 1, '2021-10-30 13:08:35', 1, '4', 1, 'AirPods', 'Code', '1454314250930618368', 1, '2021-10-30 13:08:32', '2021-10-30 13:08:35');
  41. INSERT INTO `user_strategy_export_000` VALUES (9, 'fustack', 100001, 1454314395218870272, 10001, 2, 1, '2021-10-30 13:09:11', 1, '3', 1, 'ipad', 'Code', '1454314394698776576', 1, '2021-10-30 13:09:06', '2021-10-30 13:09:11');
  42. COMMIT;
  43. -- ----------------------------
  44. -- Table structure for user_strategy_export_001
  45. -- ----------------------------
  46. DROP TABLE IF EXISTS `user_strategy_export_001`;
  47. CREATE TABLE `user_strategy_export_001` (
  48. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  49. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  50. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  51. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  52. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  53. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  54. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  55. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  56. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  57. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  58. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  59. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  60. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  61. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  62. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  63. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  64. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  65. PRIMARY KEY (`id`),
  66. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  68. -- ----------------------------
  69. -- Records of user_strategy_export_001
  70. -- ----------------------------
  71. BEGIN;
  72. COMMIT;
  73. -- ----------------------------
  74. -- Table structure for user_strategy_export_002
  75. -- ----------------------------
  76. DROP TABLE IF EXISTS `user_strategy_export_002`;
  77. CREATE TABLE `user_strategy_export_002` (
  78. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  79. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  80. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  81. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  82. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  83. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  84. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  85. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  86. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  87. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  88. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  89. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  90. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  91. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  92. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  93. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  94. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  95. PRIMARY KEY (`id`),
  96. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  97. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  98. -- ----------------------------
  99. -- Records of user_strategy_export_002
  100. -- ----------------------------
  101. BEGIN;
  102. COMMIT;
  103. -- ----------------------------
  104. -- Table structure for user_strategy_export_003
  105. -- ----------------------------
  106. DROP TABLE IF EXISTS `user_strategy_export_003`;
  107. CREATE TABLE `user_strategy_export_003` (
  108. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  109. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  110. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  111. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  112. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  113. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  114. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  115. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  116. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  117. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  118. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  119. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  120. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  121. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  122. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  123. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  124. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  125. PRIMARY KEY (`id`),
  126. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  127. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  128. -- ----------------------------
  129. -- Records of user_strategy_export_003
  130. -- ----------------------------
  131. BEGIN;
  132. COMMIT;
  133. -- ----------------------------
  134. -- Table structure for user_take_activity
  135. -- ----------------------------
  136. DROP TABLE IF EXISTS `user_take_activity`;
  137. CREATE TABLE `user_take_activity` (
  138. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  139. `u_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  140. `take_id` bigint(20) DEFAULT NULL COMMENT '活动领取ID',
  141. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  142. `activity_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '活动名称',
  143. `take_date` datetime DEFAULT NULL COMMENT '活动领取时间',
  144. `take_count` int(11) DEFAULT NULL COMMENT '领取次数',
  145. `strategy_id` int(11) DEFAULT NULL COMMENT '抽奖策略ID',
  146. `state` tinyint(2) DEFAULT NULL COMMENT '活动单使用状态 0未使用、1已使用',
  147. `uuid` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  148. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  149. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  150. PRIMARY KEY (`id`),
  151. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE COMMENT '防重ID'
  152. ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户参与活动记录表';
  153. -- ----------------------------
  154. -- Records of user_take_activity
  155. -- ----------------------------
  156. BEGIN;
  157. INSERT INTO `user_take_activity` VALUES (4, 'fustack', 1444537120189480960, 100001, '???', '2021-10-03 13:37:33', 1, 10001, 1, 'fustack_100001_1', '2021-10-03 13:37:42', '2021-10-03 13:37:42');
  158. INSERT INTO `user_take_activity` VALUES (6, 'fustack', 1444539043961536512, 100001, '???', '2021-10-03 13:45:18', 2, 10001, 1, 'fustack_100001_2', '2021-10-03 13:45:37', '2021-10-03 13:45:37');
  159. INSERT INTO `user_take_activity` VALUES (7, 'fustack', 1444540455500021760, 100001, '???', '2021-10-03 13:50:57', 3, 10001, 1, 'fustack_100001_3', '2021-10-03 13:50:57', '2021-10-03 13:50:57');
  160. INSERT INTO `user_take_activity` VALUES (8, 'fustack', 1444541564645965824, 100001, '???', '2021-10-03 13:55:22', 4, 10001, 1, 'fustack_100001_4', '2021-10-03 13:55:21', '2021-10-03 13:55:21');
  161. INSERT INTO `user_take_activity` VALUES (9, 'fustack', 1444820310565273600, 100001, '???', '2021-10-04 08:23:00', 5, 10001, 1, 'fustack_100001_5', '2021-10-04 08:23:00', '2021-10-04 08:23:00');
  162. INSERT INTO `user_take_activity` VALUES (11, 'fustack', 1454313490931122176, 100001, '活动名', '2021-10-30 13:05:29', 6, 10001, 1, 'fustack_100001_6', '2021-10-30 13:05:30', '2021-10-30 13:05:30');
  163. INSERT INTO `user_take_activity` VALUES (12, 'fustack', 1454313878132490240, 100001, '活动名', '2021-10-30 13:06:59', 7, 10001, 1, 'fustack_100001_7', '2021-10-30 13:07:03', '2021-10-30 13:07:03');
  164. INSERT INTO `user_take_activity` VALUES (13, 'fustack', 1454314085456936960, 100001, '活动名', '2021-10-30 13:07:51', 8, 10001, 1, 'fustack_100001_8', '2021-10-30 13:07:52', '2021-10-30 13:07:52');
  165. INSERT INTO `user_take_activity` VALUES (14, 'fustack', 1454314250930618368, 100001, '活动名', '2021-10-30 13:08:31', 9, 10001, 1, 'fustack_100001_9', '2021-10-30 13:08:31', '2021-10-30 13:08:31');
  166. INSERT INTO `user_take_activity` VALUES (15, 'fustack', 1454314394698776576, 100001, '活动名', '2021-10-30 13:09:06', 10, 10001, 1, 'fustack_100001_10', '2021-10-30 13:09:06', '2021-10-30 13:09:06');
  167. COMMIT;
  168. -- ----------------------------
  169. -- Table structure for user_take_activity_count
  170. -- ----------------------------
  171. DROP TABLE IF EXISTS `user_take_activity_count`;
  172. CREATE TABLE `user_take_activity_count` (
  173. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  174. `u_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  175. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  176. `total_count` int(11) DEFAULT NULL COMMENT '可领取次数',
  177. `left_count` int(11) DEFAULT NULL COMMENT '已领取次数',
  178. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  179. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  180. PRIMARY KEY (`id`),
  181. UNIQUE KEY `idx_uId_activityId` (`u_id`,`activity_id`) USING BTREE
  182. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户活动参与次数表';
  183. -- ----------------------------
  184. -- Records of user_take_activity_count
  185. -- ----------------------------
  186. BEGIN;
  187. INSERT INTO `user_take_activity_count` VALUES (1, 'fustack', 100001, 10, 0, '2021-10-03 13:37:42', '2021-10-03 13:37:42');
  188. COMMIT;
  189. SET FOREIGN_KEY_CHECKS = 1;