salix/db/routines/vn/views/ticketDownBuffer.sql

23 lines
648 B
MySQL
Raw Normal View History

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`ticketDownBuffer`
AS SELECT `td`.`ticketFk` AS `ticketFk`,
`td`.`created` AS `created`,
`td`.`selected` AS `selected`,
concat(`w`.`firstName`, ' ', `w`.`lastName`) AS `sacador`,
`pk`.`code` AS `parking`
FROM (
(
(
(
`vn`.`ticketDown` `td`
JOIN `vn`.`ticketParking` `tp` ON(`tp`.`ticketFk` = `td`.`ticketFk`)
)
JOIN `vn`.`parking` `pk` ON(`pk`.`id` = `tp`.`parkingFk`)
)
2024-01-25 16:33:54 +00:00
JOIN `vn`.`ticketStateToday` `tst` ON(`tst`.`ticketFk` = `td`.`ticketFk`)
)
2024-01-25 16:33:54 +00:00
JOIN `vn`.`worker` `w` ON(`w`.`id` = `tst`.`userFk`)
)
WHERE `td`.`selected` = 2