SQL korrigiert

This commit is contained in:
Tobias Peper 2025-03-22 16:09:12 +01:00
parent ae7dca5284
commit 45ded979d5

View File

@ -38,7 +38,7 @@ class VzRestController {
List<Aggregate> getLatestData( List<Aggregate> getLatestData(
@RequestParam("houseId")final int houseId, @RequestParam("houseId")final int houseId,
@RequestParam("timeWindow")final int timeWindow) { @RequestParam("timeWindow")final int timeWindow) {
return jdbcTemplate.query("SELECT * FROM tobias_aggregate2 WHERE houseId=? ORDER BY timestamp_start DESC LIMIT ?;", return jdbcTemplate.query("SELECT * FROM tobias_aggregate2 WHERE house_id=? ORDER BY timestamp_start DESC LIMIT ?;",
(rs, rowNum) -> new Aggregate(houseId, rs.getLong("timestamp_start"), rs.getLong("timestamp_end"), rs.getLong("produced_energy"), rs.getLong("obtained_energy"), rs.getLong("injected_energy")), (rs, rowNum) -> new Aggregate(houseId, rs.getLong("timestamp_start"), rs.getLong("timestamp_end"), rs.getLong("produced_energy"), rs.getLong("obtained_energy"), rs.getLong("injected_energy")),
houseId, timeWindow); houseId, timeWindow);
} }