<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-7-24 下午7:36:34  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                 select t.fiscal_year || '年' || t.fiscal_month || '月' fiscal_year,
       'fourth_year' as year,
       t.audit_inf, 
        'N' as  flag     
   from rsc_fin_statement_prj_hds t
  where t.fin_statement_id =
        rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${/parameter/@bp_id}, 4)
 union all
 select t.fiscal_year || '年' || t.fiscal_month || '月' fiscal_year,
       'third_year' as year,
       t.audit_inf,
        'N' as  flag     
   from rsc_fin_statement_prj_hds t
  where t.fin_statement_id =
        rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${/parameter/@bp_id}, 3)
  union all
  select t.fiscal_year || '年' || t.fiscal_month || '月' fiscal_year,
       'second_year' as year,
       t.audit_inf,
        'N' as  flag     
   from rsc_fin_statement_prj_hds t
  where t.fin_statement_id =
        rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${/parameter/@bp_id}, 2)
  union all
  select t.fiscal_year || '年' || t.fiscal_month || '月' fiscal_year,
       'first_year' as year,
       t.audit_inf,
        'Y' as  flag     
   from rsc_fin_statement_prj_hds t
  where t.fin_statement_id =
        rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${/parameter/@bp_id}, 1)            
        
 
 
               
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <!-- <bm:fields>
        <bm:field name="column_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COLUMN_NAME"/>
        <bm:field name="field_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIELD_DESCRIPTION"/>
        <bm:field name="field_width" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FIELD_WIDTH"/>
        <bm:field name="column_align" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COLUMN_ALIGN"/>
    </bm:fields> -->
</bm:model>
