From 31a4146441e13ea59fa766f82f1098f0f4591514 Mon Sep 17 00:00:00 2001 From: Gary Date: Sun, 18 Feb 2024 20:06:28 +0800 Subject: [PATCH] 1.fix state filter bug --- luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 7e6f790..6f66ce9 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 @@ -65,10 +65,10 @@ public interface JournalDao extends JpaRepository,JpaSpecificati @Query(value = "select * from tb_journal where id in ?1 and state='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) and state='1' limit 1", nativeQuery = true) + @Query(value = "select 1 from tb_journal where ?1 in (select journal_no_tmp.journal_no from (select * from tb_journal where state='1' order by ABS(journal_no) desc limit 10) as journal_no_tmp) limit 1", nativeQuery = true) Integer isLatest10ByJournalNo(String journalNo); - @Query(value = "select 1 from tb_journal where ?1 in (select journal_no_tmp.id from (select * from tb_journal order by ABS(journal_no) desc limit 10) as journal_no_tmp) and state='1' limit 1", nativeQuery = true) + @Query(value = "select 1 from tb_journal where ?1 in (select journal_no_tmp.id from (select * from tb_journal where state='1' order by ABS(journal_no) desc limit 10) as journal_no_tmp) limit 1", nativeQuery = true) Integer isLatest10ByJournalId(String journalId); @Query(value = "select max(ABS(journal_no)) FROM tb_journal where state='1'", nativeQuery = true)