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`.`operatorWorkerCode`
|
|
|
|
AS SELECT `o`.`workerFk` AS `workerFk`,
|
|
|
|
concat(`w`.`firstName`, ' ', `w`.`lastName`) AS `fullName`,
|
|
|
|
`w`.`code` AS `code`,
|
|
|
|
`o`.`numberOfWagons` AS `numberOfWagons`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
`vn`.`worker` `w`
|
|
|
|
JOIN `vn`.`operator` `o` ON(`o`.`workerFk` = `w`.`id`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`sector` `s` ON(`o`.`sectorFk` = `s`.`id`)
|
|
|
|
)
|
|
|
|
WHERE `o`.`sectorFk` IS NOT NULL
|
|
|
|
AND `s`.`code` IN (
|
|
|
|
'H2',
|
|
|
|
'H2',
|
|
|
|
'PEQUES_H',
|
|
|
|
'ALTILLO COMP',
|
|
|
|
'ALTILLO ARTI'
|
|
|
|
)
|