Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r17446 -r17455 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 17446) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 17455) @@ -13569,13 +13569,13 @@ + " group by " + dataSql + " , rr.depart " ; // 辅料包也算次日下送率,用当天装配,和是否当天发货算 - String packingDepartSql = " select " + packingDateSql + " packTime, ip.depart depart,count(*) " - + " from TousseInstance ti,TousseDefinition td,invoicePlan ip,PackingRecord pr " - + " where ti.invoicePlanId = ip.id and ti.packingRecord_id=pr.id and ti.tousseDefinition_id = td.id " + String packingDepartSql = " select " + packingDateSql + " packTime, ti.depart depart,count(*) " + + " from TousseInstance ti,TousseDefinition td,PackingRecord pr " + + " where ti.packingRecord_id=pr.id and ti.tousseDefinition_id = td.id " + " and td.tousseType = '" + TousseDefinition.PACKAGE_TYPE_DRESSING + "' " - + " and ip.depart in (" + whereDepart + ") " + + " and ti.depart in (" + whereDepart + ") " + " and (" + dateQueryAdapter.dateAreaSql("pr.packTime", startDay, endDay, false) + ")" - + " group by " + packingDateSql + ", ip.depart "; + + " group by " + packingDateSql + ", ti.depart "; // 器械包分组数量 String recycleTousseGroupSql = " select " + dataSql + " ,tdi.tousseGroupName,sum(tItem.amount) from recyclingRecord rr,TousseItem tItem,TousseDefinition tdi " + " where rr.id = tItem.recyclingRecord_id and tItem.tousseName = tdi.name and tdi.forDisplay = 1 " @@ -13599,10 +13599,10 @@ + " group by " + dataSql ; String packingAmountSql = " select "+ packingDateSql + " packTime,count(*) " - + " from TousseInstance ti,TousseDefinition td,invoicePlan ip,PackingRecord pr where ti.invoicePlanId = ip.id and ti.packingRecord_id=pr.id " + + " from TousseInstance ti,TousseDefinition td,PackingRecord pr where ti.packingRecord_id=pr.id " + " and ti.tousseDefinition_id = td.id " + " and td.tousseType = '" + TousseDefinition.PACKAGE_TYPE_DRESSING + "' " - + " and (ip.depart in (" +whereDepart + ") or td.tousseGroupName in (" + whereTousseGroup + "))" + + " and (ti.depart in (" +whereDepart + ") or td.tousseGroupName in (" + whereTousseGroup + "))" + " and ( " + dateQueryAdapter.dateAreaSql("pr.packTime", startDay, endDay, false) + ")" + " group by " + packingDateSql ; @@ -13631,46 +13631,49 @@ } dataSql = dateQueryAdapter.dateToVarchar1("iv.recyclingTime"); // 获取次日下送数量的sql - String departMorrowSendSql = "select " + dataSql +" day,iv.depart,sum(ii.amount) from Invoice iv,InvoiceItem ii " - + " where iv.id=ii.invoice_id " + String departMorrowSendSql = "select " + dataSql +" day,iv.depart,count(*) from Invoice iv,TousseInstance ti,RecyclingRecord rr " + + " where iv.id=ti.invoice_id and ti.recyclingRecordId=rr.id " + " and " + timeCompareSql + " and iv.depart in (" + whereDepart + ")" + " and ( " + dateQueryAdapter.dateAreaSql("iv.recyclingTime", startDay, endDay, false) + ")" + " group by " + dataSql + " ,iv.depart "; // 装配辅料包的次日下送数-科室 - String departPackingMorrowSendSql = " select " + packingDateSql + " day,iv.depart,count(*) from Invoice iv,TousseInstance ti,PackingRecord pr " - + " where iv.id=ti.invoice_id and ti.packingRecord_id = pr.id " + String departPackingMorrowSendSql = " select " + packingDateSql + " day,iv.depart,count(*) from Invoice iv,TousseInstance ti,TousseDefinition td,PackingRecord pr " + + " where iv.id=ti.invoice_id and ti.packingRecord_id = pr.id and ti.tousseDefinition_id=td.id " + + " and td.tousseType = '" + TousseDefinition.PACKAGE_TYPE_DRESSING + "' " + " and "+ packingTimeCompareSql + " and iv.depart in (" + whereDepart + ")" + " and ( " + dateQueryAdapter.dateAreaSql("pr.packTime", startDay, endDay, false) + ")" + " group by " + packingDateSql +" ,iv.depart"; - String tousseGrouptMorrowSendSql = "select " + dataSql +" day,tdi.tousseGroupName,sum(ii.amount) from Invoice iv,InvoiceItem ii,TousseDefinition tdi " - + " where iv.id=ii.invoice_id and ii.tousseDefinitionId=tdi.id " + String tousseGrouptMorrowSendSql = "select " + dataSql +" day,td.tousseGroupName,count(*) from Invoice iv,TousseInstance ti,RecyclingRecord rr, TousseDefinition td " + + " where iv.id=ti.invoice_id and ti.tousseDefinition_id=td.id and ti.recyclingRecordId=rr.id " + " and " + timeCompareSql - + " and tdi.tousseGroupName in (" + whereTousseGroup + ")" + + " and td.tousseGroupName in (" + whereTousseGroup + ")" + " and ( " + dateQueryAdapter.dateAreaSql("iv.recyclingTime", startDay, endDay, false) + ")" - + " group by " + dataSql + " ,tdi.tousseGroupName "; + + " group by " + dataSql + " ,td.tousseGroupName "; // 装配辅料包的次日下送数-器械包分组 String tousseGrouptPackingMorrowSendSql = " select " + packingDateSql + " day,td.tousseGroupName,count(*) from Invoice iv,TousseInstance ti,TousseDefinition td,PackingRecord pr " + " where iv.id=ti.invoice_id and ti.packingRecord_id = pr.id and ti.tousseDefinition_id=td.id " + + " and td.tousseType = '" + TousseDefinition.PACKAGE_TYPE_DRESSING + "' " + " and "+ packingTimeCompareSql + " and td.tousseGroupName in (" + whereTousseGroup + ")" + " and ( " + dateQueryAdapter.dateAreaSql("pr.packTime", startDay, endDay, false) + ")" + " group by " + packingDateSql +" ,td.tousseGroupName"; - String totalMorrowSendSql = "select " + dataSql +" day,sum(ii.amount) from Invoice iv,InvoiceItem ii,TousseDefinition tdi " - + " where iv.id=ii.invoice_id and ii.tousseDefinitionId=tdi.id " + String totalMorrowSendSql = "select " + dataSql +" day,count(*) from Invoice iv,TousseInstance ti,RecyclingRecord rr, TousseDefinition td " + + " where iv.id=ti.invoice_id and ti.tousseDefinition_id=td.id and ti.recyclingRecordId=rr.id " + " and " + timeCompareSql - + " and ( iv.depart in (" + whereDepart + ") or tdi.tousseGroupName in (" + whereTousseGroup + ") ) " + + " and ( iv.depart in (" + whereDepart + ") or td.tousseGroupName in (" + whereTousseGroup + ") ) " + " and ( " + dateQueryAdapter.dateAreaSql("iv.recyclingTime", startDay, endDay, false) + ")" + " group by " + dataSql ; // 装配辅料包的次日下送数-科室和器械包分组总数 String totalPackingMorrowSendSql = " select " + packingDateSql + " day,count(*) from Invoice iv,TousseInstance ti,TousseDefinition td,PackingRecord pr " + " where iv.id=ti.invoice_id and ti.packingRecord_id = pr.id and ti.tousseDefinition_id=td.id " + + " and td.tousseType = '" + TousseDefinition.PACKAGE_TYPE_DRESSING + "' " + " and "+ packingTimeCompareSql + " and ( iv.depart in (" + whereDepart + ") or td.tousseGroupName in (" + whereTousseGroup + ") ) " + " and ( " + dateQueryAdapter.dateAreaSql("pr.packTime", startDay, endDay, false) + ")"