<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-7-16 下午04:16:32  
    $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
                    su.user_id,
                    su.user_name,
                    su.description,
                    e.employee_id,
                    e.employee_code,
                    e.name,
                    su.user_name || '-' || su.description user_name_desc
                FROM
                    sys_user su,
                    exp_employees e
                #WHERE_CLAUSE#
                order by su.user_name
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID"/>
        <bm:field name="user_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="USER_NAME" prompt="用户编码" queryWidth="100"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="DESCRIPTION" prompt="用户名称" queryWidth="100"/>
        <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" displayWidth="100" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_CODE" prompt="员工编码" queryWidth="100"/>
        <bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="NAME" prompt="员工姓名" queryWidth="100"/>
        <bm:field name="user_name_desc"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="employee_code" queryExpression="e.employee_code like ${@employee_code}"/>
        <bm:query-field name="user_name" queryExpression="su.user_name like ${@user_name}"/>
        <bm:query-field name="description" queryExpression="su.description like ${@description}"/>
        <bm:query-field name="name" queryExpression="e.name like ${@name}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="su.employee_id=e.employee_id "/>
    </bm:data-filters>
</bm:model>
