@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 service_hours, count( * ) as service_count, max( o.run_date ) as last_service, sum( o.trips ) as trip_total } group by l.lift_id, o.run_mode, l.building_id