<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang 
    $Date: 2015-4-13 上午11:40:59  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    t2.company_short_name AS name,
                    t2.company_id AS value
                FROM
                    sys_user_role_groups t1,
                    fnd_companies t2
                WHERE
                    t1.company_id = t2.company_id AND
                    t1.user_id    = ${/parameter/@user_id} AND
                    (
                        t1.start_date <= sysdate OR
                        t1.start_date IS NULL
                    )
                    AND
                    (
                        t1.end_date >= sysdate OR
                        t1.end_date IS NULL
                    )
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
