|
|
@ -71,16 +71,15 @@ public interface DaoAccount {
|
|
|
|
LiveData<EntityAccount> liveAccount(long id);
|
|
|
|
LiveData<EntityAccount> liveAccount(long id);
|
|
|
|
|
|
|
|
|
|
|
|
@Query("SELECT" +
|
|
|
|
@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" +
|
|
|
|
", (SELECT COUNT(operation.id) FROM operation" +
|
|
|
|
" JOIN folder ON folder.id = operation.folder" +
|
|
|
|
" 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" +
|
|
|
|
" WHERE account.synchronize) AS operations" +
|
|
|
|
", (SELECT COUNT(message.id) FROM message" +
|
|
|
|
", (SELECT COUNT(operation.id) FROM operation" +
|
|
|
|
" JOIN folder ON folder.id = message.folder" +
|
|
|
|
" WHERE operation.name = '" + EntityOperation.SEND + "') AS unsent")
|
|
|
|
" JOIN operation ON operation.message = message.id AND operation.name = '" + EntityOperation.SEND + "'" +
|
|
|
|
|
|
|
|
" WHERE NOT message.ui_seen" +
|
|
|
|
|
|
|
|
" AND folder.type = '" + EntityFolder.OUTBOX + "') AS unsent")
|
|
|
|
|
|
|
|
LiveData<TupleAccountStats> liveStats();
|
|
|
|
LiveData<TupleAccountStats> liveStats();
|
|
|
|
|
|
|
|
|
|
|
|
@Insert
|
|
|
|
@Insert
|
|
|
|