<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-9-9 下午03:33:56  
    $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 (select bp.bp_name from hls_bp_master bp
where bp.bp_id=con.bp_id_tenant) bp_name,
con.contract_number,
wo.times,
cf.due_date,
nvl(cf.principal,0) principal,
nvl(cf.interest,0) interest,
wo.write_off_date,
nvl(wo.write_off_due_amount,0) write_off_due_amount,
nvl(wo.write_off_principal,0) write_off_principal,
nvl(wo.write_off_interest,0) write_off_interest,
con.contract_id
from csh_write_off wo,
con_contract_cashflow cf,
con_contract con
where cf.cashflow_id=wo.cashflow_id
and con.contract_id=cf.contract_id
and wo.cf_item=1
and wo.cf_type=1
and con.contract_id=${@contract_id}

and wo.reversed_flag='N'
]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="bp_name"/>
        <bm:field name="contract_number"/>
        <bm:field name="times"/>
        <bm:field name="due_date" databaseType="Date" datatype="java.util.Date"/>
        <bm:field name="principal"/>
        <bm:field name="interest"/>
        <bm:field name="write_off_date" databaseType="Date" datatype="java.util.Date"/>
        <bm:field name="write_off_due_amount"/>
        <bm:field name="write_off_principal"/>
        <bm:field name="write_off_interest"/>
    </bm:fields>
</bm:model>
