CREATE OR REPLACE FORCE VIEW "OASYS"."CALCULATE_VIEW" ("CLF", "HYF", "JTF", "YSF", "ZDF", "YJF", "BGF", "LWF", "ZXF", "CLYXF", "PXFF", "SDF", "QNF", "WYGLF", "BGSBGZ", "WHF", "WTYWF", "QTZCGZ", "CGF", "BOOKGZ", "QITA", "ID") AS SELECT SUM(TOTALL.clf), SUM(TOTALL.hyf), SUM(TOTALL.jtf), SUM(TOTALL.ysf), SUM(TOTALL.zdf), SUM(TOTALL.yjf), SUM(TOTALL.bgf), SUM(TOTALL.lwf), SUM(TOTALL.zxf), SUM(TOTALL.clyxf), SUM(TOTALL.pxff), SUM(TOTALL.sdf), SUM(TOTALL.qnf), SUM(TOTALL.wyglf), SUM(TOTALL.bgsbgz), SUM(TOTALL.whf), SUM(TOTALL.wtywf), SUM(TOTALL.qtzcgz), SUM(TOTALL.cgf), SUM(TOTALL.bookgz), SUM(TOTALL.qita), TOTALL.id FROM ( SELECT SUM(0) as clf , /*差旅费*/ SUM(rcfybx.F_HYF) AS hyf , /*会议费*/ SUM(rcfybx.F_JTF) AS jtf , /*交通费*/ SUM(rcfybx.F_YSF) AS ysf , /*印刷费*/ SUM(rcfybx.F_ZDF) AS zdf , /*招待费*/ SUM(rcfybx.F_YJF) AS yjf , /*邮电费*/ SUM(rcfybx.F_BGF) AS bgf , /*办公费*/ SUM(rcfybx.F_LWF) AS lwf , /*劳务费*/ SUM(rcfybx.F_ZXF) AS zxf , /*咨询费*/ SUM(rcfybx.F_CLYXF) AS clyxf , /*车辆运行费*/ SUM(rcfybx.F_PXF) AS pxff, /*培训费*/ SUM(rcfybx.F_SF) AS sdf, /*水电费*/ SUM(rcfybx.F_QNF) AS qnf, /*取暖费*/ SUM(rcfybx.F_WYGLF) AS wyglf , /*物业管理费*/ SUM(rcfybx.F_BGSBJ) AS bgsbgz , /*办公设备购置*/ SUM(rcfybx.F_WHF) AS whf, /*维护费*/ SUM(rcfybx.F_WTYWF) AS wtywf, /*委托业务费*/ SUM(rcfybx.F_QTZCGZ) AS qtzcgz , /*其他资产购置*/ SUM(rcfybx.F_CGF) AS cgf, /*出国费*/ SUM(rcfybx.F_TSGZ) AS bookgz , /*图书购置*/ SUM(rcfybx.F_QTZBXJ) AS qita, /*其他*/ rcfybx.F_YSID AS id /*预算ID */ FROM T_APP_JFBX_RCFYBX rcfybx where rcfybx.FID IN(SELECT SDATA1 FROM SA_Task task GROUP BY SDATA1 HAVING count(SDATA1)>=3 ) GROUP BY rcfybx.F_YSID UNION ALL /*公务卡报销明细凭单(T_APP_JFBX_GWK_KT)*/ SELECT SUM(0) AS clf , /*差旅费*/ SUM(gwk.F_HY) AS hyf , /*会议费*/ SUM(gwk.F_JT) AS jtf , /*交通费*/ SUM(gwk.F_YS) AS ysf , /*印刷费*/ SUM(gwk.F_ZDF) AS zdf , /*招待费*/ SUM(gwk.F_YJ) AS yjf , /*邮电费*/ SUM(gwk.F_BGF) AS bgf , /*办公费*/ SUM(0) AS lwf , /*劳务费*/ SUM(0) AS zxf , /*咨询费*/ SUM(0) AS clyxf , /*车辆运行费*/ SUM(0) AS pxff, /*培训费*/ SUM(gwk.F_SDF) AS sdf, /*水电费*/ SUM(gwk.F_QNF) AS qnf, /*取暖费*/ SUM(gwk.F_WYGLF) AS wyglf , /*物业管理费*/ SUM(gwk.F_BGYP) AS bgsbgz , /*办公设备购置*/ SUM(gwk.F_WHF) AS whf, /*维护费*/ SUM(gwk.F_WTYW) AS wtywf, /*委托业务费*/ SUM(gwk.F_QTZCGZ) AS qtzcgz , /*其他资产购置*/ SUM(gwk.F_CGF) AS cgf, /*出国费*/ SUM(gwk.F_TSGZ) AS bookgz , /*图书购置*/ SUM(gwk.F_QT) AS qita, /*其他*/ gwk.F_YSID AS id /*预算ID*/ FROM T_APP_JFBX_GWK_KT gwk where gwk.FID IN(SELECT SDATA1 FROM SA_Task task GROUP BY SDATA1 HAVING count(SDATA1)>=3 ) GROUP BY gwk.F_YSID UNION ALL /*差旅费报销单(T_APP_JFBX_CWBXFORXM_CLF)*/ SELECT SUM(clff.F_BXZE) AS clf , /*差旅费*/ SUM(0) AS hyf , /*会议费*/ SUM(0) AS jtf , /*交通费*/ SUM(0) AS ysf , /*印刷费*/ SUM(0) AS zdf , /*招待费*/ SUM(0) AS yjf , /*邮电费*/ SUM(0) AS bgf , /*办公费*/ SUM(0) AS lwf , /*劳务费*/ SUM(0) AS zxf , /*咨询费*/ SUM(0) AS clyxf , /*车辆运行费*/ SUM(0) AS pxff, /*培训费*/ SUM(0) AS sdf, /*水电费*/ SUM(0) AS qnf, /*取暖费*/ SUM(0) AS wyglf , /*物业管理费*/ SUM(0) AS bgsbgz , /*办公设备购置*/ SUM(0) AS whf, /*维护费*/ SUM(0) AS wtywf, /*委托业务费*/ SUM(0) AS qtzcgz , /*其他资产购置*/ SUM(0) AS cgf, /*出国费*/ SUM(0) AS bookgz , /*图书购置*/ SUM(0) AS qita, /*其他*/ clff.F_YSID AS id /*预算ID */ FROM T_APP_JFBX_CWBXFORXM_CLF clff where clff.FID IN(SELECT SDATA1 FROM SA_Task task GROUP BY SDATA1 HAVING count(SDATA1)>=3 ) GROUP BY clff.F_YSID UNION ALL /*借款单(T_APP_JFBX_JKD)*/ /*支票转账申请单(T_APP_JFBX_ZPZZ)*/ SELECT SUM(0) AS clf , /*差旅费*/ SUM(0) AS hyf , /*会议费*/ SUM(0) AS jtf , /*交通费*/ SUM(0) AS ysf , /*印刷费*/ SUM(0) AS zdf , /*招待费*/ SUM(0) AS yjf , /*邮电费*/ SUM(0) AS bgf , /*办公费*/ SUM(0) AS lwf , /*劳务费*/ SUM(0) AS zxf , /*咨询费*/ SUM(0) AS clyxf , /*车辆运行费*/ SUM(0) AS pxff, /*培训费*/ SUM(0) AS sdf, /*水电费*/ SUM(0) AS qnf, /*取暖费*/ SUM(0) AS wyglf , /*物业管理费*/ SUM(0) AS bgsbgz , /*办公设备购置*/ SUM(0) AS whf, /*维护费*/ SUM(0) AS wtywf, /*委托业务费*/ SUM(0) AS qtzcgz , /*其他资产购置*/ SUM(0) AS cgf, /*出国费*/ SUM(0) AS bookgz , /*图书购置*/ SUM(zpzz.F_HJNUM) AS qita, /*其他*/ zpzz.F_YSID AS id /*预算ID*/ FROM T_APP_JFBX_ZPZZ zpzz where zpzz.FID IN(SELECT SDATA1 FROM SA_Task task GROUP BY SDATA1 HAVING count(SDATA1)>=3 ) GROUP BY zpzz.F_YSID UNION ALL SELECT SUM(0) AS clf , /*差旅费*/ SUM(0) AS hyf , /*会议费*/ SUM(0) AS jtf , /*交通费*/ SUM(0) AS ysf , /*印刷费*/ SUM(0) AS zdf , /*招待费*/ SUM(0) AS yjf , /*邮电费*/ SUM(0) AS bgf , /*办公费*/ SUM(0) AS lwf , /*劳务费*/ SUM(0) AS zxf , /*咨询费*/ SUM(0) AS clyxf , /*车辆运行费*/ SUM(0) AS pxff, /*培训费*/ SUM(0) AS sdf, /*水电费*/ SUM(0) AS qnf, /*取暖费*/ SUM(0) AS wyglf , /*物业管理费*/ SUM(0) AS bgsbgz , /*办公设备购置*/ SUM(0) AS whf, /*维护费*/ SUM(0) AS wtywf, /*委托业务费*/ SUM(0) AS qtzcgz , /*其他资产购置*/ SUM(0) AS cgf, /*出国费*/ SUM(0) AS bookgz , /*图书购置*/ SUM(jkd.F_JKJE) AS qita, /*其他*/ jkd.F_YSID AS id /*预算ID*/ FROM T_APP_JFBX_JKD jkd where jkd.FID IN(SELECT SDATA1 FROM SA_Task task GROUP BY SDATA1 HAVING count(SDATA1)>=3 ) GROUP BY jkd.F_YSID ) TOTALL GROUP BY TOTALL.id