2024-01-15 11:31:03 +00:00
|
|
|
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-15 11:31:03 +00:00
|
|
|
)
|
2024-01-25 16:33:54 +00:00
|
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `tst`.`userFk`)
|
2024-01-15 11:31:03 +00:00
|
|
|
)
|
|
|
|
WHERE `td`.`selected` = 2
|