Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
15 lines
450 B
Plaintext
15 lines
450 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Station energy totals'
|
|
define view entity {{P}}I_STATION_ENERGY
|
|
as select from {{p}}station as st
|
|
left outer join {{p}}session as se on se.station_id = st.station_id and se.status = 'C'
|
|
{
|
|
key st.station_id as station_id,
|
|
st.city as city,
|
|
count( se.session_id ) as session_count,
|
|
sum( se.energy_kwh ) as total_energy
|
|
}
|
|
group by
|
|
st.station_id,
|
|
st.city
|