<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Foreinyel  
    $Date: 2014-5-5 下午2:51:35  
    $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 * from(
                SELECT
                    l.payment_req_ln_id,
                    l.payment_req_id,
                    l.ref_doc_id,
                    cl.bp_id_tenant_n,
                    cl.contract_number,
                    l.amount,
                    to_char(l.apply_pay_date,'yyyy-mm-dd')apply_pay_date,
                    cf.cf_item,
                    (SELECT
                        iv.cf_item_desc
                    FROM
                        hls_cashflow_item_v iv
                    WHERE
                        iv.cf_item = cf.cf_item
                    )cf_item_desc
                FROM
                    csh_payment_req_ln l,
                    con_contract_lv cl,
                    con_contract_cashflow cf
                WHERE
                    cl.contract_id     = l.ref_doc_id AND
                    l.ref_doc_category = 'CONTRACT' AND
                    cf.cashflow_id     = l.ref_doc_line_id)v
                    #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
