Browse Source

jdbc migrate hot fix

master
gsd 1 year ago
parent
commit
1fa53f7502
  1. 2
      src/main/java/app/services/db/BanService.java
  2. 2
      src/main/java/app/services/db/DiscordAuthService.java
  3. 2
      src/main/java/app/services/db/KillfeedService.java
  4. 2
      src/main/java/app/services/db/PermitionService.java
  5. 2
      src/main/java/app/services/db/UsertimeService.java

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

@ -120,7 +120,7 @@ public class BanService {
}
public List<Long> 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<Long>() {
@Override

2
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<String>() {
@Override

2
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();*/

2
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);
}

2
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<Long>() {
@Override

Loading…
Cancel
Save