<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qianming 
    $Date: 2015-5-25 下午1:30:16  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="HLS_CAR_MODEL_VL" defaultOrderBy="brand_id,series_id,model_id">
    <bm:fields>
        <bm:field name="model_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MODEL_ID" prompt="HLS_CAR_MODEL_VL.MODEL_ID"/>
        <bm:field name="brand_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BRAND_ID" prompt="HLS_CAR_MODEL_VL.BRAND_ID"/>
        <bm:field name="series_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SERIES_ID" prompt="HLS_CAR_MODEL_VL.SERIES_ID"/>
        <bm:field name="model_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="MODEL_CODE" prompt="车型编号"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="DESCRIPTION" prompt="车型名称"/>
        <bm:field name="brand_name" expression="(select description from hls_car_brands_vl where brand_id = t1.brand_id)" forDisplay="true" prompt="所属品牌"/>
        <bm:field name="series_name" expression="(select description from hls_car_series_vl where series_id = t1.series_id)" forDisplay="true" prompt="所属车系"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="brand_id" queryOperator="="/>
        <bm:query-field field="series_id" queryOperator="="/>
        <bm:query-field field="model_code" queryExpression="upper(t1.model_code) like &apos;%&apos; || upper(${@model_code}) || &apos;%&apos;"/>
        <bm:query-field field="description" queryExpression="upper(t1.description) like &apos;%&apos; || upper(${@description}) || &apos;%&apos;"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.enabled_flag = &apos;Y&apos;"/>
    </bm:data-filters>
</bm:model>
