<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jessen  
    $Date: 2011-9-13 下午2:59:15  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select *
              from (select v.position_id,
                           v.position_code,
                           v.description       position_name,
                           v.company_id,
                           j.employee_job_id,
                           j.employee_job_code job_code,
                           j.description       job_name,
                           eou.unit_code,
                           eou.description     unit_desc
                      from exp_org_position_vl  v,
                           exp_employee_jobs_vl j,
                           exp_org_unit_vl      eou
                     where v.enabled_flag = 'Y'
                       and v.employee_job_id = j.employee_job_id(+)
                       and v.unit_id = eou.unit_id(+)
                       and v.company_id=${@company_id}) a
             #WHERE_CLAUSE#
             order by a.position_code
 ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="position_id" datatype="java.lang.Long"/>
        <bm:field name="position_code" datatype="java.lang.String" displayWidth="80" forDisplay="true" forQuery="true" prompt="EXP_EMPLOYEE_ASSIGN.POSITION_CODE"/>
        <bm:field name="position_name" datatype="java.lang.String" displayWidth="120" forDisplay="true" forQuery="true" prompt="EXP_EMPLOYEE_ASSIGN.POSITION_NAME"/>
        <bm:field name="employee_job_id" datatype="java.lang.Long"/>
        <bm:field name="job_code" datatype="java.lang.String" displayWidth="80" forDisplay="true" prompt="EXP_EMPLOYEE_ASSIGN.JOB_CODE"/>
        <bm:field name="job_name" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="EXP_EMPLOYEE_ASSIGN.JOB_NAME"/>
        <bm:field name="unit_code" datatype="java.lang.String" displayWidth="80" forDisplay="true" prompt="EXP_ORG_UNIT.UNIT_CODE"/>
        <bm:field name="unit_desc" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="EXP_ORG_UNIT.DESCRIPTION_ID"/>
    </bm:fields>
    <!--<bm:data-filters>
        <bm:data-filter name="company_id" expression="(a.company_id = ${@company_id} or exists (select 1 from fnd_companies_vl c where a.company_id = c.company_id and c.parent_company_id=${@company_id}))"/>
    </bm:data-filters>-->
    <bm:query-fields>
        <bm:query-field field="position_code" queryOperator="like"/>
        <bm:query-field field="position_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
