Index: ssts-packing/src/main/java/com/forgon/disinfectsystem/packing/service/PackingManagerImpl.java =================================================================== diff -u -r29808 -r29813 --- ssts-packing/src/main/java/com/forgon/disinfectsystem/packing/service/PackingManagerImpl.java (.../PackingManagerImpl.java) (revision 29808) +++ ssts-packing/src/main/java/com/forgon/disinfectsystem/packing/service/PackingManagerImpl.java (.../PackingManagerImpl.java) (revision 29813) @@ -7162,19 +7162,19 @@ if(config != null){ isPackingAfterWashTimeEnd = BooleanUtils.toBooleanDefaultIfNull(config.getIsPackingAfterWashTimeEnd(), true); } + String databaseNowTimeSql = ""; if(isPackingAfterWashTimeEnd){ - String databaseNowTimeSql = ""; String databaseNowTime = "GETDATE()"; if(DatabaseUtil.isOracle(dbConnection.getDatabase())){ databaseNowTime = "SYSDATE"; } databaseNowTimeSql = " and endDate<" + databaseNowTime; - washRecord_idSql = String.format(" and ((po.taskType is null or po.taskType<> %s) or po.taskType=%s and po.washRecord_id in (select id from WashAndDisinfectRecord where washStatus='%s' %s)) ", - PackingTask.TASK_RECYCLINGRECORD, - PackingTask.TASK_RECYCLINGRECORD, - WashAndDisinfectRecord.STATUS_WASHED, - databaseNowTimeSql); } + washRecord_idSql = String.format(" and ((po.taskType is null or po.taskType<> %s) or po.taskType=%s and po.washRecord_id in (select id from WashAndDisinfectRecord where washStatus='%s' %s)) ", + PackingTask.TASK_RECYCLINGRECORD, + PackingTask.TASK_RECYCLINGRECORD, + WashAndDisinfectRecord.STATUS_WASHED, + databaseNowTimeSql); } String sql = String.format("where %s and po.orgUnitCoding = '%s' " + "and %s and po.status = '%s' %s", SqlUtils.getNonStringFieldInLargeCollectionsPredicate("po.tousseDefinition.id", tousseDefinitionIds),handlerDepartCode,