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`.`workingHours`(username varchar(255), logon boolean)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
DECLARE userid int(11);
|
|
|
|
|
|
|
|
SELECT vn.getUserId(username) INTO userid;
|
|
|
|
SELECT username, userid;
|
|
|
|
IF userid IS NOT NULL THEN
|
|
|
|
IF (logon) THEN
|
|
|
|
CALL vn.workingHoursTimeIn(userid);
|
|
|
|
ELSE
|
|
|
|
CALL vn.workingHoursTimeOut(userid);
|
|
|
|
END IF;
|
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|