SELECT W.ID
FROM PLMWorkScheduleItems W
WHERE W.JORoutine_ID = :JORoutine_ID
order by case
when status = 2 then 10
when status = 1 then 20
when status = 0 then 30
when status in (3,4) then 40
else 50
end
Generated by ABRA Software a.s. 27.10.2021 16:34:49