mirror of
https://github.com/SyncrowIOT/data.git
synced 2025-07-10 15:17:24 +00:00
energy consummed
This commit is contained in:
@ -1,9 +1,13 @@
|
||||
SELECT distinct(code)
|
||||
SELECT event_time::date,
|
||||
device_id ,
|
||||
space_device_uuid as space_id,
|
||||
sum(value::integer) as total_energy_consummed
|
||||
FROM device
|
||||
LEFT JOIN "device-status-log"
|
||||
ON device.uuid = "device-status-log".device_id
|
||||
LEFT JOIN product
|
||||
ON product.uuid = device.product_device_uuid
|
||||
where product.name='Power Clamp'
|
||||
--and code='VoltageA'
|
||||
--ORDER BY device.uuid, "device-status-log".event_time
|
||||
and code in ('EnergyConsumed','EnergyConsumedA','EnergyConsumedB','EnergyConsumedC')
|
||||
group by 1,2,3
|
||||
ORDER BY 1,2
|
||||
|
Reference in New Issue
Block a user