2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`worker_getFromHasMistake`(vDepartmentFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtiene los trabajadores de los departamentos que se les puede poner error
|
|
|
|
* @param vDepartmentFk id del departamento
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
SELECT w.id,w.firstName, w.lastName,d.name
|
|
|
|
FROM worker w
|
|
|
|
JOIN workerDepartment wd ON wd.workerFk = w.id
|
|
|
|
JOIN department d ON d.id = wd.departmentFk
|
|
|
|
WHERE d.id = vDepartmentFk
|
|
|
|
ORDER BY firstName;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|