<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-9-12 下午04:13:02  
    $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="RSC_FC_ESTIMATE">
    <bm:fields>
        <bm:field name="fc_estimate_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FC_ESTIMATE_ID" prompt="RSC_FC_ESTIMATE.FC_ESTIMATE_ID"/>
        <bm:field name="five_class_plan" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIVE_CLASS_PLAN" prompt="RSC_FC_ESTIMATE.FIVE_CLASS_PLAN"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/session/@company_id}" physicalName="COMPANY_ID" prompt="RSC_FC_ESTIMATE.COMPANY_ID"/>
        <bm:field name="estimate_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ESTIMATE_NUM" prompt="RSC_FC_ESTIMATE.ESTIMATE_NUM"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="RSC_FC_ESTIMATE.DESCRIPTION"/>
        <bm:field name="estimate_date" databaseType="DATE" datatype="java.util.Date" physicalName="ESTIMATE_DATE" prompt="RSC_FC_ESTIMATE.ESTIMATE_DATE"/>
        <bm:field name="internal_period_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERNAL_PERIOD_NUM" prompt="RSC_FC_ESTIMATE.INTERNAL_PERIOD_NUM"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="RSC_FC_ESTIMATE.STATUS"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="RSC_FC_ESTIMATE.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="RSC_FC_ESTIMATE.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="RSC_FC_ESTIMATE.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="RSC_FC_ESTIMATE.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="RSC_FC_ESTIMATE.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="RSC_FC_ESTIMATE.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="RSC_FC_ESTIMATE.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="RSC_FC_ESTIMATE.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="RSC_FC_ESTIMATE.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="RSC_FC_ESTIMATE.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="RSC_FC_ESTIMATE.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="RSC_FC_ESTIMATE.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="RSC_FC_ESTIMATE.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="RSC_FC_ESTIMATE.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="RSC_FC_ESTIMATE.REF_D05"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="fc_estimate_id"/>
    </bm:primary-key>
    <bm:relations>
        <bm:relation name="ref" joinType="LEFT OUTER" refAlias="fst" refModel="rsc.RSC200.rsc_five_class_plan">
            <bm:reference foreignField="five_class_plan" localField="five_class_plan"/>
        </bm:relation>
    </bm:relations>
    <bm:ref-fields>
        <bm:ref-field name="five_class_plan_name" relationName="ref" sourceField="description"/>
    </bm:ref-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.company_id=${/session/@company_id}"/>
    </bm:data-filters>
    <bm:operations>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
        		BEGIN
        		    rsc_fc_estimate_pkg.rsc_fc_estimate_con_lamp(p_result_id       =>${@result_id},
				                                                 p_contract_id     =>${@contract_id},
				                                                 p_user_id         =>${/session/@user_id});
        		END;
    		]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
