add point totalConsumed

This commit is contained in:
Timi
2026-08-22 11:45:00 +08:00
parent 376f0ecd05
commit 3c56e21efa
7 changed files with 28 additions and 7 deletions
@@ -12,9 +12,9 @@
<insert id="insertIfAbsent">
INSERT INTO `gao_point_account` (
`id`, `store_id`, `customer_id`, `balance`, `total_earned`, `total_revoked`, `total_adjusted`, `version`, `created_at`, `updated_at`, `deleted_at`
`id`, `store_id`, `customer_id`, `balance`, `total_earned`, `total_consumed`, `total_revoked`, `total_adjusted`, `version`, `created_at`, `updated_at`, `deleted_at`
) VALUES (
#{account.id}, #{account.storeId}, #{account.customerId}, #{account.balance}, #{account.totalEarned}, #{account.totalRevoked}, #{account.totalAdjusted}, #{account.version}, #{account.createdAt}, #{account.updatedAt}, #{account.deletedAt}
#{account.id}, #{account.storeId}, #{account.customerId}, #{account.balance}, #{account.totalEarned}, #{account.totalConsumed}, #{account.totalRevoked}, #{account.totalAdjusted}, #{account.version}, #{account.createdAt}, #{account.updatedAt}, #{account.deletedAt}
)
ON DUPLICATE KEY UPDATE `id` = `id`
</insert>
@@ -33,6 +33,7 @@
SET
`balance` = `balance` + #{delta},
`total_earned` = `total_earned` + #{totalEarnedDelta},
`total_consumed` = `total_consumed` + #{totalConsumedDelta},
`total_revoked` = `total_revoked` + #{totalRevokedDelta},
`total_adjusted` = `total_adjusted` + #{totalAdjustedDelta},
`version` = `version` + 1,