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`.`machine_getWorkerPlate`(vWorkerFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Selecciona la matrícula del vehículo del workerfk
|
|
|
|
*
|
|
|
|
* @param vWorkerFk el id del trabajador
|
|
|
|
*/
|
|
|
|
SELECT m.plate
|
|
|
|
FROM machine m
|
|
|
|
JOIN machineWorker mw ON mw.machineFk = m.id
|
|
|
|
WHERE mw.inTimed >= TIMESTAMPADD(HOUR , -12,util.VN_NOW())
|
|
|
|
AND ISNULL(mw.outTimed)
|
|
|
|
AND mw.workerFk = vWorkerFk;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|