<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Icon  
    $Date: 2014-10-10 下午3:42:39  
    $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_FINANCIAL">
    <bm:fields>
        <bm:field name="conds_fin_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONDS_FIN_ID" prompt="HLS_PRICE_LIST_CONDS_FINANCIAL.CONDS_FIN_ID"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST" prompt="HLS_PRICE_LIST_CONDS_FINANCIAL.PRICE_LIST"/>
        <bm:field name="financial_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FINANCIAL_CODE" prompt="HLS_PRICE_LIST_CONDS_FINANCIAL.FINANCIAL_CODE"/>
        <bm:field name="code_value_name" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" physicalName="CODE_VALUE_NAME"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk sequenceName="HLS_PRICE_LIST_CONDS_FIN_S"/>
    </bm:features>
    <bm:operations>
        <bm:operation name="query">
            <bm:update-sql><![CDATA[
            select hf.*, scv.code_value_name
  from hls_price_list_conds_financial hf, sys_code_values_v scv
 where hf.financial_code = scv.code_value
   and scv.code = 'HLS_052_FINANCIAL_SCALE'
   and hf.price_list=${@price_list}
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="conds_fin_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>
