From 18236132282c50d48b418710961c0ac720095911 Mon Sep 17 00:00:00 2001 From: piyuskag Date: Mon, 4 Nov 2024 13:56:19 +0530 Subject: [PATCH] Fixed application count issue on admin dashboard. --- .../repositories/ApplicationRepository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java index 158c43fd..38d73e8d 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java @@ -29,15 +29,15 @@ public interface ApplicationRepository extends JpaRepository findByIdAndUserIdAndCallIdAndIsDeletedFalse(Long applicationId, Long userId, Long callId); - @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.userId = :userId AND a.company.id = :companyId AND a.status = 'SUBMIT' ") + @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.userId = :userId AND a.company.id = :companyId AND a.status = 'SUBMIT' AND a.isDeleted = false") Long countSubmittedApplicationsByUserId(@Param("userId") Long userId, @Param("companyId") Long companyId); List findByCompanyIdAndUserIdAndIsDeletedFalse(Long companyId,Long userId); - @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'SUBMIT' And a.hubId = :hubId") + @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'SUBMIT' And a.hubId = :hubId AND a.isDeleted = false") public Long countSubmittedApplicationsByHubId(@Param("hubId") Long hubId); - @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT' And a.hubId = :hubId") + @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT' And a.hubId = :hubId AND a.isDeleted = false") public Long countDraftApplicationsByHubId(@Param("hubId") Long hubId); @Query("SELECT a.call.id FROM ApplicationEntity a WHERE a.id = :id")