<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng  
    $Date: 2017-10-30 下午2:08:59  
    $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="HN_PRJ_PAYMENT_CON_TYPE">
    <bm:fields>
        <bm:field name="type_record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TYPE_RECORD_ID" prompt="HN_PRJ_PAYMENT_CON_TYPE.TYPE_RECORD_ID"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID" prompt="HN_PRJ_PAYMENT_CON_TYPE.PROJECT_ID"/>
        <bm:field name="record_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RECORD_TYPE" prompt="HN_PRJ_PAYMENT_CON_TYPE.RECORD_TYPE"/>
        <bm:field name="record_type_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = &apos;PAYMENT_CON_HD_TYPE&apos; and v.code_value = t1.record_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="data_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DATA_CLASS" prompt="HN_PRJ_PAYMENT_CON_TYPE.DATA_CLASS"/>
        <bm:field name="version" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VERSION" prompt="HN_PRJ_PAYMENT_CON_TYPE.VERSION"/>
        <bm:field name="version_dispaly" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VERSION_DISPALY" prompt="HN_PRJ_PAYMENT_CON_TYPE.VERSION_DISPALY"/>
        <bm:field name="owner_id" expression="t1.created_by" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="type_record_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter name="1" expression="t1.project_id = ${@project_id} and data_class=&apos;NORMAL&apos;"/>
    </bm:data-filters>
    <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>
