mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
Made Server identifier query more flexible
Affects issues: - Possibly fixed #1381
This commit is contained in:
parent
975bb64c4c
commit
278602db36
@ -85,6 +85,7 @@ public class ServerQueries {
|
||||
String sql = SELECT + '*' + FROM + ServerTable.TABLE_NAME +
|
||||
" WHERE (LOWER(" + ServerTable.SERVER_UUID + ") LIKE LOWER(?)" +
|
||||
OR + "LOWER(" + ServerTable.NAME + ") LIKE LOWER(?)" +
|
||||
OR + ServerTable.SERVER_ID + "=?" +
|
||||
OR + ServerTable.SERVER_ID + "=?)" +
|
||||
AND + ServerTable.INSTALLED + "=?" +
|
||||
" LIMIT 1";
|
||||
@ -94,7 +95,9 @@ public class ServerQueries {
|
||||
statement.setString(1, identifier);
|
||||
statement.setString(2, identifier);
|
||||
statement.setInt(3, NumberUtils.isParsable(identifier) ? Integer.parseInt(identifier) : -1);
|
||||
statement.setBoolean(4, true);
|
||||
String id = identifier.startsWith("Server ") ? identifier.substring(7) : identifier;
|
||||
statement.setInt(4, NumberUtils.isParsable(id) ? Integer.parseInt(id) : -1);
|
||||
statement.setBoolean(5, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user