diff --git a/modules/core/src/main/java/com/bytedesk/core/thread/ThreadRepository.java b/modules/core/src/main/java/com/bytedesk/core/thread/ThreadRepository.java index 6753520acc..1be45dbef6 100644 --- a/modules/core/src/main/java/com/bytedesk/core/thread/ThreadRepository.java +++ b/modules/core/src/main/java/com/bytedesk/core/thread/ThreadRepository.java @@ -44,11 +44,8 @@ public interface ThreadRepository extends JpaRepository, Jpa Optional findFirstByTopicAndStatusNotContainingAndDeleted(String topic, String status, Boolean deleted); - // @Query(value = "select * from bytedesk_core_thread t where t.topic like ?1 and t.status not in ?2 and t.is_deleted = ?3", nativeQuery = true) - @Query(value = "select * from bytedesk_core_thread t where t.topic = ?1 and t.status not in ?2 and t.is_deleted = ?3 LIMIT 1", nativeQuery = true) - Optional findTopicAndStatusesNotInAndDeleted(String topicWithWildcard, - List statuses, - Boolean deleted); + @Query(value = "select * from bytedesk_core_thread t where t.thread_topic = ?1 and t.thread_status not in ?2 and t.is_deleted = ?3 LIMIT 1", nativeQuery = true) + Optional findTopicAndStatusesNotInAndDeleted(String topic, List statuses, Boolean deleted); Page findByOwnerAndHideAndDeleted(UserEntity owner, Boolean hide, Boolean deleted, Pageable pageable);