<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        t1.bank_account_id,
                        t1.bank_account_code,
                        t3.bank_short_name,
                        t2.bank_branch_name,
                        t1.bank_account_name,
                        t1.bank_account_num,
                        t3.bank_code
                    FROM
                        csh_bank_account t1,
                        csh_bank_branch t2,
                        csh_bank t3
                    WHERE
                        t1.bank_branch_id = t2.bank_branch_id AND
                        t2.bank_id        = t3.bank_id AND
                        t1.enabled_flag   = 'Y' AND
                        t2.enabled_flag   = 'Y' AND
                        t3.enabled_flag   = 'Y'
                    ) v #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="bank_account_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="bank_account_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="账户代码"/>
        <bm:field name="bank_short_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" prompt="银行简称" queryWidth="100"/>
        <bm:field name="bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" prompt="分行名称" queryWidth="100"/>
        <bm:field name="bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="账户名"/>
        <bm:field name="bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="银行账号"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="bank_short_name" queryExpression="v.bank_short_name like ${@bank_short_name}"/>
        <bm:query-field name="bank_branch_name" queryExpression="v.bank_branch_name like ${@bank_branch_name}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="v.bank_code  IN ('021')"/>
    </bm:data-filters>
</bm:model>
