Skip to content

Commit

Permalink
!hotfix : 유입채널 조회 최신순으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboysj committed Sep 8, 2024
1 parent b42f0ef commit dc88cc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/FITPET/dev/repository/ReferSiteRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ public interface ReferSiteRepository extends JpaRepository<ReferSite, Long> {

Optional<ReferSite> findByReferSiteId(Long ReferSiteId);

@Query("SELECT r FROM ReferSite r WHERE r.deletedAt IS NULL")
@Query("SELECT r FROM ReferSite r WHERE r.deletedAt IS NULL ORDER BY r.createdAt DESC")
Page<ReferSite> findAllNotDeleted(Pageable pageable);

@Query("SELECT r FROM ReferSite r WHERE r.deletedAt IS NULL AND r.referSiteId = :id")
Optional<ReferSite> findByIdAndNotDeleted(@Param("id") Long id);

@Query("SELECT r FROM ReferSite r WHERE r.deletedAt IS NULL AND " +
"(:content IS NULL OR (r.channel LIKE %:content% OR r.url LIKE %:content% OR r.channelKor LIKE %:content%))")
"(:content IS NULL OR (r.channel LIKE %:content% OR r.url LIKE %:content% OR r.channelKor LIKE %:content%)) " +
"ORDER BY r.createdAt DESC")
Page<ReferSite> searchReferSites(@Param("content") String content, Pageable pageable);

}

0 comments on commit dc88cc2

Please sign in to comment.