diff --git a/src/main/java/com/yn/bftl/thirdparty/common/repository/AccountRepository.java b/src/main/java/com/yn/bftl/thirdparty/common/repository/AccountRepository.java index 8e64913..f6866f6 100644 --- a/src/main/java/com/yn/bftl/thirdparty/common/repository/AccountRepository.java +++ b/src/main/java/com/yn/bftl/thirdparty/common/repository/AccountRepository.java @@ -30,11 +30,11 @@ @Modifying @Transactional - @Query("UPDATE Account account SET account.balance = account.balance + :amount where account.company = :companyId and account.type = 'DEPOSIT' and account.state = 'ENABLED'") + @Query("UPDATE Account account SET account.balance = account.balance + :amount where account.company.id = :companyId and account.type = 'DEPOSIT' and account.state = 'ENABLED'") int plusBalanceForCompany(@Param("amount") BigDecimal amount, @Param("companyId") Long companyId); @Modifying @Transactional - @Query("UPDATE Account account SET account.balance = account.balance - :amount where account.balance >= :amount and account.company = :companyId and account.type = 'DEPOSIT' and account.state = 'ENABLED'") + @Query("UPDATE Account account SET account.balance = account.balance - :amount where account.balance >= :amount and account.company.id = :companyId and account.type = 'DEPOSIT' and account.state = 'ENABLED'") int subBalanceForCompany(@Param("amount") BigDecimal amount, @Param("companyId") Long companyId); }