SELECT
t.taskID,
t.priority,
t.status,
t.assignedDateTime,
t.wdoSnapshot,
t.overflowInd,
t.versionNo,
wfdl. deadlinetime AS dueDateTime
INTO
:taskID,
:priority,
:status,
:assignedDateTime,
:wdoSnapshot,
:overflowInd,
:versionNo,
:dueDateTime
FROM
TaskAssignment ta,
Task t
LEFT OUTER JOIN
WorkflowDeadline wfdl
ON wfdl.taskID = t.taskID
WHERE
(
:searchByRelatedIDInd = '0'
OR ta.relatedID = :relatedID
)
AND
(
:relatedName IS NULL
OR ta.relatedName = :relatedName
)
AND ta.assigneeType = :assigneeType
AND t.status NOT IN ( :closedStatus, :completedStatus)
AND t.taskID =ta.taskID
AND t.reservedBy IS NULL
ORDER BY wfdl.deadlineTime ASC
|