<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select t.csh_bank_slip_num,i.write_off_type,(select sc.code_value_name from sys_code_values_v sc where sc.code = 'CSH513_WRITE_OFF_TYPE' and sc.code_value = i.write_off_type) write_off_type_n,i.contract_number,i.write_off_times,c.description as write_off_cf_item,i.write_off_amount,i.write_off_principal,i.write_off_interest
  from csh_write_off_interface i,
       csh_transaction_interface t,
       hls_cashflow_item c
 where i.batch_id = ${@batch_id}
   and i.record_type is not null
   and i.trx_interface_id = t.trx_interface_id
   and i.write_off_cf_item = c.cf_item
order by t.csh_bank_slip_num,i.contract_number,i.write_off_cf_item,i.write_off_times]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter name="batch_id"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="csh_bank_slip_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CSH_BANK_SLIP_NUM"/>
        <bm:field name="write_off_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WRITE_OFF_TYPE"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER"/>
        <bm:field name="write_off_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_TIMES"/>
        <bm:field name="write_off_cf_item" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WRITE_OFF_CF_ITEM"/>
        <bm:field name="write_off_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_AMOUNT"/>
        <bm:field name="write_off_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_PRINCIPAL"/>
        <bm:field name="write_off_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_INTEREST"/>
        <bm:field name="write_off_type_n"/>
    </bm:fields>
</bm:model>
