<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        eou.unit_id,
                        eou.unit_code,
                        eou.description_id,
                        (SELECT
                            DESCRIPTION_TEXT
                        FROM
                            fnd_descriptions
                        WHERE
                            DESCRIPTION_ID = eou.description_id AND
                            Language       = 'ZHS'
                        ) AS org_unit_description,
                        eou.company_id
                    FROM
                        EXP_ORG_UNIT eou,
                        hls_product_plan_district hd
                    WHERE
                        eou.unit_id        = hd.unit_id(+) AND
                        hd.product_plan_id = ${/parameter/@product_plan_id}
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="unit_id" required="true"/>
        <bm:field name="unit_code"/>
        <bm:field name="description_id"/>
        <bm:field name="org_unit_description"/>
        <bm:field name="company_id"/>
    </bm:fields>
</bm:model>
