<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-11-24 下午06:07:14  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="DOCUMENT_LEND_RECORD_LN">
    <bm:fields>
        <bm:field name="lend_line_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEND_LINE_ID" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.LEND_LINE_ID"/>
        <bm:field name="lend_header_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${../../@lend_header_id}" physicalName="LEND_HEADER_ID" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.LEND_HEADER_ID"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.CONTRACT_ID"/>
        <bm:field name="cdd_item_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CDD_ITEM_ID" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.CDD_ITEM_ID"/>
        <bm:field name="quantity" databaseType="NUMBER" datatype="java.lang.Long" physicalName="QUANTITY"/>
        <bm:field name="use_to" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USE_TO"/>
        <bm:field name="promise_date" databaseType="DATE" datatype="java.util.Date" physicalName="PROMISE_DATE"/>
        <bm:field name="real_date" databaseType="DATE" datatype="java.util.Date" physicalName="REAL_DATE"/>
        <bm:field name="return_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RETURN_NUMBER"/>
        <bm:field name="overdue_explain" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OVERDUE_EXPLAIN"/>
        <bm:field name="deposit" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DEPOSIT"/>
        <bm:field name="deposit_handle" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_HANDLE"/>
        <bm:field name="comments" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENTS"/>
        <bm:field name="cdd_item_desc" expression="(select ci.description from prj_cdd_item ci where ci.cdd_item_id=t1.cdd_item_id )" forInsert="false" forUpdate="false"/>
        <bm:field name="return_date" databaseType="DATE" datatype="java.util.Date" physicalName="RETURN_DATE"/>
        <bm:field name="lend_flag" expression="&apos;Y&apos;" forInsert="false" forUpdate="false"/>
        <bm:field name="return_flag" expression="(case when t1.real_date is null then &apos;N&apos; else &apos;Y&apos; end)" forInsert="false" forUpdate="false"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="YONDA_DOCUMENT_LEND_RECORD_LN.REF_D05"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk sequenceName="yonda_document_lend_ln_s"/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="lend_line_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="contract_id" queryOperator="="/>
        <bm:query-field field="lend_header_id" queryOperator="="/>
        <bm:query-field field="lend_line_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
