Done ticket GEPAFINBE-167
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.CategoryEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface CategoryRepository extends JpaRepository<CategoryEntity,Long> {
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import feign.Param;
|
||||
import net.gepafin.tendermanagement.entities.ApplicationAmendmentRequestEntity;
|
||||
import net.gepafin.tendermanagement.entities.CompanyDocumentEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface CompanyDocumentRepository extends JpaRepository<CompanyDocumentEntity,Long>, JpaSpecificationExecutor<CompanyDocumentEntity> {
|
||||
|
||||
@Query("SELECT c FROM CompanyDocumentEntity c WHERE c.id = :id AND c.isDeleted = false")
|
||||
Optional<CompanyDocumentEntity> findByIdAndNotDeleted(@Param("id") Long id);
|
||||
|
||||
@Query("SELECT d FROM CompanyDocumentEntity d " +
|
||||
"WHERE d.isDeleted = false " +
|
||||
"AND d.expirationDate BETWEEN :startTime AND :endTime")
|
||||
List<CompanyDocumentEntity> findExpiringBetween(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query("SELECT c FROM CompanyDocumentEntity c " +
|
||||
"WHERE c.isDeleted = false " +
|
||||
"AND c.expirationDate < :now")
|
||||
List<CompanyDocumentEntity> findByExpirationDateBeforeAndIsDeletedFalse(LocalDateTime now);
|
||||
|
||||
@Query("SELECT c FROM CompanyDocumentEntity c " +
|
||||
"WHERE c.companyId = :companyId " +
|
||||
"AND c.isDeleted = false")
|
||||
List<CompanyDocumentEntity> findByCompanyId(Long companyId);
|
||||
|
||||
List<CompanyDocumentEntity> findByCategoryEntityId(Long categoryId);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user