diff --git a/internal/dao/sensor.go b/internal/dao/sensor.go index d3f1957..220c7ac 100644 --- a/internal/dao/sensor.go +++ b/internal/dao/sensor.go @@ -69,7 +69,7 @@ func (dao *SensorDAO) GetAggregatedData(start, end time.Time, interval string) ( '%Y-%m-%dT%H:%i:00' ) AS bucket_time, ROUND(AVG(temperature)/10, 1) AS avg_temp, - MAX(rainfall) - MIN(rainfall) AS rainfall, + ROUND((MAX(rainfall) - MIN(rainfall))/10, 1) AS rainfall, ROUND(AVG(humidity)/10, 1) AS avg_humidity, ROUND(AVG(wind_speed)/100, 1) AS avg_wind_speed, ROUND(AVG(atm_pressure)/10, 1) AS avg_atm_pressure, @@ -256,7 +256,7 @@ func (dao *SensorDAO) GetRawData(start, end time.Time) ([]model.AggregatedData, SELECT timestamp, temperature/10 AS temperature, - rainfall, + rainfall/10 AS rainfall, humidity/10 AS humidity, wind_speed/100 AS wind_speed, atm_pressure/10 AS atm_pressure,