mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-04 18:48:31 +00:00
Simplify account/operation stats
This commit is contained in:
parent
099239ca64
commit
fa8952404a
1 changed files with 8 additions and 9 deletions
|
@ -71,16 +71,15 @@ public interface DaoAccount {
|
|||
LiveData<EntityAccount> liveAccount(long id);
|
||||
|
||||
@Query("SELECT" +
|
||||
" (SELECT COUNT(account.id) FROM account WHERE synchronize AND state = 'connected') AS accounts" +
|
||||
" (SELECT COUNT(account.id) FROM account" +
|
||||
" WHERE synchronize" +
|
||||
" AND state = 'connected') AS accounts" +
|
||||
", (SELECT COUNT(operation.id) FROM operation" +
|
||||
" JOIN folder ON folder.id = operation.folder" +
|
||||
" JOIN account ON account.id = folder.account" +
|
||||
" JOIN account ON account.id = folder.account" + // not outbox
|
||||
" WHERE account.synchronize) AS operations" +
|
||||
", (SELECT COUNT(message.id) FROM message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
" JOIN operation ON operation.message = message.id AND operation.name = '" + EntityOperation.SEND + "'" +
|
||||
" WHERE NOT message.ui_seen" +
|
||||
" AND folder.type = '" + EntityFolder.OUTBOX + "') AS unsent")
|
||||
", (SELECT COUNT(operation.id) FROM operation" +
|
||||
" WHERE operation.name = '" + EntityOperation.SEND + "') AS unsent")
|
||||
LiveData<TupleAccountStats> liveStats();
|
||||
|
||||
@Insert
|
||||
|
|
Loading…
Add table
Reference in a new issue