<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2014-1-9 下午03:58:00  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="GLD_3C_BOOK_V">
    <bm:fields>
        <bm:field name="report_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REPORT_ID" prompt="GLD_3C_BOOK_V.REPORT_ID"/>
        <bm:field name="journal_header_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JOURNAL_HEADER_ID" prompt="GLD_3C_BOOK_V.JOURNAL_HEADER_ID"/>
        <bm:field name="journal_line_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JOURNAL_LINE_ID" prompt="GLD_3C_BOOK_V.JOURNAL_LINE_ID"/>
        <bm:field name="line_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LINE_NUMBER" prompt="GLD_3C_BOOK_V.LINE_NUMBER"/>
        <bm:field name="page_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAGE_NUMBER" prompt="GLD_3C_BOOK_V.PAGE_NUMBER"/>
        <bm:field name="parent_account_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PARENT_ACCOUNT_ID" prompt="GLD_3C_BOOK_V.PARENT_ACCOUNT_ID"/>
        <bm:field name="account_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ACCOUNT_ID" prompt="GLD_3C_BOOK_V.ACCOUNT_ID"/>
        <bm:field name="account_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACCOUNT_CODE" prompt="GLD_3C_BOOK_V.ACCOUNT_CODE"/>
        <bm:field name="account_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACCOUNT_DESC" prompt="GLD_3C_BOOK_V.ACCOUNT_DESC"/>
        <bm:field name="journal_date" databaseType="DATE" datatype="java.util.Date" physicalName="JOURNAL_DATE" prompt="GLD_3C_BOOK_V.JOURNAL_DATE"/>
        <bm:field name="journal_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JOURNAL_NUM" prompt="GLD_3C_BOOK_V.JOURNAL_NUM"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="GLD_3C_BOOK_V.DESCRIPTION"/>
        <bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_CODE" prompt="GLD_3C_BOOK_V.CURRENCY_CODE"/>
        <bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select a.currency_name from gld_currency_v a where a.currency_code=t1.currency_code)" physicalName="CURRENCY_DESC"/>
        <bm:field name="amount_dr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="AMOUNT_DR" prompt="GLD_3C_BOOK_V.AMOUNT_DR"/>
        <bm:field name="amount_cr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="AMOUNT_CR" prompt="GLD_3C_BOOK_V.AMOUNT_CR"/>
        <bm:field name="dir" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIR" prompt="GLD_3C_BOOK_V.DIR"/>
        <bm:field name="balance" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BALANCE" prompt="GLD_3C_BOOK_V.BALANCE"/>
        <bm:field name="fuc_dir" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUC_DIR" prompt="GLD_3C_BOOK_V.FUC_DIR"/>
        <bm:field name="amount_fuc_dr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="AMOUNT_FUC_DR" prompt="GLD_3C_BOOK_V.AMOUNT_FUC_DR"/>
        <bm:field name="amount_fuc_cr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="AMOUNT_FUC_CR" prompt="GLD_3C_BOOK_V.AMOUNT_FUC_CR"/>
        <bm:field name="fuc_balance" databaseType="NUMBER" datatype="java.lang.Double" physicalName="FUC_BALANCE" prompt="GLD_3C_BOOK_V.FUC_BALANCE"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="report_id" queryOperator="="/>
        <bm:query-field field="account_id" queryExpression="((t1.parent_account_id is not null and t1.parent_account_id=${@account_id}) or (parent_account_id is null and t1.account_id=${@account_id}))"/>
    </bm:query-fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
</bm:model>
