Operation Details
Description: Searches the CaseEvidenceTree entity by statusCode, effectiveFrom date and caseID.
Sterotype: nsmulti
SQL
SELECT
  CaseEvidenceTree.caseEvidenceTreeID,
  CaseEvidenceTree.caseID,
  CaseEvidenceTree.effectiveFrom,
  CaseEvidenceTree.statusCode,
  CaseEvidenceTree.previousEvidenceID,
  CaseEvidenceTree.versionNo
INTO
  :caseEvidenceTreeID,
  :caseID,
  :effectiveFrom,
  :statusCode,
  :previousEvidenceID,
  :versionNo 
FROM
  CaseEvidenceTree 
WHERE CaseEvidenceTree.caseID = :caseID 
  AND CaseEvidenceTree.statusCode = :statusCode 
  AND 
  (
    
    (
      CaseEvidenceTree.effectiveFrom = :effectiveFrom 
      AND :useDateInd <> '0' 
    ) 
    OR 
    (
      CaseEvidenceTree.effectiveFrom IS NULL 
      AND :useDateInd = '0' 
    ) 
  ) 
ORDER BY caseID,
  effectiveFrom,
  statusCode