<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-9-23 下午12:37:37  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select a.* from 
            	(SELECT tv.line_number,
				       tv.description AS target_value_desc,
				       nvl(tv.fixed_target_value,tv.description) target_value,
				       tv.score_target_value_id,
				       lv.score_template_line_id
				  FROM fnd_score_target_values tv, fnd_score_template_ln_value lv
				 where tv.score_target_value_id = lv.score_target_value_id
				 )a
			 #WHERE_CLAUSE#
			 order by a.line_number asc
 ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="target_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TARGET_VALUE" prompt="FND713.FND_SCORE_TEMPLATE_LN_VALUE.SCORE_VALUE"/>
        <bm:field name="target_value_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TARGET_VALUE_DESC" prompt="FND713.FND_SCORE_TEMPLATE_LN_VALUE.SCORE_VALUE_DESC"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="target_value" queryOperator="like"/>
        <bm:query-field field="target_value_desc" queryOperator="like"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="score_template_line_id" enforceOperations="query" expression="a.score_template_line_id=${@score_template_line_id}"/>
    </bm:data-filters>
</bm:model>
