17 lines
509 B
Plaintext
17 lines
509 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Honey yield per apiary'
|
|
define view entity {{P}}I_HONEY_YIELD
|
|
as select from {{p}}apiary as api
|
|
left outer join {{p}}honey as harv on harv.apiary_id = api.apiary_id
|
|
{
|
|
key api.apiary_id as apiary_id,
|
|
api.beekeeper as beekeeper,
|
|
api.region as region,
|
|
count( * ) as harvest_count,
|
|
sum( harv.kilograms ) as total_kg
|
|
}
|
|
group by
|
|
api.apiary_id,
|
|
api.beekeeper,
|
|
api.region
|