<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select * from (select
               (select cc.contract_number
                  from con_contract cc
                 where cc.contract_id = cw.contract_id) contract_number,
               cw.times,
               cw.write_off_due_amount,
               to_char(cw.creation_date, 'YYYY-MM-DD') creation_date,
               (select v.code_value_name
                  from sys_code_values_v v
                 where v.code = 'DEPOSIT_TRANS_TYPE'
                   and v.code_value = cw.deposit_trans_type) deposit_trans_type_n,
                    (select t.bp_name
          from hls_bp_master t, con_contract ct
         where t.bp_id = ct.bp_id_tenant
           and ct.contract_id = cw.contract_id) bp_id_telnet_n,
           (select v.code_value_name
                  from sys_code_values_v v
                 where v.code = 'CSH513_WRITE_OFF_TYPE'
                   and v.code_value = cw.write_off_type) write_off_type_n
          from csh_write_off cw
          where cw.csh_transaction_id=${@transaction_id})v
                #WHERE_CLAUSE#

                ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>