Browse Source

posgres support 5

master
gsd 6 months ago
parent
commit
d6d9e7534e
  1. 2
      src/main/java/app/services/db/DetectService.java
  2. 4
      src/main/java/app/services/db/UsertimeService.java

2
src/main/java/app/services/db/DetectService.java

@ -81,7 +81,7 @@ public class DetectService {
}
public List<Map<String, Object>> getAttachedDiscordAccountPerSteam(SteamID steamID) {
return jdbcTemplate_ro.query("SELECT discord_id, extract(epoch from timestamp) as utime, active FROM steam2discord WHERE steam_id LIKE ? GROUP BY discord_id",
return jdbcTemplate_ro.query("SELECT discord_id, extract(epoch from timestamp) as utime, active FROM steam2discord WHERE steam_id LIKE ? GROUP BY discord_id, active, timestamp",
new Object[]{ steamID.steam2 },
(rs, n) -> Map.of("discord_id", rs.getObject("discord_id"), "utime", rs.getObject("utime"), "active", rs.getObject("active")));
}

4
src/main/java/app/services/db/UsertimeService.java

@ -101,13 +101,13 @@ public class UsertimeService {
}
public List<String> getMap(String db, int limit) {
return jdbcTemplate.query("select distinct map from "+db+".user_connections WHERE true ORDER BY user_connections.id DESC LIMIT ?",
return jdbcTemplate.query("select map from "+db+".user_connections WHERE true group by map, id ORDER BY user_connections.id DESC LIMIT ?",
new Object[]{ limit },
(rs, n) -> rs.getString("map"));
}
public List<String> getMaps(String db) {
return jdbcTemplate.query("select distinct map from "+db+".user_connections",
return jdbcTemplate.query("select map from "+db+".user_connections group by map",
(rs, n) -> rs.getString("map"));
}

Loading…
Cancel
Save