<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2015-5-21 下午7:31:13  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model 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_SET_HD">
    <bm:fields>
        <bm:field name="templet_set_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_SET_ID" prompt="HLS_DOC_FILE_TEMPLET_SET_HD.TEMPLET_SET_ID"/>
        <bm:field name="templet_set_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEMPLET_SET_CODE" prompt="HLS_DOC_FILE_TEMPLET_SET_HD.TEMPLET_SET_CODE"/>
        <bm:field name="templet_set_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEMPLET_SET_NAME" prompt="HLS_DOC_FILE_TEMPLET_SET_HD.TEMPLET_SET_NAME"/>
        <bm:field name="usage_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USAGE_CODE" prompt="HLS_DOC_FILE_TEMPLET_SET_HD.USAGE_CODE"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="HLS_DOC_FILE_TEMPLET_SET_HD.NOTE"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS_DOC_FILE_TEMPLET_SET_HD.ENABLED_FLAG"/>
        <bm:field name="usage_code_des" expression="(select sc.code_value_name from sys_code_values_v sc where sc.code=&apos;HLS_DOC_FILE_USAGE&apos; and sc.code_value=t1.usage_code)" forInsert="false" forQuery="true" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <o:sequence-pk sequenceName="hls_doc_file_templet_set_hd_s"/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="templet_set_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="templet_set_code" queryOperator="like"/>
        <bm:query-field field="templet_set_name" queryOperator="like"/>
        <bm:query-field field="usage_code" queryOperator="="/>
        <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>
</bm:model>
