<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hty
    $Date: 2018/5/17 23:43
    $Revision: 1.0 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT overdue_amount
                from (
                       SELECT nvl(SUM((nvl(cc.due_amount, 0) - nvl(cc.received_amount, 0))), 0) AS overdue_amount
                       FROM
                         con_contract_cashflow cc
                       WHERE
                         cc.overdue_status = 'Y'
                         AND to_char(cc.due_date, 'yyyyiw') = to_char(trunc(sysdate), 'yyyyiw')) t1
                where t1.overdue_amount > 0
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="overdue_amount" databaseType="NUMBER" datatype="java.lang.Double" forDisplay="true" forQuery="true" physicalName="overdueAmount" prompt="员工号"/>
    </bm:fields>
</bm:model>
