CREATE OR REPLACE DEFINER=`vn-admin`@`localhost`
	SQL SECURITY DEFINER
	VIEW `vn`.`workerTimeControlUserInfo`
AS SELECT `u`.`id` AS `userFk`,
	`w`.`firstName` AS `name`,
	`w`.`lastName` AS `surname`,
	`u`.`name` AS `user`,
	`u`.`password` AS `password`,
	`wd`.`departmentFk` AS `departmentFk`,
	left(`c`.`fi`, 8) AS `dni`
FROM (
		(
			(
				`account`.`user` `u`
				JOIN `vn`.`worker` `w` ON(`w`.`id` = `u`.`id`)
			)
			JOIN `vn`.`client` `c` ON(`c`.`id` = `u`.`id`)
		)
		LEFT JOIN `vn`.`workerDepartment` `wd` ON(`wd`.`workerFk` = `w`.`id`)
	)
