SELECT
workingPatternID,
userName,
organisationID,
locationID,
startDate,
endDate,
defaultStartTime,
defaultEndTime,
recordStatusCode,
workingHoursType,
versionNo
INTO
:workingPatternID,
:userName,
:organisationID,
:locationID,
:startDate,
:endDate,
:defaultStartTime,
:defaultEndTime,
:recordStatusCode,
:workingHoursType,
:versionNo
FROM
WorkingPattern
WHERE
(
userName = :userName
OR organisationID = :organisationID
OR locationID = :locationID
)
AND
(
workingHoursType = :workingHoursType
)
AND
(
startDate <= :effectiveDate
)
AND
(
(
endDate IS NULL
)
OR
(
endDate >= :effectiveDate
)
)
AND
(
recordStatusCode = :recordStatusCode
)
|