Updated code for super admin dashboard api

This commit is contained in:
nisha
2024-10-14 17:16:20 +05:30
parent 6f54ed0fad
commit 4133b4f9dc
4 changed files with 46 additions and 9 deletions

View File

@@ -33,4 +33,12 @@ public interface ApplicationRepository extends JpaRepository<ApplicationEntity,
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.userId = :userId AND a.status = 'SUBMIT' ")
Long countSubmittedApplicationsByUserId(@Param("userId") Long userId);
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'SUBMIT'")
Long countSubmittedApplications();
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT'")
Long countDraftApplications();
}

View File

@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import net.gepafin.tendermanagement.entities.CompanyEntity;
@@ -15,4 +16,8 @@ public interface CompanyRepository extends JpaRepository<CompanyEntity, Long> {
Boolean existsByVatNumber(String vatNumber);
CompanyEntity findByVatNumber(String vatNumber);
@Query("SELECT COUNT(c) FROM CompanyEntity c")
long countTotalCompanies();
}