Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r23839 -r23920 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 23839) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 23920) @@ -3678,13 +3678,15 @@ String queryYear = year + "-01-01 00:00:00"; String nextYear = getNextYear(year) + " 00:00:00"; String sql = "select " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm") - + " monthstr, sum(ti.statisticsAmount) from tousseinstance ti, invoice i,invoiceplan ip" - + " where ti.invoice_id = i.id and i.invoiceplan_id = ip.id" - + " and ip.type = '消毒物品申请单' and i.sendTime >= " + + " monthstr, sum(ti.statisticsAmount) from tousseinstance ti, invoice i,invoiceplan ip , TousseDefinition td" + + " where ti.invoice_id = i.id and i.invoiceplan_id = ip.id and ti.tousseDefinition_id=td.id" + //+ " and ip.type = '消毒物品申请单' " //因为消毒物品不只是消毒物品申请单里有,所以这里去掉单类型的条件过滤,在下面一行增加包类型为消毒物品 + + " and td.tousseType='"+ TousseDefinition.PACKAGE_TYPE_DISINFECTION +"' " + + " and i.sendTime >= " + dateQueryAdapter.dateAdapter(queryYear) + " and i.sendTime <= " + dateQueryAdapter.dateAdapter(nextYear) - + " and ti.status = '已发货'" + + " and ti.status = '"+ TousseInstance.STATUS_SHIPPED +"'" + " group by " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm"); ResultSet result = objectDao.executeSql(sql); bean.setRowNum(list.size()+1); @@ -9302,7 +9304,7 @@ String month = year + "-" + monthFormart; String sql = "select sum((case when generalMaterialAmount is null then 0 else generalMaterialAmount end) + (case when operateMaterialAmount is null then 0 else operateMaterialAmount end) + (case when foreignMaterialAmount is null then 0 else foreignMaterialAmount end)) as tousseAmount " - +",sum(case when foreignMaterialAmount is null then 0 else generalMaterialAmount end) as foreignMaterialAmount from WashAndDisinfectRecord w " + +",sum(case when foreignMaterialAmount is null then 0 else foreignMaterialAmount end) as foreignMaterialAmount from WashAndDisinfectRecord w " +" where w.endDate between "+ startDay +" and "+endDay +" and w.orgUnitCoding = '"+querySupplyRoom+"'";