Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r13296 -r13298 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 13296) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 13298) @@ -7681,16 +7681,21 @@ } String endDate = dateQueryAdapter.dateAdapter(currentRecord.getStockTakeDate()); - String sql = "select d.name,d.specification,i.amount,i.cost,r.type,r.subType from" - + " GodownEntry r inner join GodownEntryItem i on r.id = i.godownEntry_id" - + " inner join DisposableGoodsStock d on i.diposableGoods_id = d.id" + String sql = "select d.name,d.specification,i.amount,i.cost,r.type,r.subType from " + + GodownEntry.class.getSimpleName() + " r inner join " + GodownEntryItem.class.getSimpleName() + + " i on r.id = i.godownEntry_id" + + " inner join " + DisposableGoodsStock.class.getSimpleName() + + " d on i.diposableGoods_id = d.id" + " where r.warehouseID=" + currentRecord.getWarehouseId(); if(StringUtils.isBlank(startDate)){ sql += " and r.time < " + endDate + ""; }else{ sql += " and r.time between " + startDate + " and " + endDate + " "; } + if(StringUtils.isNotBlank(type)){ + sql += " and d.type = '" + type + "' "; + } //一次性物品发货单 String diposableSql = "select dg.name,dg.specification,bo.amount,bo.price as cost," @@ -7704,6 +7709,9 @@ }else{ diposableSql += " and po.sendTime between " + startDate + " and " + endDate; } + if(StringUtils.isNotBlank(type)){ + diposableSql += " and dg.type = '" + type + "' "; + } //供应室领用 String supplyRoomDiposableGoodsSql = " select dg.name,dg.specification,rri.price as cost,rri.amount," @@ -7718,6 +7726,9 @@ }else{ supplyRoomDiposableGoodsSql += " and rr.time between " + startDate + " and " + endDate; } + if(StringUtils.isNotBlank(type)){ + supplyRoomDiposableGoodsSql += " and dg.type = '" + type + "' "; + } //科室退货 String returnGoodsSql = "select dg.name,dg.specification,i.amount,i.price as cost," + "'" + GodownEntry.TYPE_IN + "' as type,'科室退货' as subType from " @@ -7730,6 +7741,9 @@ }else{ returnGoodsSql += " and r.returnTime between " + startDate + " and " + endDate; } + if(StringUtils.isNotBlank(type)){ + returnGoodsSql += " and dg.type = '" + type + "' "; + } sql += " union all " + diposableSql; sql += " union all " + supplyRoomDiposableGoodsSql; sql += " union all " + returnGoodsSql;