This commit is contained in:
@@ -34,7 +34,7 @@ public interface ComplaintEntityRepository extends JpaRepository<ComplaintEntity
|
|||||||
Long getTotalComplaintsCount();
|
Long getTotalComplaintsCount();
|
||||||
|
|
||||||
@Query("SELECT COUNT(c.id) FROM ComplaintEntity c WHERE c.status = :status")
|
@Query("SELECT COUNT(c.id) FROM ComplaintEntity c WHERE c.status = :status")
|
||||||
Long getTotalComplaintsCountByStatus(@Param("status")String status);
|
Long getTotalComplaintsCountByStatus(@Param("status")ComplaintStatus status);
|
||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
SELECT COUNT(c.id)
|
SELECT COUNT(c.id)
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ public class ComplaintStatisticService {
|
|||||||
|
|
||||||
return ComplaintStatisticResponse.builder()
|
return ComplaintStatisticResponse.builder()
|
||||||
.totalComplaints(complaintEntityRepository.getTotalComplaintsCount())
|
.totalComplaints(complaintEntityRepository.getTotalComplaintsCount())
|
||||||
.totalCancelled(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CANCELLED.name()))
|
.totalCancelled(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CANCELLED))
|
||||||
.totalCreated(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CREATED.name()))
|
.totalCreated(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CREATED))
|
||||||
.totalCompleted(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.COMPLETED.name()))
|
.totalCompleted(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.COMPLETED))
|
||||||
.totalInWork(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.IN_WORK.name()))
|
.totalInWork(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.IN_WORK))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user