diff options
author | desperateCoder <echotodevnull@gmail.com> | 2021-05-19 13:09:12 +0300 |
---|---|---|
committer | Niedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com> | 2021-07-10 23:35:18 +0300 |
commit | 75588245fef6f5bc08af0405b0657183b1e7d631 (patch) | |
tree | b82c7fd12f4d1f53e6271a901dc0b4f95abeaa8c | |
parent | 63d10e99ca9f24097e253ec882f8b8053468c767 (diff) |
#986 changed upcoming cards logic
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java index 14ae2eaa5..26454c002 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java @@ -20,9 +20,17 @@ public interface CardDao extends GenericDao<Card> { "join stack s on s.localId = c.stackId " + "join board b on b.localId = s.boardId " + "WHERE b.archived = 0 and c.archived = 0 and b.status <> 3 and s.status <> 3 and c.status <> 3 " + - "and (c.dueDate is not null or exists(select 1 from AccessControl ac where ac.boardId = b.localId and ac.status <> 3))" + - "and (not exists(select 1 from AccessControl ac where ac.boardId = b.localId and ac.status <> 3) " + - "or exists(select 1 from JoinCardWithUser j where j.cardId = c.localId and j.userId in (select u.localId from user u where u.uid in (select a.userName from Account a))))" + + // FUll Logic: (hasDueDate AND isIn_PRIVATE_Board) OR (isInSharedBoard AND (assignedToMe OR noAssignees)) + "and (" + + "(c.dueDate is not null AND NOT exists(select 1 from AccessControl ac where ac.boardId = b.localId and ac.status <> 3))" + //(hasDueDate AND isInPrivateBoard) + "OR (" + + "exists(select 1 from AccessControl ac where ac.boardId = b.localId and ac.status <> 3) " + //OR (isInSharedBoard AND + "AND (" + + "exists(select 1 from JoinCardWithUser j where j.cardId = c.localId and j.userId in (select u.localId from user u where u.uid in (select a.userName from Account a)))" + //(assignedToMe OR + "OR not exists(select 1 from JoinCardWithUser j where j.cardId = c.localId)" + // noAssignees + ")" + + ")" + + ")" + "ORDER BY c.dueDate asc"; @Query("SELECT * FROM card WHERE stackId = :localStackId order by `order`, createdAt asc") |