<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang
    $Date: 2013-6-18 下午3:47:27  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    DECODE('${:/parameter/@continue_flag}','N','',t1.tab_type) tab_type,
                    t1.tab_code,
                    t1.tab_group,
                    t1.tab_seq
                FROM
                    hls_doc_layout_tab_group_v t1
                WHERE
                    t1.layout_code = ${@layout_code} AND
                    (
                        t1.tree_code   = ${@tree_code} OR
                        ${@tree_code} IS NULL
                    )
                    AND
                    (
                        (
                            t1.parent_tab_code IS NULL AND
                            ${@tab_tab_code}   IS NULL
                        )
                        OR
                        (
                            ${@tab_tab_code}  IS NOT NULL AND
                            t1.parent_tab_code = ${@tab_tab_code}
                        )
                    )
                    AND
                    t1.enabled_flag = 'Y'
                GROUP BY
                    t1.tab_type,
                    t1.tab_code,
                    t1.tab_group,
                    t1.tab_seq
                ORDER BY
                    t1.tab_seq,
                    t1.tab_type
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
