diff options
author | 2017-09-25 14:19:18 +0300 | |
---|---|---|
committer | 2017-09-25 14:19:18 +0300 | |
commit | 83af39fd6c3f89670130a8f6a63898e35e172cbf (patch) | |
tree | 1c2009c4a7c4762834a1540bef97c1ccb962c17a /juick-server-jdbc/src/main/java/com/juick/service | |
parent | 207e2632a878ff308b30cbf24b0930e7221ffe5c (diff) |
jdbc: fix getMessage query
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java index c23b04e4..430039ea 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -286,9 +286,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Override public com.juick.Message getMessage(final int mid) { List<com.juick.Message> list = getJdbcTemplate().query( - "SELECT messages.message_id, 0 as rid, 0 as replyto, " - + "messages.user_id, users.nick, users.banned as banned, " - + "TIMESTAMPDIFF(MINUTE, messages.ts, NOW())," + "SELECT messages.message_id as mid, 0 as rid, 0 as replyto, " + + "messages.user_id as uid, users.nick, users.banned as banned, " + + "TIMESTAMPDIFF(MINUTE, messages.ts, NOW()) as ago," + "messages.ts," + "messages.readonly, messages.privacy, messages.replies," + "messages.attach, messages.place_id, messages.lat," @@ -299,7 +299,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ + "ON messages.message_id = txt.message_id " + "LEFT JOIN favorites " + "ON messages.message_id = favorites.message_id " - + "WHERE messages.message_id = ?", + + "WHERE messages.message_id = ? " + + "GROUP BY mid, rid, replyto, uid, nick, banned, ago, ts, readonly, " + + "privacy, replies, attach, place_id, lat, lon, tags, repliesby, q", new MessageMapper(), mid); |