<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-4-15 下午01:13:07  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features">
    <bm:fields>
        <bm:field name="bp_id" prompt="HLS_BP_MASTER_V.BP_ID"/>
        <bm:field name="bp_code" displayWidth="242" forDisplay="true" forQuery="true" prompt="HLS.BP_CODE"/>
        <bm:field name="bp_name" displayWidth="242" forDisplay="true" forQuery="true" prompt="HLS.BP_NAME"/>
        <bm:field name="bp_category"/>
        <bm:field name="bp_category_name" displayWidth="80" forDisplay="true" prompt="商业伙伴类别"/>
        <bm:field name="bp_class"/>
        <bm:field name="bp_class_name" displayWidth="80" forDisplay="true" prompt="商业伙伴分类"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    		SELECT bp_id,
			       bp_code,
			       bp_name,
			       bp_category,
			       (SELECT description FROM hls_bp_category WHERE bp_category = t1.bp_category) bp_category_name,
			       bp_class,
			       (SELECT code_value_name
			          FROM sys_code_values_v
			         WHERE code_value = t1.bp_class
			               AND code = 'HLS211_BP_CLASS') bp_class_name
			  FROM hls_bp_master t1
    		#WHERE_CLAUSE#
    		order by bp_code
    	]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field field="bp_code" queryExpression="t1.bp_code like &apos;%&apos; || upper(${@bp_code}) || &apos;%&apos;"/>
        <bm:query-field field="bp_name" queryExpression="t1.bp_name like &apos;%&apos; || ${@bp_name} || &apos;%&apos;"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="query" expression="t1.bp_category = ${@bp_category}"/>
    </bm:data-filters>
</bm:model>
