<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-5-9 上午10:30:51  
    $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_HD" needAccessControl="false">
    <bm:fields>
        <bm:field name="lend_header_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEND_HEADER_ID" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.LEND_HEADER_ID"/>
        <bm:field name="borrower_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BORROWER_NAME" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.BORROWER_NAME"/>
        <bm:field name="borrower_phone" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BORROWER_PHONE" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.BORROWER_PHONE"/>
        <bm:field name="borrower_date" databaseType="DATE" datatype="java.util.Date" physicalName="BORROWER_DATE" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.BORROWER_DATE"/>
        <bm:field name="lender_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LENDER_NAME" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.LENDER_NAME"/>
        <bm:field name="lender_name_n" databaseType="VARCHAR2" datatype="java.lang.String" expression="(SELECT user_name FROM sys_user s WHERE s.user_id=${/session/@user_id})"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.REF_D05"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.STATUS"/>
        <bm:field name="borrow_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BORROW_STATUS" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.BORROW_STATUS"/>
        <bm:field name="borrow_status_n" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select v.code_value_name as value_name from sys_code_values_v v where v.code = &apos;BORROW_TYPE&apos;  and v.code_value=t1.borrow_status)" forInsert="false" forUpdate="false"/>
        <bm:field name="instance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSTANCE_ID" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.INSTANCE_ID"/>
        <bm:field name="express_number_out" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_NUMBER_OUT" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EXPRESS_NUMBER_OUT"/>
        <bm:field name="express_company_out" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_COMPANY_OUT" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EXPRESS_COMPANY_OUT"/>
        <bm:field name="express_address_out" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_ADDRESS_OUT" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EXPRESS_ADDRESS_OUT"/>
        <bm:field name="doc_out_time" databaseType="DATE" datatype="java.util.Date" physicalName="DOC_OUT_TIME" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.DOC_OUT_TIME"/>
        <bm:field name="express_number_in" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_NUMBER_IN" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EXPRESS_NUMBER_IN"/>
        <bm:field name="express_company_in" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_COMPANY_IN" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EXPRESS_COMPANY_IN"/>
        <bm:field name="express_address_in" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_ADDRESS_IN" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EXPRESS_ADDRESS_IN"/>
        <bm:field name="doc_in_time" databaseType="DATE" datatype="java.util.Date" physicalName="DOC_IN_TIME" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.DOC_IN_TIME"/>
        <bm:field name="email" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMAIL" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.EMAIL"/>
        <bm:field name="borrower_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BORROWER_NUMBER" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.BORROWER_NUMBER"/>
        <bm:field name="borrow_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BORROW_TYPE" prompt="YONDA_DOCUMENT_LEND_RECORD_HD.BORROW_TYPE"/>
        <bm:field name="borrow_type_n" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select v.code_value_name as value_name from sys_code_values_v v where v.code = &apos;BORROW_TYPE&apos;  and v.code_value=t1.borrow_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="atm_num" databaseType="NUMBER" datatype="java.lang.Long" expression="(select count(1) from fnd_atm_attachment_multi t where t.table_name = &apos;YONDA_DOCUMENT_LEND_RECORD_HD&apos; and t.table_pk_value = t1.lend_header_id)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="lend_header_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter name="lend_header_id" expression="t1.lend_header_id=${@lend_header_id}"/>
    </bm:data-filters>
</bm:model>
