<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    v.*
                FROM
                    (SELECT
                        e.employee_id,
                        e.employee_code,
                        e.name employee_name,
                        a.position_name,
                        a.unit_name,
                        a.unit_code
                    FROM
                        exp_employees e,
                        exp_employee_assigns_v a
                    WHERE
                        a.employee_id =e.employee_id AND
                        a.enabled_flag='Y' AND
                        e.enabled_flag='Y' AND
                        a.primary_position_flag = 'Y'
                    ) v #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="employee_id"/>
        <bm:field name="employee_code" forDisplay="true" forQuery="true" prompt="员工编码"/>
        <bm:field name="employee_name" forDisplay="true" forQuery="true" prompt="员工名称"/>
        <bm:field name="unit_name" forDisplay="true" forQuery="true" prompt="部门名称"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="employee_name" queryOperator="like"/>
        <bm:query-field field="employee_code" queryOperator="like"/>
        <bm:query-field field="unit_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
