<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-9-13 上午9:29:29  
    $Revision: 1.0  
    $Purpose: gld.GLD161.gld_ref_code_categories
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="GLD_REF_CODE_VALUES" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
              select t1.ref_code_category_id,
		           t1.ref_code,
		           t1.enabled_flag,
		           t1.ref_code_value_id,
		           (select description_text
		              from fnd_descriptions
		             where description_id = t1.ref_code_value_id
		               and language = ${/session/@lang}) as value_name
		      from gld_ref_code_values t1
		     where ref_code_category_id =${/parameter/@ref_code_category_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="ref_code_category_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_CODE_CATEGORY_ID" prompt="GLD_REF_CODE_CATEGORIES.REF_CODE_CATEGORY_ID" queryExpression="${/parameter/@ref_code_category_id}"/>
        <bm:field name="ref_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="REF_CODE" prompt="参数代码"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="GLD_REF_CODE_VALUES.ENABLED_FLAG"/>
        <bm:field name="ref_code_value_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="value_name" databaseType="NUMBER" datatype="java.lang.String" forDisplay="true" forInsert="true" forQuery="true" prompt="参数名称"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="ref_code_category_id" queryOperator="="/>
        <bm:query-field field="ref_code" queryOperator="like"/>
        <bm:query-field field="value_name" queryOperator="like"/>
    </bm:query-fields>
    <bm:features>
        <f:standard-who/>
        <f:multi-language-storage/>
        <f:sequence-pk/>
    </bm:features>
</bm:model>
