/*根据时间,单位,报表类型,所属报表,得到一张报表*/
/*孙中元  2008.3.16*/
CREATE or REPLACE PROCEDURE CWFX_GETRPTBYFinanceID
(
         RPTTIME in date,   /*报表时间*/
         FinanceID in varchar2, /*报表单位*/
         RPTTYPE   in int,   /*报表类型*/
         RPTMu   in int    /*所属报表(指的是什么报表,例如资产负债表)*/
)
as
begin
 
  
       if RPTMu=0
       then
            SELECT * FROM Cwfx_Report_BalanceSheet where FinanceId=FinanceID and
             RPTTIME=RptDate  and RptTypeId=RPTTYPE;
      
       
       Elsif RPTMu=1
       then
            SELECT * FROM Cwfx_Report_CashFlowSheet where FinanceId=FinanceID and
             RPTTIME=RptDate and  RptTypeId=RPTTYPE;
      
       
       Elsif RPTMu=2
       then
            SELECT * FROM Cwfx_Report_ProfitsSheet where FinanceId=FinanceID and
             RPTTIME=RptDate and RptTypeId=RPTTYPE;
      
end