diff --git a/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java b/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java index 2d8ba8ce..c8664edc 100644 --- a/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java +++ b/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java @@ -513,6 +513,8 @@ where 二次过磅时间>='%s' and 二次过磅时间<='%s' String where = "where 1 = 1 "; + where += " and d.organization_id = :organizationId"; + if (request.getStartTime() != null) { where += " and d.ecgb_time >= :startTime "; } @@ -609,6 +611,9 @@ where 二次过磅时间>='%s' and 二次过磅时间<='%s' Query selectQuery = em.createNativeQuery(selectSql, Tuple.class); Query countQuery = em.createNativeQuery(countSql, Integer.class); + selectQuery.setParameter("organizationId", Ctx.currentUser().getOrganizationId()); + countQuery.setParameter("organizationId", Ctx.currentUser().getOrganizationId()); + if (request.getStartTime() != null) { selectQuery.setParameter("startTime", request.getStartTime()); countQuery.setParameter("startTime", request.getStartTime());