Operation Details
Description:  
Sterotype: ns
SQL
SELECT
  COUNT(*)
INTO
  :count 
FROM
  DeterminationPackageVersion 
WHERE 
  (
    
    (
      :priorityInd = 1 
      AND productID IS NULL 
      AND determinationConfigID = :determinationConfigID 
      AND gender IS NOT NULL 
      AND flag = 3 
    ) 
    OR 
    (
      :priorityInd = 2 
      AND productID IS NULL 
      AND determinationConfigID = :determinationConfigID 
      AND gender IS NULL 
      AND flag <> 3 
    ) 
    OR 
    (
      :priorityInd = 3 
      AND productID = :productID 
      AND determinationConfigID = :determinationConfigID 
      AND gender IS NOT NULL 
      AND flag = 3 
    ) 
    OR 
    (
      :priorityInd = 4 
      AND productID = :productID 
      AND determinationConfigID = :determinationConfigID 
      AND gender IS NULL 
      AND flag <> 3 
    ) 
  ) 
  AND determinationPackageID <> :determinationPackageID