Open system folders first

This commit is contained in:
M66B 2018-08-13 18:54:16 +00:00
parent 106e518960
commit 5d86ae6df2
1 changed files with 7 additions and 2 deletions

View File

@ -31,10 +31,15 @@ public interface DaoFolder {
@Query("SELECT * FROM folder WHERE account = :account")
List<EntityFolder> getFolders(long account);
@Query("SELECT * FROM folder WHERE account = :account AND synchronize = :synchronize")
@Query("SELECT * FROM folder" +
" WHERE account = :account" +
" AND synchronize = :synchronize" +
" ORDER BY CASE WHEN folder.type = '" + EntityFolder.USER + "' THEN 1 ELSE 0 END")
List<EntityFolder> getFolders(long account, boolean synchronize);
@Query("SELECT * FROM folder WHERE account = :account AND type = '" + EntityFolder.USER + "'")
@Query("SELECT * FROM folder" +
" WHERE account = :account" +
" AND type = '" + EntityFolder.USER + "'")
List<EntityFolder> getUserFolders(long account);
@Query("SELECT folder.*, account.name AS accountName" +