<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-6-3 下午02:00:20  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="RSC_FIN_STATEMENT_PRJ_HDS_V">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
	    		select t1.* from 
	    		(select v.fin_statement_id,
			       l.item_desc,
			       l.line_number,
			       v.fin_statement_templet_id,
			       v.fin_statement_templet_code,
			       v.fin_statement_templet_name,
			       v.fin_statement_type,
			       v.fin_statement_item,
			       v.fiscal_year,
			       v.fiscal_month,
			       v.fiscal_year||'年'||v.fiscal_month||'月' fiscal_date,
			       v.amount,
			       v.amount_adj,
			       v.amount_after_adj,
			       v.description,
			       v.audit_inf,
			       l.item_type
			  from rsc_fin_statement_prj_lns_v v,rsc_fin_statement_tmplt_lns l
			  where  v.fin_statement_templet_id=l.fin_statement_templet_id
			  and v.line_number=l.line_number
			  and v.fin_statement_item=l.fin_statement_item
			  order by v.fin_statement_type ,v.line_number asc)t1
			  #WHERE_CLAUSE#
		  ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="fin_statement_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FIN_STATEMENT_ID" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FIN_STATEMENT_ID"/>
        <bm:field name="fin_statement_templet_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FIN_STATEMENT_TEMPLET_ID" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FIN_STATEMENT_TEMPLET_ID"/>
        <bm:field name="fin_statement_templet_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIN_STATEMENT_TEMPLET_CODE" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FIN_STATEMENT_TEMPLET_CODE"/>
        <bm:field name="fin_statement_templet_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIN_STATEMENT_TEMPLET_NAME" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FIN_STATEMENT_TEMPLET_NAME"/>
        <bm:field name="fin_statement_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIN_STATEMENT_TYPE" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FIN_STATEMENT_TYPE"/>
        <bm:field name="amount" databaseType="Double" datatype="java.lang.Double" physicalName="AMOUNT" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.AMOUNT"/>
        <bm:field name="fin_statement_item" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIN_STATEMENT_ITEM" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FIN_STATEMENT_ITEM"/>
        <bm:field name="line_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LINE_NUMBER" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.LINE_NUMBER"/>
        <bm:field name="fiscal_year" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FISCAL_YEAR" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FISCAL_YEAR"/>
        <bm:field name="fiscal_month" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FISCAL_MONTH" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.FISCAL_MONTH"/>
        <bm:field name="fiscal_date" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="amount_adj" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_ADJ" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.AMOUNT_ADJ"/>
        <bm:field name="amount_after_adj" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_AFTER_ADJ" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.AMOUNT_AFTER_ADJ"/>
        <bm:field name="item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ITEM_DESC" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.ITEM_DESC"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="RSC_FIN_STATEMENT_PRJ_LNS_V.DESCRIPTION"/>
        <bm:field name="audit_inf" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="item_type" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field field="fin_statement_templet_id" queryOperator="="/>
        <bm:query-field field="fin_statement_type" queryOperator="="/>
        <bm:query-field field="fin_statement_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
