<?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.times,
                    to_char(t.calc_date,'yyyy-mm-dd') calc_date,
                      to_char(t.tax_rate * 100,'990.99') || '%' tax_rate,
                       to_char(t.xirr * 100,'990.999999') || '%' xirr,
                    t.cf_amount,
                    t.inflow_amount,
                    t.net_income_amount,
                    t.income_amount,
                    t.repayment_principal,
                    t.outstanding_principal
                FROM
                    hn_contract_calc_interest t
                WHERE
                    t.contract_id = ${@contract_id}
                ORDER BY
                    t.times,
                    t.calc_date
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
