Database SQL Operation: ProductEvidenceFormLink.countByEvidenceFormIDStatusAndDate
Description: | Returns count of records for the EvidenceFormID and status and endDate less than the provided one |
Sterotype: | ns |
SELECT
COUNT(*)
INTO
:value
FROM
ProductEvidenceFormLink
WHERE ProductEvidenceFormLink.evidenceFormID = :evidenceFormID
AND
(
ProductEvidenceFormLink.endDate >= :currentDate
OR :currentDate IS NULL
OR ProductEvidenceFormLink.endDate IS NULL
)
AND
(
ProductEvidenceFormLink.recordStatus = :recordStatus
OR :recordStatus IS NULL
)
|