fix: 前期没数据导致回收图表为空

This commit is contained in:
2024-12-21 16:06:05 +08:00
parent af1ea5a2a9
commit 6609c02ebf

View File

@@ -181,7 +181,13 @@ public class PdcDeviceDataService
with tmp as (select d.device_id,
time_bucket_gapfill(cast(:bucket as interval), d.time) as tb,
interpolate(max(d.total_data)) as total_data
interpolate(max(d.total_data), (select ('2024-12-18 00:00:00'::timestamp, (select total_data
from t_pdc_device_data x
where x.time >= :startTime
AND x.time <= :endTime
and x.device_id = d.device_id
order by x.time
limit 1)))) as total_data
from t_pdc_device_data d
left join t_pdc_device pdc on d.device_id = pdc.id