<?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 t1.*,
         (select v.code_value_name from sys_code_values_v v
         where v.code = 'CON_DEBTS_CONFIRMED_STATUS'
         and v.code_value=t1.confirmed_types)confirmed_types_desc,
                decode (t1.confirmed_rate,null,null,decode(substr((t1.confirmed_rate*100),1,1),'.','0'||(t1.confirmed_rate*100),(t1.confirmed_rate*100))||'%') confirmed_rate,
                t1.confirmed_amount*t1.confirmed_rate confirmed_sum_amount
         from con_debts_confirmed_sum_tmp t1 where t1.session_id=${/session/@session_id} order by t1.confirmed_types
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
<!--    <bm:query-fields>-->
<!--        <bm:query-field name="contract_id" queryExpression="t.contract_id = ${@contract_id}"/>-->
<!--    </bm:query-fields>-->
</bm:model>
