This commit is contained in:
jack ning
2025-11-24 09:49:14 +08:00
parent d3375f7a9d
commit a0d27d0bbe

View File

@@ -44,11 +44,8 @@ public interface ThreadRepository extends JpaRepository<ThreadEntity, Long>, Jpa
Optional<ThreadEntity> 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<ThreadEntity> findTopicAndStatusesNotInAndDeleted(String topicWithWildcard,
List<String> 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<ThreadEntity> findTopicAndStatusesNotInAndDeleted(String topic, List<String> statuses, Boolean deleted);
Page<ThreadEntity> findByOwnerAndHideAndDeleted(UserEntity owner, Boolean hide, Boolean deleted, Pageable pageable);