Operation Details
Description: Search for appeal case details using various search parameters @deprecated Since Curam 6.0 SP1, replaced with {searchAppeal(AppealDatabseSeachKeyDtls)}. See release note: CR00289218.
Sterotype: nsmulti
SQL
SELECT
  Appeal.caseID,
  caseReference,
  appealTypeCode,
  concernRoleName,
  participantRoleID,
  typeCode,
  concernRoleType,
  CaseHeader.registrationDate,
  CaseHeader.statusCode
INTO
  :caseID,
  :caseReference,
  :appealType,
  :participantName,
  :participantRoleID,
  :participantType,
  :concernRoleType,
  :creationDate,
  :status 
FROM
  Appeal,
  CaseHeader,
  CaseParticipantRole,
  ConcernRole 
WHERE CaseHeader.caseID = Appeal.caseID 
  AND CaseParticipantRole.caseID = Appeal.caseID 
  AND ConcernRole.concernRoleID = CaseParticipantRole.participantRoleID 
  AND typeCode in ( :appellantParticipantRoleType, :respondentParticipantRoleType) 
  AND 
  (
    :searchByAppealType = '0' 
    OR appealTypeCode = :appealType 
  ) 
  AND 
  (
    :searchByStatus = '0' 
    OR CaseHeader.statusCode = :status 
  ) 
  AND 
  (
    :searchByCreationDate = '0' 
    OR CaseHeader.registrationDate = :creationDate 
  ) 
  AND 
  (
    :searchByAppellant = '0' 
    OR 
    (
      participantRoleID = :appellantID 
      AND typeCode = :appellantParticipantRoleType 
    ) 
  )
  AND 
  (
    :searchByRespondent = '0' 
    OR 
    (
      participantRoleID = :respondentID 
      AND typeCode = :respondentParticipantRoleType 
    ) 
  ) 
ORDER BY caseReference,
  typeCode