<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-12-31 下午1:28:57  
    $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
                    t.company_id,
                    t.company_code,
                    t.company_type,
                    t.company_short_name,
                    t.company_full_name
                FROM
                    fnd_companies t 
                    #WHERE_CLAUSE# 
             START  WITH t.company_id = ${/session/@company_id} CONNECT BY prior t.company_id = t.parent_biz_company_id
                
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="company_code" forDisplay="true" forQuery="true" prompt="COMPANY_CODE"/>
        <bm:field name="company_short_name" forDisplay="true" forQuery="true" prompt="FND_COMPANIES.COMPANY_NAME"/>
        <bm:field name="company_id"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="company_code" queryExpression="t.company_code like &apos;%&apos;||${@company_code}||&apos;%&apos;"/>
        <bm:query-field name="company_short_name" queryExpression="t.company_short_name like &apos;%&apos;||${@company_short_name}||&apos;%&apos;"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t.company_type =1  and t.set_of_books_id=(select v.set_of_books_id from fnd_companies_vl v where v.company_id=${/session/@company_id})  "/>
    </bm:data-filters>
</bm:model>
