<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-9-30 下午12:18:54  
    $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 d.aging_bucket_line_id,d.days,d.description,d.aging_bucket_id,d.days||'天以上' prompt 
			  from fnd_aging_bucket_lines d
			 where d.aging_bucket_id = ${@aging_bucket_id}
			   and d.days = (select max(t1.days) days
			                   from fnd_aging_bucket_lines t1
			                  where t1.aging_bucket_id = ${@aging_bucket_id})
			   and rownum = 1
			]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="aging_bucket_line_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AGING_BUCKET_LINE_ID"/>
        <bm:field name="days" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DAYS"/>
        <bm:field name="aging_bucket_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AGING_BUCKET_ID"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
        <bm:field name="prompt" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROMPT"/>
    </bm:fields>
</bm:model>
