<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Leaf Generator
    $Date: Tue Jul 10 16:14:22 CST 2018  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" alias="t1" baseTable="T_GOODS_BATCH" defaultOrderBy="batch_number desc">
    <bm:fields>
        <bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="T_GOODS_BATCH.BATCH_ID"/>
        <bm:field name="batch_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BATCH_NUMBER" prompt="政策批次号"/>
        <bm:field name="batch_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BATCH_NAME" prompt="批次名称"/>
        <bm:field name="batch_date" databaseType="DATE" datatype="java.util.Date" physicalName="BATCH_DATE" prompt="创建时间"/>
        <bm:field name="date_from" databaseType="DATE" datatype="java.util.Date" physicalName="DATE_FROM" prompt="有效期从"/>
        <bm:field name="date_to" databaseType="DATE" datatype="java.util.Date" physicalName="DATE_TO" prompt="有效期到"/>
        <bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION" prompt="产品线"/>
        <bm:field name="enable_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLE_FLAG" prompt="启用"/>

        <bm:field name="division_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION_N" forceUpdate="false" forInsert="false" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'GOODS_POLICY_DIVISION' and v.code_value = t1.division)"  prompt="产品线"/>
    </bm:fields>
    <bm:features>
        <f:standard-who xmlns:f="leaf.database.features"/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="batch_id"/>
    </bm:primary-key>
</bm:model>