<?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
                    --应付我司开户名
                     (SELECT BP_NAME
                        FROM HLS_BP_MASTER HBM, HLS_BP_MASTER_BANK_ACCOUNT HBBC
                       WHERE HBBC.BANK_ACCOUNT_ID = V.BP_BANK_ACCOUNT_ID
                         AND HBBC.BP_ID = HBM.BP_ID) AGENT_NAME,
                     --应付我司开户行
                     (SELECT HBBC.BANK_BRANCH_NAME
                        FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
                       WHERE HBBC.BANK_ACCOUNT_ID = V.BP_BANK_ACCOUNT_ID) AGENT_BANK_NAME,
                     --应付我司开户账号
                     (SELECT HBBC.BANK_ACCOUNT_NUM
                        FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
                       WHERE HBBC.BANK_ACCOUNT_ID = V.BP_BANK_ACCOUNT_ID) AGENT_BANK_NUM,
                     --应付我司开户名
                     (SELECT BP_NAME
                        FROM HLS_BP_MASTER HBM, HLS_BP_MASTER_BANK_ACCOUNT HBBC
                       WHERE HBBC.BANK_ACCOUNT_ID = V.VENDER_BANK_ACCOUNT_ID
                         AND HBBC.BP_ID = HBM.BP_ID) VENDER_NAME,
                     --应付我司开户行
                     (SELECT HBBC.BANK_BRANCH_NAME
                        FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
                       WHERE HBBC.BANK_ACCOUNT_ID = V.VENDER_BANK_ACCOUNT_ID) VENDER_BANK_NAME,
                     --应付我司开户账号
                     (SELECT HBBC.BANK_ACCOUNT_NUM
                        FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
                       WHERE HBBC.BANK_ACCOUNT_ID = V.VENDER_BANK_ACCOUNT_ID) VENDER_BANK_NUM,
                      ( to_char(SYSDATE,'yyyy')||'年'||to_char(SYSDATE,'mm')||'月'||to_char(SYSDATE,'dd')||'日') current_date

                      FROM CSH_PAYMENT_REQ_LN V
                      #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="v.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>
