<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="employee_code_name"/>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EMPLOYEE_ID"/>
        <bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="200" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_CODE" prompt="HLS.EMPLOYEE_CODE"/>
        <bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="250" forDisplay="true" forQuery="true" physicalName="NAME" prompt="HLS.EMPLOYEE_NAME"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            	select t.employee_id,
				       t.employee_code,
				       t.name,
				       t.employee_code || '-' || t.name as employee_code_name
				  from exp_employees t
				 #WHERE_CLAUSE#
				 order by t.employee_code
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="employee_code" queryExpression="t.employee_code like ${@employee_code}"/>
        <bm:query-field name="name" queryExpression="t.name like ${@name}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="exists (select 1 from exp_employee_assigns a where a.employee_id = t.employee_id and a.company_id = ${/session/@company_id})"/>
        <bm:data-filter enforceOperations="query" expression="t.enabled_flag=&apos;Y&apos;"/>
    </bm:data-filters>
</bm:model>
