<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="unit_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="UNIT_CODE" prompt="EXP_ORG_UNIT.UNIT_CODE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
        <bm:field name="unit_desc" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="UNIT_DESC" prompt="EXP_ORG_UNIT.ORG_UNIT_DESCRIPTION"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select * from (select u.unit_id,
							       u.company_id,
							       u.unit_code,
							       u.description,
							       u.unit_code || '-' || u.description unit_desc
							  from exp_org_unit_vl u
							 where u.enabled_flag = 'Y'
							   and u.company_id = ${/parameter/@company_id})v
			   #WHERE_CLAUSE# 
			   ]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter name="/parameter/@company_id"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="unit_code" queryOperator="like"/>
        <bm:query-field field="unit_desc" queryExpression="unit_desc like ${@unit_desc}"/>
    </bm:query-fields>
</bm:model>
