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

16 lines
522 B
MySQL
Raw Normal View History

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`ticketStateToday`
2024-02-05 06:30:04 +00:00
AS SELECT
`ts`.`ticketFk` AS `ticketFk`,
`ts`.`state` AS `state`,
`ts`.`productionOrder` AS `productionOrder`,
`ts`.`alertLevel` AS `alertLevel`,
2024-02-05 06:30:04 +00:00
`ts`.`userFk` AS `userFk`,
`ts`.`code` AS `code`,
`ts`.`updated` AS `updated`,
`ts`.`isPicked` AS `isPicked`
2024-02-05 06:30:04 +00:00
FROM `ticketState` `ts`
JOIN `ticket` `t` ON `t`.`id` = `ts`.`ticketFk`
WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `MIDNIGHT`(`util`.`VN_CURDATE`());