<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Eugene Song
    $Date: 2018年11月6日15:37:19
    $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 * FROM (SELECT cb.bank_short_name    AS code_value_name,
                   cb.bank_code          AS code_value,
                   cba.bank_account_id,
                   cba.bank_account_num,
                   cba.bank_account_name,
                   cb.bank_short_name,
                   cbb.bank_branch_name,
                   cba.currency_code,
                   (select code_value_name from sys_code_values_v where code = 'CURRENCY' and code_value = cba.currency_code and CODE_VALUE_ENABLED_FLAG = 'Y') currency_name
              FROM csh_bank cb, csh_bank_branch cbb, csh_bank_account cba
             WHERE cb.bank_id = cbb.bank_id
               AND cba.bank_branch_id = cbb.bank_branch_id
               AND cba.enabled_flag = 'Y'
               AND cba.spd_receipt_flag = 'Y')t1
               #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="code_value_name"/>
        <bm:field name="code_value"/>
        <bm:field name="bank_account_id"/>
        <bm:field name="bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="账户名"/>
        <bm:field name="bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="银行账户"/>
        <bm:field name="bank_short_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="银行"/>
        <bm:field name="bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="支行名"/>
        <bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="false" prompt="币种"/>
        <bm:field name="currency_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="币种"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="bank_account_name" queryExpression="t1.bank_account_name like &apos;%&apos; || ${@bank_account_name} || &apos;%&apos; "/>
        <bm:query-field name="bank_account_num" queryExpression="t1.bank_account_num like &apos;%&apos; || ${@bank_account_num} || &apos;%&apos; "/>
    </bm:query-fields>

</bm:model>
