lottery_01.sql 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. use lottery_01;
  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 DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  29. -- ----------------------------
  30. -- Records of user_strategy_export_000
  31. -- ----------------------------
  32. BEGIN;
  33. COMMIT;
  34. -- ----------------------------
  35. -- Table structure for user_strategy_export_001
  36. -- ----------------------------
  37. DROP TABLE IF EXISTS `user_strategy_export_001`;
  38. CREATE TABLE `user_strategy_export_001` (
  39. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  40. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  41. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  42. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  43. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  44. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  45. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  46. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  47. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  48. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  49. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  50. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  51. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  52. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  53. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  54. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  55. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  56. PRIMARY KEY (`id`),
  57. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  58. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  59. -- ----------------------------
  60. -- Records of user_strategy_export_001
  61. -- ----------------------------
  62. BEGIN;
  63. INSERT INTO `user_strategy_export_001` VALUES (1, 'xiaofuge', 100001, 1454347265400504320, 10001, 2, 1, '2021-10-30 15:19:43', 1, '3', 1, 'ipad', 'Code', '1454347264666501120', 1, '2021-10-30 15:19:43', '2021-10-30 15:19:43');
  64. INSERT INTO `user_strategy_export_001` VALUES (2, 'xiaofuge', 100001, 1454351703703945216, 10001, 2, 1, '2021-10-30 15:37:21', 1, '3', 1, 'ipad', 'Code', '1454351703137714176', 1, '2021-10-30 15:37:21', '2021-10-30 15:37:21');
  65. INSERT INTO `user_strategy_export_001` VALUES (3, 'xiaofuge', 100001, 1454355276684722176, 10001, 2, 1, '2021-10-30 15:51:33', 1, '3', 1, 'ipad', 'Code', '1454355275833278464', 1, '2021-10-30 15:51:33', '2021-10-30 15:51:33');
  66. COMMIT;
  67. -- ----------------------------
  68. -- Table structure for user_strategy_export_002
  69. -- ----------------------------
  70. DROP TABLE IF EXISTS `user_strategy_export_002`;
  71. CREATE TABLE `user_strategy_export_002` (
  72. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  73. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  74. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  75. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  76. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  77. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  78. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  79. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  80. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  81. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  82. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  83. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  84. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  85. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  86. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  87. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  88. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  89. PRIMARY KEY (`id`),
  90. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  91. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  92. -- ----------------------------
  93. -- Records of user_strategy_export_002
  94. -- ----------------------------
  95. BEGIN;
  96. COMMIT;
  97. -- ----------------------------
  98. -- Table structure for user_strategy_export_003
  99. -- ----------------------------
  100. DROP TABLE IF EXISTS `user_strategy_export_003`;
  101. CREATE TABLE `user_strategy_export_003` (
  102. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  103. `u_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  104. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  105. `order_id` bigint(32) DEFAULT NULL COMMENT '订单ID',
  106. `strategy_id` bigint(20) DEFAULT NULL COMMENT '策略ID',
  107. `strategy_mode` tinyint(2) DEFAULT NULL COMMENT '策略方式(1:单项概率、2:总体概率)',
  108. `grant_type` tinyint(2) DEFAULT NULL COMMENT '发放奖品方式(1:即时、2:定时[含活动结束]、3:人工)',
  109. `grant_date` datetime DEFAULT NULL COMMENT '发奖时间',
  110. `grant_state` tinyint(4) DEFAULT NULL COMMENT '发奖状态',
  111. `award_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发奖ID',
  112. `award_type` tinyint(2) DEFAULT NULL COMMENT '奖品类型(1:文字描述、2:兑换码、3:优惠券、4:实物奖品)',
  113. `award_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品名称',
  114. `award_content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '奖品内容「文字描述、Key、码」',
  115. `uuid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  116. `mq_state` tinyint(4) DEFAULT NULL COMMENT '消息发送状态(0未发送、1发送成功、2发送失败)',
  117. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  118. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  119. PRIMARY KEY (`id`),
  120. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE
  121. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户策略计算结果表';
  122. -- ----------------------------
  123. -- Records of user_strategy_export_003
  124. -- ----------------------------
  125. BEGIN;
  126. INSERT INTO `user_strategy_export_003` VALUES (1, 'Uhdgkw766120d', 120405215, 1443558966104850432, 42480428672, 1, 1, '2021-09-30 20:50:52', 1, '1', 1, 'IMac', '????', '1443558966104850432', NULL, '2021-09-30 20:50:52', '2021-09-30 20:50:52');
  127. COMMIT;
  128. -- ----------------------------
  129. -- Table structure for user_take_activity
  130. -- ----------------------------
  131. DROP TABLE IF EXISTS `user_take_activity`;
  132. CREATE TABLE `user_take_activity` (
  133. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  134. `u_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  135. `take_id` bigint(20) DEFAULT NULL COMMENT '活动领取ID',
  136. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  137. `activity_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '活动名称',
  138. `take_date` datetime DEFAULT NULL COMMENT '活动领取时间',
  139. `take_count` int(11) DEFAULT NULL COMMENT '领取次数',
  140. `strategy_id` int(11) DEFAULT NULL COMMENT '抽奖策略ID',
  141. `state` tinyint(2) DEFAULT NULL COMMENT '活动单使用状态 0未使用、1已使用',
  142. `uuid` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '防重ID',
  143. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  144. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  145. PRIMARY KEY (`id`),
  146. UNIQUE KEY `idx_uuid` (`uuid`) USING BTREE COMMENT '防重ID'
  147. ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户参与活动记录表';
  148. -- ----------------------------
  149. -- Records of user_take_activity
  150. -- ----------------------------
  151. BEGIN;
  152. INSERT INTO `user_take_activity` VALUES (16, 'Uhdgkw766120d', 1443899607431151616, 100001, 'test', '2021-10-01 19:24:27', 2, NULL, NULL, 'Uhdgkw766120d_100001_2', '2021-10-01 19:24:27', '2021-10-01 19:24:27');
  153. INSERT INTO `user_take_activity` VALUES (17, 'Uhdgkw766120d', 1443900230654394368, 100001, 'test', '2021-10-01 19:26:56', 3, NULL, NULL, 'Uhdgkw766120d_100001_3', '2021-10-01 19:26:56', '2021-10-01 19:26:56');
  154. INSERT INTO `user_take_activity` VALUES (18, 'xiaofuge', 1454347264666501120, 100001, '活动名', '2021-10-30 15:19:43', 1, 10001, 1, 'xiaofuge_100001_1', '2021-10-30 15:19:43', '2021-10-30 15:19:43');
  155. INSERT INTO `user_take_activity` VALUES (19, 'xiaofuge', 1454351703137714176, 100001, '活动名', '2021-10-30 15:37:21', 2, 10001, 1, 'xiaofuge_100001_2', '2021-10-30 15:37:21', '2021-10-30 15:37:21');
  156. INSERT INTO `user_take_activity` VALUES (20, 'xiaofuge', 1454355275833278464, 100001, '活动名', '2021-10-30 15:51:32', 3, 10001, 1, 'xiaofuge_100001_3', '2021-10-30 15:51:33', '2021-10-30 15:51:33');
  157. COMMIT;
  158. -- ----------------------------
  159. -- Table structure for user_take_activity_count
  160. -- ----------------------------
  161. DROP TABLE IF EXISTS `user_take_activity_count`;
  162. CREATE TABLE `user_take_activity_count` (
  163. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  164. `u_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户ID',
  165. `activity_id` bigint(20) DEFAULT NULL COMMENT '活动ID',
  166. `total_count` int(11) DEFAULT NULL COMMENT '可领取次数',
  167. `left_count` int(11) DEFAULT NULL COMMENT '已领取次数',
  168. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  169. `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  170. PRIMARY KEY (`id`),
  171. UNIQUE KEY `idx_uId_activityId` (`u_id`,`activity_id`) USING BTREE
  172. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户活动参与次数表';
  173. -- ----------------------------
  174. -- Records of user_take_activity_count
  175. -- ----------------------------
  176. BEGIN;
  177. INSERT INTO `user_take_activity_count` VALUES (1, 'Uhdgkw766120d', 100001, 10, 6, '2021-10-01 15:29:27', '2021-10-01 15:29:27');
  178. INSERT INTO `user_take_activity_count` VALUES (2, 'xiaofuge', 100001, 10, 7, '2021-10-30 15:19:43', '2021-10-30 15:19:43');
  179. COMMIT;
  180. SET FOREIGN_KEY_CHECKS = 1;