salix/db/routines/vn/procedures/timeControl_calculateByWork...

23 lines
560 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`timeControl_calculateByWorker`(vWorkerFk INT, vDatedFrom DATETIME, vDatedTo DATETIME)
BEGIN
/**
* @param vWorkerFk
* @param vDatedFrom workerTimeControl
* @param vDatedTo workerTimeControl
*/
DROP TEMPORARY TABLE IF EXISTS tmp.`user`;
CREATE TEMPORARY TABLE tmp.`user`
SELECT u.id userFk
FROM account.user u
JOIN vn.worker w ON w.id = u.id
WHERE w.id = vWorkerFk;
CALL vn.timeControl_calculate(vDatedFrom, vDatedTo);
DROP TEMPORARY TABLE tmp.`user`;
END$$
DELIMITER ;