vue-pro/sql/mysql/pay_wallet.sql

74 lines
4.9 KiB
Java
Raw Normal View History

2023-08-25 11:14:59 +08:00
-- ----------------------------
2023-09-04 14:54:38 +08:00
-- 会员钱包表
2023-08-25 11:14:59 +08:00
-- ----------------------------
DROP TABLE IF EXISTS `pay_wallet`;
CREATE TABLE `pay_wallet`
(
2023-09-13 17:28:42 +08:00
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`user_id` bigint NOT NULL COMMENT '用户编号',
`user_type` tinyint NOT NULL DEFAULT 0 COMMENT '用户类型',
`balance` int NOT NULL DEFAULT 0 COMMENT '余额单位分',
`total_expense` int NOT NULL DEFAULT 0 COMMENT '累计支出单位分',
`total_recharge` int NOT NULL DEFAULT 0 COMMENT '累计充值单位分',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2023-08-25 11:14:59 +08:00
PRIMARY KEY (`id`) USING BTREE
2023-09-04 14:54:38 +08:00
) ENGINE=InnoDB COMMENT='会员钱包表';
2023-08-25 11:14:59 +08:00
-- ----------------------------
2023-09-04 14:54:38 +08:00
-- 会员钱包流水表
2023-08-25 11:14:59 +08:00
-- ----------------------------
DROP TABLE IF EXISTS `pay_wallet_transaction`;
CREATE TABLE `pay_wallet_transaction`
(
2023-09-04 14:54:38 +08:00
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`wallet_id` bigint NOT NULL COMMENT '会员钱包 id',
`biz_type` tinyint NOT NULL COMMENT '关联类型',
`biz_id` varchar(64) NOT NULL COMMENT '关联业务编号',
`no` varchar(64) NOT NULL COMMENT '流水号',
`title` varchar(128) NOT NULL COMMENT '流水标题',
`price` int NOT NULL COMMENT '交易金额, 单位分',
`balance` int NOT NULL COMMENT '余额, 单位分',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2023-08-25 11:14:59 +08:00
PRIMARY KEY (`id`) USING BTREE
2023-09-04 14:54:38 +08:00
) ENGINE=InnoDB COMMENT='会员钱包流水表';
2023-09-13 17:28:42 +08:00
-- ----------------------------
-- 会员钱包充值
-- ----------------------------
DROP TABLE IF EXISTS `pay_wallet_recharge`;
CREATE TABLE `pay_wallet_recharge`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`wallet_id` bigint NOT NULL COMMENT '会员钱包 id',
2023-09-21 17:31:58 +08:00
`total_price` int NOT NULL COMMENT '用户实际到账余额例如充 100 20则该值是 120',
2023-09-13 17:28:42 +08:00
`pay_price` int NOT NULL COMMENT '实际支付金额',
2023-09-21 17:31:58 +08:00
`bonus_price` int NOT NULL COMMENT '钱包赠送金额',
2023-09-13 17:28:42 +08:00
`pay_status` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已支付[0:未支付 1:已经支付过]',
`pay_order_id` bigint NULL COMMENT '支付订单编号',
`pay_channel_code` varchar(16) NULL COMMENT '支付成功的支付渠道',
`pay_time` datetime NULL COMMENT '订单支付时间',
`pay_refund_id` bigint NULL COMMENT '支付退款单编号',
2023-09-21 17:31:58 +08:00
`refund_total_price` int NOT NULL DEFAULT 0 COMMENT '退款金额包含赠送金额',
2023-09-13 17:28:42 +08:00
`refund_pay_price` int NOT NULL DEFAULT 0 COMMENT '退款支付金额',
2023-09-21 17:31:58 +08:00
`refund_bonus_price` int NOT NULL DEFAULT 0 COMMENT '退款钱包赠送金额',
`refund_time` datetime NULL COMMENT '退款时间',
2023-09-13 17:28:42 +08:00
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='会员钱包充值';