We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68a2c66 commit 983c829Copy full SHA for 983c829
src/main/resources/db/migration/V1_0_4__update.sql
@@ -0,0 +1,17 @@
1
+-- came with https://github.com/steve-community/steve/issues/1219
2
+CREATE OR REPLACE VIEW ocpp_tag_activity AS
3
+select `o`.*,
4
+ count(`t`.`id_tag`) AS `active_transaction_count`,
5
+ case when count(`t`.`id_tag`) > 0 then 1 else 0 end AS `in_transaction`,
6
+ case when `o`.`max_active_transaction_count` = 0 then 1 else 0 end AS `blocked`
7
+from `ocpp_tag` `o` left join `transaction` `t` on (
8
+ `o`.`id_tag` = `t`.`id_tag` and
9
+ `t`.`stop_timestamp` is null and
10
+ `t`.`stop_value` is null)
11
+group by
12
+ `o`.`ocpp_tag_pk`,
13
+ `o`.`id_tag`,
14
+ `o`.`parent_id_tag`,
15
+ `o`.`expiry_date`,
16
+ `o`.`max_active_transaction_count`,
17
+ `o`.`note`;
0 commit comments