Added search unified inbox on device

This commit is contained in:
M66B
2019-01-22 14:29:45 +00:00
parent 3eb2798a17
commit a5166c530a
6 changed files with 37 additions and 25 deletions

View File

@@ -49,6 +49,14 @@ public interface DaoFolder {
" WHERE account.synchronize AND folder.synchronize AND unified")
List<EntityFolder> getFoldersSynchronizingUnified();
@Query("SELECT folder.* FROM folder" +
" JOIN account ON account.id = folder.account" +
" WHERE ((:folder IS NULL AND unified) OR (NOT :folder is NULL AND folder.id = :folder))" +
" AND folder.synchronize" +
" AND account.synchronize" +
" AND (NOT :browse OR account.browse)")
List<EntityFolder> getFolders(Long folder, boolean browse);
@Query("SELECT folder.*, account.name AS accountName, account.color AS accountColor, account.state AS accountState" +
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +