feat(pdcDeviceData):按组织查询报表

- 在 GetReport2Request 中添加 organizationId 字段
- 在 PdcDeviceDataService 中设置当前用户的组织 ID
- 更新 SQL 查询语句,增加按组织 ID 过滤的条件
This commit is contained in:
2025-02-20 21:57:06 +08:00
parent ffc84c5229
commit a9f956b872
2 changed files with 7 additions and 0 deletions

View File

@@ -32,4 +32,7 @@ hour
private String td;
private String organizationId;
}

View File

@@ -96,6 +96,8 @@ public class PdcDeviceDataService
request.setTd("1 " + request.getTimeDimension());
request.setOrganizationId(Ctx.currentUser().getOrganizationId());
return JpaUtils.execNativeQuery(
em,
FreeMakerUtils.render(
@@ -117,6 +119,8 @@ public class PdcDeviceDataService
where dd.time >= :startTime
and dd.time <= :endTime
and dd.organization_id = :organizationId
<#if deviceGroup??>
and pd.device_group like '%' || :deviceGroup || '%'