mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
fix: 前期没数据导致回收图表为空
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user