<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng  
    $Date: 2017-8-2 上午11:06:31  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HN_EXPENSES_APP" defaultOrderBy="t1.expenses_id desc">
    <bm:fields>
        <bm:field name="expenses_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXPENSES_ID" prompt="HN_EXPENSES_APP.EXPENSES_ID"/>
        <bm:field name="expenses_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPENSES_NUMBER" prompt="HN_EXPENSES_APP.EXPENSES_NUMBER"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="HN_EXPENSES_APP.DOCUMENT_CATEGORY"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="HN_EXPENSES_APP.DOCUMENT_TYPE"/>
        <bm:field name="fund_use" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUND_USE" prompt="HN_EXPENSES_APP.FUND_USE"/>
        <bm:field name="expenses_date" databaseType="DATE" datatype="java.util.Date" physicalName="EXPENSES_DATE" prompt="HN_EXPENSES_APP.EXPENSES_DATE"/>
        <bm:field name="expenses_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXPENSES_AMOUNT" prompt="HN_EXPENSES_APP.EXPENSES_AMOUNT"/>
        <bm:field name="drawee_bp_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DRAWEE_BP_ID" prompt="HN_EXPENSES_APP.DRAWEE_BP_ID"/>
        <bm:field name="drawee_bp_bank" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DRAWEE_BP_BANK" prompt="HN_EXPENSES_APP.DRAWEE_BP_BANK"/>
        <bm:field name="drawee_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DRAWEE_BP_BANK_ACCOUNT" prompt="HN_EXPENSES_APP.DRAWEE_BP_BANK_ACCOUNT"/>
        <bm:field name="payee_bp_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE_BP_ID" prompt="HN_EXPENSES_APP.PAYEE_BP_ID"/>
        <bm:field name="payee_bp_bank" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE_BP_BANK" prompt="HN_EXPENSES_APP.PAYEE_BP_BANK"/>
        <bm:field name="payee_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE_BP_BANK_ACCOUNT" prompt="HN_EXPENSES_APP.PAYEE_BP_BANK_ACCOUNT"/>
        <bm:field name="settlement_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SETTLEMENT_METHOD" prompt="HN_EXPENSES_APP.SETTLEMENT_METHOD"/>
        <bm:field name="wfl_instance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WFL_INSTANCE_ID" prompt="HN_EXPENSES_APP.WFL_INSTANCE_ID"/>
        <bm:field name="wfl_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WFL_STATUS" prompt="HN_EXPENSES_APP.WFL_STATUS"/>
        <bm:field name="request_date" databaseType="DATE" datatype="java.util.Date" physicalName="REQUEST_DATE" prompt="HN_EXPENSES_APP.REQUEST_DATE"/>
        <bm:field name="approval_date" databaseType="DATE" datatype="java.util.Date" physicalName="APPROVAL_DATE" prompt="HN_EXPENSES_APP.APPROVAL_DATE"/>
        <bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID" prompt="HN_EXPENSES_APP.OWNER_USER_ID"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="HN_EXPENSES_APP.NOTE"/>
        <bm:field name="expenses_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="cdd_list_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <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:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="expenses_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="wfl_status" queryOperator="="/>
        <bm:query-field field="expenses_number" queryExpression="t1.expenses_number like ${@expenses_number}"/>
        <bm:query-field field="expenses_name" queryExpression="t1.expenses_name like &apos;%&apos;||${@expenses_name}||&apos;%&apos;"/>
    </bm:query-fields>
    <!--   <bm:data-filters>
        <bm:data-filter expression="((select eeaev.unit_code           from exp_emp_assign_e_v eeaev          where eeaev.user_id = t1.owner_user_id            and eeaev.primary_position_flag = &apos;Y&apos;)            = (select eeaev.unit_code           from exp_emp_assign_e_v eeaev          where eeaev.user_id = ${/session/@user_id}            and eeaev.primary_position_flag = &apos;Y&apos;) or ${/session/@role_id}=1)"/>
    </bm:data-filters> -->
</bm:model>
