Resolve Conflict
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface ApplicationEvaluationRepository extends JpaRepository<ApplicationEvaluationEntity, Long> {
|
||||
|
||||
Optional<ApplicationEvaluationEntity> findByApplicationIdAndIsDeletedFalse(Long applicationId);
|
||||
|
||||
Optional<ApplicationEvaluationEntity> findByAssignedApplicationsEntity_IdAndIsDeletedFalse(Long assignedApplicationId);
|
||||
|
||||
Optional<ApplicationEvaluationEntity> findByApplicationIdAndAssignedApplicationsEntity_IdAndIsDeletedFalse(Long applicationId, Long assignedApplicationId);
|
||||
|
||||
Optional<ApplicationEvaluationEntity> findFirstByIsDeletedFalseOrderByCreatedDateDesc();
|
||||
|
||||
}
|
||||
@@ -23,6 +23,17 @@ public interface ApplicationFormFieldRepository extends JpaRepository<Applicatio
|
||||
|
||||
public List<ApplicationFormFieldEntity> findByFieldValueInAndApplicationFormApplicationId(
|
||||
List<String> fieldValue, Long applicationId);
|
||||
/**
|
||||
* Find ApplicationFormField entity by Field ID, Form ID, and Application ID.
|
||||
*
|
||||
* @param fieldId The Field ID to search.
|
||||
* @param formId The Form ID to search.
|
||||
* @param applicationId The Application ID to search.
|
||||
* @return Optional of ApplicationFormFieldEntity
|
||||
*/
|
||||
Optional<ApplicationFormFieldEntity> findByFieldIdAndApplicationFormIdAndApplicationFormApplicationId(
|
||||
String fieldId, Long formId, Long applicationId);
|
||||
|
||||
|
||||
public ApplicationFormFieldEntity findByFieldId(String FieldId);
|
||||
|
||||
|
||||
@@ -32,13 +32,14 @@ public interface ApplicationRepository extends JpaRepository<ApplicationEntity,
|
||||
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.userId = :userId AND a.company.id = :companyId AND a.status = 'SUBMIT' ")
|
||||
Long countSubmittedApplicationsByUserId(@Param("userId") Long userId, @Param("companyId") Long companyId);
|
||||
|
||||
@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();
|
||||
|
||||
List<ApplicationEntity> findByCompanyIdAndUserIdAndIsDeletedFalse(Long companyId,Long userId);
|
||||
|
||||
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'SUBMIT' And a.hubId = :hubId")
|
||||
public Long countSubmittedApplicationsByHubId(@Param("hubId") Long hubId);
|
||||
|
||||
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT' And a.hubId = :hubId")
|
||||
public Long countDraftApplicationsByHubId(@Param("hubId") Long hubId);
|
||||
|
||||
@Query("SELECT a.call.id FROM ApplicationEntity a WHERE a.id = :id")
|
||||
Long findCallIdById(@Param("id") Long id);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.ApplicationSignedDocumentEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface ApplicationSignedDocumentRepository extends JpaRepository<ApplicationSignedDocumentEntity, Long> {
|
||||
|
||||
ApplicationSignedDocumentEntity findByApplicationIdAndStatus(Long applicationId, String status);
|
||||
|
||||
Long findApplicationIdById(Long id);
|
||||
|
||||
@Query("SELECT a.id FROM ApplicationSignedDocumentEntity d JOIN d.application a WHERE d.id = :id")
|
||||
List<Long> findApplicationIdIdsById(@Param("id") Long id);
|
||||
|
||||
@Query("SELECT d FROM ApplicationSignedDocumentEntity d WHERE d.status = :status")
|
||||
List<ApplicationSignedDocumentEntity> findAllByIsStatus(@Param("status")String status);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package net.gepafin.tendermanagement.repositories;
|
||||
import net.gepafin.tendermanagement.entities.AssignedApplicationsEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -9,5 +11,11 @@ import java.util.Optional;
|
||||
public interface AssignedApplicationsRepository extends JpaRepository<AssignedApplicationsEntity,Long>, JpaSpecificationExecutor<AssignedApplicationsEntity>{
|
||||
Optional<AssignedApplicationsEntity> findByApplicationIdAndIsDeletedFalse(Long applicationId);
|
||||
Optional<AssignedApplicationsEntity> findByIdAndIsDeletedFalse(Long id);
|
||||
@Query("SELECT aa FROM AssignedApplicationsEntity aa WHERE aa.isDeleted = false " +
|
||||
"AND (:applicationId IS NULL OR aa.application.id = :applicationId) " +
|
||||
"AND (:id IS NULL OR aa.id = :id)")
|
||||
Optional<AssignedApplicationsEntity> findByApplicationIdOrId(@Param("applicationId") Long applicationId,
|
||||
@Param("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
import net.gepafin.tendermanagement.entities.CallEntity;
|
||||
import net.gepafin.tendermanagement.enums.CallStatusEnum;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -11,18 +11,38 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface CallRepository extends JpaRepository<CallEntity, Long> {
|
||||
|
||||
public CallEntity findByIdAndStatusNotIn(Long id, List<String> status);
|
||||
List<CallEntity> findByStatusIn(List<String> callStatus);
|
||||
// public CallEntity findByIdAndStatusNotIn(Long id, List<String> status);
|
||||
|
||||
// List<CallEntity> findByStatusIn(List<String> callStatus);
|
||||
|
||||
public CallEntity findByIdAndStatus(Long id,String status);
|
||||
// public CallEntity findByIdAndStatus(Long id,String status);
|
||||
|
||||
public Long countByStatus(String status);
|
||||
// public Long countByStatus(String status);
|
||||
|
||||
@Query("SELECT COALESCE(SUM(c.amount), 0) FROM CallEntity c WHERE c.status = 'PUBLISH'")
|
||||
BigDecimal findTotalAmountOfPublishedCalls();
|
||||
// @Query("SELECT COALESCE(SUM(c.amount), 0) FROM CallEntity c WHERE c.status = 'PUBLISH'")
|
||||
// BigDecimal findTotalAmountOfPublishedCalls();
|
||||
|
||||
@Query("SELECT c.name, COUNT(a.id) " +
|
||||
"FROM CallEntity c LEFT JOIN ApplicationEntity a ON c.id = a.call.id " +
|
||||
"GROUP BY c.name")
|
||||
List<Object[]> findApplicationsPerCall();
|
||||
|
||||
|
||||
@Query("SELECT c FROM CallEntity c JOIN ApplicationEntity a ON c.id = a.call.id WHERE a.id = :applicationId")
|
||||
CallEntity findCallEntityByApplicationId(Long applicationId);
|
||||
// @Query("SELECT c.name, COUNT(a.id) " +
|
||||
// "FROM CallEntity c LEFT JOIN ApplicationEntity a ON c.id = a.call.id " +
|
||||
// "GROUP BY c.name")
|
||||
// List<Object[]> findApplicationsPerCall();
|
||||
|
||||
public List<CallEntity> findByStatusInAndHubId(List<String> callStatus, Long hubId);
|
||||
|
||||
public CallEntity findByIdAndStatusAndHubId(Long id, String status, Long hubId);
|
||||
|
||||
public Long countByStatusAndHubId(String status, Long hubId);
|
||||
|
||||
public CallEntity findByIdAndStatusNotInAndHubId(Long id, List<String> status, Long hubId);
|
||||
|
||||
@Query("SELECT COALESCE(SUM(c.amount), 0) FROM CallEntity c WHERE c.status = 'PUBLISH' And c.hub.id = :hubId")
|
||||
BigDecimal findTotalAmountOfPublishedCallsAndHubId(@Param("hubId") Long hubId);
|
||||
}
|
||||
|
||||
@@ -17,4 +17,5 @@ public interface CallTargetAudienceChecklistRepository extends JpaRepository<Cal
|
||||
Optional<CallTargetAudienceChecklistEntity> findById(@Param("id") Long id);
|
||||
|
||||
List<CallTargetAudienceChecklistEntity> findByCallIdAndLookupDataTypeAndIsDeletedFalse(Long id, String type);
|
||||
List<CallTargetAudienceChecklistEntity> findByCallId(Long callId);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.CompanyEntity;
|
||||
@@ -11,13 +12,14 @@ import net.gepafin.tendermanagement.entities.CompanyEntity;
|
||||
@Repository
|
||||
public interface CompanyRepository extends JpaRepository<CompanyEntity, Long> {
|
||||
|
||||
List<CompanyEntity> findByIdIn(List<Long> companyIds);
|
||||
List<CompanyEntity> findByIdInAndHubId(List<Long> companyIds, Long hubId);
|
||||
|
||||
Boolean existsByVatNumber(String vatNumber);
|
||||
CompanyEntity findByVatNumber(String vatNumber);
|
||||
Boolean existsByVatNumberAndHubId(String vatNumber, Long hubId);
|
||||
|
||||
@Query("SELECT COUNT(c) FROM CompanyEntity c")
|
||||
long countTotalCompanies();
|
||||
@Query("SELECT COUNT(c) FROM CompanyEntity c where c.hub.id = :hubId")
|
||||
long countTotalCompaniesByHubId(@Param("hubId") Long hubId);
|
||||
|
||||
CompanyEntity findByVatNumberAndHubId(String vatNumber, Long hubId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,17 +13,19 @@ import org.springframework.stereotype.Repository;
|
||||
public interface DocumentRepository extends JpaRepository<DocumentEntity, Long> {
|
||||
|
||||
@Query("SELECT d FROM DocumentEntity d WHERE d.id = :id AND d.isDeleted = false")
|
||||
Optional<DocumentEntity> findById(@Param("id") Long id);
|
||||
Optional<DocumentEntity> findByIdAndNotDeleted(@Param("id") Long id);
|
||||
|
||||
// List<DocumentEntity> findBySourceIdAndTypeAndIsDeletedFalse(Long sourceId, String type);
|
||||
|
||||
// Optional<DocumentEntity> findByIdAndSourceIdAndIsDeletedFalse(Long id, Long sourceId);
|
||||
|
||||
List<DocumentEntity> findBySource(String source);
|
||||
|
||||
|
||||
List<DocumentEntity> findBySourceIdAndSourceAndTypeAndIsDeletedFalse(Long sourceId, String source, String type);
|
||||
|
||||
Optional<DocumentEntity> findByIdAndSourceIdAndSourceAndIsDeletedFalse(Long id, Long sourceId, String source);
|
||||
|
||||
@Query("SELECT d FROM DocumentEntity d WHERE d.isDeleted = false")
|
||||
List<DocumentEntity> findAllByIsDeleteFalse();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,6 @@ public interface EvaluationCriteriaRepository extends JpaRepository<EvaluationCr
|
||||
Optional<EvaluationCriteriaEntity> findById(@Param("id") Long id);
|
||||
|
||||
List<EvaluationCriteriaEntity> findByCallIdAndLookupDataTypeAndIsDeletedFalse(Long callId, String type);
|
||||
List<EvaluationCriteriaEntity> findByCallId(Long callId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.LoginAttemptEntity;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface LoginAttemptRepository extends JpaRepository<LoginAttemptEntity,Long> {
|
||||
|
||||
@Query("SELECT la FROM LoginAttemptEntity la LEFT JOIN UserEntity u ON u.email = la.username WHERE u.hub.id = :hubId")
|
||||
Page<LoginAttemptEntity> findByHubId(@Param("hubId") Long hubId, PageRequest pageRequest);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.S3ConfigEntity;
|
||||
import net.gepafin.tendermanagement.enums.DocOtherSourceTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface S3ConfigRepository extends JpaRepository<S3ConfigEntity, Long> {
|
||||
Optional<S3ConfigEntity> getPathByType(String type);
|
||||
|
||||
S3ConfigEntity findS3PathConfigurationById(Long id);
|
||||
|
||||
String getBucketNameByType(DocumentSourceTypeEnum type);
|
||||
|
||||
String getBucketNameByType(DocOtherSourceTypeEnum type);
|
||||
|
||||
@Query("Select s3.parentFolder From S3ConfigEntity s3 Where s3.type = :s")
|
||||
String getPathByTypeOther(String s);
|
||||
}
|
||||
@@ -2,9 +2,15 @@ package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import net.gepafin.tendermanagement.entities.UserCompanyDelegationEntity;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserCompanyDelegationRepository extends JpaRepository<UserCompanyDelegationEntity, Long> {
|
||||
|
||||
UserCompanyDelegationEntity findByUserIdAndCompanyIdAndStatus(Long userId, Long companyId, String status);
|
||||
|
||||
@Query("SELECT d FROM UserCompanyDelegationEntity d where d.status = :status")
|
||||
List<UserCompanyDelegationEntity> findAllByStatus(@Param("status") String status);
|
||||
}
|
||||
|
||||
@@ -10,21 +10,9 @@ import java.util.Optional;
|
||||
@Repository
|
||||
public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
||||
|
||||
// Optional<UserEntity> findByEmailIgnoreCase(String email);
|
||||
|
||||
// boolean existsByEmailIgnoreCase(String email);
|
||||
|
||||
// UserEntity findByEmail(String email);
|
||||
|
||||
Optional<UserEntity> findByBeneficiaryCodiceFiscale(String codiceFiscale);
|
||||
|
||||
boolean existsByBeneficiaryCodiceFiscale(String codiceFiscale);
|
||||
|
||||
UserEntity findByBeneficiaryId(Long beneficiaryId);
|
||||
|
||||
Long countByStatusAndRoleEntityRoleType(String status, String roleName);
|
||||
|
||||
Optional<UserEntity> findByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubId);
|
||||
Optional<UserEntity> findByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubUuid);
|
||||
|
||||
boolean existsByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubUuid);
|
||||
|
||||
@@ -35,4 +23,6 @@ public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
||||
Long countByStatusAndRoleEntityRoleTypeAndHubId(String status, String roleName, Long hubId);
|
||||
|
||||
Optional<UserEntity> findByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
||||
|
||||
boolean existsByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
||||
}
|
||||
|
||||
@@ -14,10 +14,8 @@ public interface UserWithCompanyRepository extends JpaRepository<UserWithCompany
|
||||
|
||||
void deleteByCompanyIdAndIsDeletedFalse(Long companyId);
|
||||
|
||||
@Query("SELECT u.companyId FROM UserWithCompanyEntity u WHERE u.userId = :userId AND u.isDeleted = false")
|
||||
List<Long> findActiveCompanyIdsByUserId(@Param("userId") Long userId);
|
||||
|
||||
|
||||
@Query("SELECT u.companyId FROM UserWithCompanyEntity u WHERE u.userId = :userId AND u.isDeleted = false")
|
||||
List<Long> findActiveCompanyIdsByUserId(@Param("userId") Long userId);
|
||||
|
||||
Optional<UserWithCompanyEntity> findByUserIdAndCompanyIdAndIsDeletedFalse(Long userId, Long companyId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user