<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-4-2 上午9:39:16  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="FND_SCORE_TEMPLATE_LINE">
    <bm:fields>
        <bm:field name="score_template_line_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SCORE_TEMPLATE_LINE_ID"/>
        <bm:field name="score_template_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SCORE_TEMPLATE_ID" prompt="FND713.FND_SCORE_TEMPLATE_LINE.SCORE_TEMPLATE_ID"/>
        <bm:field name="score_target_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SCORE_TARGET_ID" prompt="FND713.FND_SCORE_TEMPLATE_LINE.SCORE_TARGET_ID"/>
        <bm:field name="weight_value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WEIGHT_VALUE" prompt="FND713.FND_SCORE_TEMPLATE_LINE.WEIGHT_VALUE"/>
        <bm:field name="parent_line_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PARENT_LINE_ID" prompt="FND713.FND_SCORE_TEMPLATE_LINE.PARENT_LINE_ID"/>
        <bm:field name="score_target_code" forInsert="false" forUpdate="false"/>
        <bm:field name="score_target_name" forInsert="false" forUpdate="false"/>
        <bm:field name="summary_flag" forInsert="false" forUpdate="false"/>
        <bm:field name="data_value_from" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select p.score_template_line_id,
				       p.score_template_id,
				       p.score_target_id,
				       t.score_target_code,
				       t.score_target_name,
				       t.summary_flag,
				       t.data_value_from,
				       p.weight_value,
				       p.parent_line_id
				  from fnd_score_template_line p,
				       fnd_score_template_line s,
				       fnd_score_target        t
				 where s.score_template_line_id = ${@score_template_line_id}
				   and p.score_template_id = s.parent_line_id
				   and t.score_target_id = p.score_target_id
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="score_template_line_id"/>
    </bm:primary-key>
</bm:model>
