<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: duanjian  
    $Date: 2012-2-8 下午01:31:13  
    $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 fc.company_id,
                 fc.company_code,
                 fc.company_short_name
            from fnd_companies_vl fc
            where fc.company_id in
                (select ger.company_id 
                 from gld_books_exchange_rates gber,
                      gld_exchange_rates ger
              where ger.from_currency=gber.from_currency
                and ger.to_currency=gber.to_currency
                and ger.type_code=gber.type_code
                and ger.set_of_books_id=gber.set_of_books_id
                and nvl(ger.conversion_date,sysdate) = nvl(gber.conversion_date,sysdate)
                and nvl(ger.period_name,'1')=nvl(gber.period_name,'1')
                and gber.exchange_rate_id=${@exchange_rate_id}
            )
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="company_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_CODE"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_SHORT_NAME"/>
    </bm:fields>
</bm:model>
