<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2013-12-9 上午09:40:07  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CSH_DEPOSIT_WRITE_OFF_V" needAccessControl="false">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CSH_DEPOSIT_WRITE_OFF_V.CONTRACT_ID"/>
        <bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID" prompt="CSH_DEPOSIT_WRITE_OFF_V.CASHFLOW_ID"/>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" prompt="CSH_DEPOSIT_WRITE_OFF_V.CF_ITEM"/>
        <bm:field name="cf_item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_ITEM_DESC" prompt="CSH_DEPOSIT_WRITE_OFF_V.CF_ITEM_DESC"/>
        <bm:field name="cf_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_TYPE" prompt="CSH_DEPOSIT_WRITE_OFF_V.CF_TYPE"/>
        <bm:field name="cf_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_TYPE_DESC" prompt="CSH_DEPOSIT_WRITE_OFF_V.CF_TYPE_DESC"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="CSH_DEPOSIT_WRITE_OFF_V.CONTRACT_NUMBER"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="CSH_DEPOSIT_WRITE_OFF_V.DOCUMENT_TYPE"/>
        <bm:field name="bp_id_agent_level1" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_AGENT_LEVEL1" prompt="CSH_DEPOSIT_WRITE_OFF_V.BP_ID_AGENT_LEVEL1"/>
        <bm:field name="bp_id_agent_level1_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_ID_AGENT_LEVEL1_N" prompt="CSH_DEPOSIT_WRITE_OFF_V.BP_ID_AGENT_LEVEL1_N"/>
        <bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_TENANT" prompt="CSH_DEPOSIT_WRITE_OFF_V.BP_ID_TENANT"/>
        <bm:field name="bp_id_tenant_desc" expression="(select h.bp_code||&apos;-&apos;||h.bp_name from hls_bp_master h where h.bp_id = t1.bp_id_tenant)" forInsert="false" forUpdate="false"/>
        <bm:field name="lease_item_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_ITEM_AMOUNT" prompt="CSH_DEPOSIT_WRITE_OFF_V.LEASE_ITEM_AMOUNT"/>
        <bm:field name="due_date" databaseType="DATE" datatype="java.util.Date" physicalName="DUE_DATE" prompt="CSH_DEPOSIT_WRITE_OFF_V.DUE_DATE"/>
        <bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT" prompt="CSH_DEPOSIT_WRITE_OFF_V.DUE_AMOUNT"/>
        <bm:field name="received_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_AMOUNT" prompt="CSH_DEPOSIT_WRITE_OFF_V.RECEIVED_AMOUNT"/>
        <bm:field name="residue_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RESIDUE_AMOUNT" prompt="CSH_DEPOSIT_WRITE_OFF_V.RESIDUE_AMOUNT"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="contract_id" queryOperator="="/>
        <!--<bm:query-field field="bp_id_agent_level1" queryOperator="="/>-->
        <bm:query-field field="bp_id_tenant" queryOperator="="/>
        <bm:query-field name="due_date_from" queryExpression="t1.due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="due_date_to" queryExpression="t1.due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
    </bm:query-fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
</bm:model>
