@AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Lift usage' define view entity {{P}}I_LIFT_USAGE as select from {{p}}lift as l inner join {{p}}lift_op as o on o.lift_id = l.lift_id and o.run_mode <> 'TEST' { key l.lift_id as lift_id, key o.run_mode as run_mode, l.building_id as building_id, sum( o.run_hours ) as hours, count( * ) as run_count, max( o.run_date ) as last_run, sum( o.trips ) as value } group by l.lift_id, o.run_mode, l.building_id