<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: sf
    $Date: 2019-10-20 下午03:50:31
    $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  tt.*  from (      SELECT
--应付我司开户行
  v.bp_bank_full_name agent_bank_name,
 --代理商名称
 ( SELECT b.bp_name
       from con_contract_bp b
       where b.contract_id=t.contract_id
           AND b.bp_category = 'AGENT') agent_name,
 --应付我司开户名
   v.bp_bank_account_name agent_account_name,
 --应付我司开户账号
   v.bp_bank_account_num AGENT_BANK_NUM,
 --厂商开户名
  v.vender_bank_account_name vender_account_name,
 --厂商开户行
  v.vender_bank_full_name vender_bank_name,
 --厂商名称
  (
        SELECT hbm.bp_name
           FROM hls_bp_master hbm,hls_bp_master_bank_account hbbc
           WHERE hbm.bp_id=hbbc.bp_id
           AND hbbc.bank_account_id= v.vender_bank_account_id ) vender_name ,
 --应付我司开户账号
  v.vender_bank_account_number VENDER_BANK_NUM,
 (to_char(SYSDATE, 'yyyy') || '年' || to_char(SYSDATE, 'mm') || '月' ||
 to_char(SYSDATE, 'dd') || '日') current_date,
 v.payment_req_id,
 v.ref_doc_id

  FROM CSH_PAYMENT_REQ_LN V, con_contract t
 where t.contract_id = V.ref_doc_id)  tt
                      #WHERE_CLAUSE#

                   --  WHERE V.PAYMENT_REQ_ID = 2512561  AND ROWNUM <= 1



                ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="tt.payment_req_id =${@payment_req_id}"/>
    </bm:data-filters>
    <!--  <bm:query-fields>
          <bm:query-field name="payment_req_id" queryOperator="="/>
      </bm:query-fields>-->

</bm:model>