<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="position_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POSITION_ID"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
        <bm:field name="position_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="POSITION_CODE" prompt="EXP_ORG_POSITION.POSITION_CODE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
        <bm:field name="pos_desc" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="POS_DESC" prompt="EXP_ORG_POSITION.POSITION_NAME"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select * from (select pos.position_id,
						       pos.unit_id,
						       pos.position_code,
						       pos.description,
						       pos.position_code || '-' || pos.description pos_desc
						  from exp_org_position_vl pos
						 where pos.enabled_flag = 'Y'
						   and pos.unit_id = ${/parameter/@unit_id})v
			#WHERE_CLAUSE# 			   
			order by position_code
		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="position_code" queryOperator="like"/>
        <bm:query-field field="pos_desc" queryExpression="pos_desc like ${@pos_desc}"/>
    </bm:query-fields>
</bm:model>
