<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Icon  
    $Date: 2014-10-9 下午3:33:47  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="EXP_ORG_UNIT_VL">
    <bm:fields>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID" prompt="EXP_ORG_UNIT_VL.UNIT_ID"/>
        <bm:field name="unit_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="UNIT_CODE" prompt="4s店代码"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="DESCRIPTION" prompt="描述"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="EXP_ORG_UNIT_VL.COMPANY_ID"/>
        <bm:field name="responsibility_center_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESPONSIBILITY_CENTER_ID" prompt="EXP_ORG_UNIT_VL.RESPONSIBILITY_CENTER_ID"/>
        <bm:field name="parent_unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PARENT_UNIT_ID" prompt="EXP_ORG_UNIT_VL.PARENT_UNIT_ID"/>
        <bm:field name="operate_unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OPERATE_UNIT_ID" prompt="EXP_ORG_UNIT_VL.OPERATE_UNIT_ID"/>
        <bm:field name="chief_position_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CHIEF_POSITION_ID" prompt="EXP_ORG_UNIT_VL.CHIEF_POSITION_ID"/>
        <bm:field name="org_unit_level_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ORG_UNIT_LEVEL_ID" prompt="EXP_ORG_UNIT_VL.ORG_UNIT_LEVEL_ID"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="EXP_ORG_UNIT_VL.ENABLED_FLAG"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select * from (
    			select *
  from exp_org_unit_vl eouv
 where eouv.UNIT_ID in (select eou.unit_id
                          from exp_org_unit eou
                         where eou.org_unit_type = '4S')) t1 #WHERE_CLAUSE#
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="unit_code" queryExpression="t1.unit_code like &apos;%&apos;||${@unit_code}||&apos;%&apos;"/>
        <bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
    </bm:query-fields>
</bm:model>
