<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-3-13 下午03:14:00  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="EXP_EMPLOYEES">
    <bm:fields>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID" prompt="EXP_EMPLOYEES.EMPLOYEE_ID"/>
        <bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="210" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_CODE" prompt="EXP_EMPLOYEES.EMPLOYEE_CODE"/>
        <bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="210" forDisplay="true" forQuery="true" physicalName="NAME" prompt="EXP_EMPLOYEES.NAME"/>
        <bm:field name="email" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMAIL" prompt="EXP_EMPLOYEES.EMAIL"/>
        <bm:field name="mobil" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MOBIL" prompt="EXP_EMPLOYEES.MOBIL"/>
        <bm:field name="phone" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PHONE" prompt="EXP_EMPLOYEES.PHONE"/>
        <bm:field name="bank_of_deposit" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_OF_DEPOSIT" prompt="EXP_EMPLOYEES.BANK_OF_DEPOSIT"/>
        <bm:field name="bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_ACCOUNT" prompt="EXP_EMPLOYEES.BANK_ACCOUNT"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="EXP_EMPLOYEES.ENABLED_FLAG"/>
        <bm:field name="employee_type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_TYPE_ID" prompt="EXP_EMPLOYEES.EMPLOYEE_TYPE_ID"/>
        <bm:field name="id_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_TYPE" prompt="EXP_EMPLOYEES.ID_TYPE"/>
        <bm:field name="id_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_CODE" prompt="EXP_EMPLOYEES.ID_CODE"/>
        <bm:field name="notes" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTES" prompt="EXP_EMPLOYEES.NOTES"/>
        <bm:field name="national_identifier" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NATIONAL_IDENTIFIER" prompt="EXP_EMPLOYEES.NATIONAL_IDENTIFIER"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="employee_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="employee_code" queryOperator="="/>
        <bm:query-field field="name" queryOperator="like"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="query" expression="(t1.enabled_flag=&apos;Y&apos; and exists (select 1           from exp_employee_assigns eea, exp_org_position eop          where eea.employee_id = t1.employee_id            and eea.company_id = ${@company_id}            and eea.position_id = eop.position_id            and eop.position_type = &apos;SALES&apos;            and eea.enabled_flag = &apos;Y&apos;            and eop.enabled_flag = &apos;Y&apos;))"/>
    </bm:data-filters>
</bm:model>
