<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-9-30 下午01:34:58  
    $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 days
			  from (select l.days
			          from fnd_aging_bucket_lines l
			         where l.aging_bucket_id = ${@aging_bucket_id}
			           and l.days < ${/model/result_ln_tmp_path/record/@days}
			         order by l.days desc)
 				where rownum = 1
 			]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="days" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DAYS"/>
    </bm:fields>
</bm:model>
