<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-6-3 上午11:41:02  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:parameters>
                <!-- <bm:parameter  name="fin_statement_templet_id" inputPath=""  input="true" dataType="java.lang.Long"   /> -->
                <!-- <bm:parameter  name="bp_id" input="true" inputPath=""  dataType="java.lang.Long"   /> --><![CDATA[
        
        
        ]]></bm:parameters>
            <bm:query-sql><![CDATA[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(${/model/get_tenant_id/record/@fin_statement_templet_id}, ${/session/@company_id},${/model/get_tenant_id/record/@bp_id}, 1)
 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(${/model/get_tenant_id/record/@fin_statement_templet_id}, ${/session/@company_id},${/model/get_tenant_id/record/@bp_id}, 2)
  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(${/model/get_tenant_id/record/@fin_statement_templet_id}, ${/session/@company_id},${/model/get_tenant_id/record/@bp_id}, 3)
  union all
  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(${/model/get_tenant_id/record/@fin_statement_templet_id}, ${/session/@company_id},${/model/get_tenant_id/record/@bp_id}, 4)            
        
 ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
