diff --git a/src/main/java/app/services/db/BanService.java b/src/main/java/app/services/db/BanService.java index 16147a2..624c198 100644 --- a/src/main/java/app/services/db/BanService.java +++ b/src/main/java/app/services/db/BanService.java @@ -120,7 +120,7 @@ public class BanService { } public List getUsersDiscordWithBanOnServers() { - return jdbcTemplate.query("SELECT `discord_id` FROM `light_bans` INNER JOIN `steam2discord` ON `light_bans`.`active` = ?1 AND `light_bans`.`steam_id` COLLATE utf8mb4_unicode_ci LIKE `steam2discord`.`steam_id`", + return jdbcTemplate.query("SELECT `discord_id` FROM `light_bans` INNER JOIN `steam2discord` ON `light_bans`.`active` = ? AND `light_bans`.`steam_id` COLLATE utf8mb4_unicode_ci LIKE `steam2discord`.`steam_id`", new Object[]{1}, new RowMapper() { @Override diff --git a/src/main/java/app/services/db/DiscordAuthService.java b/src/main/java/app/services/db/DiscordAuthService.java index 13d9efc..6077bf3 100644 --- a/src/main/java/app/services/db/DiscordAuthService.java +++ b/src/main/java/app/services/db/DiscordAuthService.java @@ -33,7 +33,7 @@ public class DiscordAuthService { } public String getDiscordIDofSteamID(SteamID steamID) { - return jdbcTemplate.query("SELECT discord_id FROM steam2discord WHERE steam_id = ?1 AND active = 1 LIMIT 1", + return jdbcTemplate.query("SELECT discord_id FROM steam2discord WHERE steam_id = ? AND active = 1 LIMIT 1", new Object[]{ steamID.steam2 }, new RowMapper() { @Override diff --git a/src/main/java/app/services/db/KillfeedService.java b/src/main/java/app/services/db/KillfeedService.java index e7ed24f..d73b0f9 100644 --- a/src/main/java/app/services/db/KillfeedService.java +++ b/src/main/java/app/services/db/KillfeedService.java @@ -105,7 +105,7 @@ public class KillfeedService { } }); - /*Long count = (Long) createNativeQuery("SELECT COUNT(`weapon_index`) FROM `user_killfeed` WHERE `attacker_id` = ?1 AND server_id like ?2 GROUP BY `weapon_index`") + /*Long count = (Long) createNativeQuery("SELECT COUNT(`weapon_index`) FROM `user_killfeed` WHERE `attacker_id` = ? AND server_id like ? GROUP BY `weapon_index`") .setParameter(1, steamID.account_id) .setParameter(2, server_id==null||server_id.isEmpty()?'%':server_id) .getSingleResult();*/ diff --git a/src/main/java/app/services/db/PermitionService.java b/src/main/java/app/services/db/PermitionService.java index 42dfaf6..15c6f28 100644 --- a/src/main/java/app/services/db/PermitionService.java +++ b/src/main/java/app/services/db/PermitionService.java @@ -53,7 +53,7 @@ public class PermitionService { } public int extendPermition(SteamID steamID, Integer amount, String status) { - return jdbcTemplate.update("UPDATE `sm_admins` SET `amount`=`amount`+?1, `reg_date`=`reg_date` WHERE `identity` LIKE ?2 AND `status` LIKE ?3", + return jdbcTemplate.update("UPDATE `sm_admins` SET `amount`=`amount`+?, `reg_date`=`reg_date` WHERE `identity` LIKE ? AND `status` LIKE ?", amount, steamID.steam2, status); } diff --git a/src/main/java/app/services/db/UsertimeService.java b/src/main/java/app/services/db/UsertimeService.java index a30c4c2..3e2f375 100644 --- a/src/main/java/app/services/db/UsertimeService.java +++ b/src/main/java/app/services/db/UsertimeService.java @@ -161,7 +161,7 @@ public class UsertimeService { public Long getTotalGametimeOnServer(SteamID steamID, String server) { String db = stats.getServers().entrySet().stream().filter(s -> s.getKey().equals(server)).map(s -> s.getValue().getDb()).findFirst().orElse(null); if (db == null) return 0L; - return jdbcTemplate.query("SELECT count(id) as c FROM `"+db+"`.`user_connections` WHERE account_id = ?1 AND connection_type LIKE ?2", + return jdbcTemplate.query("SELECT count(id) as c FROM `"+db+"`.`user_connections` WHERE account_id = ? AND connection_type LIKE ?", new Object[]{ steamID.account_id, "disconnect" }, new RowMapper() { @Override