<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang 
    $Date: 2015-6-17 上午10:51:58  
    $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
                    p.bookmark,
                    pa.column_name,
                    pa.column_num,
                    pa.column_width,
                    pa.alignment,
                    pa.column_desc,
                    NVL(p.table_width,0) table_width,
                    NVL(p.ind_width,0) ind_width,
                    NVL(p.font_family,'宋体') font_family,
                    NVL(p.font_size,'15') font_size
                FROM
                    con_contract_content cc,
                    con_clause_templet t,
                    hls_doc_file_tmp_para_link l,
                    hls_doc_file_templet_para p,
                    hls_doc_file_para_table pa #WHERE_CLAUSE#
                ORDER BY
                    column_num
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="bookmark" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BOOKMARK" required="true"/>
        <bm:field name="column_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COLUMN_NAME"/>
        <bm:field name="column_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COLUMN_DESC"/>
        <bm:field name="alignment" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ALIGNMENT"/>
        <bm:field name="column_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COLUMN_NUM"/>
        <bm:field name="table_width" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TABLE_WIDTH"/>
        <bm:field name="ind_width" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IND_WIDTH"/>
        <bm:field name="column_width" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COLUMN_WIDTH"/>
        <bm:field name="font_family" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FONT_FAMILY"/>
        <bm:field name="font_size" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FONT_SIZE"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="bookmark" queryOperator="="/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="bookmark" enforceOperations="query" expression=" cc.content_id     = nvl(${/parameter/@content_id},${@content_id}) AND                     cc.templet_id     = t.templet_id AND                     t.doc_template_id = l.templet_id AND                     t.doc_plugin_flag = &apos;Y&apos; AND                     l.templet_para_id = p.templet_para_id AND                     l.ENABLED_FLAG    =&apos;Y&apos; AND                     p.enabled_flag    = &apos;Y&apos; AND                     p.bookmark_type   in(&apos;TABLE&apos;,&apos;FORM_TABLE&apos;,&apos;DYNAMIC_TABLE&apos;) AND                     p.templet_para_id =pa.templet_para_id AND                     pa.enabled_flag   =&apos;Y&apos;"/>
    </bm:data-filters>
</bm:model>
