<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-5-24 上午11:25:41  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select bp_id, bp_code, bp_name, bp_category
  from (select m.bp_id,
               m.bp_code,
               m.bp_name,
               csh_payment_req_pkg.get_bp_category_desc(b.contract_id, b.bp_id) bp_category
          from hls_bp_master m, hls_bp_category c, con_contract_bp b
         where b.contract_id = ${@contract_id}
           and b.bp_id = m.bp_id
           and b.bp_category = c.bp_category
         group by m.bp_id,
                  m.bp_code,
                  m.bp_name,
                  csh_payment_req_pkg.get_bp_category_desc(b.contract_id, b.bp_id))
      #WHERE_CLAUSE# 
  
  ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID"/>
        <bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="BP_CODE" prompt="商业伙伴编码"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="BP_NAME" prompt="商业伙伴名称"/>
        <bm:field name="bp_category" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="BP_CATEGORY" prompt="商业伙伴类别"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="bp_code" queryOperator="like"/>
        <bm:query-field field="bp_name" queryOperator="like"/>
        <bm:query-field field="bp_category" queryOperator="="/>
    </bm:query-fields>
</bm:model>
