<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-1-15 下午05:45:28  
    $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.cashflow_id,
				       t1.contract_id,
				       t1.cf_direction,
				       t1.times,
				       t1.cf_item,
				       t1.cf_type,
				       (select i.description from hls_cashflow_item i where i.cf_item=t1.cf_item)cf_item_name,
				       t1.write_off_flag,
				       t1.due_date,
				       t1.due_amount,
				       t1.tt_bank_account_num_1,
				       t1.tt_bank_account_num_2,
				       t1.tt_bank_account_num_3,
				       t1.tt_account_1_amt,
				       t1.tt_account_2_amt,
				       t1.tt_account_3_amt,
				       t1.tt_bank_account_id_1,
				       t1.tt_bank_account_id_2,
				       t1.tt_bank_account_id_3
				  from con_contract_cashflow t1
				 where t1.cf_item in (${:@cf_item})
				   and t1.contract_id = ${@contract_id}
				   and t1.cf_direction != 'NONCASH'
				   order by t1.times ,t1.cf_item asc
				   
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="cashflow_id"/>
        <bm:field name="contract_id"/>
        <bm:field name="cf_direction"/>
        <bm:field name="times"/>
        <bm:field name="cf_item"/>
        <bm:field name="cf_type"/>
        <bm:field name="cf_item_name"/>
        <bm:field name="write_off_flag"/>
        <bm:field name="due_date" databaseType="DATE" datatype="java.util.Date"/>
        <bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double"/>
        <bm:field name="tt_bank_account_num_1"/>
        <bm:field name="tt_bank_account_num_2"/>
        <bm:field name="tt_bank_account_num_3"/>
        <bm:field name="tt_bank_account_id_1"/>
        <bm:field name="tt_bank_account_id_2"/>
        <bm:field name="tt_bank_account_id_3"/>
        <bm:field name="tt_account_1_amt" databaseType="NUMBER" datatype="java.lang.Double"/>
        <bm:field name="tt_account_2_amt" databaseType="NUMBER" datatype="java.lang.Double"/>
        <bm:field name="tt_account_3_amt" databaseType="NUMBER" datatype="java.lang.Double"/>
    </bm:fields>
</bm:model>
