<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-9-9 下午4:22:53  
    $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" needAccessControl="false">
    <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" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_CODE" prompt="EXP_EMPLOYEES.EMPLOYEE_CODE"/>
        <bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="NAME" prompt="EXP_EMPLOYEES.NAME"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field field="employee_code" queryOperator="like"/>
        <bm:query-field field="name" queryOperator="like"/>
        <bm:query-field name="unit_code" queryExpression="EXISTS(SELECT 1 FROM exp_employee_assigns tt1,exp_org_position tt2,exp_org_unit tt3 WHERE tt1.employee_id = t1.employee_id AND tt1.position_id = tt2.position_id AND tt2.unit_id = tt3.unit_id AND tt3.unit_code = ${@unit_code} AND tt1.enabled_flag = &apos;Y&apos; AND tt2.enabled_flag = &apos;Y&apos; AND tt3.enabled_flag = &apos;Y&apos;)"/>
    </bm:query-fields>
    <bm:primary-key>
        <bm:pk-field name="employee_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.enabled_flag = &apos;Y&apos;"/>
    </bm:data-filters>
</bm:model>
