<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: duanjian  
    $Date: 2012-2-6 下午06:13:33  
    $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 distinct e.employee_id,
                  e.employee_code,
                  e.name,
                  (select f.company_short_name
                     from fnd_companies_vl f
                    where e.company_id = f.company_id) company_short_name,e.employee_code || '-' || e.name code_name
    from exp_company_employees_v e
  #WHERE_CLAUSE#
 ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="  not exists            (select h.employee_id              from exp_user_group_lines h, exp_user_group_headers u             where e.employee_id = h.employee_id               and h.expense_user_group_id = u.expense_user_group_id               and u.expense_user_group_id = ${/parameter/@expense_user_group_id})                   "/>
    </bm:data-filters>
    <bm:fields>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forQuery="true" fordisplay="true" physicalName="EMPLOYEE_CODE" prompt="EXP_EMP_COMPANY_CODE"/>
        <bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="170" forQuery="true" fordisplay="true" physicalName="NAME" prompt="EXP_EMPLOYEE.NAME"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="199" fordisplay="true" physicalName="COMPANY_SHORT_NAME" prompt="EXP_EMP_COMPANY_NAME"/>
        <bm:field name="code_name"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="employee_code" queryOperator="like"/>
        <bm:query-field field="name" queryOperator="like"/>
        <bm:query-field name="code_name" queryExpression="e.employee_code like ${@code_name} || &apos;%&apos;"/>
    </bm:query-fields>
</bm:model>
