Prepare individual account management

This commit is contained in:
M66B
2019-12-06 16:00:11 +01:00
parent ea64f2f308
commit 5fadfd879d
5 changed files with 153 additions and 1 deletions

View File

@@ -69,6 +69,16 @@ public interface DaoAccount {
", account.name COLLATE NOCASE")
LiveData<List<TupleAccountEx>> liveAccountsEx(boolean all);
@Query("SELECT account.*" +
", SUM(folder.synchronize) AS folders" +
", COUNT(operation.id) AS operations" +
" FROM account" +
" LEFT JOIN folder ON folder.account = account.id" +
" LEFT JOIN operation ON operation.folder = folder.id" +
" GROUP BY account.id" +
" ORDER BY account.id")
LiveData<List<TupleAccountState>> liveAccountState();
@Query("SELECT * FROM account WHERE id = :id")
EntityAccount getAccount(long id);