Resolved conflicts
This commit is contained in:
@@ -59,7 +59,7 @@ public interface ApplicationAmendmentRequestRepository extends JpaRepository<App
|
||||
|
||||
@Query("SELECT a FROM ApplicationAmendmentRequestEntity a " +
|
||||
"WHERE a.isDeleted = false " +
|
||||
"AND a.status <> 'CLOSE' " +
|
||||
"AND a.status NOT IN('CLOSE','EXPIRED') " +
|
||||
"AND a.endDate < :currentTime")
|
||||
List<ApplicationAmendmentRequestEntity> findAmendmentsDueForExpiration(LocalDateTime currentTime);
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface ApplicationAmendmentRequestRepository extends JpaRepository<App
|
||||
"AND NOT EXISTS ( " +
|
||||
" SELECT 1 FROM ApplicationAmendmentRequestEntity activeAmendment" +
|
||||
" WHERE activeAmendment.applicationEvaluationEntity.id = a.applicationEvaluationEntity.id " +
|
||||
" AND activeAmendment.status <> 'CLOSE' " +
|
||||
" AND activeAmendment.status NOT IN('CLOSE','EXPIRED') " +
|
||||
" AND activeAmendment.isDeleted = false) ")
|
||||
Set<ApplicationEvaluationEntity> findEvaluationsWithoutActiveAmendmentsByIds(@Param("applicationEvaluationIds") Set<Long> applicationEvaluationIds);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface ApplicationEvaluationRepository extends JpaRepository<Applicati
|
||||
"WHERE aar.id = :evaluationId AND aar.isDeleted = false)")
|
||||
ApplicationEntity findApplicationByEvaluationId(Long evaluationId);
|
||||
|
||||
@Query("SELECT a FROM ApplicationEvaluationEntity a WHERE a.isDeleted = false AND a.endDate < :currentDate")
|
||||
@Query("SELECT a FROM ApplicationEvaluationEntity a WHERE a.isDeleted = false AND a.status = 'OPEN' AND a.endDate < :currentDate")
|
||||
List<ApplicationEvaluationEntity> findAllByIsDeletedFalseAndEndDateBefore(@Param("currentDate") LocalDateTime currentDate);
|
||||
|
||||
@Query("SELECT a FROM ApplicationEvaluationEntity a " +
|
||||
@@ -55,11 +55,13 @@ public interface ApplicationEvaluationRepository extends JpaRepository<Applicati
|
||||
WHERE e.applicationId IN :applicationIds
|
||||
AND FUNCTION('DATE', e.endDate) BETWEEN :startDate AND :endDate
|
||||
AND e.isDeleted = false
|
||||
AND e.status IN :statusList
|
||||
""")
|
||||
Long countDueApplicationsBetween(
|
||||
@Param("applicationIds") List<Long> applicationIds,
|
||||
@Param("startDate") LocalDate startDate,
|
||||
@Param("endDate") LocalDate endDate
|
||||
@Param("endDate") LocalDate endDate,
|
||||
@Param("statusList") List<String> statusList
|
||||
);
|
||||
|
||||
@Query("SELECT ae FROM ApplicationEvaluationEntity ae " +
|
||||
|
||||
@@ -25,4 +25,46 @@ public interface AssignedApplicationsRepository extends JpaRepository<AssignedAp
|
||||
|
||||
@Query("SELECT aa.application.id FROM AssignedApplicationsEntity aa WHERE aa.isDeleted = false AND aa.userId = :userId")
|
||||
List<Long> findApplicationIdsByUserIdAndIsDeletedFalse(@Param("userId") Long userId);
|
||||
|
||||
@Query("""
|
||||
SELECT
|
||||
COALESCE(COUNT(a.id), 0) AS totalAssigned,
|
||||
COALESCE(SUM(CASE WHEN a.status = 'SOCCORSO' THEN 1 ELSE 0 END), 0) AS amendmentCount,
|
||||
COALESCE(SUM(CASE WHEN a.status = 'OPEN' THEN 1 ELSE 0 END), 0) AS openCount,
|
||||
COALESCE(SUM(CASE WHEN a.status = 'CLOSE' THEN 1 ELSE 0 END), 0) AS closeCount
|
||||
FROM AssignedApplicationsEntity a
|
||||
JOIN a.application app
|
||||
WHERE a.isDeleted = false
|
||||
AND a.userId = :userId
|
||||
AND app.isDeleted = false
|
||||
AND app.hubId = :hubId
|
||||
""")
|
||||
Object[] countAssignedApplicationsWithStatus(
|
||||
@Param("userId") Long userId,
|
||||
@Param("hubId") Long hubId
|
||||
);
|
||||
|
||||
@Query("""
|
||||
SELECT
|
||||
COALESCE(COUNT(a.id), 0) AS totalAssigned,
|
||||
COALESCE(SUM(CASE WHEN a.status = 'SOCCORSO' THEN 1 ELSE 0 END), 0) AS amendmentCount,
|
||||
COALESCE(SUM(CASE WHEN a.status = 'OPEN' THEN 1 ELSE 0 END), 0) AS openCount,
|
||||
COALESCE(SUM(CASE WHEN a.status = 'CLOSE' THEN 1 ELSE 0 END), 0) AS closeCount
|
||||
FROM AssignedApplicationsEntity a
|
||||
JOIN a.application app
|
||||
WHERE a.isDeleted = false
|
||||
AND app.isDeleted = false
|
||||
AND app.hubId = :hubId
|
||||
""")
|
||||
Object[] countAssignedApplicationsForHub(@Param("hubId") Long hubId);
|
||||
|
||||
@Query("SELECT aa.application.id FROM AssignedApplicationsEntity aa " +
|
||||
"WHERE aa.userId = :userId AND aa.application.hubId = :hubId AND aa.isDeleted = false")
|
||||
List<Long> findApplicationIdsByUserIdAndHubIdAndIsDeletedFalse(@Param("userId") Long userId, @Param("hubId") Long hubId);
|
||||
|
||||
@Query("SELECT aa.application.id FROM AssignedApplicationsEntity aa " +
|
||||
"WHERE aa.application.hubId = :hubId AND aa.isDeleted = false")
|
||||
List<Long> findApplicationIdsByHubId(@Param("hubId") Long hubId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user