mirror of https://github.com/M66B/FairEmail.git
Query fixes
This commit is contained in:
parent
9e6d9903c0
commit
898e7bccf3
|
@ -62,7 +62,7 @@ public interface DaoAccount {
|
||||||
" FROM account" +
|
" FROM account" +
|
||||||
" LEFT JOIN folder AS drafts ON drafts.account = account.id" +
|
" LEFT JOIN folder AS drafts ON drafts.account = account.id" +
|
||||||
" WHERE :all OR account.synchronize" +
|
" WHERE :all OR account.synchronize" +
|
||||||
" AND drafts.type = '" + EntityFolder.DRAFTS + "'" +
|
" AND (drafts.type = '" + EntityFolder.DRAFTS + "' OR drafts.type IS NULL)" +
|
||||||
" GROUP BY account.id" +
|
" GROUP BY account.id" +
|
||||||
" ORDER BY CASE WHEN :all THEN 0 ELSE account.`order` END" +
|
" ORDER BY CASE WHEN :all THEN 0 ELSE account.`order` END" +
|
||||||
", CASE WHEN :all THEN 0 ELSE account.`primary` END DESC" +
|
", CASE WHEN :all THEN 0 ELSE account.`primary` END DESC" +
|
||||||
|
|
|
@ -44,9 +44,9 @@ public interface DaoFolder {
|
||||||
" LEFT JOIN rule ON rule.folder = folder.id" +
|
" LEFT JOIN rule ON rule.folder = folder.id" +
|
||||||
" LEFT JOIN operation ON operation.folder = folder.id" +
|
" LEFT JOIN operation ON operation.folder = folder.id" +
|
||||||
" WHERE folder.account = :account AND account.synchronize" +
|
" WHERE folder.account = :account AND account.synchronize" +
|
||||||
" AND message.ui_hide = 0" +
|
" AND (message.ui_hide = 0 OR message.ui_hide IS NULL)" +
|
||||||
" AND rule.enabled" +
|
" AND (rule.enabled OR rule.enabled IS NULL)" +
|
||||||
" AND operation.state = 'executing'" +
|
" AND (operation.state = 'executing' OR operation.state IS NULL)" +
|
||||||
" GROUP BY folder.id")
|
" GROUP BY folder.id")
|
||||||
List<TupleFolderEx> getFoldersEx(long account);
|
List<TupleFolderEx> getFoldersEx(long account);
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@ public interface DaoFolder {
|
||||||
" THEN folder.unified AND account.synchronize" +
|
" THEN folder.unified AND account.synchronize" +
|
||||||
" ELSE folder.account = :account AND account.synchronize" +
|
" ELSE folder.account = :account AND account.synchronize" +
|
||||||
" END" +
|
" END" +
|
||||||
" AND message.ui_hide = 0" +
|
" AND (message.ui_hide = 0 OR message.ui_hide IS NULL)" +
|
||||||
" AND rule.enabled" +
|
" AND (rule.enabled OR rule.enabled IS NULL)" +
|
||||||
" AND operation.state = 'executing'" +
|
" AND (operation.state = 'executing' OR operation.state IS NULL)" +
|
||||||
" GROUP BY folder.id")
|
" GROUP BY folder.id")
|
||||||
LiveData<List<TupleFolderEx>> liveFolders(Long account);
|
LiveData<List<TupleFolderEx>> liveFolders(Long account);
|
||||||
|
|
||||||
|
@ -105,9 +105,9 @@ public interface DaoFolder {
|
||||||
" LEFT JOIN operation ON operation.folder = folder.id" +
|
" LEFT JOIN operation ON operation.folder = folder.id" +
|
||||||
" WHERE account.`synchronize`" +
|
" WHERE account.`synchronize`" +
|
||||||
" AND folder.unified" +
|
" AND folder.unified" +
|
||||||
" AND message.ui_hide = 0" +
|
" AND (message.ui_hide = 0 OR message.ui_hide IS NULL)" +
|
||||||
" AND rule.enabled" +
|
" AND (rule.enabled OR rule.enabled IS NULL)" +
|
||||||
" AND operation.state = 'executing'" +
|
" AND (operation.state = 'executing' OR operation.state IS NULL)" +
|
||||||
" GROUP BY folder.id")
|
" GROUP BY folder.id")
|
||||||
LiveData<List<TupleFolderEx>> liveUnified();
|
LiveData<List<TupleFolderEx>> liveUnified();
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public interface DaoFolder {
|
||||||
" LEFT JOIN account ON account.id = folder.account" +
|
" LEFT JOIN account ON account.id = folder.account" +
|
||||||
" LEFT JOIN message ON message.folder = folder.id" +
|
" LEFT JOIN message ON message.folder = folder.id" +
|
||||||
" WHERE (account.id IS NULL OR (account.`synchronize` AND folder.navigation))" +
|
" WHERE (account.id IS NULL OR (account.`synchronize` AND folder.navigation))" +
|
||||||
" AND message.ui_hide = 0" +
|
" AND (message.ui_hide = 0 OR message.ui_hide IS NULL)" +
|
||||||
" GROUP BY folder.id")
|
" GROUP BY folder.id")
|
||||||
LiveData<List<TupleFolderNav>> liveNavigation();
|
LiveData<List<TupleFolderNav>> liveNavigation();
|
||||||
|
|
||||||
|
@ -149,9 +149,9 @@ public interface DaoFolder {
|
||||||
" LEFT JOIN rule ON rule.folder = folder.id" +
|
" LEFT JOIN rule ON rule.folder = folder.id" +
|
||||||
" LEFT JOIN operation ON operation.folder = folder.id" +
|
" LEFT JOIN operation ON operation.folder = folder.id" +
|
||||||
" WHERE folder.id = :id" +
|
" WHERE folder.id = :id" +
|
||||||
" AND message.ui_hide = 0" +
|
" AND (message.ui_hide = 0 OR message.ui_hide IS NULL)" +
|
||||||
" AND rule.enabled" +
|
" AND (rule.enabled OR rule.enabled IS NULL)" +
|
||||||
" AND operation.state = 'executing'" +
|
" AND (operation.state = 'executing' OR operation.state IS NULL)" +
|
||||||
" GROUP BY folder.id")
|
" GROUP BY folder.id")
|
||||||
LiveData<TupleFolderEx> liveFolderEx(long id);
|
LiveData<TupleFolderEx> liveFolderEx(long id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue