1.add is publish filter

main
Gary 9 months ago
parent 2370d3de24
commit fada0cdc3c

@ -62,7 +62,7 @@ public interface JournalDao extends JpaRepository<Journal,String>,JpaSpecificati
@Query("UPDATE Journal j SET j.comment = j.comment - 1 WHERE j.id = :journalId") @Query("UPDATE Journal j SET j.comment = j.comment - 1 WHERE j.id = :journalId")
int decreaseCommentCount(@Param("journalId") String 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<Journal> orderByField(List<String> objectIds); List<Journal> orderByField(List<String> 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) @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)

Loading…
Cancel
Save