<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-8-28 下午02:39:33  
    $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 DISTINCT
                    h.function_code,
                    sf.function_name,
                    h.tab_code,
                    htv.tab_desc
                FROM
                    hls_doc_layout_tab_button h,
                    hls_doc_layout_tab_v htv,
                    hls_doc_layout hdl,
            	(   select v1.function_code, v1.function_name
                      from sys_function_v v1
                    union
                    select v2.function_code, v2.function_name
                      from sys_function_dynamic v2
                    ) sf #WHERE_CLAUSE#
                ORDER BY
                    h.function_code,
                    h.tab_code
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="function_code" queryExpression="h.function_code like ${@function_code}"/>
        <bm:query-field name="function_name" queryExpression="sf.function_name like ${@function_name}"/>
        <bm:query-field name="tab_code" queryExpression="h.tab_code like ${@tab_code}"/>
        <bm:query-field name="tab_desc" queryExpression="htv.tab_desc like ${@tab_desc}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="sf.function_code = h.function_code and htv.layout_code = h.layout_code AND htv.tab_code = h.tab_code AND h.layout_code = ${@layout_code}"/>
    </bm:data-filters>
</bm:model>
