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`.`workerWithoutTractor`
|
|
|
|
AS SELECT `c`.`workerFk` AS `workerFk`,
|
|
|
|
`cl`.`name` AS `Trabajador`,
|
|
|
|
COUNT(DISTINCT `c`.`id`) AS `Colecciones`,
|
|
|
|
max(`c`.`created`) AS `created`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
`vn`.`collection` `c`
|
|
|
|
JOIN `vn`.`client` `cl` ON(`cl`.`id` = `c`.`workerFk`)
|
|
|
|
)
|
2024-10-23 09:33:45 +00:00
|
|
|
JOIN `vn`.`operator` `o` ON(
|
|
|
|
`o`.`workerFk` = `c`.`workerFk`
|
2024-01-15 11:31:03 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
WHERE `c`.`created` > `util`.`VN_CURDATE`()
|
2024-10-23 09:33:45 +00:00
|
|
|
AND `o`.`machineFk` IS NULL
|
2024-01-15 11:31:03 +00:00
|
|
|
GROUP BY `c`.`workerFk`
|