Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r24671 -r24728 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 24671) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 24728) @@ -12366,12 +12366,12 @@ sql += String.format("select 'wash-material' as type,ti.tousseName,sum(ti.tousseAmount),ti.tousseType from (" + "select td.name as tousseName,ci.amount as tousseAmount,td.tousseType as tousseType," + "case when (cb.personInCharge is null or cb.personInCharge = '') then wdr.operator else cb.personInCharge end userName " - + "from WashAndDisinfectRecord wdr,ClassifyBasket_WashRecord cw,ClassifyBasket cb,ClassifiedItem ci,tousseDefinition td,materialInstance ms " - + "where wdr.id = cw.WashAndDisinfectRecord_ID and cw.ClassifyBasket_ID = cb.id and cb.id = ci.classifybasket_id and ci.toussedefinition_id=ms.tousse_id " - + " and ci.materialdefinition_id=ms.materialDefinition_id and td.id = ms.tousse_id and ci.itemType = '"+ MaterialDefinition.TYPE_NAME +"' " + + "from WashAndDisinfectRecord wdr,ClassifyBasket_WashRecord cw,ClassifyBasket cb,ClassifiedItem ci,tousseDefinition td " + + "where wdr.id = cw.WashAndDisinfectRecord_ID and cw.ClassifyBasket_ID = cb.id and cb.id = ci.classifybasket_id " + + " and ci.itemType = '"+ MaterialDefinition.TYPE_NAME +"' " + " %s %s %s and wdr.orgUnitCoding = '%s' and wdr.endDate between %s and %s and wdr.washMaterialAmount<>0 " + " union all " - + "select ci.tousseNameForMaterial as tousseName,ci.amount as tousseAmount,td.tousseType as tousseType," + + "select ci.name as tousseName,ci.amount as tousseAmount,td.tousseType as tousseType," + "case when (cb.personInCharge is null or cb.personInCharge = '') then wdr.operator else cb.personInCharge end userName " + "from WashAndDisinfectRecord wdr,ClassifyBasket_WashRecord cw,ClassifyBasket cb,ClassifiedItem ci,tousseDefinition td " + "where wdr.id = cw.WashAndDisinfectRecord_ID and cw.ClassifyBasket_ID = cb.id and cb.id = ci.classifybasket_id and ci.tousseDefinitionID=td.id and ci.itemType = '"+ TousseDefinition.PACKAGE_TYPE_INSIDE +"' " @@ -12386,7 +12386,7 @@ sql += String.format("select 'packing' as type,ti.name tousseName,sum(pr.amount),ti.tousseType from PackingRecord pr,TousseDefinition ti " +" where pr.tousseDefinitionId=ti.id %s %s %s and pr.orgUnitCoding = '%s' and pr.packTime between %s and %s " + "%s %s group by ti.tousseType,ti.name ", - isDisableIDCardSql,taskGroupSql,tousseGroupSql, + isDisableIDCardSql,String.format(" and ti.taskGroup='%s' ", taskGroup),tousseGroupSql, departCoding,startDateSql,endDateSql,getAndSql("pr.packer", operator),tousseTypeSql); //审核数量(按包统计) @@ -12395,7 +12395,7 @@ +" where t.tousseDefinition_id=ti.id %s %s %s and t.orgUnitCoding = '%s' and t.reviewTime between %s and %s and t.foreignTousseApp_id is null " + "and (ti.statisticsReviewWorkload='%s' or ti.statisticsReviewWorkload is null or ti.statisticsReviewWorkload='') and ti.isReview='%s' " + "%s %s group by ti.tousseType,t.tousseName ", - isDisableIDCardSql,taskGroupSql,tousseGroupSql, + isDisableIDCardSql,String.format(" and ti.taskGroup='%s' ", taskGroup),tousseGroupSql, departCoding,startDateSql,endDateSql,Constants.STR_YES,Constants.STR_YES,getAndSql("t.reviewer", operator),tousseTypeSql); if (includeForeignTousse) { @@ -12413,7 +12413,7 @@ +" where sr.id = st.sterilizationRecord_id and st.tousseInstance_id = tis.id and tis.tousseDefinition_id=ti.id " +" %s %s %s and sr.orgUnitCoding = '%s' and sr.endDate between %s and %s and tis.foreignTousseApp_id is null " + "%s %s group by ti.tousseType,tis.tousseName ", - isDisableIDCardSql,taskGroupSql,tousseGroupSql, + isDisableIDCardSql,String.format(" and ti.taskGroup='%s' ", taskGroup),tousseGroupSql, departCoding,startDateSql,endDateSql,getAndSql("sr.sterilizationUser", operator),tousseTypeSql); if (includeForeignTousse) { sql += " union all "; @@ -12430,7 +12430,7 @@ +" where sr.id = sre.sterilizationRecord_id and sre.reviewedBasket_id = rb.id and rb.id = tis.reviewBasket_ID and tis.tousseDefinition_id=ti.id " +" %s %s %s and sr.orgUnitCoding = '%s' and sr.endDate between %s and %s and tis.foreignTousseApp_id is null " + "%s %s group by ti.tousseType,tis.tousseName", - isDisableIDCardSql,taskGroupSql,tousseGroupSql, + isDisableIDCardSql,String.format(" and ti.taskGroup='%s' ", taskGroup),tousseGroupSql, departCoding,startDateSql,endDateSql,getAndSql("sr.sterilizationUser", operator),tousseTypeSql); if (includeForeignTousse) { sql += " union all "; @@ -12466,7 +12466,7 @@ sql += String.format("select 'signed' as type,tis.tousseName,count(*),ti.tousseType from TousseInstance tis,TousseDefinition ti " +" where tis.tousseDefinition_id=ti.id %s %s %s and tis.orgUnitCoding = '%s' and %s between %s and %s and tis.foreignTousseApp_id is null " + "%s %s group by ti.tousseType,tis.tousseName ", - isDisableIDCardSql,taskGroupSql,tousseGroupSql, + isDisableIDCardSql,String.format(" and ti.taskGroup='%s' ", taskGroup),tousseGroupSql, departCoding,signedTimeString,startDateSql,endDateSql,getAndSql("tis.signedUser", operator),tousseTypeSql); if (includeForeignTousse) { sql += " union all "; @@ -12479,7 +12479,7 @@ Map> typeOfChild = new HashMap>(); GoodsOption option = goodsOptionManager.getGoodsOption(GoodsOption.MODEL_TOUSSEWORKLOAD, departCoding); - + logger.debug("getTousseWorkLoadData sql...=" + sql); ResultSet result = objectDao.executeSql(sql); try { //若用户自定义了需要查询的器械包,则根据自定义查询,否则查全部的器械包