From 98b141f96f381fbfb4f5b0382b71c27c0282c12f Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 17:13:51 +0900 Subject: [PATCH] =?UTF-8?q?DocumentDao=E3=81=AESelect=E3=82=AF=E3=82=A8?= =?UTF-8?q?=E3=83=AA=E3=82=92=E4=BF=AE=E6=AD=A3(Combine=E3=81=AEChild?= =?UTF-8?q?=E3=82=92=E5=90=AB=E3=82=81=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/source/database/dao/DocumentDao.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java index 21e1cc2e..7b410ba4 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java @@ -29,13 +29,13 @@ public interface DocumentDao { @Query("SELECT * FROM Document WHERE id IN (:ids)") List findByIds(List ids); - @Query("SELECT * FROM Document WHERE parent_id = :parentId") + @Query("SELECT * FROM Document WHERE parent_id = :parentId AND is_combine_child = 0 ORDER BY created_at DESC") List findByParentId(String parentId); - @Query("SELECT * FROM Document WHERE parent_id IS NULL") + @Query("SELECT * FROM Document WHERE parent_id IS NULL AND is_combine_child = 0 ORDER BY created_at DESC") List findRootDocuments(); - @Query("SELECT * FROM Document ORDER BY created_at DESC LIMIT :limit") + @Query("SELECT * FROM Document WHERE is_combine_child = 0 ORDER BY created_at DESC LIMIT :limit") List getRecentDocument(int limit); // Insert