<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Byeongjoon Moon
    $Date: 2018-10-18
    $Revision: 1.0  
    $Purpose:
    $ETC: byeongjoon.moon@hlcm.com
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    AA.*
                FROM
                    (SELECT
                          U."UserID" AS user_id
                        , U."Name" AS user_name
                        , U."PersonID" AS person_id
                        , U."OrgUnitID" AS org_unit_id
                        , D."DeptName" AS dept_name
                    FROM
                        DS_EXP_ADMASTER_USER U
                      , DS_EXP_ADMASTER_DEPT D
                    WHERE U."OrgUnitID" = D."OrgUnitID"
                      AND (   D."RootOrgUnitID" = '03084461'
                           or D."RootOrgUnitID" = '03066335'
                           or D."RootOrgUnitID" = '03077520'
                           or D."RootOrgUnitID" = '03066718'
                           or D."RootOrgUnitID" = '03085292'
                           )
                      AND U."UserID" IS NOT NULL
                    ) AA #WHERE_CLAUSE#
                ORDER BY
                    AA.user_id
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="user_id" displayWidth="200" forDisplay="false" forQuery="false" prompt="SYS_USER.EMPLOYEE_ID"/>
        <bm:field name="user_name" displayWidth="200" forDisplay="true" forQuery="true" prompt="SYS_USER.USER_NAME"/>
        <bm:field name="person_id" displayWidth="200" forDisplay="false" forQuery="false" prompt="SYS_USER.USER_NAME"/>
        <bm:field name="org_unit_id" displayWidth="200" forDisplay="false" forQuery="false" prompt="Dept Code"/>
        <bm:field name="dept_name" displayWidth="350" forDisplay="true" forQuery="true" prompt="Dept Name"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="user_id" queryOperator="like"/>
        <bm:query-field field="user_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
