2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`productionVolume_LastHour`
|
|
|
|
AS SELECT cast(
|
|
|
|
sum(`productionVolume`.`cm3` / 1000000) AS decimal(10, 0)
|
|
|
|
) AS `m3`,
|
|
|
|
`productionVolume`.`warehouseFk` AS `warehouseFk`
|
|
|
|
FROM `vn`.`productionVolume`
|
|
|
|
WHERE `productionVolume`.`created` > `util`.`VN_NOW`() + INTERVAL -1 HOUR
|
|
|
|
AND `productionVolume`.`warehouseFk` IN (1, 44, 60)
|
|
|
|
GROUP BY `productionVolume`.`warehouseFk`
|