SELECT
t.taskID,
t.priority,
t.assignedDateTime,
t.restartTime,
t.wdoSnapshot,
t.overflowInd,
w.deadlineTime
INTO
:taskID,
:priority,
:reservedDateTime,
:restartDateTime,
:wdoSnapshot,
:overflowInd,
:deadlineDateTime
FROM
Task t
LEFT OUTER JOIN
WorkflowDeadline w
ON t.taskID = w.taskID
WHERE t.taskID IN
(
SELECT
twqa.taskID
FROM
TaskWorkQueueAssignment twqa
WHERE twqa.workQueueID = :workQueueID
)
AND t.reservedBy = :reservedBy
AND
(
:searchByStatusInd = '0'
OR t.status = :status
)
ORDER BY w.deadlineTime ASC
|