<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: dingzhichao2855 $
    $Date: 2011/03/29 11:45:05 $
    $Revision: 1.1 $
    $Purpose: 区域查询
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_FND_REGION">
    <bm:fields>
        <bm:field name="region_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REGION_ID"/>
        <bm:field name="city_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CITY_ID"/>
        <bm:field name="region_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="REGION_CODE" prompt="区代码"/>
        <bm:field name="region_name_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REGION_NAME_ID"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG"/>
        <bm:field name="region_name" datatype="java.lang.String" expression="(select description_text from fnd_descriptions fn where t1.region_name_id=fn.description_id and fn.language = ${/session/@lang})" forDisplay="true" forInsert="false" forQuery="true" forUpdate="false" prompt="区名称"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="region_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="city_id" queryOperator="="/>
        <bm:query-field field="region_code" queryOperator="like"/>
        <bm:query-field name="region_name" queryExpression=" exists (select 1 from fnd_descriptions fn where t1.region_name_id=fn.description_id and fn.language = ${/session/@lang} and fn.description_text like ${@region_name})"/>
    </bm:query-fields>
</bm:model>
