mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
Fixed a network page query
This commit is contained in:
parent
bbb158ddc5
commit
8f3f2e9127
@ -88,7 +88,6 @@ public class ServerAggregateQueries {
|
|||||||
*/
|
*/
|
||||||
public static Query<Map<UUID, Integer>> serverUserCounts() {
|
public static Query<Map<UUID, Integer>> serverUserCounts() {
|
||||||
String sql = "SELECT COUNT(1) as c, " + UserInfoTable.SERVER_UUID + FROM + UserInfoTable.TABLE_NAME +
|
String sql = "SELECT COUNT(1) as c, " + UserInfoTable.SERVER_UUID + FROM + UserInfoTable.TABLE_NAME +
|
||||||
WHERE + UserInfoTable.SERVER_UUID + "=?" +
|
|
||||||
GROUP_BY + UserInfoTable.SERVER_UUID;
|
GROUP_BY + UserInfoTable.SERVER_UUID;
|
||||||
return new QueryAllStatement<Map<UUID, Integer>>(sql, 100) {
|
return new QueryAllStatement<Map<UUID, Integer>>(sql, 100) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1009,4 +1009,12 @@ public abstract class CommonDBTest {
|
|||||||
assertEquals("Wrong return value. " + tpsData.stream().map(TPS::getPlayers).collect(Collectors.toList()).toString(), expected, actual);
|
assertEquals("Wrong return value. " + tpsData.stream().map(TPS::getPlayers).collect(Collectors.toList()).toString(), expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void playerCountForServersIsCorrect() {
|
||||||
|
Map<UUID, Integer> expected = Collections.singletonMap(serverUUID, 1);
|
||||||
|
saveUserOne();
|
||||||
|
|
||||||
|
Map<UUID, Integer> result = db.query(ServerAggregateQueries.serverUserCounts());
|
||||||
|
assertEquals(expected, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user