Show when folder is executing operations

This commit is contained in:
M66B
2019-05-11 21:30:09 +02:00
parent c00eac14f4
commit a70a517c9f
10 changed files with 1826 additions and 6 deletions

View File

@@ -63,6 +63,7 @@ public interface DaoFolder {
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +
", SUM(CASE WHEN message.ui_seen = 0 THEN 1 ELSE 0 END) AS unseen" +
", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id AND operation.state = 'executing') AS executing" +
", (SELECT COUNT(child.id) FROM folder child WHERE child.parent = folder.id) AS childs" +
" FROM folder" +
" LEFT JOIN account ON account.id = folder.account" +
@@ -80,6 +81,7 @@ public interface DaoFolder {
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +
", SUM(CASE WHEN message.ui_seen = 0 THEN 1 ELSE 0 END) AS unseen" +
", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id AND operation.state = 'executing') AS executing" +
", (SELECT COUNT(child.id) FROM folder child WHERE child.parent = folder.id) AS childs" +
" FROM folder" +
" JOIN account ON account.id = folder.account" +
@@ -92,7 +94,8 @@ public interface DaoFolder {
@Query("SELECT folder.*" +
", account.`order` AS accountOrder, account.name AS accountName, account.color AS accountColor" +
", SUM(CASE WHEN message.ui_seen = 0 THEN 1 ELSE 0 END) AS unseen" +
", (SELECT COUNT(*) FROM operation WHERE operation.folder = folder.id) AS operations" +
", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id) AS operations" +
", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id AND operation.state = 'executing') AS executing" +
" FROM folder" +
" LEFT JOIN account ON account.id = folder.account" +
" LEFT JOIN message ON message.folder = folder.id AND NOT message.ui_hide" +
@@ -118,6 +121,7 @@ public interface DaoFolder {
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +
", SUM(CASE WHEN message.ui_seen = 0 THEN 1 ELSE 0 END) AS unseen" +
", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id AND operation.state = 'executing') AS executing" +
", (SELECT COUNT(child.id) FROM folder child WHERE child.parent = folder.id) AS childs" +
" FROM folder" +
" LEFT JOIN account ON account.id = folder.account" +