2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`timeControl_calculateByWorker`(vWorkerFk INT, vDatedFrom DATETIME, vDatedTo DATETIME)
|
2024-01-15 11:31:03 +00:00
|
|
|
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 ;
|