From fada0cdc3c018a7363326c2275dced52a41e3cf7 Mon Sep 17 00:00:00 2001 From: Gary Date: Tue, 20 Feb 2024 15:20:50 +0800 Subject: [PATCH] 1.add is publish filter --- luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 313989d..f0a07b3 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 @@ -62,7 +62,7 @@ public interface JournalDao extends JpaRepository,JpaSpecificati @Query("UPDATE Journal j SET j.comment = j.comment - 1 WHERE j.id = :journalId") int decreaseCommentCount(@Param("journalId") String journalId); - @Query(value = "select * from tb_journal where id in ?1 and state='1' order by field(id,?1)", nativeQuery = true) + @Query(value = "select * from tb_journal where id in ?1 and state='1' and is_publish='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 where state='1' and is_publish='1' order by ABS(journal_no) desc limit 10) as journal_no_tmp) limit 1", nativeQuery = true)