2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`ticketLastUpdatedList`
|
|
|
|
AS SELECT `s`.`ticketFk` AS `ticketFk`,
|
|
|
|
`st`.`created` AS `created`
|
|
|
|
FROM (
|
|
|
|
`vn`.`saleTracking` `st`
|
|
|
|
JOIN `vn`.`sale` `s` ON(`s`.`id` = `st`.`saleFk`)
|
|
|
|
)
|
|
|
|
WHERE `st`.`created` > `util`.`VN_CURDATE`()
|
|
|
|
UNION ALL
|
|
|
|
SELECT `tt`.`ticketFk` AS `Id_Ticket`,
|
|
|
|
`tt`.`created` AS `odbc_date`
|
|
|
|
FROM `vn`.`ticketTracking` `tt`
|
|
|
|
WHERE `tt`.`created` > `util`.`VN_CURDATE`()
|
|
|
|
UNION ALL
|
|
|
|
SELECT `s`.`ticketFk` AS `ticketFk`,
|
|
|
|
`iss`.`created` AS `created`
|
|
|
|
FROM (
|
|
|
|
`vn`.`itemShelvingSale` `iss`
|
|
|
|
JOIN `vn`.`sale` `s` ON(`s`.`id` = `iss`.`saleFk`)
|
|
|
|
)
|
|
|
|
WHERE `iss`.`created` > `util`.`VN_CURDATE`()
|