fix:修改解析函数
This commit is contained in:
parent
3d58223306
commit
dae8e5eca7
@ -69,7 +69,7 @@ func (dao *SensorDAO) GetAggregatedData(start, end time.Time, interval string) (
|
|||||||
'%Y-%m-%dT%H:%i:00'
|
'%Y-%m-%dT%H:%i:00'
|
||||||
) AS bucket_time,
|
) AS bucket_time,
|
||||||
ROUND(AVG(temperature)/10, 1) AS avg_temp,
|
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(humidity)/10, 1) AS avg_humidity,
|
||||||
ROUND(AVG(wind_speed)/100, 1) AS avg_wind_speed,
|
ROUND(AVG(wind_speed)/100, 1) AS avg_wind_speed,
|
||||||
ROUND(AVG(atm_pressure)/10, 1) AS avg_atm_pressure,
|
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
|
SELECT
|
||||||
timestamp,
|
timestamp,
|
||||||
temperature/10 AS temperature,
|
temperature/10 AS temperature,
|
||||||
rainfall,
|
rainfall/10 AS rainfall,
|
||||||
humidity/10 AS humidity,
|
humidity/10 AS humidity,
|
||||||
wind_speed/100 AS wind_speed,
|
wind_speed/100 AS wind_speed,
|
||||||
atm_pressure/10 AS atm_pressure,
|
atm_pressure/10 AS atm_pressure,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user