<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2014-12-24 下午5:50:06  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_CONTRACT_ALL_V" defaultOrderBy="t1.contract_id desc">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_ALL_V.CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="CON_CONTRACT_ALL_V.CONTRACT_NUMBER"/>
        <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" prompt="CON_CONTRACT_ALL_V.CONTRACT_STATUS"/>
        <bm:field name="contract_status_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS_DES" prompt="CON_CONTRACT_ALL_V.CONTRACT_STATUS_DES"/>
        <bm:field name="district" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISTRICT" prompt="CON_CONTRACT_ALL_V.DISTRICT"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="CON_CONTRACT_ALL_V.LEASE_CHANNEL"/>
        <bm:field name="lease_channel_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_DES" prompt="CON_CONTRACT_ALL_V.LEASE_CHANNEL_DES"/>
        <bm:field name="district_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISTRICT_DES" prompt="CON_CONTRACT_ALL_V.DISTRICT_DES"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID" prompt="CON_CONTRACT_ALL_V.UNIT_ID"/>
        <bm:field name="unit_id_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNIT_ID_DES" prompt="CON_CONTRACT_ALL_V.UNIT_ID_DES"/>
        <bm:field name="organization_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ORGANIZATION_ID" prompt="CON_CONTRACT_ALL_V.ORGANIZATION_ID"/>
        <bm:field name="organization_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ORGANIZATION_NAME" prompt="CON_CONTRACT_ALL_V.ORGANIZATION_NAME"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" prompt="CON_CONTRACT_ALL_V.BUSINESS_TYPE"/>
        <bm:field name="business_type_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DES" prompt="CON_CONTRACT_ALL_V.BUSINESS_TYPE_DES"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST" prompt="CON_CONTRACT_ALL_V.PRICE_LIST"/>
        <bm:field name="price_list_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST_DES" prompt="CON_CONTRACT_ALL_V.PRICE_LIST_DES"/>
        <bm:field name="plate_resource_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PLATE_RESOURCE_DES" prompt="CON_CONTRACT_ALL_V.PLATE_RESOURCE_DES"/>
        <bm:field name="brand_id_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BRAND_ID_DES" prompt="CON_CONTRACT_ALL_V.BRAND_ID_DES"/>
        <bm:field name="brand_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BRAND_ID" prompt="CON_CONTRACT_ALL_V.BRAND_ID"/>
        <bm:field name="series_id_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SERIES_ID_DES" prompt="CON_CONTRACT_ALL_V.SERIES_ID_DES"/>
        <bm:field name="series_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SERIES_ID" prompt="CON_CONTRACT_ALL_V.SERIES_ID"/>
        <bm:field name="model_id_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MODEL_ID_DES" prompt="CON_CONTRACT_ALL_V.MODEL_ID_DES"/>
        <bm:field name="model_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MODEL_ID" prompt="CON_CONTRACT_ALL_V.MODEL_ID"/>
        <bm:field name="tenant_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TENANT_NAME" prompt="CON_CONTRACT_ALL_V.TENANT_NAME"/>
        <bm:field name="guarantor_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GUARANTOR_NAME" prompt="CON_CONTRACT_ALL_V.GUARANTOR_NAME"/>
        <bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID" prompt="CON_CONTRACT_ALL_V.OWNER_USER_ID"/>
        <bm:field name="owner_user_id_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OWNER_USER_ID_DES" prompt="CON_CONTRACT_ALL_V.OWNER_USER_ID_DES"/>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID" prompt="CON_CONTRACT_ALL_V.EMPLOYEE_ID"/>
        <bm:field name="employee_id_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_ID_DES" prompt="CON_CONTRACT_ALL_V.EMPLOYEE_ID_DES"/>
        <bm:field name="sale_consultant" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SALE_CONSULTANT" prompt="CON_CONTRACT_ALL_V.SALE_CONSULTANT"/>
        <bm:field name="submit_date" databaseType="DATE" datatype="java.util.Date" physicalName="SUBMIT_DATE" prompt="CON_CONTRACT_ALL_V.SUBMIT_DATE"/>
        <bm:field name="create_date_fmt" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CREATE_DATE_FMT" prompt="CON_CONTRACT_ALL_V.CREATE_DATE_FMT"/>
        <bm:field name="action_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACTION_TYPE_DESC" prompt="CON_CONTRACT_ALL_V.ACTION_TYPE_DESC"/>
        <bm:field name="signing_date" databaseType="DATE" datatype="java.util.Date" physicalName="SIGNING_DATE" prompt="CON_CONTRACT_ALL_V.SIGNING_DATE"/>
        <bm:field name="item_frame_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ITEM_FRAME_NUMBER" prompt="CON_CONTRACT_ALL_V.ITEM_FRAME_NUMBER"/>
        <bm:field name="hd_user_col_n06" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N06" prompt="CON_CONTRACT_ALL_V.HD_USER_COL_N06"/>
        <bm:field name="hd_user_col_n06_v" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_N06_V" prompt="CON_CONTRACT_ALL_V.HD_USER_COL_N06_V"/>
        <bm:field name="irr" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IRR" prompt="CON_CONTRACT_ALL_V.IRR"/>
        <bm:field name="irr_v" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="IRR_V" prompt="CON_CONTRACT_ALL_V.IRR_V"/>
        <bm:field name="finance_income" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FINANCE_INCOME" prompt="CON_CONTRACT_ALL_V.FINANCE_INCOME"/>
        <bm:field name="lease_item_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_ITEM_AMOUNT" prompt="CON_CONTRACT_ALL_V.LEASE_ITEM_AMOUNT"/>
        <bm:field name="down_payment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOWN_PAYMENT" prompt="CON_CONTRACT_ALL_V.DOWN_PAYMENT"/>
        <bm:field name="down_payment_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOWN_PAYMENT_RATIO" prompt="CON_CONTRACT_ALL_V.DOWN_PAYMENT_RATIO"/>
        <bm:field name="down_payment_ratio_v" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOWN_PAYMENT_RATIO_V" prompt="CON_CONTRACT_ALL_V.DOWN_PAYMENT_RATIO_V"/>
        <bm:field name="finance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FINANCE_AMOUNT" prompt="CON_CONTRACT_ALL_V.FINANCE_AMOUNT"/>
        <bm:field name="lease_term" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_TERM" prompt="CON_CONTRACT_ALL_V.LEASE_TERM"/>
        <bm:field name="lease_charge" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CHARGE" prompt="CON_CONTRACT_ALL_V.LEASE_CHARGE"/>
        <bm:field name="pmt" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PMT" prompt="CON_CONTRACT_ALL_V.PMT"/>
        <bm:field name="annual_pay_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ANNUAL_PAY_TIMES" prompt="CON_CONTRACT_ALL_V.ANNUAL_PAY_TIMES"/>
        <bm:field name="annual_pay_times_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ANNUAL_PAY_TIMES_DES" prompt="CON_CONTRACT_ALL_V.ANNUAL_PAY_TIMES_DES"/>
        <bm:field name="pay_type" databaseType="CHAR" datatype="java.lang.String" physicalName="PAY_TYPE" prompt="CON_CONTRACT_ALL_V.PAY_TYPE"/>
        <bm:field name="residual_value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESIDUAL_VALUE" prompt="CON_CONTRACT_ALL_V.RESIDUAL_VALUE"/>
        <bm:field name="deposit" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEPOSIT" prompt="CON_CONTRACT_ALL_V.DEPOSIT"/>
        <bm:field name="deposit_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEPOSIT_RATIO" prompt="CON_CONTRACT_ALL_V.DEPOSIT_RATIO"/>
        <bm:field name="deposit_ratio_v" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_RATIO_V" prompt="CON_CONTRACT_ALL_V.DEPOSIT_RATIO_V"/>
        <bm:field name="deposit_deduction_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_DEDUCTION_DES" prompt="CON_CONTRACT_ALL_V.DEPOSIT_DEDUCTION_DES"/>
        <bm:field name="hd_user_col_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N03" prompt="CON_CONTRACT_ALL_V.HD_USER_COL_N03"/>
        <bm:field name="hd_user_col_n12" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N12" prompt="CON_CONTRACT_ALL_V.HD_USER_COL_N12"/>
        <bm:field name="other_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_FEE" prompt="CON_CONTRACT_ALL_V.OTHER_FEE"/>
        <bm:field name="other_fee3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_FEE3" prompt="CON_CONTRACT_ALL_V.OTHER_FEE3"/>
        <bm:field name="insurance_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_FEE" prompt="CON_CONTRACT_ALL_V.INSURANCE_FEE"/>
        <bm:field name="hd_user_col_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N05" prompt="CON_CONTRACT_ALL_V.HD_USER_COL_N05"/>
        <bm:field name="full_write_off_date" databaseType="DATE" datatype="java.util.Date" physicalName="FULL_WRITE_OFF_DATE" prompt="CON_CONTRACT_ALL_V.FULL_WRITE_OFF_DATE"/>
        <bm:field name="car_invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CAR_INVOICE_NUMBER" prompt="CON_CONTRACT_ALL_V.CAR_INVOICE_NUMBER"/>
        <bm:field name="car_invoice_date" databaseType="DATE" datatype="java.util.Date" physicalName="CAR_INVOICE_DATE" prompt="CON_CONTRACT_ALL_V.CAR_INVOICE_DATE"/>
        <bm:field name="car_invoice_total_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CAR_INVOICE_TOTAL_AMOUNT" prompt="CON_CONTRACT_ALL_V.CAR_INVOICE_TOTAL_AMOUNT"/>
        <bm:field name="car_accounting_date" databaseType="DATE" datatype="java.util.Date" physicalName="CAR_ACCOUNTING_DATE" prompt="CON_CONTRACT_ALL_V.CAR_ACCOUNTING_DATE"/>
        <bm:field name="car_payment_completed_date" databaseType="DATE" datatype="java.util.Date" physicalName="CAR_PAYMENT_COMPLETED_DATE" prompt="CON_CONTRACT_ALL_V.CAR_PAYMENT_COMPLETED_DATE"/>
        <bm:field name="fee_invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FEE_INVOICE_NUMBER" prompt="CON_CONTRACT_ALL_V.FEE_INVOICE_NUMBER"/>
        <bm:field name="fee_invoice_date" databaseType="DATE" datatype="java.util.Date" physicalName="FEE_INVOICE_DATE" prompt="CON_CONTRACT_ALL_V.FEE_INVOICE_DATE"/>
        <bm:field name="fee_invoice_total_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FEE_INVOICE_TOTAL_AMOUNT" prompt="CON_CONTRACT_ALL_V.FEE_INVOICE_TOTAL_AMOUNT"/>
        <bm:field name="fee_accounting_date" databaseType="DATE" datatype="java.util.Date" physicalName="FEE_ACCOUNTING_DATE" prompt="CON_CONTRACT_ALL_V.FEE_ACCOUNTING_DATE"/>
        <bm:field name="fee_payment_completed_date" databaseType="DATE" datatype="java.util.Date" physicalName="FEE_PAYMENT_COMPLETED_DATE" prompt="CON_CONTRACT_ALL_V.FEE_PAYMENT_COMPLETED_DATE"/>
        <bm:field name="insurance_invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_INVOICE_NUMBER" prompt="CON_CONTRACT_ALL_V.INSURANCE_INVOICE_NUMBER"/>
        <bm:field name="insurance_invoice_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_INVOICE_DATE" prompt="CON_CONTRACT_ALL_V.INSURANCE_INVOICE_DATE"/>
        <bm:field name="insurance_invoice_total_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_INVOICE_TOTAL_AMOUNT" prompt="CON_CONTRACT_ALL_V.INSURANCE_INVOICE_TOTAL_AMOUNT"/>
        <bm:field name="insurance_accounting_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_ACCOUNTING_DATE" prompt="CON_CONTRACT_ALL_V.INSURANCE_ACCOUNTING_DATE"/>
        <bm:field name="insurance_payment_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_PAYMENT_DATE" prompt="CON_CONTRACT_ALL_V.INSURANCE_PAYMENT_DATE"/>
        <bm:field name="hd_user_col_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N02" prompt="CON_CONTRACT_ALL_V.HD_USER_COL_N02"/>
        <bm:field name="document_status"/>
        <bm:field name="discount_date" databaseType="DATE" datatype="java.util.Date" expression="(select A.FULL_WRITE_OFF_DATE from con_contract_cashflow a where a.cf_item=912 and a.cf_type=908 and a.write_off_flag=&apos;FULL&apos; AND A.CONTRACT_ID=T1.contract_id )"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryOperator="like"/>
        <bm:query-field field="employee_id" queryOperator="="/>
        <bm:query-field field="unit_id" queryOperator="="/>
        <bm:query-field name="end_date" queryExpression="t1.signing_date&lt;=to_date(${@end_date},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="start_date" queryExpression="t1.signing_date&gt;=to_date(${@start_date},&apos;yyyy-mm-dd&apos;)"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="document_status" enforceOperations="query" expression="t1.document_status=&apos;INCEPT&apos;"/>
    </bm:data-filters>
</bm:model>
