diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java index 9a5ac6c..17b73e9 100644 --- a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java @@ -32,21 +32,51 @@ public class Constants { public static final int CATEGORY_MEASURE = 3;//计测 public static final int CATEGORY_STATUS= 4;//状态 +// // 所有设备类型ID的总集合 +// public static final List ALL_DEVICE_TYPE_IDS = new ArrayList<>(); +// +// // 定义分类与设备类型的映射 +// public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>(); +// +// //温湿度 +// public static final List DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882,9999992); +// +// static { +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, new ArrayList<>(Arrays.asList(46, 110))); +// +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, new ArrayList<>(Arrays.asList(47, 111, 121))); +// CATEGORY_DEVICE_TYPE_MAP.get(CATEGORY_MEASURE).addAll(DEVICE_TYPE_TEMPERATURE_HUMIDITY); +// +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, new ArrayList<>(Arrays.asList(48, 112, 122))); +// +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_STATUS, new ArrayList<>(Arrays.asList(86, 113, 123))); +// +// // 收集所有的设备类型ID +// for (List ids : CATEGORY_DEVICE_TYPE_MAP.values()) { +// ALL_DEVICE_TYPE_IDS.addAll(ids); +// } +// } // 所有设备类型ID的总集合 - public static final List ALL_DEVICE_TYPE_IDS = new ArrayList<>(); + public static final List ALL_CATEGORY_IDS = new ArrayList<>(); // 定义分类与设备类型的映射 - public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>(); + public static final Map> CATEGORY_MAP = new HashMap<>(); + + //温湿度 + public static final List DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882L,9999992L); static { - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, Arrays.asList(46, 110)); - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, Arrays.asList(47, 111, 121)); - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, Arrays.asList(48, 112, 122)); - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_STATUS, Arrays.asList(86, 113, 123)); + CATEGORY_MAP.put(CATEGORY_ALARM, new ArrayList<>(List.of(1001L))); + + CATEGORY_MAP.put(CATEGORY_MEASURE, new ArrayList<>(List.of(1003L))); + + CATEGORY_MAP.put(CATEGORY_ACCUMULATE, new ArrayList<>(List.of(1002L))); + + CATEGORY_MAP.put(CATEGORY_STATUS, new ArrayList<>(List.of(1004L))); // 收集所有的设备类型ID - for (List ids : CATEGORY_DEVICE_TYPE_MAP.values()) { - ALL_DEVICE_TYPE_IDS.addAll(ids); + for (List ids : CATEGORY_MAP.values()) { + ALL_CATEGORY_IDS.addAll(ids); } } diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/DeviceAttrCode.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/DeviceAttrCode.java new file mode 100644 index 0000000..dbd1d9c --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/DeviceAttrCode.java @@ -0,0 +1,11 @@ +package com.dongjian.dashboard.back.common; + +public class DeviceAttrCode { + + public static final String COMMON = "single"; + + public static final String MEASURE_TEMPERATURE = "temperature"; + + public static final String MEASURE_HUMIDITY = "humidity"; + +} diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml index 866d528..d882e5e 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml @@ -58,7 +58,7 @@ msgcn: consecutiveLoginFail: 登录失败次数过多,请等待{0}分{1}秒后再登录 loginFailCount: 已登录失败{0}次,剩余尝试登录次数:{1} deviceGroupNameHasExisted: 此设备组名称已存在 - groupTypeNotMatch: 设备类型与分组类型不匹配 + invalidDeviceCategory: 无效的设备类别 monitoringPointCategoryNameHasExisted: 此监控点分类名称已存在 monitoringPointCategoryGroupNameHasExisted: 此监控点分组名称已存在 alertLevel_1: 正常 diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml index 8aaa156..4263fa6 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml @@ -58,7 +58,7 @@ msgen: consecutiveLoginFail: Too many failed login attempts. Please wait {0} minute(s) and {1} second(s) before trying again. loginFailCount: Login failed {0} times. Remaining login attempts:{1}. deviceGroupNameHasExisted: Device group name already exists. - groupTypeNotMatch: Device type does not match the group type + invalidDeviceCategory: Invalid device category monitoringPointCategoryNameHasExisted: This monitoring point category name already exists monitoringPointCategoryGroupNameHasExisted: The monitoring point group name already exists alertLevel_1: Normal diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml index 52c08e6..373e8f4 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml @@ -58,7 +58,7 @@ msgjp: consecutiveLoginFail: ログインの失敗が多すぎます。{0}分{1}秒待ってから再度ログインしてください。 loginFailCount: ログインに{0}回失敗しました。残りの試行回数:{1}回。 deviceGroupNameHasExisted: デバイスグループ名は既に存在しています。 - groupTypeNotMatch: デバイスタイプがグループタイプと一致しません。 + invalidDeviceCategory: サポートされていないデバイスタイプ。 monitoringPointCategoryNameHasExisted: この監視ポイントカテゴリ名は既に存在します monitoringPointCategoryGroupNameHasExisted: この監視ポイントグループ名は既に存在します alertLevel_1: 通常 diff --git a/dongjian-dashboard-back-controller/dockerfile b/dongjian-dashboard-back-controller/dockerfile index 936f8e6..77e7952 100644 --- a/dongjian-dashboard-back-controller/dockerfile +++ b/dongjian-dashboard-back-controller/dockerfile @@ -1,5 +1,9 @@ -FROM registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest +# FROM registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest # FROM openjdk:17-jdk +FROM amazoncorretto:17-alpine +# 安装 fontconfig 和 DejaVu 字体 (这是一个通用且免费的字体包) +RUN apk --no-cache add fontconfig ttf-dejavu + ENV TZ=Asia/Tokyo WORKDIR /home/data-center-dashboard diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java index c411b0c..7404568 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java @@ -114,14 +114,14 @@ public class DeviceDataAccumulateController { @OperationLog(operation = "getLineData", remark = "") @Operation(summary = "获取7日趋势数据") - @RequestMapping(value = "/getLineData",method = RequestMethod.GET) - public SimpleDataResponse getLineData( + @RequestMapping(value = "/getLineData",method = RequestMethod.POST) + public SimpleDataResponse> getLineData( @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, - LineDataSearchParams lineDataSearchParams + @RequestBody LineDataSearchParams lineDataSearchParams ) throws BusinessException { return deviceDataAccumulateService.getLineData(lineDataSearchParams, CompanyId, UserId, LanguageType); } diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java index f9343fb..2e34f8d 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java @@ -113,16 +113,17 @@ public class DeviceDataMeasureController { @OperationLog(operation = "getLineData", remark = "") @Operation(summary = "获取7日趋势数据") - @RequestMapping(value = "/getLineData",method = RequestMethod.GET) - public SimpleDataResponse getLineData( + @RequestMapping(value = "/getLineData",method = RequestMethod.POST) + public SimpleDataResponse> getLineData( + @Parameter(name = "searchType", description = "1-按小时,2-全部数据", required = true) Integer searchType, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, - LineDataSearchParams lineDataSearchParams + @RequestBody LineDataSearchParams lineDataSearchParams ) throws BusinessException { - return deviceDataMeasureService.getLineData(lineDataSearchParams, CompanyId, UserId, LanguageType); + return deviceDataMeasureService.getLineData(searchType, lineDataSearchParams, CompanyId, UserId, LanguageType); } } diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java index 4e1db67..92d1f08 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java @@ -1,6 +1,7 @@ package com.dongjian.dashboard.back.controller; import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.dto.BaseSearchNoCompanysParams; import com.dongjian.dashboard.back.dto.devicegroup.*; import com.dongjian.dashboard.back.vo.device.DeviceVO; import io.swagger.v3.oas.annotations.Hidden; @@ -23,6 +24,7 @@ import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; import com.dongjian.dashboard.back.service.DeviceGroupService; import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; +import java.util.Collections; import java.util.List; @@ -38,7 +40,6 @@ public class DeviceGroupController { @Autowired private DeviceGroupService deviceGroupService; - @Hidden @OperationLog(operation = "addDeviceGroup", remark = "") @Operation(summary = "Add deviceGroup") @RequestMapping(value = "/add", method = RequestMethod.POST) @@ -52,7 +53,6 @@ public class DeviceGroupController { return deviceGroupService.add(optDeviceGroupParams, UserId, CompanyId, LanguageType); } - @Hidden @OperationLog(operation = "editDeviceGroup", remark = "") @Operation(summary = "Edit deviceGroup") @RequestMapping(value = "/edit", method = RequestMethod.POST) @@ -66,7 +66,6 @@ public class DeviceGroupController { return deviceGroupService.edit(optDeviceGroupParams, UserId, CompanyId, LanguageType); } - @Hidden @OperationLog(operation = "deleteDeviceGroup", remark = "") @Operation(summary = "Delete deviceGroup") @RequestMapping(value = "/batchDelete", method = RequestMethod.POST) @@ -151,14 +150,32 @@ public class DeviceGroupController { @Operation(summary = "根据设备组ID获取绑定的设备") @RequestMapping(value = "/getBindedDeviceByGroup/{deviceGroupId}", method = RequestMethod.GET) - public SimpleDataResponse> getBindedDeviceByGroup( + public PageResponse> getBindedDeviceByGroup( @PathVariable Long deviceGroupId, + BaseSearchNoCompanysParams BaseSearchNoCompanysParams, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { - return deviceGroupService.getBindedDeviceByGroup(deviceGroupId, UserId, CompanyId, LanguageType); + + DeviceGroupSearchParams pageSearchParam = new DeviceGroupSearchParams(); + pageSearchParam.setPageNum(BaseSearchNoCompanysParams.getPageNum()); + pageSearchParam.setPageSize(BaseSearchNoCompanysParams.getPageSize()); + pageSearchParam.setUserId(UserId); + pageSearchParam.setDeviceGroupIdList(Collections.singletonList(deviceGroupId)); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(deviceGroupService.getBindedDeviceByGroup(pageSearchParam, UserId, CompanyId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; } @OperationLog(operation = "addDeviceForGroup", remark = "") diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java index d15bd59..86818d4 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java @@ -3,6 +3,7 @@ package com.dongjian.dashboard.back.controller; import com.dongjian.dashboard.back.common.response.SimpleDataResponse; import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; import com.dongjian.dashboard.back.service.OverviewService; +import com.dongjian.dashboard.back.vo.dashboardnotification.DashboardNotificationPageVO; import com.dongjian.dashboard.back.vo.data.OverviewVO; import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts; import com.dongjian.dashboard.back.weather.QueryWeather; @@ -53,4 +54,16 @@ public class OverviewController { @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { return overviewService.getWeatherInfo(queryWeather, UserId, CompanyId, LanguageType, UTCOffset); } + + @Operation(summary = "Get notification") + @RequestMapping(value = "/getNotification", method = RequestMethod.GET) + public SimpleDataResponse getNotification( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { + return overviewService.getNotification(UserId, CompanyId, LanguageType, UTCOffset); + } } diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNotificationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNotificationMapper.java new file mode 100644 index 0000000..fcbd442 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNotificationMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardNotification; +import com.dongjian.dashboard.back.model.DashboardNotificationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardNotificationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + long countByExample(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int deleteByExample(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int insert(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int insertSelective(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + List selectByExample(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + DashboardNotification selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardNotification record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java index 4e2038b..bc5cb19 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java @@ -22,14 +22,6 @@ public interface DashboardRealtimeMeasureMapper { */ int deleteByExample(DashboardRealtimeMeasureExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_realtime_measure - * - * @mbg.generated - */ - int deleteByPrimaryKey(String deviceId); - /** * This method was generated by MyBatis Generator. * This method corresponds to the database table dashboard_realtime_measure @@ -54,14 +46,6 @@ public interface DashboardRealtimeMeasureMapper { */ List selectByExample(DashboardRealtimeMeasureExample example); - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_realtime_measure - * - * @mbg.generated - */ - DashboardRealtimeMeasure selectByPrimaryKey(String deviceId); - /** * This method was generated by MyBatis Generator. * This method corresponds to the database table dashboard_realtime_measure @@ -77,20 +61,4 @@ public interface DashboardRealtimeMeasureMapper { * @mbg.generated */ int updateByExample(@Param("record") DashboardRealtimeMeasure record, @Param("example") DashboardRealtimeMeasureExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_realtime_measure - * - * @mbg.generated - */ - int updateByPrimaryKeySelective(DashboardRealtimeMeasure record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_realtime_measure - * - * @mbg.generated - */ - int updateByPrimaryKey(DashboardRealtimeMeasure record); } \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java index afc1af1..cff17f5 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java @@ -46,6 +46,14 @@ public interface DeviceInfoMapper { */ int insertSelective(DeviceInfo record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(DeviceInfoExample example); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table device_info @@ -70,6 +78,14 @@ public interface DeviceInfoMapper { */ int updateByExampleSelective(@Param("record") DeviceInfo record, @Param("example") DeviceInfoExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") DeviceInfo record, @Param("example") DeviceInfoExample example); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table device_info @@ -86,6 +102,14 @@ public interface DeviceInfoMapper { */ int updateByPrimaryKeySelective(DeviceInfo record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(DeviceInfo record); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table device_info diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNotificationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNotificationMapperExt.java new file mode 100644 index 0000000..7de86e8 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNotificationMapperExt.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; + +import com.dongjian.dashboard.back.dao.auto.DashboardNotificationMapper; +import com.dongjian.dashboard.back.dao.auto.UserBuildingRelationMapper; +import com.dongjian.dashboard.back.model.UserBuildingRelation; +import com.dongjian.dashboard.back.vo.building.BindedBuildingVO; +import com.dongjian.dashboard.back.vo.dashboardnotification.DashboardNotificationPageVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DashboardNotificationMapperExt extends DashboardNotificationMapper { + + DashboardNotificationPageVO getNotification(Long companyId); + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java index ce766cd..358eb60 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java @@ -18,5 +18,5 @@ public interface DeviceGroupMapperExt extends DeviceGroupMapper { List getBindedGroupByDevice(Integer deviceInfoId); - List getBindedDeviceByGroup(Long deviceGroupId); + List getBindedDeviceByGroup(DeviceGroupSearchParams pageSearchParam); } diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/aurora/DashboardRealtimeMeasureMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/aurora/DashboardRealtimeMeasureMapperExt.xml index 2443055..3d4082f 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/aurora/DashboardRealtimeMeasureMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/aurora/DashboardRealtimeMeasureMapperExt.xml @@ -5,6 +5,7 @@ + + select + + distinct + + 'true' as QUERYID, + + , + + from dashboard_notification + + + + + order by ${orderByClause} + + + + + + + delete from dashboard_notification + where id = #{id,jdbcType=BIGINT} + + + + delete from dashboard_notification + + + + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_notification (company_id, demand_time, category, + flag, created_at, created_by, + updated_at, updated_by, content + ) + values (#{companyId,jdbcType=BIGINT}, #{demandTime,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, + #{flag,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_notification + + + company_id, + + + demand_time, + + + category, + + + flag, + + + created_at, + + + created_by, + + + updated_at, + + + updated_by, + + + content, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{demandTime,jdbcType=VARCHAR}, + + + #{category,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{updatedBy,jdbcType=BIGINT}, + + + #{content,jdbcType=LONGVARCHAR}, + + + + + + + update dashboard_notification + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + demand_time = #{record.demandTime,jdbcType=VARCHAR}, + + + category = #{record.category,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + + + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + + + + + + + update dashboard_notification + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + demand_time = #{record.demandTime,jdbcType=VARCHAR}, + category = #{record.category,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR} + + + + + + + update dashboard_notification + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + demand_time = #{record.demandTime,jdbcType=VARCHAR}, + category = #{record.category,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + updated_by = #{record.updatedBy,jdbcType=BIGINT} + + + + + + + update dashboard_notification + + + company_id = #{companyId,jdbcType=BIGINT}, + + + demand_time = #{demandTime,jdbcType=VARCHAR}, + + + category = #{category,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + updated_by = #{updatedBy,jdbcType=BIGINT}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_notification + set company_id = #{companyId,jdbcType=BIGINT}, + demand_time = #{demandTime,jdbcType=VARCHAR}, + category = #{category,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + updated_by = #{updatedBy,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_notification + set company_id = #{companyId,jdbcType=BIGINT}, + demand_time = #{demandTime,jdbcType=VARCHAR}, + category = #{category,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + updated_by = #{updatedBy,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml index 4329daf..50dc4bf 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml @@ -6,7 +6,8 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - + + @@ -89,7 +90,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - device_id, date_year, date_month, date_day, date_hour, date_minute, date_second, + device_id, attr_code, date_year, date_month, date_day, date_hour, date_minute, date_second, upload_value, min_value, max_value, upload_at - - - - delete from dashboard_realtime_measure - where device_id = #{deviceId,jdbcType=VARCHAR} - - insert into dashboard_realtime_measure (device_id, date_year, date_month, - date_day, date_hour, date_minute, - date_second, upload_value, min_value, - max_value, upload_at) - values (#{deviceId,jdbcType=VARCHAR}, #{dateYear,jdbcType=INTEGER}, #{dateMonth,jdbcType=INTEGER}, - #{dateDay,jdbcType=INTEGER}, #{dateHour,jdbcType=INTEGER}, #{dateMinute,jdbcType=INTEGER}, - #{dateSecond,jdbcType=INTEGER}, #{uploadValue,jdbcType=VARCHAR}, #{minValue,jdbcType=VARCHAR}, - #{maxValue,jdbcType=VARCHAR}, #{uploadAt,jdbcType=BIGINT}) + insert into dashboard_realtime_measure (device_id, attr_code, date_year, + date_month, date_day, date_hour, + date_minute, date_second, upload_value, + min_value, max_value, upload_at + ) + values (#{deviceId,jdbcType=VARCHAR}, #{attrCode,jdbcType=VARCHAR}, #{dateYear,jdbcType=INTEGER}, + #{dateMonth,jdbcType=INTEGER}, #{dateDay,jdbcType=INTEGER}, #{dateHour,jdbcType=INTEGER}, + #{dateMinute,jdbcType=INTEGER}, #{dateSecond,jdbcType=INTEGER}, #{uploadValue,jdbcType=VARCHAR}, + #{minValue,jdbcType=VARCHAR}, #{maxValue,jdbcType=VARCHAR}, #{uploadAt,jdbcType=BIGINT} + ) update dashboard_realtime_measure set device_id = #{record.deviceId,jdbcType=VARCHAR}, + attr_code = #{record.attrCode,jdbcType=VARCHAR}, date_year = #{record.dateYear,jdbcType=INTEGER}, date_month = #{record.dateMonth,jdbcType=INTEGER}, date_day = #{record.dateDay,jdbcType=INTEGER}, @@ -306,62 +301,4 @@ - - - update dashboard_realtime_measure - - - date_year = #{dateYear,jdbcType=INTEGER}, - - - date_month = #{dateMonth,jdbcType=INTEGER}, - - - date_day = #{dateDay,jdbcType=INTEGER}, - - - date_hour = #{dateHour,jdbcType=INTEGER}, - - - date_minute = #{dateMinute,jdbcType=INTEGER}, - - - date_second = #{dateSecond,jdbcType=INTEGER}, - - - upload_value = #{uploadValue,jdbcType=VARCHAR}, - - - min_value = #{minValue,jdbcType=VARCHAR}, - - - max_value = #{maxValue,jdbcType=VARCHAR}, - - - upload_at = #{uploadAt,jdbcType=BIGINT}, - - - where device_id = #{deviceId,jdbcType=VARCHAR} - - - - update dashboard_realtime_measure - set date_year = #{dateYear,jdbcType=INTEGER}, - date_month = #{dateMonth,jdbcType=INTEGER}, - date_day = #{dateDay,jdbcType=INTEGER}, - date_hour = #{dateHour,jdbcType=INTEGER}, - date_minute = #{dateMinute,jdbcType=INTEGER}, - date_second = #{dateSecond,jdbcType=INTEGER}, - upload_value = #{uploadValue,jdbcType=VARCHAR}, - min_value = #{minValue,jdbcType=VARCHAR}, - max_value = #{maxValue,jdbcType=VARCHAR}, - upload_at = #{uploadAt,jdbcType=BIGINT} - where device_id = #{deviceId,jdbcType=VARCHAR} - \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml index 86138d0..519ea82 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml @@ -8,6 +8,7 @@ --> + @@ -90,8 +91,8 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - id, device_id, date_year, date_month, date_day, date_hour, date_minute, date_second, - upload_value, increment_today, increment_minute, upload_at + id, device_id, attr_code, date_year, date_month, date_day, date_hour, date_minute, + date_second, upload_value, increment_today, increment_minute, upload_at + id, device_id, device_sn, type_id, wsclient_id, space_id, device_name, remark, building_id, - asset_id, flag, company_id, created_by, created_timestamp, updated_by, updated_timestamp, - project_id, floor_id, monitoring_point_name, monitoring_point_category_id, data_provider_id, - gateway_info_id, alarm_level, retain_alert + asset_id, gateway_client_id, flag, company_id, created_by, created_timestamp, updated_by, + updated_timestamp, project_id, floor_id, monitoring_point_name, monitoring_point_category_id, + data_provider_id, gateway_info_id, alarm_level, retain_alert, unit, dashboard_decimal_places + + + + data_mapping + @@ -165,21 +205,23 @@ insert into device_info (device_id, device_sn, type_id, wsclient_id, space_id, device_name, remark, building_id, asset_id, - flag, company_id, created_by, - created_timestamp, updated_by, updated_timestamp, - project_id, floor_id, monitoring_point_name, - monitoring_point_category_id, data_provider_id, - gateway_info_id, alarm_level, retain_alert - ) + gateway_client_id, flag, company_id, + created_by, created_timestamp, updated_by, + updated_timestamp, project_id, floor_id, + monitoring_point_name, monitoring_point_category_id, + data_provider_id, gateway_info_id, alarm_level, + retain_alert, unit, dashboard_decimal_places, + data_mapping) values (#{deviceId,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER}, #{wsclientId,jdbcType=INTEGER}, #{spaceId,jdbcType=BIGINT}, #{deviceName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{buildingId,jdbcType=BIGINT}, #{assetId,jdbcType=BIGINT}, - #{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT}, - #{createdTimestamp,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, #{updatedTimestamp,jdbcType=BIGINT}, - #{projectId,jdbcType=BIGINT}, #{floorId,jdbcType=BIGINT}, #{monitoringPointName,jdbcType=VARCHAR}, - #{monitoringPointCategoryId,jdbcType=BIGINT}, #{dataProviderId,jdbcType=BIGINT}, - #{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER}, #{retainAlert,jdbcType=INTEGER} - ) + #{gatewayClientId,jdbcType=INTEGER}, #{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, + #{createdBy,jdbcType=BIGINT}, #{createdTimestamp,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, + #{updatedTimestamp,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{floorId,jdbcType=BIGINT}, + #{monitoringPointName,jdbcType=VARCHAR}, #{monitoringPointCategoryId,jdbcType=BIGINT}, + #{dataProviderId,jdbcType=BIGINT}, #{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER}, + #{retainAlert,jdbcType=INTEGER}, #{unit,jdbcType=VARCHAR}, #{dashboardDecimalPlaces,jdbcType=INTEGER}, + #{dataMapping,jdbcType=LONGVARCHAR}) + update device_info + set id = #{record.id,jdbcType=INTEGER}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + device_sn = #{record.deviceSn,jdbcType=VARCHAR}, + type_id = #{record.typeId,jdbcType=INTEGER}, + wsclient_id = #{record.wsclientId,jdbcType=INTEGER}, + space_id = #{record.spaceId,jdbcType=BIGINT}, + device_name = #{record.deviceName,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + asset_id = #{record.assetId,jdbcType=BIGINT}, + gateway_client_id = #{record.gatewayClientId,jdbcType=INTEGER}, + flag = #{record.flag,jdbcType=INTEGER}, + company_id = #{record.companyId,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_timestamp = #{record.createdTimestamp,jdbcType=TIMESTAMP}, + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + updated_timestamp = #{record.updatedTimestamp,jdbcType=BIGINT}, + project_id = #{record.projectId,jdbcType=BIGINT}, + floor_id = #{record.floorId,jdbcType=BIGINT}, + monitoring_point_name = #{record.monitoringPointName,jdbcType=VARCHAR}, + monitoring_point_category_id = #{record.monitoringPointCategoryId,jdbcType=BIGINT}, + data_provider_id = #{record.dataProviderId,jdbcType=BIGINT}, + gateway_info_id = #{record.gatewayInfoId,jdbcType=BIGINT}, + alarm_level = #{record.alarmLevel,jdbcType=INTEGER}, + retain_alert = #{record.retainAlert,jdbcType=INTEGER}, + unit = #{record.unit,jdbcType=VARCHAR}, + dashboard_decimal_places = #{record.dashboardDecimalPlaces,jdbcType=INTEGER}, + data_mapping = #{record.dataMapping,jdbcType=LONGVARCHAR} + + + + + update device_info + set device_id = #{deviceId,jdbcType=VARCHAR}, + device_sn = #{deviceSn,jdbcType=VARCHAR}, + type_id = #{typeId,jdbcType=INTEGER}, + wsclient_id = #{wsclientId,jdbcType=INTEGER}, + space_id = #{spaceId,jdbcType=BIGINT}, + device_name = #{deviceName,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + building_id = #{buildingId,jdbcType=BIGINT}, + asset_id = #{assetId,jdbcType=BIGINT}, + gateway_client_id = #{gatewayClientId,jdbcType=INTEGER}, + flag = #{flag,jdbcType=INTEGER}, + company_id = #{companyId,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_timestamp = #{createdTimestamp,jdbcType=TIMESTAMP}, + updated_by = #{updatedBy,jdbcType=BIGINT}, + updated_timestamp = #{updatedTimestamp,jdbcType=BIGINT}, + project_id = #{projectId,jdbcType=BIGINT}, + floor_id = #{floorId,jdbcType=BIGINT}, + monitoring_point_name = #{monitoringPointName,jdbcType=VARCHAR}, + monitoring_point_category_id = #{monitoringPointCategoryId,jdbcType=BIGINT}, + data_provider_id = #{dataProviderId,jdbcType=BIGINT}, + gateway_info_id = #{gatewayInfoId,jdbcType=BIGINT}, + alarm_level = #{alarmLevel,jdbcType=INTEGER}, + retain_alert = #{retainAlert,jdbcType=INTEGER}, + unit = #{unit,jdbcType=VARCHAR}, + dashboard_decimal_places = #{dashboardDecimalPlaces,jdbcType=INTEGER}, + data_mapping = #{dataMapping,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + device_id, building_id, `status`, receive_ts, alert_title, alert_cancel_title, upload_year, - upload_month, upload_day + upload_month, upload_day, dashboard_status @@ -227,7 +227,7 @@ io.netty netty-bom - 4.1.128.Final + 4.2.9.Final pom import