SELECT
OrganisationUnit.organisationUnitID,
OrganisationUnit.name,
OrganisationUnit.statusCode,
OrganisationUnit.businessTypeCode,
OrganisationStructure.name,
OrganisationStructure.organisationStructureID
INTO
:organisationUnitID,
:name,
:statusCode,
:businessTypeCode,
:organisationStructureName,
:organisationStrucureID
FROM
OrganisationUnit,
OrgUnitParentLink,
OrganisationStructure
WHERE
(
OrgUnitParentLink.organisationStructureID = :organisationStructureID
OR
(
:organisationStructureIDIsNull <> '0'
)
)
AND OrgUnitParentLink.organisationUnitID = OrganisationUnit.organisationUnitID
AND
(
OrganisationUnit.businessTypeCode = :businessTypeCode
OR :businessTypeCode IS NULL
)
AND
(
upper(OrganisationUnit.name) like :name
OR :name IS NULL
)
AND
(
OrganisationUnit.recordStatus = :recordStatus
OR :recordStatus IS NULL
)
AND OrganisationStructure.organisationStructureID = OrgUnitParentLink.organisationStructureID
|