Database SQL Operation: TaskAssignment.countTaskAssignmentForWorkQueuePositionByTaskID
Description: | Returns the count of assigned tasks for the work queue assignee type, the organizational unit subscriber type and by task ID and user name. |
Sterotype: | ns |
SELECT
COUNT(*)
INTO
:numberOfRecords
FROM
TaskAssignment ta
WHERE ta.assigneeType = :assigneeType
AND ta.taskID = :taskID
AND ta.relatedID IN
(
SELECT
DISTINCT wqs.workqueueID
FROM
Users u ,
PositionHolderLink ph ,
Position p ,
WorkQueueSubscription wqs
WHERE u.userName = :userName
AND u.userName = ph.userName
AND ph.positionID = p.positionID
AND ph.recordStatus = :recordStatus
AND wqs.subscriberType = :subscriberType
AND wqs.subscriberID = p.positionID
AND :currentDate >= ph.fromDate
AND
(
:currentDate <= ph.toDate
OR ph.toDate IS NULL
)
)
|