From 12c36dedf4225afc1d1bc0cb6d36f3f505452c54 Mon Sep 17 00:00:00 2001 From: Dulanic <2948206+Dulanic@users.noreply.github.com> Date: Fri, 22 May 2020 11:55:52 -0500 Subject: [PATCH] Update charge-details.json Pull from charging_process if available, if not, use charges. --- grafana/dashboards/internal/charge-details.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana/dashboards/internal/charge-details.json b/grafana/dashboards/internal/charge-details.json index 3e7934bd77..c4a67859d2 100644 --- a/grafana/dashboards/internal/charge-details.json +++ b/grafana/dashboards/internal/charge-details.json @@ -234,7 +234,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT charge_energy_added from charging_processes where id = $charging_process_id;", + "rawSql": "select coalesce(cp.charge_energy_added, c.charge_energy_added)\r\nfrom charging_processes cp\r\njoin charges c\r\n\ton cp.id = c.charging_process_id\r\nwhere car_id = $car_id\r\nAND cp.id = $charging_process_id\r\nORDER BY c.date desc\r\nfetch first row only", "refId": "A", "select": [ [