Skip to content

Commit 3ee5152

Browse files
committed
fix on getOperationCountFromLast24Hours query.
1 parent c7ecf7c commit 3ee5152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

BankApplicationBackend/src/main/java/com/demo/bankapp/repository/TransactionRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@RepositoryRestResource(exported = false)
1313
public interface TransactionRepository extends JpaRepository<Transaction, Long> {
1414

15-
@Query(value = "SELECT COUNT(*) FROM Transaction WHERE transactionTime >= DATEADD(day, -1, GETDATE())")
15+
@Query(value = "SELECT COUNT(*) FROM Transaction WHERE userId = :userId and transactionTime >= DATEADD(day, -1, GETDATE())")
1616
int getOperationCountFromLast24Hours(@Param("userId") Long userId);
1717

1818
List<Transaction> findAllByUserId(Long userId);

0 commit comments

Comments
 (0)