<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Administrator  
    $Date: 2014-8-25 下午3:49:27  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:s="leaf.plugin.script" xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select v.* from(
            select t.employee_id, t.employee_code, t.name  FROM exp_employees t where  t.enabled_flag='Y' and t.employee_id in
            (select b.employee_id from sys_user_role_groups a,sys_user b where a.user_id=b.user_id and  role_id in(3,5)))v
            #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID"/>
        <bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_CODE" prompt="员工代码"/>
        <bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="NAME" prompt="员工姓名"/>
    </bm:fields>
    <s:bm-script><![CDATA[
            var cx = Packages.leaf.javascript.Context.getCurrentContext();
            Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");
        ]]></s:bm-script>
    <bm:query-fields>
        <bm:query-field field="employee_code" queryOperator="="/>
        <bm:query-field field="name" queryOperator="like"/>
    </bm:query-fields>
    <!-- select t1.employee_id, t1.employee_code, t1.name from exp_employees t1 #WHERE_CLAUSE#-->
</bm:model>
