<?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
                    'rnum' column_name,
                    '序号' field_description,
                    50 field_width ,
                    'left' column_align
                FROM
                    dual
                UNION ALL
                SELECT
                    'indicator_type_desc' column_name,
                    '指标类型' field_description,
                    100 field_width ,
                    'left' column_align
                FROM
                    dual
                UNION ALL
                SELECT
                    'indicator_name' column_name,
                    '指标名称' field_description,
                    150 field_width ,
                    'left' column_align
                FROM
                    dual
               
                UNION ALL
                select   'first_year_value' column_name,
               fiscal_year || '年' || fiscal_month || '月' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 1)

union all          
select 'second_year_value' column_name,
               fiscal_year || '年' || fiscal_month || '月' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id  = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 2) 
union all 
select    'second_year_change_rate' column_name,
               '变化率' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 2)          
          
union all
select 'third_year_value' column_name,
               fiscal_year || '年' || fiscal_month || '月' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id  = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 3) 
union all 
select    'third_year_change_rate' column_name,
               '变化率' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 3)          
union all 
select 'fourth_year_value'  column_name,
               fiscal_year || '年' || fiscal_month || '月' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id  = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 4) 
union all 
select    'fourth_year_change_rate' column_name,
               '变化率' field_description,
               100 field_width,
               'right' column_align
          from rsc_fin_indicator_hds t
         where t.fin_statement_id = rsc_fin_statement_prj_pkg.get_fin_statement_id(${@fin_statement_templet_id}, ${/session/@company_id}, ${@bp_id}, 4)                                                                                                                                                                
                UNION ALL
                SELECT
                    'reference_results' column_name,
                    '参考结果' field_description,
                    100 field_width ,
                    'left' column_align
                FROM
                    dual
                UNION ALL
                SELECT
                    'description' column_name,
                    '备注' field_description,
                    150 field_width ,
                    'left' column_align
                FROM
                    dual    
            ]]></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>
