<?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:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="YONDA_DOCUMENT_LEND_RECORD_LN" needAccessControl="false">
    <bm:fields>
        <bm:field name="lend_line_id" databaseType="NUMBER" datatype="java.lang.Long" 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="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.return_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-fields>
</bm:model>
