Skip to content

Commit

Permalink
[Feat] 검색 조건 중복 방지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Apr 2, 2024
1 parent 635a813 commit ccd7e1e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public interface FolderPostRepository extends JpaRepository<FolderPost,Long> {
Optional<FolderPost> findByFolderAndPost(Folder folder, Post post);
boolean existsByFolderAndPost(Folder folder, Post post);
List<FolderPost> findAllByFolder(Folder folder);
@Query("SELECT f FROM FolderPost f JOIN FETCH f.post WHERE f.folder=:folder and (f.post.content LIKE concat('%',:content,'%') or f.post.title LIKE concat('%',:content,'%')) ")
@Query("SELECT DISTINCT f FROM FolderPost f JOIN FETCH f.post WHERE f.folder=:folder and (f.post.content LIKE concat('%',:content,'%') or f.post.title LIKE concat('%',:content,'%'))")
List<FolderPost> searchInFolder(Folder folder,String content);
}

0 comments on commit ccd7e1e

Please sign in to comment.