<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2015-5-21 下午4:11:53  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_DOC_FILE_TEMPLET_PARA">
    <bm:fields>
        <bm:field name="templet_para_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_PARA_ID" prompt="HLS_DOC_FILE_TEMPLET_PARA.TEMPLET_PARA_ID"/>
        <bm:field name="bookmark" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="BOOKMARK" prompt="参数代码"/>
        <bm:field name="bookmark_description" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="BOOKMARK_DESCRIPTION" prompt="参数描述"/>
        <bm:field name="sql_content" databaseType="CLOB" datatype="java.sql.Clob" physicalName="SQL_CONTENT" prompt="HLS_DOC_FILE_TEMPLET_PARA.SQL_CONTENT"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS_DOC_FILE_TEMPLET_PARA.ENABLED_FLAG"/>
        <bm:field name="font_family" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FONT_FAMILY" prompt="HLS_DOC_FILE_TEMPLET_PARA.FONT_FAMILY"/>
        <bm:field name="font_size" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FONT_SIZE" prompt="HLS_DOC_FILE_TEMPLET_PARA.FONT_SIZE"/>
        <bm:field name="bookmark_type"/>
        <bm:field name="bookmark_type_desc" expression="(select scv.code_value_name from sys_code_values_v scv where scv.code = &apos;BOOKMARK_TYPE&apos; and scv.code_value = t1.bookmark_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="sql" databaseType="CLOB" datatype="java.sql.Clob" physicalName="SQL" prompt="合同取值SQL"/>
        <bm:field name="underline" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNDERLINE" prompt="HLS_DOC_FILE_TEMPLET_PARA.UNDERLINE"/>
    </bm:fields>
    <bm:features>
        <o:sequence-pk sequenceName="hls_doc_file_templet_para_s"/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="templet_para_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="bookmark" queryOperator="like"/>
        <bm:query-field field="bookmark_description" queryOperator="like"/>
        <bm:query-field name="enabled_flag" queryExpression="((${@enabled_flag}=&apos;Y&apos; and t1.enabled_flag=&apos;Y&apos;) or (${@enabled_flag}=&apos;N&apos; and nvl(t1.enabled_flag,&apos;N&apos;)=&apos;N&apos;) or  (${@enabled_flag}=&apos;ALL&apos; and nvl(t1.enabled_flag,&apos;N&apos;) in(&apos;N&apos;,&apos;Y&apos;)) )"/>
    </bm:query-fields>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="文件模板参数已存在！"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
