Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java =================================================================== diff -u -r14443 -r14450 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 14443) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 14450) @@ -821,9 +821,9 @@ //如果物品类型不为空时 if (StringUtils.isNotBlank(tousseType)) { if(TousseItem.DIPOSABLE_YES.equals(tousseType)){ - where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and amount - sendOutAmount > 0 and tousseType = '%s')",TousseItem.TYPE_DIPOSABLE_GOODS); + where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and (amount - sendOutAmount > 0) and tousseType = '%s')",TousseItem.TYPE_DIPOSABLE_GOODS); }else if(TousseItem.DIPOSABLE_NO.equals(tousseType)){ - where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and amount - sendOutAmount > 0 and tousseType != '%s')",TousseItem.TYPE_DIPOSABLE_GOODS); + where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and ((po.type = '"+InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION+"' and (recyclingAmount - sendOutAmount) > 0) or (po.type <> '"+InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION+"' and (amount - sendOutAmount) > 0)) and tousseType != '%s')",TousseItem.TYPE_DIPOSABLE_GOODS); } }