表名修改

This commit is contained in:
luojiaquan
2026-09-24 09:25:47 +08:00
parent f834dd785b
commit cef55c517e
34 changed files with 184 additions and 152 deletions
@@ -82,24 +82,24 @@
// void setUp()
// {
// // 1) 若账户不存在则先创建(总额度=TEST_TOTAL,余额/已用/临时均为0),保证后续 update 有行可改
// jdbc.update("INSERT INTO customer_account "
// jdbc.update("INSERT INTO ctr_customer_account "
// + "(customer_id, currency, balance, frozen_balance, total_credit, extra_credit, used_credit, tax, version, del_flag, create_by, create_time) "
// + "SELECT ?, ?, 0, 0, ?, 0, 0, 0, 0, '0', '并发测试', now() "
// + "FROM DUAL WHERE NOT EXISTS "
// + "(SELECT 1 FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0')",
// + "(SELECT 1 FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0')",
// CUSTOMER_ID, CURRENCY, TEST_TOTAL, CUSTOMER_ID, CURRENCY);
//
// // 2) 快照账户原值(用于恢复)
// origTotal = queryAmount("SELECT total_credit FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// origUsed = queryAmount("SELECT used_credit FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// origExtra = queryAmount("SELECT extra_credit FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// origTotal = queryAmount("SELECT total_credit FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// origUsed = queryAmount("SELECT used_credit FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// origExtra = queryAmount("SELECT extra_credit FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
//
// // 3) 重置为受控状态:总额度=TEST_TOTAL,已用=0,临时=0,并清掉历史额度流水(只清本客户,避免影响统计断言)
// jdbc.update("UPDATE customer_account SET total_credit = ?, used_credit = 0, extra_credit = 0, "
// jdbc.update("UPDATE ctr_customer_account SET total_credit = ?, used_credit = 0, extra_credit = 0, "
// + "extra_effective_date = NULL, extra_expire_date = NULL, version = version + 1 "
// + "WHERE customer_id = ? AND currency = ? AND del_flag = '0'",
// TEST_TOTAL, CUSTOMER_ID, CURRENCY);
// jdbc.update("DELETE FROM customer_credit_flow WHERE customer_id = ? AND create_by = '并发测试'",
// jdbc.update("DELETE FROM ctr_customer_credit_flow WHERE customer_id = ? AND create_by = '并发测试'",
// CUSTOMER_ID);
//
// // 4) 构造登录态(occupyCredit 内部调用 SecurityUtils.getUsername()/getUserId())
@@ -115,10 +115,10 @@
// // 1) 物理删除测试产生的额度流水
// for (Long id : createdFlowIds)
// {
// jdbc.update("DELETE FROM customer_credit_flow WHERE id = ?", id);
// jdbc.update("DELETE FROM ctr_customer_credit_flow WHERE id = ?", id);
// }
// // 2) 恢复账户原值
// jdbc.update("UPDATE customer_account SET total_credit = ?, used_credit = ?, extra_credit = ? "
// jdbc.update("UPDATE ctr_customer_account SET total_credit = ?, used_credit = ?, extra_credit = ? "
// + "WHERE customer_id = ? AND currency = ? AND del_flag = '0'",
// origTotal, origUsed, origExtra, CUSTOMER_ID, CURRENCY);
// // 3) 清理线程本地上下文,避免污染其他用例
@@ -157,7 +157,7 @@
// public void 并发占用_额度充足时所有更新全部生效()
// throws InterruptedException
// {
// jdbc.update("UPDATE customer_account SET total_credit = 5000, used_credit = 0 "
// jdbc.update("UPDATE ctr_customer_account SET total_credit = 5000, used_credit = 0 "
// + "WHERE customer_id = ? AND currency = ? AND del_flag = '0'", CUSTOMER_ID, CURRENCY);
//
// RunResult result = runConcurrentOccupy(5, AMOUNT);
@@ -230,17 +230,17 @@
//
// private BigDecimal queryUsedCredit()
// {
// return queryAmount("SELECT used_credit FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// return queryAmount("SELECT used_credit FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// }
//
// private BigDecimal queryTotalCredit()
// {
// return queryAmount("SELECT total_credit FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// return queryAmount("SELECT total_credit FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// }
//
// private BigDecimal queryExtraCredit()
// {
// return queryAmount("SELECT extra_credit FROM customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// return queryAmount("SELECT extra_credit FROM ctr_customer_account WHERE customer_id = ? AND currency = ? AND del_flag = '0'");
// }
//
// private BigDecimal queryAmount(String sql)