Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r32937 -r32951 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 32937) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 32951) @@ -23813,10 +23813,11 @@ dateQueryAdapter.dateAdapter(startDate), dateQueryAdapter.dateAdapter(endDate)); String sql = String.format("select a.eventName,a.timeoutHandType,count(*) eventCount " - + " from %s a where a.eventTime %s " + + " from %s a join %s ip on ip.id=a.recyclingApplication_ID where ip.applicationTime %s " + " and eventCode='%s' " + " group by a.eventName,a.timeoutHandType order by a.eventName ,a.timeoutHandType", AdverseEventRecord.class.getSimpleName(), + InvoicePlan.class.getSimpleName(), betweenSql, eventCode); int invoicePlanCount = objectDao.countBySql("select count(*) from InvoicePlan ip " @@ -23875,23 +23876,22 @@ String betweenSql = String.format(" between %s and %s ", dateQueryAdapter.dateAdapter(startDate), dateQueryAdapter.dateAdapter(endDate)); - String sql = String.format("select a.eventName,count(*) eventCount,(select count(*) from " - + " %s ip where ip.recyclingStatus is not null and ip.applicationTime %s " - + " ) invoicePlanCount " - + " from %s a where a.eventTime %s " + String sql = String.format("select a.eventName,count(*) eventCount " + + " from %s a join %s ip on ip.id=a.recyclingApplication_ID where ip.applicationTime %s " + " and eventCode='%s' " + " group by a.eventName order by a.eventName", + AdverseEventRecord.class.getSimpleName(), InvoicePlan.class.getSimpleName(), betweenSql, - AdverseEventRecord.class.getSimpleName(), - betweenSql, eventCode); + int invoicePlanCount = objectDao.countBySql("select count(*) from InvoicePlan ip " + + "where ip.type='"+ InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION +"' and ip.recyclingStatus is not null and ip.applicationTime " + + betweenSql); rs = objectDao.executeSql(sql); while (rs.next()) { AdverseEventRecordReportVo adverseEventRecordReportVo = new AdverseEventRecordReportVo(); String eventName = rs.getString("eventName"); int eventCount = rs.getInt("eventCount"); - int invoicePlanCount = rs.getInt("invoicePlanCount"); adverseEventRecordReportVo.setEventCount(eventCount); String rate = "0.0%";