<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang 
    $Date: 2015-6-10 下午04:07:48  
    $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,
                    NVL(p.line_num,0)line_num,
                    hls_doc_file_templet_pkg.get_doc_bookmark_value(cc.content_id, p.bookmark, NVL(${@user_id},${/session/@user_id})) bookmark_value,
                    NVL(p.bookmark_type,'TEXT') bookmark_type,
                    NVL(NVL(l.font_family,p.font_family),'微软雅黑') font_family,
                    NVL(NVL(l.font_size,p.font_size),'15') font_size,
                    NVL(l.underline,p.underline) underline
                FROM
                    con_contract_content cc,
                    con_clause_templet t,
                    hls_doc_file_tmp_para_link l,
                    hls_doc_file_templet_para p
                WHERE
                    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 = 'Y' AND
                    l.templet_para_id = p.templet_para_id AND
                    l.ENABLED_FLAG    ='Y' AND
                    p.enabled_flag    = 'Y'
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="bookmark" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BOOKMARK"/>
        <bm:field name="underline" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNDERLINE"/>
        <bm:field name="line_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LINE_NUM"/>
        <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:field name="bookmark_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BOOKMARK_TYPE"/>
        <bm:field name="bookmark_value" databaseType="CLOB" datatype="java.sql.Clob" physicalName="BOOKMARK_VALUE"/>
    </bm:fields>
</bm:model>
