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

23 lines
646 B
MySQL
Raw Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`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