fix: 修正雨量为空的情况

This commit is contained in:
yarnom 2025-07-10 12:36:23 +08:00
parent c6c9015cd3
commit 58a98edc33

View File

@ -160,7 +160,7 @@ LIMIT 1
const QueryAggregatedDataSQL = ` const QueryAggregatedDataSQL = `
SELECT SELECT
w.time_hour as timestamp, w.time_hour as timestamp,
MAX(r.hourly_rainfall) as rainfall, IFNULL(MAX(r.hourly_rainfall), 0) as rainfall,
AVG(w.temperature) as avg_temperature, AVG(w.temperature) as avg_temperature,
AVG(w.humidity) as avg_humidity, AVG(w.humidity) as avg_humidity,
AVG(w.wind_speed) as avg_wind_speed, AVG(w.wind_speed) as avg_wind_speed,