<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2013-9-18 上午09:46:22  
    $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="FND_SC_SCORE" defaultOrderBy="project_number asc">
    <bm:fields>
        <bm:field name="sc_score_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SC_SCORE_ID" prompt="FND_SC_SCORE.SC_SCORE_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/session/@company_id}" physicalName="COMPANY_ID" prompt="FND_SC_SCORE.COMPANY_ID"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID" prompt="FND_SC_SCORE.PROJECT_ID"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select p.project_number from prj_project p where p.project_id=t1.project_id)" forInsert="false" forUpdate="false" prompt="HLS.PROJECT_NUMBER"/>
        <bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select p.project_name from prj_project p where p.project_id=t1.project_id)" forInsert="false" forUpdate="false" prompt="HLS.PROJECT_NAME"/>
        <bm:field name="score_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SCORE_NUM" prompt="FND_SC_SCORE.SCORE_NUM"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="FND_SC_SCORE.DESCRIPTION"/>
        <bm:field name="score_date" databaseType="DATE" datatype="java.util.Date" physicalName="SCORE_DATE" prompt="FND_SC_SCORE.SCORE_DATE"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="FND_SC_SCORE.STATUS"/>
        <bm:field name="pd_result" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PD_RESULT" prompt="FND_SC_SCORE.PD_RESULT"/>
        <bm:field name="lgd_result" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LGD_RESULT" prompt="FND_SC_SCORE.LGD_RESULT"/>
        <bm:field name="ead_result" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EAD_RESULT" prompt="FND_SC_SCORE.EAD_RESULT"/>
        <bm:field name="el_result" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EL_RESULT" prompt="FND_SC_SCORE.EL_RESULT"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="FND_SC_SCORE.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="FND_SC_SCORE.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="FND_SC_SCORE.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="FND_SC_SCORE.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="FND_SC_SCORE.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="FND_SC_SCORE.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="FND_SC_SCORE.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="FND_SC_SCORE.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="FND_SC_SCORE.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="FND_SC_SCORE.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="FND_SC_SCORE.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="FND_SC_SCORE.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="FND_SC_SCORE.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="FND_SC_SCORE.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="FND_SC_SCORE.REF_D05"/>
    </bm:fields>
    <!--      <bm:relations>
        <bm:relation name="ref" joinType="LEFT OUTER" refAlias="fst" refModel="fnd.FND713.fnd_score_template">
        <bm:reference foreignField="score_template_id" localField="score_template_id"/>
        </bm:relation>
    </bm:relations>
    <bm:ref-fields>
        <bm:ref-field name="score_template_name" relationName="ref" sourceField="score_template_name"/>
    </bm:ref-fields> -->
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="sc_score_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="score_num" queryOperator="like"/>
        <bm:query-field field="project_id" queryOperator="="/>
        <bm:query-field name="score_template_id" queryExpression="t1.score_template_id=  ${@score_template_id}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.company_id=  ${/session/@company_id}"/>
    </bm:data-filters>
</bm:model>
