<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Icon  
    $Date: 2014-10-9 下午4:22:54  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_PRICE_LIST_CONDS_LEASE">
    <bm:fields>
        <bm:field name="conds_lease_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONDS_LEASE_ID" prompt="HLS_PRICE_LIST_CONDS_LEASE.CONDS_LEASE_ID"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" insertExpression="${@price_list}" physicalName="PRICE_LIST" prompt="HLS_PRICE_LIST_CONDS_LEASE.PRICE_LIST"/>
        <bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" prompt="HLS_PRICE_LIST_CONDS_LEASE.LEASE_ORGANIZATION"/>
        <bm:field name="lease_org_unit" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORG_UNIT" prompt="HLS_PRICE_LIST_CONDS_LEASE.LEASE_ORG_UNIT"/>
        <bm:field name="lease_organization_description" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false"/>
        <bm:field name="lease_org_unit_description" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select hc.*,
       ho.organization_name  lease_organization_description,
       eov.DESCRIPTION lease_org_unit_description
  from hls_price_list_conds_lease hc
  left join hls_car_organization ho
    on hc.lease_organization = ho.organization_code
  left join exp_org_unit_vl eov
    on hc.lease_org_unit = eov.UNIT_ID
    where hc.price_list=${@price_list}
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="conds_lease_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="price_list" queryExpression="t1.price_list like ${@price_list}"/>
    </bm:query-fields>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="条件值定义重复"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
