<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Date: 2013-6-24 上午11:24:10}  
    $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="TRE_LOAN_CON_WITHDRAW_CON" needAccessControl="false">
    <bm:fields>
        <bm:field name="withdraw_con_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WITHDRAW_CON_ID" prompt="TRE_LOAN_CON_WITHDRAW_CON.WITHDRAW_CON_ID"/>
        <bm:field name="withdraw_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WITHDRAW_ID" prompt="TRE_LOAN_CON_WITHDRAW_CON.WITHDRAW_ID"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="TRE_LOAN_CON_WITHDRAW_CON.CONTRACT_ID"/>
        <bm:field name="amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="AMOUNT" prompt="TRE_LOAN_CON_WITHDRAW_CON.AMOUNT"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="TRE_LOAN_CON_WITHDRAW_CON.REF_D05"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="insert">
            <bm:query-sql><![CDATA[
    			begin
    				tre_loan_con_withdraw_pkg.insert_loan_con_withdraw_con(p_withdraw_con_id=>${@withdraw_con_id},
    																	   p_withdraw_id =>${@withdraw_id},
									                                       p_contract_id =>${@contract_id},
									                                       p_amount      =>${@amount},
									                                       p_user_id     =>${/session/@user_id});
    			end;
    		]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter name="withdraw_con_id" dataType="java.lang.Long" input="false" output="true" outputPath="@withdraw_con_id"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="update">
            <bm:query-sql><![CDATA[
    			begin
    				tre_loan_con_withdraw_pkg.update_loan_con_withdraw_con(p_withdraw_con_id=>${@withdraw_con_id},
    																	   p_withdraw_id    =>${@withdraw_id},
									                                       p_contract_id 	=>${@contract_id},
									                                       p_amount      	=>${@amount},
									                                       p_user_id     	=>${/session/@user_id});
    			end;
    		]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:query-sql><![CDATA[
    			begin
    				tre_loan_con_withdraw_pkg.del_loan_con_withdraw_con(p_withdraw_con_id =>${@withdraw_con_id},
                                      									p_user_id         =>${/session/@user_id});
    			end;
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <o:sequence-pk/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="withdraw_con_id"/>
    </bm:primary-key>
    <bm:relations>
        <bm:relation name="con_contract" joinType="left outer" refAlias="t2" refModel="cont.CON500.con_contract_lov">
            <bm:reference foreignField="contract_id" localField="contract_id"/>
        </bm:relation>
    </bm:relations>
    <bm:ref-fields>
        <bm:ref-field name="contract_number" relationName="con_contract" sourceField="contract_number"/>
        <bm:ref-field name="contract_name" relationName="con_contract" sourceField="contract_name"/>
    </bm:ref-fields>
    <bm:query-fields>
        <bm:query-field field="withdraw_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
