Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java =================================================================== diff -u -r29238 -r29242 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java (.../TousseInstanceManagerImpl.java) (revision 29238) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java (.../TousseInstanceManagerImpl.java) (revision 29242) @@ -7109,13 +7109,16 @@ } String wareHouseIdSql = null; if(wareHouselist.size() == 1){ - wareHouseIdSql = " and ti.wareHouseId =" + wareHouselist.get(0).getId(); + Long wareHouseId = wareHouselist.get(0).getId(); + wareHouseIdSql = String.format("and ((wareHouseId2 is null and wareHouseId =%s) or (wareHouseId2 is not null and wareHouseId2=%s)) ", wareHouseId,wareHouseId); }else{ Set wareHouseIds = new HashSet(); for(WareHouse wareHouse : wareHouselist){ wareHouseIds.add(wareHouse.getId()); } - wareHouseIdSql = SqlUtils.getNonStringFieldInLargeCollectionsPredicate("ti.wareHouseId", wareHouseIds); + wareHouseIdSql = String.format("and ((wareHouseId2 is null and %s ) or (wareHouseId2 is not null and %s)) ", + SqlUtils.getNonStringFieldInLargeCollectionsPredicate("ti.wareHouseId", wareHouseIds), + SqlUtils.getNonStringFieldInLargeCollectionsPredicate("ti.wareHouseId2", wareHouseIds)); } //一级供应室只显示库存数量和基数,库存数量为该物品当前在科室(也就是器械包信息列表里的位置)中状态为已灭菌、已消毒的数量 sql = String.format("select count(*) amount,'%s' status,td.name tousseName from %s ti " @@ -7294,9 +7297,8 @@ String sql = null; if(isFirst){ sql = String.format(" select ti.tousseName,ti.id from %s ti " - + " where ((location_2 is null and location='%s') or (location_2='%s')) and tousseFixedBarcode=0 %s %s and comboTousseInstanceId is null and (ti.status='%s' or ti.status='%s') %s", - TousseInstance.class.getSimpleName(),departCoding, - departCoding,wareHouseIdSql, tousseNameSql, + + " where tousseFixedBarcode=0 %s %s and comboTousseInstanceId is null and (ti.status='%s' or ti.status='%s') %s", + TousseInstance.class.getSimpleName(),wareHouseIdSql, tousseNameSql, TousseInstance.STATUS_DISINFECTED, TousseInstance.STATUS_STERILED, dateSql);