Simplify Message ID query

pull/50/head
M66B 6 years ago
parent 42a4de8931
commit f943303bee

@ -80,12 +80,8 @@ public interface DaoMessage {
@Query("SELECT * FROM message WHERE folder = :folder AND uid = :uid") @Query("SELECT * FROM message WHERE folder = :folder AND uid = :uid")
EntityMessage getMessageByUid(long folder, long uid); EntityMessage getMessageByUid(long folder, long uid);
@Query("SELECT message.* FROM message" + @Query("SELECT * FROM message WHERE msgid = :msgid")
" JOIN folder ON folder.id = message.folder" + EntityMessage getMessageByMsgId(String msgid);
" WHERE message.account = :account" +
" AND folder.type <> '" + EntityFolder.ARCHIVE + "'" +
" AND msgid = :msgid")
EntityMessage getMessageByMsgId(long account, String msgid);
@Query("SELECT message.*, folder.name as folderName, folder.type as folderType" + @Query("SELECT message.*, folder.name as folderName, folder.type as folderType" +
", (SELECT COUNT(m.id) FROM message m WHERE m.account = message.account AND m.thread = message.thread AND NOT m.ui_hide) AS count" + ", (SELECT COUNT(m.id) FROM message m WHERE m.account = message.account AND m.thread = message.thread AND NOT m.ui_hide) AS count" +

Loading…
Cancel
Save