From 17a860896e6873e4cb1712939f9a487594437642 Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/data/dao/BookGroupDao.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt b/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt index 630843653..667429d34 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt @@ -27,26 +27,26 @@ interface BookGroupDao { """ with const as (SELECT sum(groupId) sumGroupId FROM book_groups where groupId > 0) SELECT book_groups.* FROM book_groups, const - where (groupId >= 0 and show > 0 and exists (select `group` from books where books.`group` = book_groups.groupId)) + where (groupId >= 0 and show > 0 and exists (select 1 from books where `group` & book_groups.groupId > 0)) or (groupId = -1 and show > 0) - or (groupId = -2 and show > 0 and (select count(*) from books where type & ${BookType.local} > 0) > 0) - or (groupId = -3 and show > 0 and (select count(*) from books where type & ${BookType.audio} > 0) > 0) - or (groupId = -11 and show > 0 and (select count(*) from books where type & ${BookType.updateError} > 0) > 0) + or (groupId = -2 and show > 0 and exists (select 1 from books where type & ${BookType.local} > 0)) + or (groupId = -3 and show > 0 and exists (select 1 from books where type & ${BookType.audio} > 0)) + or (groupId = -11 and show > 0 and exists (select 1 from books where type & ${BookType.updateError} > 0)) or (groupId = -4 and show > 0 - and ( - select count(*) from books + and exists ( + select 1 from books where type & ${BookType.audio} = 0 and type & ${BookType.local} = 0 and const.sumGroupId & `group` = 0 - ) > 0 + ) ) or (groupId = -5 and show > 0 - and ( - select count(*) from books + and exists ( + select 1 from books where type & ${BookType.audio} = 0 and type & ${BookType.local} > 0 and const.sumGroupId & `group` = 0 - ) > 0 + ) ) ORDER BY `order`""" )