<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qianming 
    $Date: 2015-5-22 上午9:31:42  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="YONDA_REPORT_OVERDUE_V" defaultOrderBy="contract_number">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CONTRACT_ID" prompt="YONDA_REPORT_OVERDUE_V.CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="合同编号"/>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BP_ID" prompt="YONDA_REPORT_OVERDUE_V.BP_ID"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="承租人"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="COMPANY_ID" prompt="YONDA_REPORT_OVERDUE_V.COMPANY_ID"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_SHORT_NAME" prompt="所属区域公司"/>
        <bm:field name="lease_item_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="LEASE_ITEM_AMOUNT" prompt="融资额"/>
        <bm:field name="finance_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="FINANCE_AMOUNT" prompt="风险敞口"/>
        <bm:field name="lease_times" databaseType="NUMBER" datatype="java.lang.Double" physicalName="LEASE_TIMES" prompt="租赁期数"/>
        <bm:field name="pmt_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PMT_DATE" prompt="租金支付日"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="UNIT_ID" prompt="YONDA_REPORT_OVERDUE_V.UNIT_ID"/>
        <bm:field name="unit_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNIT_NAME" prompt="4s店"/>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EMPLOYEE_ID" prompt="YONDA_REPORT_OVERDUE_V.EMPLOYEE_ID"/>
        <bm:field name="employee_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_NAME" prompt="区域经理"/>
        <bm:field name="period_times" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PERIOD_TIMES" prompt="截至今日应还期数"/>
        <bm:field name="received_times" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_TIMES" prompt="截至今日已还期数"/>
        <bm:field name="overdue_times" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OVERDUE_TIMES" prompt="逾期期数"/>
        <bm:field name="overdue_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OVERDUE_AMOUNT" prompt="逾期租金"/>
        <bm:field name="overdue_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OVERDUE_PRINCIPAL" prompt="逾期本金"/>
        <bm:field name="overdue_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OVERDUE_INTEREST" prompt="逾期利息"/>
        <bm:field name="total_unreceived_penalty" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_UNRECEIVED_PENALTY" prompt="累计未收罚息"/>
        <bm:field name="total_overdue_day" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_OVERDUE_DAY" prompt="累计逾期天数"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryExpression="upper(t1.contract_number) like &apos;%&apos; || upper(${@contract_number}) || &apos;%&apos;"/>
        <bm:query-field name="lease_item_amount_from" queryExpression="t1.lease_item_amount &gt;= ${@lease_item_amount_from} "/>
        <bm:query-field name="lease_item_amount_to" queryExpression="t1.lease_item_amount &lt;= ${@lease_item_amount_to} "/>
        <bm:query-field name="finance_amount_from" queryExpression="t1.finance_amount &gt;= ${@finance_amount_from} "/>
        <bm:query-field name="finance_amount_to" queryExpression="t1.finance_amount &lt;= ${@finance_amount_to} "/>
        <bm:query-field name="total_overdue_day_from" queryExpression="t1.total_overdue_day &gt;= ${@total_overdue_day_from} "/>
        <bm:query-field name="total_overdue_day_to" queryExpression="t1.total_overdue_day &lt;= ${@total_overdue_day_to} "/>
        <bm:query-field name="overdue_times_from" queryExpression="t1.overdue_times &gt;= ${@overdue_times_from} "/>
        <bm:query-field name="overdue_times_to" queryExpression="t1.overdue_times &lt;= ${@overdue_times_to} "/>
        <bm:query-field name="overdue_amount_from" queryExpression="t1.overdue_amount &gt;= ${@overdue_amount_from} "/>
        <bm:query-field name="overdue_amount_to" queryExpression="t1.overdue_amount &lt;= ${@overdue_amount_to} "/>
        <bm:query-field field="bp_id" queryOperator="="/>
        <bm:query-field field="company_id" queryOperator="="/>
        <bm:query-field field="lease_times" queryOperator="="/>
        <bm:query-field field="pmt_date" queryOperator="="/>
        <bm:query-field field="unit_id" queryOperator="="/>
        <bm:query-field field="employee_id" queryOperator="="/>
        <!-- <bm:query-field field="overdue_times" queryOperator="="/> -->
    </bm:query-fields>
</bm:model>
