<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qianming 
    $Date: 2015-5-22 上午9:15:44  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="YONDA_REPORT_CASHFLOW_V" defaultOrderBy="contract_number,times">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CONTRACT_ID" prompt="YONDA_REPORT_CASHFLOW_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_CASHFLOW_V.BP_ID"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="承租人"/>
        <bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TITLE" prompt="开票抬头"/>
        <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" prompt="YONDA_REPORT_CASHFLOW_V.CONTRACT_STATUS"/>
        <bm:field name="contract_status_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS_N" prompt="合同状态"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" prompt="YONDA_REPORT_CASHFLOW_V.BUSINESS_TYPE"/>
        <bm:field name="business_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_N" prompt="业务模式"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="YONDA_REPORT_CASHFLOW_V.LEASE_CHANNEL"/>
        <bm:field name="lease_channel_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_N" prompt="产品类型"/>
        <bm:field name="invoice_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TYPE" prompt="开票类型"/>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CF_ITEM" prompt="YONDA_REPORT_CASHFLOW_V.CF_ITEM"/>
        <bm:field name="billing_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_DESC" prompt="开票内容"/>
        <bm:field name="times" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TIMES" prompt="期数"/>
        <bm:field name="due_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DUE_DATE" prompt="应收日期"/>
        <bm:field name="last_received_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LAST_RECEIVED_DATE" prompt="实收日期"/>
        <bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT" prompt="应收租金"/>
        <bm:field name="principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRINCIPAL" prompt="应收本金"/>
        <bm:field name="interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INTEREST" prompt="应收利息"/>
        <bm:field name="received_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_AMOUNT" prompt="已收租金"/>
        <bm:field name="received_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_PRINCIPAL" prompt="已收本金"/>
        <bm:field name="received_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_INTEREST" prompt="已收利息"/>
        <bm:field name="total_billing_amount_t" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_BILLING_AMOUNT_T" prompt="截至当期已开票"/>
        <bm:field name="total_rec_amount_t" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_REC_AMOUNT_T" prompt="截至当期已收款"/>
        <bm:field name="total_billing_amount_d" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_BILLING_AMOUNT_D" prompt="截至今日已开票"/>
        <bm:field name="total_rec_amount_d" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_REC_AMOUNT_D" 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 field="invoice_title" queryExpression="upper(t1.invoice_title) like &apos;%&apos; || upper(${@invoice_title}) || &apos;%&apos;"/>
        <bm:query-field field="billing_desc" queryExpression="upper(t1.billing_desc) like &apos;%&apos; || upper(${@billing_desc}) || &apos;%&apos;"/>
        <bm:query-field name="due_date_from" queryExpression="t1.due_date &gt;= ${@due_date_from} "/>
        <bm:query-field name="due_date_to" queryExpression="t1.due_date &lt;= ${@due_date_to} "/>
        <bm:query-field name="last_received_date_from" queryExpression="t1.last_received_date &gt;= ${@last_received_date_from} "/>
        <bm:query-field name="last_received_date_to" queryExpression="t1.last_received_date &lt;= ${@last_received_date_to} "/>
        <bm:query-field name="due_amount_from" queryExpression="t1.due_amount &gt;= ${@due_amount_from} "/>
        <bm:query-field name="due_amount_to" queryExpression="t1.due_amount &lt;= ${@due_amount_to} "/>
        <bm:query-field name="received_amount_from" queryExpression="t1.received_amount &gt;= ${@received_amount_from} "/>
        <bm:query-field name="received_amount_to" queryExpression="t1.received_amount &lt;= ${@received_amount_to} "/>
        <bm:query-field name="total_billing_amount_t_from" queryExpression="t1.total_billing_amount_t &gt;= ${@total_billing_amount_t_from} "/>
        <bm:query-field name="total_billing_amount_t_to" queryExpression="t1.total_billing_amount_t &lt;= ${@total_billing_amount_t_to} "/>
        <bm:query-field name="total_rec_amount_t_from" queryExpression="t1.total_rec_amount_t &gt;= ${@total_rec_amount_t_from} "/>
        <bm:query-field name="total_rec_amount_t_to" queryExpression="t1.total_rec_amount_t &lt;= ${@total_rec_amount_t_to} "/>
        <bm:query-field field="contract_status" queryOperator="="/>
        <bm:query-field field="bp_id" queryOperator="="/>
        <bm:query-field field="business_type" queryOperator="="/>
        <bm:query-field field="lease_channel" queryOperator="="/>
        <bm:query-field field="invoice_type" queryExpression="t1.invoice_type like &apos;%&apos; || ${@invoice_type} || &apos;%&apos;"/>
        <bm:query-field field="cf_item" queryOperator="="/>
        <bm:query-field field="times" queryOperator="="/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="q" enforceOperations="query" expression="t1.contract_status in (&apos;INCEPT&apos;)"/>
    </bm:data-filters>
</bm:model>
