2024-01-15 11:31:03 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`ticketState`
|
|
|
|
AS SELECT `tt`.`created` AS `updated`,
|
|
|
|
`tt`.`stateFk` AS `stateFk`,
|
2024-01-25 16:33:54 +00:00
|
|
|
`tt`.`userFk` AS `userFk`,
|
2024-01-15 11:31:03 +00:00
|
|
|
`tls`.`ticketFk` AS `ticketFk`,
|
|
|
|
`s`.`id` AS `state`,
|
|
|
|
`s`.`order` AS `productionOrder`,
|
|
|
|
`s`.`alertLevel` AS `alertLevel`,
|
|
|
|
`s`.`code` AS `code`,
|
|
|
|
`s`.`isPreviousPreparable` AS `isPreviousPreparable`,
|
|
|
|
`s`.`isPicked` AS `isPicked`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
`vn`.`ticketLastState` `tls`
|
|
|
|
JOIN `vn`.`ticketTracking` `tt` ON(`tt`.`id` = `tls`.`ticketTrackingFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`state` `s` ON(`s`.`id` = `tt`.`stateFk`)
|
|
|
|
)
|