<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng  
    $Date: 2017-8-2 上午11:06:02  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HN_INVEST_APP" defaultOrderBy="t1.INVEST_ID desc">
    <bm:fields>
        <bm:field name="invest_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVEST_ID" prompt="HN_INVEST_APP.INVEST_ID"/>
        <bm:field name="invest_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVEST_NUMBER" prompt="HN_INVEST_APP.INVEST_NUMBER"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="HN_INVEST_APP.DOCUMENT_CATEGORY"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="HN_INVEST_APP.DOCUMENT_TYPE"/>
        <bm:field name="transaction_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACTION_TYPE" prompt="HN_INVEST_APP.TRANSACTION_TYPE"/>
        <bm:field name="transaction_direction" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACTION_DIRECTION" prompt="HN_INVEST_APP.TRANSACTION_DIRECTION"/>
        <bm:field name="amount_quantity" databaseType="NUMBER" datatype="java.lang.Double" physicalName="AMOUNT_QUANTITY" prompt="HN_INVEST_APP.AMOUNT_QUANTITY"/>
        <bm:field name="investment_advice" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVESTMENT_ADVICE" prompt="HN_INVEST_APP.INVESTMENT_ADVICE"/>
        <bm:field name="fund_use" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUND_USE" prompt="HN_INVEST_APP.FUND_USE"/>
        <bm:field name="expenses_date" databaseType="DATE" datatype="java.util.Date" physicalName="EXPENSES_DATE" prompt="HN_INVEST_APP.EXPENSES_DATE"/>
        <bm:field name="expenses_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXPENSES_AMOUNT" prompt="HN_INVEST_APP.EXPENSES_AMOUNT"/>
        <bm:field name="drawee_bp_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DRAWEE_BP_ID" prompt="HN_INVEST_APP.DRAWEE_BP_ID"/>
        <bm:field name="drawee_bp_bank" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DRAWEE_BP_BANK" prompt="HN_INVEST_APP.DRAWEE_BP_BANK"/>
        <bm:field name="drawee_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DRAWEE_BP_BANK_ACCOUNT" prompt="HN_INVEST_APP.DRAWEE_BP_BANK_ACCOUNT"/>
        <bm:field name="payee_bp_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE_BP_ID" prompt="HN_INVEST_APP.PAYEE_BP_ID"/>
        <bm:field name="payee_bp_bank" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE_BP_BANK" prompt="HN_INVEST_APP.PAYEE_BP_BANK"/>
        <bm:field name="payee_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE_BP_BANK_ACCOUNT" prompt="HN_INVEST_APP.PAYEE_BP_BANK_ACCOUNT"/>
        <bm:field name="settlement_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SETTLEMENT_METHOD" prompt="HN_INVEST_APP.SETTLEMENT_METHOD"/>
        <bm:field name="wfl_instance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WFL_INSTANCE_ID" prompt="HN_INVEST_APP.WFL_INSTANCE_ID"/>
        <bm:field name="wfl_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WFL_STATUS" prompt="HN_INVEST_APP.WFL_STATUS"/>
        <bm:field name="request_date" databaseType="DATE" datatype="java.util.Date" physicalName="REQUEST_DATE" prompt="HN_INVEST_APP.REQUEST_DATE"/>
        <bm:field name="approval_date" databaseType="DATE" datatype="java.util.Date" physicalName="APPROVAL_DATE" prompt="HN_INVEST_APP.APPROVAL_DATE"/>
        <bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID" prompt="HN_INVEST_APP.OWNER_USER_ID"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="HN_INVEST_APP.NOTE"/>
        <bm:field name="invest_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="wfl_status_n" expression="(select v.code_value_name from sys_code_values_v v where v.code  =  &apos;HN_COMMON_WFL_STATUS&apos; and v.code_value = t1.wfl_status)" forInsert="false" forUpdate="false"/>
        <bm:field name="owner_user_id_n" expression="(select su.description           from sys_user su          where su.user_id = t1.owner_user_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="document_type_n" expression="(select hdt.description from hls_document_type hdt where hdt.document_type = t1.document_type and hdt.document_category = t1.document_category)" forInsert="false" forUpdate="false"/>
        <bm:field name="transaction_direction_n" expression="(select v.code_value_name           from sys_code_values_v v          where v.code = &apos;TRANSACTION_DIRECTION&apos;            and v.code_value = t1.transaction_direction)" forInsert="false" forUpdate="false"/>
        <bm:field name="cdd_list_id" databaseType="NUMBER" datatype="java.lang.Long"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="invest_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="invest_number" queryExpression="t1.invest_number like ${@invest_number}"/>
        <bm:query-field name="invest_name" queryExpression="t1.invest_name like ${@invest_name}"/>
        <bm:query-field name="document_type" queryExpression="t1.document_type = ${@document_type}"/>
        <bm:query-field name="wfl_status" queryExpression="t1.wfl_status = ${@wfl_status}"/>
        <bm:query-field name="transaction_direction" queryExpression="t1.transaction_direction = ${@transaction_direction}"/>
    </bm:query-fields>
</bm:model>
