salix/db/routines/vn/procedures/workingHours.sql

17 lines
422 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`workingHours`(username varchar(255), logon boolean)
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 ;