diff --git a/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java b/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java index 9bac3a9..918a6aa 100644 --- a/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java +++ b/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java @@ -42,5 +42,8 @@ public interface JournalDao extends JpaRepository,JpaSpecificati @Query(value = "select * from tb_journal where id in ?1 order by field(id,?1)", nativeQuery = true) List orderByField(List objectIds); + + @Query(value = "select 1 from tb_journal where ?1 in (select journal_no_tmp.journal_no from (select * from tb_journal order by ABS(journal_no) desc limit 10) as journal_no_tmp) limit 1", nativeQuery = true) + Integer isLatest10(String journalNo); } diff --git a/luoo_music/src/main/java/com/luoo/music/service/JournalService.java b/luoo_music/src/main/java/com/luoo/music/service/JournalService.java index c34bb89..3630314 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/JournalService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/JournalService.java @@ -171,12 +171,10 @@ public class JournalService { } - public boolean isLatest10(String journalNo) { - return true; + return null!=journalDao.isLatest10(journalNo); } - public List orderByField(List objectIds) { return journalDao.orderByField(objectIds); }