<?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
                    *
                FROM
                    (SELECT
                        ccc.contract_id,
                        ccc.cf_item,
                        ccc.cf_type,
                        decode(ccc.due_amount,0,'0.00',to_char(ccc.due_amount,'FM999,999,999.00')) due_amount,
                        change_number_to_rmb(ccc.due_amount) due_amount_rmb
                    FROM
                        con_contract_cashflow ccc
                    WHERE
                        ccc.cf_direction = 'INFLOW' AND
                        ccc.cf_status    = 'RELEASE'
                    ) #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
        <bm:field name="cf_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_TYPE"/>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM"/>
        <bm:field name="due_amount" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DUE_AMOUNT"/>
        <bm:field name="due_amount_rmb" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DUE_AMOUNT_RMB"/>
    </bm:fields>
</bm:model>
