<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-3-12 下午01:10:46  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:p="uncertain.proc" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                select l.item_desc,
                       l.line_number,
                       l.fin_statement_templet_id,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 1)) amount1,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 2)) amount2,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 3)) amount3,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 4)) amount4,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 5)) amount5,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 6)) amount6,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 7)) amount7,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 8)) amount8,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 9)) amount9,
                       (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 10)) amount10,
                                                                             (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 11)) amount11,
                                                                             (select amount
                          from rsc_fin_statement_prj_lns t
                         where t.line_number = l.line_number
                         and t.fin_statement_item = l.fin_statement_item
                         and t.fin_statement_id =
                               rsc_excel_export_details.get_fin_statement_id(p_session_id => ${/session/@session_id},
                                                                             p_number_id  => 12)) amount12
                  from rsc_fin_statement_tmplt_lns l
                         #WHERE_CLAUSE#
                    ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
