23_20240822.sql 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ALTER TABLE distri_integral
  2. ADD COLUMN `consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '当前消费分';
  3. CREATE TABLE `distri_consumption_top_up_log` (
  4. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '充值编号',
  5. `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  6. `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
  7. `attachment` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '转账凭证附件',
  8. `consumption_points` bigint NOT NULL COMMENT '消费分',
  9. `practical_consumption_points` bigint NOT NULL COMMENT '实际消费分',
  10. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  11. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  12. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  13. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  14. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  15. PRIMARY KEY (`id`) USING BTREE,
  16. KEY `user_id` (`user_id`) USING BTREE
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='平台消费分充值记录';
  18. CREATE TABLE `distri_consumption_change_log` (
  19. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志编号',
  20. `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  21. `consumption_points` bigint NOT NULL COMMENT '变动的消费分',
  22. `after_consumption_points` bigint NOT NULL COMMENT '变动后消费分',
  23. `practical_consumption_points` bigint DEFAULT NULL COMMENT '实际消费分',
  24. `consumption_status` tinyint DEFAULT NULL COMMENT '消费分变动类型',
  25. `generate_user_id` bigint DEFAULT NULL COMMENT '消费分产生对象',
  26. `order_id` bigint DEFAULT NULL COMMENT '订单Id',
  27. `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  28. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  29. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  30. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  31. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  32. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  33. PRIMARY KEY (`id`) USING BTREE,
  34. KEY `user_id` (`user_id`) USING BTREE
  35. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='消费分变动记录';
  36. ALTER TABLE distri_order_percentage
  37. ADD COLUMN `consumption_magnification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '充值消费分的倍率',
  38. ADD COLUMN `first_top_up_consumption` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '首次充值消费分的额度',
  39. ADD COLUMN `follow_up_consumption` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '后续充值消费分的额度',
  40. ADD COLUMN `withdraw_commission` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '提现佣金百分比',
  41. ADD COLUMN `withdraw_consumption` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '提现消费分百分比';
  42. CREATE TABLE `distri_consumption_transfer_log` (
  43. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志编号',
  44. `transfer_user_id` bigint DEFAULT NULL COMMENT '转让用户ID',
  45. `transfer_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '转让人用户名',
  46. `consumption_points` bigint NOT NULL COMMENT '转让的消费分',
  47. `after_transfer_consumption_points` bigint NOT NULL COMMENT '变动后消费分(余额)',
  48. `recipient_user_id` bigint DEFAULT NULL COMMENT '接收用户ID',
  49. `recipient_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接收人用户名',
  50. `recipient_points` bigint NOT NULL COMMENT '接收的消费分',
  51. `after_recipient_consumption_points` bigint NOT NULL COMMENT '变动后消费分(余额)',
  52. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  53. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  54. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  55. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  56. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  57. PRIMARY KEY (`id`) USING BTREE
  58. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='消费分转让记录';
  59. ALTER TABLE distri_application_for_withdrawal
  60. ADD COLUMN `amount_total` bigint NOT NULL DEFAULT '0' COMMENT '提现总金额,单位:分',
  61. ADD COLUMN `withdraw_consumption` bigint NOT NULL DEFAULT '0' COMMENT '提现消费分,单位:分',
  62. ADD COLUMN `percent_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '计算百分比模板';
  63. ALTER TABLE distri_application_for_withdrawal_channel
  64. ADD COLUMN `amount_total` bigint NOT NULL DEFAULT '0' COMMENT '提现总金额,单位:分',
  65. ADD COLUMN `withdraw_consumption` bigint NOT NULL DEFAULT '0' COMMENT '提现消费分,单位:分';
  66. ALTER TABLE distri_pt_daily_withdrawal
  67. ADD COLUMN `amount_total` bigint NOT NULL DEFAULT '0' COMMENT '提现总金额,单位:分',
  68. ADD COLUMN `withdraw_consumption` bigint NOT NULL DEFAULT '0' COMMENT '提现消费分,单位:分';
  69. ALTER TABLE trade_order
  70. ADD COLUMN `pay_consumption_points` bigint DEFAULT '0' COMMENT '支付消费分',
  71. ADD COLUMN `refund_consumption` bigint DEFAULT '0' COMMENT '退还的使用的消费分';
  72. ALTER TABLE trade_order_item
  73. ADD COLUMN `pay_consumption_points` bigint DEFAULT '0' COMMENT '支付消费分',
  74. ADD COLUMN `refund_consumption` bigint DEFAULT '0' COMMENT '退还的使用的消费分';
  75. ALTER TABLE distri_daily_bill
  76. ADD COLUMN `consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '消费分',
  77. ADD COLUMN `received_consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '确收消费分',
  78. ADD COLUMN `refund_consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '退款消费分';
  79. ALTER TABLE distri_pt_daily_bill
  80. ADD COLUMN `consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '消费分',
  81. ADD COLUMN `received_consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '确收消费分',
  82. ADD COLUMN `refund_consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '退款消费分';
  83. ALTER TABLE trade_shop_settlement
  84. ADD COLUMN `shop_consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '抵扣消费分';
  85. ALTER TABLE trade_pt_settlement
  86. ADD COLUMN `consumption_points` bigint NOT NULL DEFAULT '0' COMMENT '抵扣消费分';
  87. ALTER TABLE trade_after_sale
  88. ADD COLUMN `refund_consumption_points` bigint DEFAULT '0' COMMENT '退还的使用的消费分',
  89. ADD COLUMN `refund_price_total` bigint NOT NULL DEFAULT '0' COMMENT '退款总金额,单位:分',
  90. ADD COLUMN `refund_integral` bigint DEFAULT '0' COMMENT '退还的使用的积分';
  91. CREATE TABLE distri_consumption_error_log (
  92. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '异动日志编号',
  93. `error_users_count` int NOT NULL DEFAULT '0' COMMENT '异动用户数量',
  94. `error_consumption_points_total` bigint DEFAULT '0' COMMENT '异动消费分总额',
  95. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  96. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  97. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  98. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  99. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  100. PRIMARY KEY (`id`) USING BTREE
  101. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='消费分异动日志记录';
  102. CREATE TABLE distri_consumption_error_user (
  103. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  104. `consumption_error_log_id` bigint unsigned NOT NULL COMMENT '异动日志编号',
  105. `user_id` bigint unsigned NOT NULL COMMENT '用户编号',
  106. `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
  107. `consumption_points_total` bigint DEFAULT '0' COMMENT '累加消费分总额',
  108. `now_consumption_points_total` bigint DEFAULT '0' COMMENT '目前消费分总额',
  109. `current_consumption_points_total` bigint DEFAULT '0' COMMENT '可用消费分',
  110. `used_consumption_points_total` bigint DEFAULT '0' COMMENT '已用消费分',
  111. `transfer_consumption_points_total` bigint DEFAULT '0' COMMENT '已转让消费分',
  112. `error_consumption_points_total` bigint DEFAULT '0' COMMENT '异动消费分差额',
  113. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  114. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  115. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  116. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  117. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  118. PRIMARY KEY (`id`) USING BTREE,
  119. KEY `user_id` (`user_id`) USING BTREE
  120. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='消费分异动用户';
  121. CREATE TABLE distri_user_top_up_consumption_points_order (
  122. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户充值消费分订单编号',
  123. `no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '订单流水号',
  124. `terminal` int NOT NULL COMMENT '订单来源终端',
  125. `user_id` bigint unsigned NOT NULL COMMENT '用户编号',
  126. `user_ip` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '用户 IP',
  127. `subject` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品标题',
  128. `top_up_consumption_points` bigint NOT NULL COMMENT '充值消费分',
  129. `practical_consumption_points` bigint NOT NULL COMMENT '到账消费分',
  130. `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
  131. `pay_order_id` bigint DEFAULT NULL COMMENT '支付订单编号',
  132. `pay_status` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已支付:[0:未支付 1:已经支付过]',
  133. `pay_time` datetime DEFAULT NULL COMMENT '订单支付时间',
  134. `pay_channel_code` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '支付成功的支付渠道',
  135. `finish_time` datetime DEFAULT NULL COMMENT '订单完成时间',
  136. `cancel_time` datetime DEFAULT NULL COMMENT '订单取消时间',
  137. `pay_price` bigint NOT NULL DEFAULT '0' COMMENT '应付金额(总),单位:分',
  138. `percent_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '计算百分比模板',
  139. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  140. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  141. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  142. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  143. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  144. PRIMARY KEY (`id`) USING BTREE
  145. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户充值消费分订单';
  146. ALTER TABLE distri_order_percentage
  147. ADD COLUMN `user_top_up_consumption_points` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户充值消费分的额度',
  148. ADD COLUMN `trigger_magnification_points` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '触发倍率的最低金额';