", COUNT(DISTINCT CASE WHEN message.content = 1 THEN message.id ELSE NULL END) AS content"+
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen THEN message.id ELSE NULL END) AS unseen"+
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged THEN message.id ELSE NULL END) AS flagged"+
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing"+
" FROM folder"+
@ -85,7 +85,7 @@ public interface DaoFolder {
", COUNT(DISTINCT CASE WHEN message.ui_hide THEN NULL ELSE message.id END) AS messages"+
", COUNT(DISTINCT CASE WHEN message.content = 1 AND NOT message.ui_hide THEN message.id ELSE NULL END) AS content"+
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND NOT message.ui_hide THEN message.id ELSE NULL END) AS unseen"+
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view AND NOT message.ui_hide THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND NOT message.ui_hide AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged AND NOT message.ui_hide THEN message.id ELSE NULL END) AS flagged"+
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing"+
" FROM folder"+
@ -110,7 +110,7 @@ public interface DaoFolder {
", COUNT(DISTINCT message.id) AS messages"+
", COUNT(DISTINCT CASE WHEN message.content = 1 THEN message.id ELSE NULL END) AS content"+
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen THEN message.id ELSE NULL END) AS unseen"+
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged THEN message.id ELSE NULL END) AS flagged"+
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing"+
" FROM folder"+
@ -144,7 +144,7 @@ public interface DaoFolder {
", COUNT(DISTINCT message.id) AS messages"+
", COUNT(DISTINCT CASE WHEN message.content = 1 THEN message.id ELSE NULL END) AS content"+
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen THEN message.id ELSE NULL END) AS unseen"+
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged THEN message.id ELSE NULL END) AS flagged"+
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing"+
" FROM folder"+
@ -194,7 +194,7 @@ public interface DaoFolder {
", COUNT(DISTINCT folder.id) AS folders"+
", COUNT(message.id) AS messages"+
", SUM(CASE WHEN NOT message.ui_seen THEN 1 ELSE 0 END) AS unseen"+
", SUM(CASE WHEN message.received > folder.last_view THEN 1 ELSE 0 END) AS unexposed" +
", SUM(CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN 1 ELSE 0 END) AS unexposed" +
", CASE WHEN folder.account IS NULL THEN folder.sync_state ELSE NULL END AS sync_state"+
", folder.color, COUNT (DISTINCT folder.color) AS colorCount"+