<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-12-17 下午4:50:14  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_PENALTY_PROFILE">
    <bm:fields>
        <bm:field name="penalty_profile" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PENALTY_PROFILE" prompt="CON_PENALTY_PROFILE.PENALTY_PROFILE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="CON_PENALTY_PROFILE.DESCRIPTION"/>
        <bm:field name="grace_period" databaseType="NUMBER" datatype="java.lang.Long" physicalName="GRACE_PERIOD" prompt="CON_PENALTY_PROFILE.GRACE_PERIOD"/>
        <bm:field name="penalty_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PENALTY_RATE" prompt="CON_PENALTY_PROFILE.PENALTY_RATE"/>
        <bm:field name="penalty_calc_base" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PENALTY_CALC_BASE" prompt="CON_PENALTY_PROFILE.PENALTY_CALC_BASE"/>
        <bm:field name="penalty_calc_base_desc" expression="(select code_value_name from sys_code_values_v where code_value = t1.penalty_calc_base and enabled_flag = &apos;Y&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="penalty_total_base_ratio" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PENALTY_TOTAL_BASE_RATIO" prompt="CON_PENALTY_PROFILE.PENALTY_TOTAL_BASE_RATIO"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="CON_PENALTY_PROFILE.ENABLED_FLAG"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="penalty_profile"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="penalty_profile" queryExpression="upper(t1.penalty_profile) like upper(&apos;%&apos;||${@penalty_profile}||&apos;%&apos;)"/>
        <bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
        <bm:query-field field="enabled_flag" queryExpression="t1.enabled_flag = decode(${@enabled_flag},&apos;Y&apos;,&apos;Y&apos;,&apos;N&apos;,&apos;N&apos;,t1.enabled_flag)"/>
    </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>
