<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2018-8-21 上午10:36:49
    $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 t1.*
                From (Select '2' type_desc,
                ln.cashflow_id cf_check_id,
                ln.bank_account_name,
                ln.bank_account_num,
                ln.due_amount * 100 As due_amount,
                ln.currency_code,
                --TO_CHAR(hd.due_date,'yyyymmdd') due_date,
                to_char(Sysdate, 'yyyymmdd') due_date,
                hd.head_id,
                cc.contract_number as contract_pk,
                --ccc.times,
                hb.bp_id
                From ds_abc_interface_ln   ln,
                ds_abc_interface_hd   hd,
                con_contract          cc,
                hls_bp_master         hb
                Where ln.head_id = hd.head_id
                And ln.contract_id = cc.contract_id
                And cc.bp_id_tenant = hb.bp_id) t1 #WHERE_CLAUSE#
                Order By t1.bp_id, t1.contract_pk
            ]]></bm:query-sql>
        </bm:operation>



    </bm:operations>
    <bm:fields>
        <bm:field name="type_desc"/>
        <bm:field name="cf_check_id"/>
        <bm:field name="bank_account_name"/>
        <bm:field name="bank_account_num"/>
        <bm:field name="due_amount"/>
        <bm:field name="currency_code"/>
        <bm:field name="due_date"/>
        <bm:field name="head_id"/>
        <bm:field name="contract_pk"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter name="head_id" enforceOperations="query" expression="t1.head_id=${@head_id}"/>
    </bm:data-filters>
</bm:model>
