Interface QueueMemberRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<QueueMemberEntity,
,Long> org.springframework.data.jpa.repository.JpaRepository<QueueMemberEntity,
,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<QueueMemberEntity>
,org.springframework.data.repository.ListCrudRepository<QueueMemberEntity,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<QueueMemberEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<QueueMemberEntity,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<QueueMemberEntity>
,org.springframework.data.repository.Repository<QueueMemberEntity,
Long>
public interface QueueMemberRepository
extends org.springframework.data.jpa.repository.JpaRepository<QueueMemberEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<QueueMemberEntity>
-
Method Summary
Modifier and TypeMethodDescriptioncalculateAverageWaitTime
(String queueUid) int
cleanupExpiredMembers
(String queueUid, LocalDateTime beforeTime) int
countByQueueUidAndEndStatusIsTrue
(String queueUid) int
countByQueueUidAndPriorityGreaterThan
(String queueUid, int priority) int
countByQueueUidAndStatus
(String queueUid, String status) int
countResolvedThreadsByAgent
(String agentUid) int
countServingThreadsByAgent
(String agentUid) int
countTotalThreadsByAgent
(String agentUid) findByAgentUid
(String agentUid) findByOrgUidAndCreatedAtBetweenAndAcceptType
(String orgUid, LocalDateTime startTime, LocalDateTime endTime, String acceptType) findByOrgUidAndCreatedAtBetweenAndSolved
(String orgUid, LocalDateTime startTime, LocalDateTime endTime, boolean solved) findByQueueTopicAndQueueDayAndThreadUidAndStatus
(String queueTopic, String queueDay, String threadUid, String status) findByQueueUidAndStatus
(String queueUid, String status) findByQueueUidOrderByPriorityDesc
(String queueUid) findByStatus
(String status) findByThreadUid
(String threadUid) findByVisitorUid
(String visitorUid) findServingThreadsByAgent
(String agentUid) getAssignedAgent
(String threadUid) getQueueStats
(String queueUid) void
updateAssignedAgent
(String threadUid, String agentUid) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findBy, findOne
Methods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAll
Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByUid
-
findByQueueTopicAndQueueDayAndThreadUidAndStatus
-
findByOrgUidAndCreatedAtBetweenAndSolved
List<QueueMemberEntity> findByOrgUidAndCreatedAtBetweenAndSolved(String orgUid, LocalDateTime startTime, LocalDateTime endTime, boolean solved) -
findByOrgUidAndCreatedAtBetweenAndAcceptType
List<QueueMemberEntity> findByOrgUidAndCreatedAtBetweenAndAcceptType(String orgUid, LocalDateTime startTime, LocalDateTime endTime, String acceptType) -
findByThreadUid
-
findByStatus
-
findByStatusOrderByPriorityDesc
-
countByQueueUidAndStatus
-
countByQueueUidAndPriorityGreaterThan
@Query("SELECT COUNT(m) FROM QueueMemberEntity m WHERE m.queueUid = :queueUid AND m.priority > :priority AND m.status = \'WAITING\'") int countByQueueUidAndPriorityGreaterThan(@Param("queueUid") String queueUid, @Param("priority") int priority) -
countByQueueUidAndEndStatusIsTrue
@Query("SELECT COUNT(m) FROM QueueMemberEntity m WHERE m.queueUid = :queueUid AND m.status IN (\'COMPLETED\', \'CANCELLED\', \'TIMEOUT\', \'REJECTED\')") int countByQueueUidAndEndStatusIsTrue(@Param("queueUid") String queueUid) -
calculateAverageWaitTime
-
findByQueueUidAndStatus
-
findByQueueUidOrderByPriorityDesc
-
findByAgentUid
-
findByVisitorUid
-
getQueueStats
@Query("SELECT new map(COUNT(m) as total, SUM(CASE WHEN m.status = \'WAITING\' THEN 1 ELSE 0 END) as waiting, SUM(CASE WHEN m.status = \'PROCESSING\' THEN 1 ELSE 0 END) as processing, AVG(TIMESTAMPDIFF(SECOND, m.enqueueTime, CASE WHEN m.acceptTime IS NULL THEN CURRENT_TIMESTAMP ELSE m.acceptTime END)) as avgWaitTime) FROM QueueMemberEntity m WHERE m.queueUid = :queueUid") Map<String,Object> getQueueStats(@Param("queueUid") String queueUid) -
cleanupExpiredMembers
@Query("DELETE FROM QueueMemberEntity m WHERE m.queueUid = :queueUid AND m.closeTime < :beforeTime AND m.status IN (\'COMPLETED\', \'CANCELLED\', \'TIMEOUT\', \'REJECTED\')") @Modifying int cleanupExpiredMembers(@Param("queueUid") String queueUid, @Param("beforeTime") LocalDateTime beforeTime) -
countServingThreadsByAgent
@Query("SELECT COUNT(t) FROM QueueMemberEntity t WHERE t.agentUid = :agentUid AND t.status = \'SERVING\'") int countServingThreadsByAgent(@Param("agentUid") String agentUid) -
findServingThreadsByAgent
-
getAssignedAgent
-
updateAssignedAgent
-
countTotalThreadsByAgent
@Query("SELECT COUNT(t) FROM QueueMemberEntity t WHERE t.agentUid = :agentUid") int countTotalThreadsByAgent(@Param("agentUid") String agentUid) -
countResolvedThreadsByAgent
@Query("SELECT COUNT(t) FROM QueueMemberEntity t WHERE t.agentUid = :agentUid AND t.status = \'resolved\'") int countResolvedThreadsByAgent(@Param("agentUid") String agentUid)
-