Operation Details
Description: This method searches for an active working pattern of a specific type in the specified date range for the specified owner
Sterotype: nsmulti
SQL
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 <= :endDate 
    ) 
    OR 
    (
      :endDate IS NULL 
    ) 
  ) 
  AND 
  (
    
    (
      endDate IS NULL 
    ) 
    OR 
    (
      endDate >= :startDate 
    ) 
  ) 
  AND 
  (
    recordStatusCode = :recordStatusCode 
  )