diff options
Diffstat (limited to 'src/main/java/com/juick/service/ShowQueriesServiceImpl.java')
-rw-r--r-- | src/main/java/com/juick/service/ShowQueriesServiceImpl.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/com/juick/service/ShowQueriesServiceImpl.java b/src/main/java/com/juick/service/ShowQueriesServiceImpl.java index 426ed9f2..15e8f875 100644 --- a/src/main/java/com/juick/service/ShowQueriesServiceImpl.java +++ b/src/main/java/com/juick/service/ShowQueriesServiceImpl.java @@ -51,12 +51,11 @@ public class ShowQueriesServiceImpl extends BaseJdbcService implements ShowQueri @Override public List<String> getTopUsers() { - return getJdbcTemplate().query( - "SELECT users.nick,COUNT(subscr_users.suser_id) AS cnt " + - "FROM (subscr_users INNER JOIN users ON subscr_users.user_id=users.id) " + - "INNER JOIN useroptions ON users.id=useroptions.user_id " + - "WHERE useroptions.privacy_view>0 AND users.lastmessage > UNIX_TIMESTAMP() - 259200 " + - "AND users.id!=2 GROUP BY subscr_users.user_id ORDER BY cnt DESC LIMIT 10", + return getJdbcTemplate().query(""" + SELECT users.nick,COUNT(subscr_users.suser_id) AS cnt + FROM (subscr_users INNER JOIN users ON subscr_users.user_id=users.id) + WHERE users.lastmessage > UNIX_TIMESTAMP() - 259200 + AND users.id!=2 GROUP BY subscr_users.user_id ORDER BY cnt DESC LIMIT 10""", (rs, rowNum) -> rs.getString(1)); } } |