<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-6-18 下午3:47:27  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_DOC_LAYOUT_TAB" defaultOrderBy="tab_seq">
    <bm:fields>
        <bm:field name="query_field1" databasetype="VARCHAR2" datatype="java.lang.String" physicalname="QUERY_FIELD1"/>
        <bm:field name="query_field2" databasetype="VARCHAR2" datatype="java.lang.String" physicalname="QUERY_FIELD2"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    		select t1.base_table_pk query_field1,
    				(select distinct base_table_pk
		             from hls_doc_layout_tab d
		            where d.layout_code = t1.layout_code
		              and d.base_table = t1.parent_table) query_field2
			  from hls_doc_layout_tab t1
			  #WHERE_CLAUSE#
    	 ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.layout_code=${@layout_code}"/>
        <bm:data-filter enforceOperations="query" expression="t1.tab_code = ${@tab_code}"/>
    </bm:data-filters>
</bm:model>
