Browse Source

代码同步

jwy
review512jwy@163.com 2 months ago
parent
commit
dc5b41c2a5
  1. 14
      document/db/20240508.sql
  2. 2
      document/db/20240515.sql
  3. 6
      document/db/init.sql
  4. 13
      dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java
  5. 2
      dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java
  6. 4
      dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java
  7. 26
      dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/HttpConfig.java
  8. 5
      dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml
  9. 5
      dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml
  10. 5
      dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml
  11. 61
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/AIController.java
  12. 30
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java
  13. 50
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java
  14. 111
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java
  15. 127
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java
  16. 15
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java
  17. 114
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/AutoLoginFilter.java
  18. 26
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/Jwks.java
  19. 162
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/SecurityConfig.java
  20. 15
      dongjian-dashboard-back-controller/src/main/resources/config/application.properties
  21. 96
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java
  22. 96
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNoticeIgnoredMapper.java
  23. 22
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java
  24. 14
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java
  25. 5
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java
  26. 1
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java
  27. 24
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java
  28. 21
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNoticeIgnoredMapperExt.java
  29. 6
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java
  30. 41
      dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java
  31. 51
      dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml
  32. 29
      dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml
  33. 158
      dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardNoticeIgnoredMapper.xml
  34. 47
      dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml
  35. 14
      dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml
  36. 46
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHistoryMapperExt.xml
  37. 2
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml
  38. 2
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml
  39. 5
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml
  40. 8
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml
  41. 64
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml
  42. 21
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardNoticeIgnoredMapperExt.xml
  43. 22
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml
  44. 61
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml
  45. 9
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml
  46. 359
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml
  47. 7
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml
  48. 2
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml
  49. 17
      dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml
  50. 2
      dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties
  51. 24
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskParam.java
  52. 21
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskResponse.java
  53. 13
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiRetrieveParam.java
  54. 34
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/Citation.java
  55. 18
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/RetrieveResponse.java
  56. 7
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java
  57. 5
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java
  58. 10
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertCloseRequest.java
  59. 15
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertQueryRequest.java
  60. 5
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java
  61. 3
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java
  62. 21
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java
  63. 18
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java
  64. 46
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java
  65. 40
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java
  66. 19
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java
  67. 22
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java
  68. 68
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java
  69. 140
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java
  70. 34
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java
  71. 60
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java
  72. 302
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java
  73. 802
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java
  74. 166
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnored.java
  75. 562
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnoredExample.java
  76. 118
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java
  77. 94
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java
  78. 24
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java
  79. 34
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java
  80. 3
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java
  81. 57
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/WindowAlertVO.java
  82. 9
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java
  83. 25
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java
  84. 25
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java
  85. 29
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java
  86. 133
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/JpMeshHourlyForecasts.java
  87. 15
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/QueryWeather.java
  88. 18
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AIService.java
  89. 7
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java
  90. 4
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java
  91. 27
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java
  92. 24
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java
  93. 3
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java
  94. 6
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java
  95. 203
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java
  96. 145
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AIServiceImpl.java
  97. 2
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java
  98. 55
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java
  99. 2
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java
  100. 2
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java

14
document/db/20240508.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -10,7 +10,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'aurora_flag'
) THEN
@ -21,7 +21,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'aurora_url'
) THEN
@ -32,7 +32,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'aurora_username'
) THEN
@ -43,7 +43,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'aurora_password'
) THEN
@ -54,7 +54,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'redis_db_id'
) THEN
@ -65,7 +65,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'bearer_token'
) THEN

2
document/db/20240515.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
/*Table structure for table `basic_menu` */

6
document/db/init.sql

@ -1,6 +1,6 @@
/*
SQLyog - MySQL GUI v8.14
MySQL - 8.0.28 : Database - data_center_new
MySQL - 8.0.28 : Database - data_center_aeon_admin
*********************************************************************
*/
@ -13,9 +13,9 @@ MySQL - 8.0.28 : Database - data_center_new
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_new` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_aeon_admin` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `data_center_new`;
USE `data_center_aeon_admin`;
/*Table structure for table `basic_company` */

13
dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java

@ -1,10 +1,6 @@
package com.dongjian.dashboard.back.common;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author Mr.Jiang
@ -24,7 +20,9 @@ public class Constants {
public static final String DATASOURCE_PREFIX = "dataSourceForCompany_";
public static final String THIRD_DB_PREFIX = "data_center_dongjian_";
public static final String THIRD_DB_PREFIX = "data_center_aeon_";
public static final String WINDOW_ALERT_IGNORED = "alert_window_notice:ignore:%d";
public static final int AURORA_IN_BATCH_SIZE = 1000;
@ -39,7 +37,8 @@ public class Constants {
// 定义分类与设备类型的映射
public static final Map<Integer, List<Integer>> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>();
static {
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));

2
dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java

@ -102,7 +102,7 @@ public class DataSourceAdminConfig {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE bcom.flag != 1 and (parent_id = 1 or parent_id = -1)";
jdbcTemplate.query(sql,rs->{

4
dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java

@ -59,7 +59,7 @@ public class DataSourceInterceptor implements HandlerInterceptor {
String sql="SELECT "
+ " bcom.id, bcom.parent_id parentId"
+ " FROM data_center_new.basic_company bcom "
+ " FROM data_center_aeon_admin.basic_company bcom "
+ " WHERE bcom.flag != 1 and bcom.id = " + companyId;
AtomicLong parentId = new AtomicLong(0);
@ -86,7 +86,7 @@ public class DataSourceInterceptor implements HandlerInterceptor {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE (bcom.parent_id=1 or bcom.parent_id=-1) and bcom.flag != 1";
jdbcTemplate.query(sql,rs->{

26
dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/HttpConfig.java

@ -0,0 +1,26 @@
package com.dongjian.dashboard.back.common.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@Configuration
public class HttpConfig {
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate();
// 设置连接超时和读取超时
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(10000); // 连接超时10秒
factory.setReadTimeout(30000); // 读取超时30秒
restTemplate.setRequestFactory(factory);
return restTemplate;
}
}

5
dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml

@ -73,8 +73,7 @@ msgcn:
handleStatus_3: 完成
handleStatus_4: 自动恢复
canNotProcessed: 无法再处理
alreadyExists: 平台已存在
hasChildLevel: 存在下级层级,不允许删除
processOwnRole: 不能处理自身角色
operationLogMap:
addRole: 新增角色
editRole: 编辑角色
@ -127,5 +126,7 @@ msgcn:
getFavoriteList: 获取收藏设备列表
removeFavoriteDevice: 删除收藏设备
addFavoriteDevice: 新增收藏设备
addDeviceForGroup: 给设备组设置绑定的设备
delDeviceForGroup: 删除设备组绑定的指定设备

5
dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml

@ -73,8 +73,7 @@ msgen:
handleStatus_3: Completed
handleStatus_4: Auto Recovered
canNotProcessed: Can not be processed further
alreadyExists: 平台已存在
hasChildLevel: 存在下级层级,不允许删除
processOwnRole: Can not process own role.
operationLogMap:
addRole: Add Role
editRole: Edit Role
@ -127,6 +126,8 @@ msgen:
getFavoriteList: Get list of favorited devices
removeFavoriteDevice: Remove favorited device
addFavoriteDevice: Add favorited device
addDeviceForGroup: Set bound devices for the device group
delDeviceForGroup: Remove the specified devices bound to the device group

5
dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml

@ -73,8 +73,7 @@ msgjp:
handleStatus_3: 完了
handleStatus_4: 自動復旧
canNotProcessed: これ以上の処理はできません
alreadyExists: 平台已存在
hasChildLevel: 存在下级层级,不允许删除
processOwnRole: 自分のロールを操作することはできません
operationLogMap:
addRole: ロールを追加
editRole: ロールを編集
@ -127,6 +126,8 @@ msgjp:
getFavoriteList: お気に入りデバイス一覧を取得
removeFavoriteDevice: お気に入りデバイスを削除
addFavoriteDevice: お気に入りデバイスを追加
addDeviceForGroup: デバイスグループにバインドされたデバイスを設定する
delDeviceForGroup: デバイスグループにバインドされた指定されたデバイスを削除する

61
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/AIController.java

@ -0,0 +1,61 @@
package com.dongjian.dashboard.back.controller;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.configurator.aspect.OperationLog;
import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired;
import com.dongjian.dashboard.back.dto.ai.AiAskParam;
import com.dongjian.dashboard.back.dto.user.OptUserParam;
import com.dongjian.dashboard.back.service.AIService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
*
* @author zhc
*
*/
@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解
//@AccessRequired //注解标识是否需要验证token
@RequestMapping("/ai") //http请求路径映射
@Tag(name = "用户管理的相关接口",description = "用户管理的相关接口")
@SuppressWarnings("unchecked")
public class AIController {
private static Logger logger = LoggerFactory.getLogger(AIController.class);
@Autowired
AIService aiService;
@OperationLog(operation = "ask", remark = "")
@Operation(summary = "提问回答")
@RequestMapping(value = "/ask",method = RequestMethod.POST)
public SimpleDataResponse ask(
@RequestBody AiAskParam param,
@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=true) 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 aiService.ask(param, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "retrieve", remark = "")
@Operation(summary = "文件搜索")
@RequestMapping(value = "/retrieve",method = RequestMethod.POST)
public SimpleDataResponse retrieve(
@RequestBody AiAskParam param,
@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=true) 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 aiService.retrieve(param, CompanyId, UserId, LanguageType);
}
}

30
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java

@ -12,11 +12,14 @@ import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired;
import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam;
import com.dongjian.dashboard.back.dto.data.HandleAlarmParams;
import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam;
import com.dongjian.dashboard.back.dto.device.WindowAlertCloseRequest;
import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest;
import com.dongjian.dashboard.back.easyexcel.ExportDeviceAlarmDataDTO;
import com.dongjian.dashboard.back.easyexcel.LanguageDynamicHeaderAdapter;
import com.dongjian.dashboard.back.service.DeviceDataAlarmService;
import com.dongjian.dashboard.back.vo.data.DeviceAlarmData;
import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO;
import com.dongjian.dashboard.back.vo.device.WindowAlertVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
@ -154,4 +157,31 @@ public class DeviceDataAlarmController {
return pageResponse;
}
@Operation(summary = "获取弹窗告警通知列表")
@RequestMapping(value = "/window/list", method = RequestMethod.GET)
public SimpleDataResponse<List<WindowAlertVO>> windowList(
WindowAlertQueryRequest searchParams,
@Parameter(name = "LoginName", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader String LoginName,
@Parameter(name = "AccessToken", required = true) @RequestHeader String AccessToken,
@Parameter(name = "UserId", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader Long UserId,
@Parameter(name = "CompanyId", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId,
@Parameter(name = "LanguageType", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader Integer LanguageType
) {
return deviceDataAlarmService.windowList(searchParams, UserId, CompanyId, AccessToken, LanguageType);
}
@Operation(summary = "关闭弹窗的指定告警")
@RequestMapping(value = "/window/dismiss", method = RequestMethod.POST)
public SimpleDataResponse windowDismiss(
@RequestBody WindowAlertCloseRequest windowAlertCloseRequest,
@Parameter(name = "LoginName", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader String LoginName,
@Parameter(name = "AccessToken", required = true) @RequestHeader String AccessToken,
@Parameter(name = "UserId", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader Long UserId,
@Parameter(name = "CompanyId", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId,
@Parameter(name = "LanguageType", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader Integer LanguageType
) {
return deviceDataAlarmService.windowDismiss(windowAlertCloseRequest, UserId, CompanyId, AccessToken, LanguageType);
}
}

50
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java

@ -25,7 +25,7 @@ import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO;
import java.util.List;
@Hidden
@RestController
@AccessRequired
@RequestMapping("/deviceGroup")
@ -38,9 +38,10 @@ public class DeviceGroupController {
@Autowired
private DeviceGroupService deviceGroupService;
@Hidden
@OperationLog(operation = "addDeviceGroup", remark = "")
@Operation(summary = "Add deviceGroup")
@RequestMapping(value = "/deviceGroup/add", method = RequestMethod.POST)
@RequestMapping(value = "/add", method = RequestMethod.POST)
public SimpleDataResponse add(
@RequestBody OptDeviceGroupParams optDeviceGroupParams,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -51,9 +52,10 @@ public class DeviceGroupController {
return deviceGroupService.add(optDeviceGroupParams, UserId, CompanyId, LanguageType);
}
@Hidden
@OperationLog(operation = "editDeviceGroup", remark = "")
@Operation(summary = "Edit deviceGroup")
@RequestMapping(value = "/deviceGroup/edit", method = RequestMethod.POST)
@RequestMapping(value = "/edit", method = RequestMethod.POST)
public SimpleDataResponse edit(
@RequestBody OptDeviceGroupParams optDeviceGroupParams,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -64,9 +66,10 @@ public class DeviceGroupController {
return deviceGroupService.edit(optDeviceGroupParams, UserId, CompanyId, LanguageType);
}
@Hidden
@OperationLog(operation = "deleteDeviceGroup", remark = "")
@Operation(summary = "Delete deviceGroup")
@RequestMapping(value = "/deviceGroup/batchDelete", method = RequestMethod.POST)
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST)
public SimpleDataResponse batchDelete(
@RequestBody DeleteDeviceGroupParams deleteDeviceGroupParams,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -79,7 +82,7 @@ public class DeviceGroupController {
@OperationLog(operation = "queryDeviceGroup", remark = "")
@Operation(summary = "Get deviceGroup list")
@RequestMapping(value = "/deviceGroup/getListPage", method = RequestMethod.GET)
@RequestMapping(value = "/getListPage", method = RequestMethod.GET)
public PageResponse<PageInfo<DeviceGroupPageVO>> getListPage(
@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,
@ -105,9 +108,10 @@ public class DeviceGroupController {
}
@Hidden
@OperationLog(operation = "bindGroupForDevice", remark = "")
@Operation(summary = "给设备绑定设备组")
@RequestMapping(value = "/deviceGroup/bindGroupForDevice", method = RequestMethod.POST)
@RequestMapping(value = "/bindGroupForDevice", method = RequestMethod.POST)
public SimpleDataResponse bindGroupForDevice(
@RequestBody BindGroupForDeviceParams bindGroupForDeviceParams,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -118,9 +122,10 @@ public class DeviceGroupController {
return deviceGroupService.bindGroupForDevice(bindGroupForDeviceParams, UserId, CompanyId, LanguageType);
}
@Hidden
@OperationLog(operation = "bindDeviceForGroup", remark = "")
@Operation(summary = "给设备组设置绑定的设备")
@RequestMapping(value = "/deviceGroup/bindDeviceForGroup", method = RequestMethod.POST)
@RequestMapping(value = "/bindDeviceForGroup", method = RequestMethod.POST)
public SimpleDataResponse bindDeviceForGroup(
@RequestBody BindDeviceForGroupParams bindDeviceForGroupParams,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -131,8 +136,9 @@ public class DeviceGroupController {
return deviceGroupService.bindDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType);
}
@Hidden
@Operation(summary = "根据设备主键ID获取绑定的设备组")
@RequestMapping(value = "/deviceGroup/getBindedGroupByDevice/{deviceInfoId}", method = RequestMethod.GET)
@RequestMapping(value = "/getBindedGroupByDevice/{deviceInfoId}", method = RequestMethod.GET)
public SimpleDataResponse<List<DeviceGroupPageVO>> getBindedGroupByDevice(
@PathVariable Integer deviceInfoId,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -144,7 +150,7 @@ public class DeviceGroupController {
}
@Operation(summary = "根据设备组ID获取绑定的设备")
@RequestMapping(value = "/deviceGroup/getBindedDeviceByGroup/{deviceGroupId}", method = RequestMethod.GET)
@RequestMapping(value = "/getBindedDeviceByGroup/{deviceGroupId}", method = RequestMethod.GET)
public SimpleDataResponse<List<DeviceVO>> getBindedDeviceByGroup(
@PathVariable Long deviceGroupId,
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@ -155,4 +161,30 @@ public class DeviceGroupController {
return deviceGroupService.getBindedDeviceByGroup(deviceGroupId, UserId, CompanyId, LanguageType);
}
@OperationLog(operation = "addDeviceForGroup", remark = "")
@Operation(summary = "给设备组增加绑定的设备")
@RequestMapping(value = "/addDeviceForGroup", method = RequestMethod.POST)
public SimpleDataResponse addDeviceForGroup(
@RequestBody BindDeviceForGroupParams bindDeviceForGroupParams,
@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.addDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType);
}
@OperationLog(operation = "delDeviceForGroup", remark = "")
@Operation(summary = "给设备组解除绑定的设备")
@RequestMapping(value = "/delDeviceForGroup", method = RequestMethod.POST)
public SimpleDataResponse delDeviceForGroup(
@RequestBody BindDeviceForGroupParams bindDeviceForGroupParams,
@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.delDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType);
}
}

111
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java

@ -1,111 +0,0 @@
package com.dongjian.dashboard.back.controller;
import com.dongjian.dashboard.back.common.exception.BusinessException;
import com.dongjian.dashboard.back.common.response.PageInfo;
import com.dongjian.dashboard.back.common.response.PageResponse;
import com.dongjian.dashboard.back.common.response.ResponseCode;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.configurator.aspect.OperationLog;
import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired;
import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO;
import com.dongjian.dashboard.back.service.LevelHierarchyService;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
*
* @author jwy-style
*
*/
@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解
@AccessRequired //注解标识是否需要验证token
@RequestMapping("/levelHierarchy") //http请求路径映射
@Tag(name = "支社、支店等层级的相关接口",description = "支社、支店等层级的相关接口")
@SuppressWarnings("unchecked")
public class LevelHierarchyController {
private static Logger logger = LoggerFactory.getLogger(LevelHierarchyController.class);
@Autowired
private LevelHierarchyService levelHierarchyService;
@OperationLog(operation = "addLevelHierarchy", remark = "")
@Operation(summary = "添加层级")
@RequestMapping(value = "/add",method = RequestMethod.POST)
public SimpleDataResponse add(
@RequestBody OptLevelHierarchyParam optLevelHierarchyParam,
@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=true) 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 levelHierarchyService.add(optLevelHierarchyParam, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "editLevelHierarchy", remark = "")
@Operation(summary = "编辑层级")
@RequestMapping(value = "/edit",method = RequestMethod.POST)
public SimpleDataResponse edit(
@RequestBody OptLevelHierarchyParam optLevelHierarchyParam,
@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=true) 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 levelHierarchyService.edit(optLevelHierarchyParam, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "deleteLevelHierarchy", remark = "")
@Operation(summary = "删除层级")
@RequestMapping(value = "/batchDelete",method = RequestMethod.POST)
public SimpleDataResponse batchDelete(
@RequestBody DeleteLevelHierarchyParam deleteLevelHierarchyParam,
@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=true) 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 levelHierarchyService.batchDelete(deleteLevelHierarchyParam, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "queryLevelHierarchy", remark = "")
@Operation(summary = "获取层级列表")
@RequestMapping(value = "/getListPage",method = RequestMethod.GET)
public PageResponse<PageInfo<LevelHierarchyPageDTO>> getListPage(
@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,
PageLevelHierarchySearchParam pageSearchParam
) throws BusinessException {
pageSearchParam.setUserId(UserId);
// pageSearchParam.setCompanyId(CompanyId);
PageResponse<PageInfo<LevelHierarchyPageDTO>> pageResponse = new PageResponse<PageInfo<LevelHierarchyPageDTO>>();
try{
pageResponse.setData(levelHierarchyService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType));
pageResponse.setCode(ResponseCode.SUCCESS);
pageResponse.setMsg("success");
}catch (Exception e){
logger.error("查询列表报错",e);
pageResponse.setCode(ResponseCode.SERVER_ERROR);
pageResponse.setMsg("service error");
}
return pageResponse;
}
}

127
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java

@ -1,127 +0,0 @@
package com.dongjian.dashboard.back.controller;
import com.dongjian.dashboard.back.common.exception.BusinessException;
import com.dongjian.dashboard.back.common.response.PageInfo;
import com.dongjian.dashboard.back.common.response.PageResponse;
import com.dongjian.dashboard.back.common.response.ResponseCode;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.configurator.aspect.OperationLog;
import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired;
import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam;
import com.dongjian.dashboard.back.service.LevelHierarchyRoleService;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* @author jwy-style
*
*/
@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解
@AccessRequired //注解标识是否需要验证token
@RequestMapping("/levelHierarchyRole") //http请求路径映射
@Tag(name = "支社、支店等层级角色的相关接口",description = "支社、支店等层级角色的相关接口")
@SuppressWarnings("unchecked")
public class LevelHierarchyRoleController {
private static Logger logger = LoggerFactory.getLogger(LevelHierarchyRoleController.class);
@Autowired
private LevelHierarchyRoleService levelHierarchyRoleService;
@OperationLog(operation = "addLevelHierarchyRole", remark = "")
@Operation(summary = "添加角色")
@RequestMapping(value = "/add",method = RequestMethod.POST)
public SimpleDataResponse add(
@RequestBody OptLevelHierarchyRoleParam optLevelHierarchyRoleParam,
@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=true) 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 levelHierarchyRoleService.add(optLevelHierarchyRoleParam, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "editLevelHierarchyRole", remark = "")
@Operation(summary = "编辑角色")
@RequestMapping(value = "/edit",method = RequestMethod.POST)
public SimpleDataResponse edit(
@RequestBody OptLevelHierarchyRoleParam optLevelHierarchyRoleParam,
@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=true) 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 levelHierarchyRoleService.edit(optLevelHierarchyRoleParam, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "deleteLevelHierarchyRole", remark = "")
@Operation(summary = "删除角色")
@RequestMapping(value = "/batchDelete",method = RequestMethod.POST)
public SimpleDataResponse batchDelete(
@RequestBody DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam,
@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=true) 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 levelHierarchyRoleService.batchDelete(deleteLevelHierarchyRoleParam, CompanyId, UserId, LanguageType);
}
@OperationLog(operation = "queryLevelHierarchyRole", remark = "")
@Operation(summary = "获取角色列表")
@RequestMapping(value = "/getListPage",method = RequestMethod.GET)
public PageResponse<PageInfo<LevelHierarchyRolePageDTO>> getListPage(
@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,
PageLevelHierarchyRoleSearchParam pageSearchParam
) throws BusinessException {
pageSearchParam.setUserId(UserId);
// pageSearchParam.setCompanyId(CompanyId);
PageResponse<PageInfo<LevelHierarchyRolePageDTO>> pageResponse = new PageResponse<PageInfo<LevelHierarchyRolePageDTO>>();
try{
pageResponse.setData(levelHierarchyRoleService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType));
pageResponse.setCode(ResponseCode.SUCCESS);
pageResponse.setMsg("success");
}catch (Exception e){
logger.error("查询列表报错",e);
pageResponse.setCode(ResponseCode.SERVER_ERROR);
pageResponse.setMsg("service error");
}
return pageResponse;
}
// @Hidden
@GetMapping("/tree/{roleId}")
@Operation(summary = "查询指定层级角色对应的物件树结构")
public SimpleDataResponse<List<LevelHierarchyTreeVO>> getHierarchyTree(
@PathVariable("roleId") Long roleId,
@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
) {
return levelHierarchyRoleService.getHierarchyTree(roleId, CompanyId, UserId, LanguageType);
}
}

15
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java

@ -4,6 +4,8 @@ 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.data.OverviewVO;
import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts;
import com.dongjian.dashboard.back.weather.QueryWeather;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
@ -38,4 +40,17 @@ 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.getOverviewInfo(UserId, CompanyId, LanguageType, UTCOffset);
}
@Operation(summary = "Get weather information")
@RequestMapping(value = "/getWeatherInfo", method = RequestMethod.GET)
public SimpleDataResponse<JpMeshHourlyForecasts> getWeatherInfo(
QueryWeather queryWeather,
@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.getWeatherInfo(queryWeather, UserId, CompanyId, LanguageType, UTCOffset);
}
}

114
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/AutoLoginFilter.java

@ -0,0 +1,114 @@
package com.dongjian.dashboard.back.oidc;
import com.dongjian.dashboard.back.util.redis.RedisUtil;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
import org.springframework.web.filter.OncePerRequestFilter;
import java.io.IOException;
public class AutoLoginFilter extends OncePerRequestFilter {
private static final Logger logger = LoggerFactory.getLogger(AutoLoginFilter.class);
private String oidc_issuser;
private final RedisUtil redisUtil;
private final AuthenticationManager authenticationManager;
public AutoLoginFilter(String oidc_issuser, AuthenticationManager authenticationManager, RedisUtil redisUtil) {
this.authenticationManager = authenticationManager;
this.redisUtil = redisUtil;
this.oidc_issuser = oidc_issuser;
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException {
String uri = request.getRequestURI();
if (uri.contains("/oauth2/") && SecurityContextHolder.getContext().getAuthentication() == null) {
String loginToken = getCookieValue(request, "auth_token");
if (loginToken == null || !validateLoginToken(loginToken)) {
logger.info("Main site login required, reject OIDC auto-login.....");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Please login first");
return;
}
String username = SecurityConfig.USERDETAILS_USERNAME;
String password = SecurityConfig.USERDETAILS_PASSWORD;
UsernamePasswordAuthenticationToken authRequest =
new UsernamePasswordAuthenticationToken(username, password);
try {
Authentication authentication = authenticationManager.authenticate(authRequest);
SecurityContext context = SecurityContextHolder.createEmptyContext();
context.setAuthentication(authentication);
SecurityContextHolder.setContext(context);
HttpSession session = request.getSession(true);
session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, context);
logger.info("Auto login success for user: {}", username);
// 认证成功后重定向,避免 SavedRequest 失效问题
// String redirectUri = uri +
// (request.getQueryString() != null ? "?" + request.getQueryString() : "");
//上面的代码,在多个域名指向同一服务时,会改变域名
String redirectUri = oidc_issuser.replace("/api", "") +
uri + (request.getQueryString() != null ? "?" + request.getQueryString() : "");
logger.info("Set redirectUri: {}", redirectUri);
response.sendRedirect(redirectUri);
return;
} catch (AuthenticationException ex) {
logger.error("Auto login failed", ex);
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
}
chain.doFilter(request, response);
}
private boolean validateLoginToken(String loginToken) {
Object userDataStr = redisUtil.get(loginToken);
if (null != userDataStr) {
return true;
}
return false;
}
private String getCookieValue(HttpServletRequest request, String name) {
if (request.getCookies() != null) {
for (Cookie cookie : request.getCookies()) {
if (name.equals(cookie.getName())) {
return cookie.getValue();
}
}
}
return null;
}
}

26
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/Jwks.java

@ -0,0 +1,26 @@
package com.dongjian.dashboard.back.oidc;
import com.nimbusds.jose.jwk.RSAKey;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.interfaces.RSAPublicKey;
import java.security.interfaces.RSAPrivateKey;
import java.util.UUID;
public class Jwks {
public static RSAKey generateRsa() {
try {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
generator.initialize(2048);
KeyPair keyPair = generator.generateKeyPair();
return new RSAKey.Builder((RSAPublicKey) keyPair.getPublic())
.privateKey((RSAPrivateKey) keyPair.getPrivate())
.keyID(UUID.randomUUID().toString())
.build();
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
}

162
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/SecurityConfig.java

@ -0,0 +1,162 @@
package com.dongjian.dashboard.back.oidc;
import java.util.UUID;
import com.dongjian.dashboard.back.util.redis.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.Customizer;
import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
import org.springframework.security.oauth2.core.oidc.OidcScopes;
import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration;
import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.jwk.RSAKey;
import com.nimbusds.jose.jwk.source.ImmutableJWKSet;
import com.nimbusds.jose.jwk.source.JWKSource;
import com.nimbusds.jose.proc.SecurityContext;
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
import org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext;
import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
@Configuration
@EnableWebSecurity
public class SecurityConfig {
private static Logger logger = LoggerFactory.getLogger(SecurityConfig.class);
@Value("${oidc.issuer}")
private String oidc_issuser;
@Value("${oidc.bimviewer-url}")
private String oidc_bimviewer_url;
@Value("${oidc.bimviewer-cognito-auth-host}")
private String oidc_bimviewer_cognito_auth_host;
@Autowired
private RedisUtil redisUtil;
public static final String USERDETAILS_USERNAME = "admin";
public static final String USERDETAILS_PASSWORD = "pass";
@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
return authenticationConfiguration.getAuthenticationManager();
}
@Bean
@Order(1)
public SecurityFilterChain authServerSecurityFilterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception {
// 默认授权服务器配置
OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http);
// 开启 OpenID Connect 支持
http.getConfigurer(OAuth2AuthorizationServerConfigurer.class)
.oidc(Customizer.withDefaults());
// 添加自动登录过滤器(放在认证过滤器之前)
http.addFilterBefore(new AutoLoginFilter(oidc_issuser, authenticationManager, redisUtil), UsernamePasswordAuthenticationFilter.class);
return http.build();
}
@Bean
@Order(2)
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(authorize -> authorize
.anyRequest().permitAll() //放行所有请求
)
.formLogin(Customizer.withDefaults()) // 可有可无,决定是否提供登录页
.csrf(csrf -> csrf.disable()); // 如果是前后端分离接口建议关闭 CSRF
return http.build();
}
@Bean
public AuthorizationServerSettings authorizationServerSettings() {
return AuthorizationServerSettings.builder()
.issuer(oidc_issuser) // 替换为真实的域名
.build();
}
@Bean
public RegisteredClientRepository registeredClientRepository() {
RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString())
.clientId("at04vt84q43nq00ueuf2l4k8b")
.clientSecret("{noop}2ih0h9h6mlt18bumiv36v0jjqfkoidlqckdcfu02mesr31d2ojia")
.clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_POST)
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
.authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN)
.redirectUri(oidc_bimviewer_url)
.redirectUri(oidc_bimviewer_cognito_auth_host + "/oauth2/idpresponse")
.scope(OidcScopes.OPENID)
.scope(OidcScopes.EMAIL)
.scope(OidcScopes.PHONE)
.scope(OidcScopes.PROFILE)
.build();
return new InMemoryRegisteredClientRepository(registeredClient);
}
@Bean
public OAuth2TokenCustomizer<JwtEncodingContext> tokenCustomizer() {
return context -> {
Authentication principal = context.getPrincipal();
// 只对 id_token 添加 claim
if ("id_token".equals(context.getTokenType().getValue())) {
if (principal != null && principal.getPrincipal() instanceof UserDetails userDetails) {
context.getClaims().claim("email", userDetails.getUsername() + "@example.com");
context.getClaims().claim("given_name", "Test");
context.getClaims().claim("family_name", "User");
}
}
};
}
@Bean
public JWKSource<SecurityContext> jwkSource() {
RSAKey rsaKey = Jwks.generateRsa();
JWKSet jwkSet = new JWKSet(rsaKey);
return new ImmutableJWKSet<>(jwkSet);
}
@Bean
public UserDetailsService users() {
UserDetails user = User.builder()
.username(USERDETAILS_USERNAME)
.password("{noop}" + USERDETAILS_PASSWORD)
.roles("USER")
.build();
return new InMemoryUserDetailsManager(user);
}
}

15
dongjian-dashboard-back-controller/src/main/resources/config/application.properties

@ -6,22 +6,22 @@ spring.mvc.pathmatch.matching-strategy= ANT_PATH_MATCHER
mybatis.mapperLocations=classpath:mappers/**/*.xml
spring.datasource.admin.name=data_center_new
spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.admin.name=data_center_aeon_admin
spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.admin.username=${datasourceUsername}
spring.datasource.admin.password=${datasourcePassword}
#使用druid数据源
spring.datasource.admin.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.admin.driverClassName=com.mysql.jdbc.Driver
spring.datasource.admin.hikari.driverClassName=com.mysql.jdbc.Driver
spring.datasource.admin.hikari.schema=data_center_new
spring.datasource.admin.hikari.schema=data_center_aeon_admin
spring.datasource.admin.hikari.minimum-idle: 5
spring.datasource.admin.hikari.maximum-pool-size: ${rdsMaxPool:40}
spring.datasource.admin.hikari.connection-timeout:10000
dynamic.jdbc.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/%s?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
#配置log日志
@ -107,3 +107,10 @@ amazon.aws.actionable.bucket=${awsActionableBucket}
amazon.aws.actionable.directory=${awsActionableDirectory}
amazon.aws.actionable.roleArn=${awsActionableRoleArn}
weather.jwa.apikey=${weatherJwaApiKey}
weather.jwa.x-apikey=${weatherJwaXApiKey}
ai.api_base=${aiApiBase:https://pdf-demo-stg.ttkdatatechbuild.com/api}
oidc.issuer = ${oidcIssuer:https://dongjian.southwave.tech/api}
oidc.bimviewer-url = ${oidcBimviewerUrl:https://bimviewer-stg.ttkdatatechbuild.com/TTNB}
oidc.bimviewer-cognito-auth-host = ${oidcBimviewerCognitoAuthHost:https://bimviewer-stg.auth.ap-northeast-1.amazoncognito.com}

96
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java

@ -1,96 +0,0 @@
package com.dongjian.dashboard.back.dao.auto;
import com.dongjian.dashboard.back.model.DashboardLevelRole;
import com.dongjian.dashboard.back.model.DashboardLevelRoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DashboardLevelRoleMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
long countByExample(DashboardLevelRoleExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int deleteByExample(DashboardLevelRoleExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int insert(DashboardLevelRole record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int insertSelective(DashboardLevelRole record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
List<DashboardLevelRole> selectByExample(DashboardLevelRoleExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
DashboardLevelRole selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DashboardLevelRole record, @Param("example") DashboardLevelRoleExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int updateByExample(@Param("record") DashboardLevelRole record, @Param("example") DashboardLevelRoleExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DashboardLevelRole record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
int updateByPrimaryKey(DashboardLevelRole record);
}

96
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNoticeIgnoredMapper.java

@ -0,0 +1,96 @@
package com.dongjian.dashboard.back.dao.auto;
import com.dongjian.dashboard.back.model.DashboardNoticeIgnored;
import com.dongjian.dashboard.back.model.DashboardNoticeIgnoredExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DashboardNoticeIgnoredMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
long countByExample(DashboardNoticeIgnoredExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int deleteByExample(DashboardNoticeIgnoredExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int insert(DashboardNoticeIgnored record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int insertSelective(DashboardNoticeIgnored record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
List<DashboardNoticeIgnored> selectByExample(DashboardNoticeIgnoredExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
DashboardNoticeIgnored selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DashboardNoticeIgnored record, @Param("example") DashboardNoticeIgnoredExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int updateByExample(@Param("record") DashboardNoticeIgnored record, @Param("example") DashboardNoticeIgnoredExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DashboardNoticeIgnored record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
int updateByPrimaryKey(DashboardNoticeIgnored record);
}

22
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java

@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -16,7 +16,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -24,7 +24,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -32,7 +32,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -40,7 +40,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -48,7 +48,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -56,7 +56,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -64,7 +64,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -72,7 +72,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -80,7 +80,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -88,7 +88,7 @@ public interface DeviceGroupMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/

14
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java

@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -16,7 +16,7 @@ public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -24,7 +24,7 @@ public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -32,7 +32,7 @@ public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -40,7 +40,7 @@ public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -48,7 +48,7 @@ public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -56,7 +56,7 @@ public interface DeviceGroupRelationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/

5
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java

@ -1,9 +1,14 @@
package com.dongjian.dashboard.back.dao.ex;
import com.dongjian.dashboard.back.dao.auto.AlertHistoryMapper;
import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest;
import com.dongjian.dashboard.back.vo.device.WindowAlertVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AlertHistoryMapperExt extends AlertHistoryMapper {
List<WindowAlertVO> getWindowList(WindowAlertQueryRequest windowAlertQueryRequest);
}

1
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java

@ -20,4 +20,5 @@ public interface BasicRoleMapperExt extends BasicRoleMapper {
List<RolePageDTO> getListPage(PageSearchParam pageSearchParam);
Long getRoleIdByUserId(Long userId);
}

24
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java

@ -1,24 +0,0 @@
package com.dongjian.dashboard.back.dao.ex;
import com.dongjian.dashboard.back.dao.auto.DashboardLevelRoleMapper;
import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DashboardLevelRoleMapperExt extends DashboardLevelRoleMapper {
long checkExist(OptLevelHierarchyRoleParam param);
long checkBound(@Param("idList") List<Long> idList);
void deleteUserRelation(@Param("idList") List<Long> idList);
List<LevelHierarchyRolePageDTO> getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam);
int checkAdministrativePrivileges(Long userId);
}

21
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNoticeIgnoredMapperExt.java

@ -0,0 +1,21 @@
package com.dongjian.dashboard.back.dao.ex;
import com.dongjian.dashboard.back.dao.auto.DashboardNoticeIgnoredMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DashboardNoticeIgnoredMapperExt extends DashboardNoticeIgnoredMapper {
// 查询指定 key 下所有告警id
List<String> getMembersByKey(@Param("userKey") String userKey);
// 添加告警id
void addMember(@Param("userKey") String userKey, @Param("memberValue") String memberValue, @Param("createdAt") Long createdAt);
// 删除告警id
void removeMember(@Param("userKey") String userKey, @Param("memberValue") String memberValue);
}

6
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java

@ -1,14 +1,8 @@
package com.dongjian.dashboard.back.dao.ex;
import com.dongjian.dashboard.back.dao.auto.DeviceGroupMapper;
import com.dongjian.dashboard.back.dao.auto.DeviceGroupRelationMapper;
import com.dongjian.dashboard.back.dto.devicegroup.DeviceGroupSearchParams;
import com.dongjian.dashboard.back.dto.devicegroup.OptDeviceGroupParams;
import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DeviceGroupRelationMapperExt extends DeviceGroupRelationMapper {

41
dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java

@ -1,41 +0,0 @@
package com.dongjian.dashboard.back.dao.ex;
import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface LevelHierarchyMapperExt {
long checkExist(OptLevelHierarchyParam param);
void insertHierarchy(OptLevelHierarchyParam param);
void deleteRelations(@Param("relationType") String relationType,
@Param("childId") Long childId);
void insertHierarchyRelation(@Param("relationType") String relationType,
@Param("parentIdList") List<Long> parentIdList,
@Param("childId") Long childId,
@Param("createdBy") Long createdBy,
@Param("createdAt") Long createdAt);
long checkOld(OptLevelHierarchyParam param);
void updateHierarchy(OptLevelHierarchyParam param);
Long countChildrenByType(@Param("type") String type,
@Param("idList") List<Long> idList);
void deleteHierarchyByType(@Param("type") String type,
@Param("idList") List<Long> idList);
List<LevelHierarchyPageDTO> getListPage(PageLevelHierarchySearchParam pageSearchParam);
List<LevelHierarchyTreeVO> selectAllHierarchyByCompanyId(@Param("companyId") Long companyId);
}

51
dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml

@ -20,6 +20,8 @@
<result column="thumbnail_num" jdbcType="INTEGER" property="thumbnailNum" />
<result column="show_switch_2d3d" jdbcType="INTEGER" property="showSwitch2d3d" />
<result column="brief_introduction" jdbcType="VARCHAR" property="briefIntroduction" />
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.dongjian.dashboard.back.model.BasicBuilding">
<!--
@ -101,7 +103,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
building_id, company_id, `name`, address, flag, create_time, creator_id, modify_time,
modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction
modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction,
latitude, longitude
</sql>
<sql id="Blob_Column_List">
<!--
@ -189,14 +192,16 @@
address, flag, create_time,
creator_id, modify_time, modifier_id,
udf_building_id, building_bucket, thumbnail_num,
show_switch_2d3d, brief_introduction, floor_info_list,
picture_introduction)
show_switch_2d3d, brief_introduction, latitude,
longitude, floor_info_list, picture_introduction
)
values (#{buildingId,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT},
#{creatorId,jdbcType=BIGINT}, #{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT},
#{udfBuildingId,jdbcType=VARCHAR}, #{buildingBucket,jdbcType=VARCHAR}, #{thumbnailNum,jdbcType=INTEGER},
#{showSwitch2d3d,jdbcType=INTEGER}, #{briefIntroduction,jdbcType=VARCHAR}, #{floorInfoList,jdbcType=LONGVARCHAR},
#{pictureIntroduction,jdbcType=LONGVARCHAR})
#{showSwitch2d3d,jdbcType=INTEGER}, #{briefIntroduction,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
#{longitude,jdbcType=VARCHAR}, #{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.BasicBuilding">
<!--
@ -247,6 +252,12 @@
<if test="briefIntroduction != null">
brief_introduction,
</if>
<if test="latitude != null">
latitude,
</if>
<if test="longitude != null">
longitude,
</if>
<if test="floorInfoList != null">
floor_info_list,
</if>
@ -297,6 +308,12 @@
<if test="briefIntroduction != null">
#{briefIntroduction,jdbcType=VARCHAR},
</if>
<if test="latitude != null">
#{latitude,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
#{longitude,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
#{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -364,6 +381,12 @@
<if test="record.briefIntroduction != null">
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
</if>
<if test="record.latitude != null">
latitude = #{record.latitude,jdbcType=VARCHAR},
</if>
<if test="record.longitude != null">
longitude = #{record.longitude,jdbcType=VARCHAR},
</if>
<if test="record.floorInfoList != null">
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -395,6 +418,8 @@
thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
latitude = #{record.latitude,jdbcType=VARCHAR},
longitude = #{record.longitude,jdbcType=VARCHAR},
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{record.pictureIntroduction,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
@ -420,7 +445,9 @@
building_bucket = #{record.buildingBucket,jdbcType=VARCHAR},
thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR}
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
latitude = #{record.latitude,jdbcType=VARCHAR},
longitude = #{record.longitude,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -471,6 +498,12 @@
<if test="briefIntroduction != null">
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
</if>
<if test="latitude != null">
latitude = #{latitude,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
longitude = #{longitude,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -499,6 +532,8 @@
thumbnail_num = #{thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
latitude = #{latitude,jdbcType=VARCHAR},
longitude = #{longitude,jdbcType=VARCHAR},
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{pictureIntroduction,jdbcType=LONGVARCHAR}
where building_id = #{buildingId,jdbcType=BIGINT}
@ -521,7 +556,9 @@
building_bucket = #{buildingBucket,jdbcType=VARCHAR},
thumbnail_num = #{thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR}
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
latitude = #{latitude,jdbcType=VARCHAR},
longitude = #{longitude,jdbcType=VARCHAR}
where building_id = #{buildingId,jdbcType=BIGINT}
</update>
</mapper>

29
dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml

@ -25,6 +25,7 @@
<result column="modify_time" jdbcType="BIGINT" property="modifyTime" />
<result column="modifier_id" jdbcType="BIGINT" property="modifierId" />
<result column="super_role" jdbcType="INTEGER" property="superRole" />
<result column="create_platform" jdbcType="INTEGER" property="createPlatform" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -99,7 +100,7 @@
-->
id, user_type, company_id, username, login_name, `password`, salt, email, mfa_secret,
mfa_bind, mobile_number, last_login_time, flag, expire_time, create_time, creator_id,
modify_time, modifier_id, super_role
modify_time, modifier_id, super_role, create_platform
</sql>
<select id="selectByExample" parameterType="com.dongjian.dashboard.back.model.BasicUserExample" resultMap="BaseResultMap">
<!--
@ -161,15 +162,15 @@
email, mfa_secret, mfa_bind,
mobile_number, last_login_time, flag,
expire_time, create_time, creator_id,
modify_time, modifier_id, super_role
)
modify_time, modifier_id, super_role,
create_platform)
values (#{userType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR},
#{loginName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{mfaSecret,jdbcType=VARCHAR}, #{mfaBind,jdbcType=INTEGER},
#{mobileNumber,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=BIGINT}, #{flag,jdbcType=INTEGER},
#{expireTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
#{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{superRole,jdbcType=INTEGER}
)
#{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{superRole,jdbcType=INTEGER},
#{createPlatform,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.BasicUser">
<!--
@ -235,6 +236,9 @@
<if test="superRole != null">
super_role,
</if>
<if test="createPlatform != null">
create_platform,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userType != null">
@ -291,6 +295,9 @@
<if test="superRole != null">
#{superRole,jdbcType=INTEGER},
</if>
<if test="createPlatform != null">
#{createPlatform,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.dongjian.dashboard.back.model.BasicUserExample" resultType="java.lang.Long">
@ -367,6 +374,9 @@
<if test="record.superRole != null">
super_role = #{record.superRole,jdbcType=INTEGER},
</if>
<if test="record.createPlatform != null">
create_platform = #{record.createPlatform,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -396,7 +406,8 @@
creator_id = #{record.creatorId,jdbcType=BIGINT},
modify_time = #{record.modifyTime,jdbcType=BIGINT},
modifier_id = #{record.modifierId,jdbcType=BIGINT},
super_role = #{record.superRole,jdbcType=INTEGER}
super_role = #{record.superRole,jdbcType=INTEGER},
create_platform = #{record.createPlatform,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -462,6 +473,9 @@
<if test="superRole != null">
super_role = #{superRole,jdbcType=INTEGER},
</if>
<if test="createPlatform != null">
create_platform = #{createPlatform,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -488,7 +502,8 @@
creator_id = #{creatorId,jdbcType=BIGINT},
modify_time = #{modifyTime,jdbcType=BIGINT},
modifier_id = #{modifierId,jdbcType=BIGINT},
super_role = #{superRole,jdbcType=INTEGER}
super_role = #{superRole,jdbcType=INTEGER},
create_platform = #{createPlatform,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

158
dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardLevelRoleMapper.xml → dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardNoticeIgnoredMapper.xml

@ -1,19 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dongjian.dashboard.back.dao.auto.DashboardLevelRoleMapper">
<resultMap id="BaseResultMap" type="com.dongjian.dashboard.back.model.DashboardLevelRole">
<mapper namespace="com.dongjian.dashboard.back.dao.auto.DashboardNoticeIgnoredMapper">
<resultMap id="BaseResultMap" type="com.dongjian.dashboard.back.model.DashboardNoticeIgnored">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="redis_key" jdbcType="VARCHAR" property="redisKey" />
<result column="member_value" jdbcType="VARCHAR" property="memberValue" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -86,9 +82,9 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_id, `name`, remark, flag, created_by, created_at, updated_at
id, redis_key, member_value, created_at
</sql>
<select id="selectByExample" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRoleExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnoredExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@ -99,7 +95,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from dashboard_level_role
from dashboard_notice_ignored
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -114,7 +110,7 @@
-->
select
<include refid="Base_Column_List" />
from dashboard_level_role
from dashboard_notice_ignored
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@ -122,20 +118,20 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dashboard_level_role
delete from dashboard_notice_ignored
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRoleExample">
<delete id="deleteByExample" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnoredExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dashboard_level_role
delete from dashboard_notice_ignored
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRole">
<insert id="insert" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnored">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@ -143,14 +139,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into dashboard_level_role (company_id, `name`, remark,
flag, created_by, created_at,
updated_at)
values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT})
insert into dashboard_notice_ignored (redis_key, member_value, created_at
)
values (#{redisKey,jdbcType=VARCHAR}, #{memberValue,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRole">
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnored">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@ -158,60 +152,36 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into dashboard_level_role
insert into dashboard_notice_ignored
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">
company_id,
<if test="redisKey != null">
redis_key,
</if>
<if test="name != null">
`name`,
</if>
<if test="remark != null">
remark,
</if>
<if test="flag != null">
flag,
</if>
<if test="createdBy != null">
created_by,
<if test="memberValue != null">
member_value,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">
#{companyId,jdbcType=BIGINT},
<if test="redisKey != null">
#{redisKey,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="flag != null">
#{flag,jdbcType=INTEGER},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
<if test="memberValue != null">
#{memberValue,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRoleExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnoredExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dashboard_level_role
select count(*) from dashboard_notice_ignored
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -221,32 +191,20 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_level_role
update dashboard_notice_ignored
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=BIGINT},
<if test="record.redisKey != null">
redis_key = #{record.redisKey,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.flag != null">
flag = #{record.flag,jdbcType=INTEGER},
</if>
<if test="record.createdBy != null">
created_by = #{record.createdBy,jdbcType=BIGINT},
<if test="record.memberValue != null">
member_value = #{record.memberValue,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=BIGINT},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -257,63 +215,43 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_level_role
update dashboard_notice_ignored
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
flag = #{record.flag,jdbcType=INTEGER},
created_by = #{record.createdBy,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=BIGINT},
updated_at = #{record.updatedAt,jdbcType=BIGINT}
redis_key = #{record.redisKey,jdbcType=VARCHAR},
member_value = #{record.memberValue,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRole">
<update id="updateByPrimaryKeySelective" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnored">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_level_role
update dashboard_notice_ignored
<set>
<if test="companyId != null">
company_id = #{companyId,jdbcType=BIGINT},
<if test="redisKey != null">
redis_key = #{redisKey,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="flag != null">
flag = #{flag,jdbcType=INTEGER},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
<if test="memberValue != null">
member_value = #{memberValue,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.dongjian.dashboard.back.model.DashboardLevelRole">
<update id="updateByPrimaryKey" parameterType="com.dongjian.dashboard.back.model.DashboardNoticeIgnored">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_level_role
set company_id = #{companyId,jdbcType=BIGINT},
`name` = #{name,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
flag = #{flag,jdbcType=INTEGER},
created_by = #{createdBy,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT}
update dashboard_notice_ignored
set redis_key = #{redisKey,jdbcType=VARCHAR},
member_value = #{memberValue,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

47
dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml

@ -10,7 +10,6 @@
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="building_id" jdbcType="BIGINT" property="buildingId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="group_type" jdbcType="INTEGER" property="groupType" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
@ -87,7 +86,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_id, building_id, `name`, group_type, remark, flag, created_by, created_at
id, company_id, building_id, `name`, remark, flag, created_by, created_at
</sql>
<select id="selectByExample" parameterType="com.dongjian.dashboard.back.model.DeviceGroupExample" resultMap="BaseResultMap">
<!--
@ -100,7 +99,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from device_group
from dashboard_device_group
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -115,7 +114,7 @@
-->
select
<include refid="Base_Column_List" />
from device_group
from dashboard_device_group
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@ -123,7 +122,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from device_group
delete from dashboard_device_group
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.dongjian.dashboard.back.model.DeviceGroupExample">
@ -131,7 +130,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from device_group
delete from dashboard_device_group
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -144,12 +143,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into device_group (company_id, building_id, `name`,
group_type, remark, flag,
created_by, created_at)
insert into dashboard_device_group (company_id, building_id, `name`,
remark, flag, created_by,
created_at)
values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{groupType,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER},
#{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT})
#{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT},
#{createdAt,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.DeviceGroup">
<!--
@ -159,7 +158,7 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into device_group
insert into dashboard_device_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">
company_id,
@ -170,9 +169,6 @@
<if test="name != null">
`name`,
</if>
<if test="groupType != null">
group_type,
</if>
<if test="remark != null">
remark,
</if>
@ -196,9 +192,6 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="groupType != null">
#{groupType,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
@ -218,7 +211,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from device_group
select count(*) from dashboard_device_group
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -228,7 +221,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update device_group
update dashboard_device_group
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
@ -242,9 +235,6 @@
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.groupType != null">
group_type = #{record.groupType,jdbcType=INTEGER},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
@ -267,12 +257,11 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update device_group
update dashboard_device_group
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
building_id = #{record.buildingId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
group_type = #{record.groupType,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
flag = #{record.flag,jdbcType=INTEGER},
created_by = #{record.createdBy,jdbcType=BIGINT},
@ -286,7 +275,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update device_group
update dashboard_device_group
<set>
<if test="companyId != null">
company_id = #{companyId,jdbcType=BIGINT},
@ -297,9 +286,6 @@
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="groupType != null">
group_type = #{groupType,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
@ -320,11 +306,10 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update device_group
update dashboard_device_group
set company_id = #{companyId,jdbcType=BIGINT},
building_id = #{buildingId,jdbcType=BIGINT},
`name` = #{name,jdbcType=VARCHAR},
group_type = #{groupType,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
flag = #{flag,jdbcType=INTEGER},
created_by = #{createdBy,jdbcType=BIGINT},

14
dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml

@ -93,7 +93,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from device_group_relation
from dashboard_device_group_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -106,7 +106,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from device_group_relation
delete from dashboard_device_group_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -116,7 +116,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into device_group_relation (device_info_id, device_group_id)
insert into dashboard_device_group_relation (device_info_id, device_group_id)
values (#{deviceInfoId,jdbcType=INTEGER}, #{deviceGroupId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.DeviceGroupRelation">
@ -124,7 +124,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into device_group_relation
insert into dashboard_device_group_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceInfoId != null">
device_info_id,
@ -147,7 +147,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from device_group_relation
select count(*) from dashboard_device_group_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -157,7 +157,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update device_group_relation
update dashboard_device_group_relation
<set>
<if test="record.deviceInfoId != null">
device_info_id = #{record.deviceInfoId,jdbcType=INTEGER},
@ -175,7 +175,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update device_group_relation
update dashboard_device_group_relation
set device_info_id = #{record.deviceInfoId,jdbcType=INTEGER},
device_group_id = #{record.deviceGroupId,jdbcType=BIGINT}
<if test="_parameter != null">

46
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHistoryMapperExt.xml

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dongjian.dashboard.back.dao.ex.AlertHistoryMapperExt">
<select id="getWindowList" resultType="com.dongjian.dashboard.back.vo.device.WindowAlertVO">
SELECT
alert_history.id alertId,
device_info.id,
device_info.company_id,
device_info.device_name,
device_info.device_id,
device_info.device_sn,
basic_building.building_id,
basic_building.name as buildingName,
basic_floor.floor_id,
basic_floor.name as floorName,
basic_space.space_id,
basic_space.name as spaceName,
basic_monitoring_asset.equipment_id as assetId,
basic_monitoring_asset.symbol as assetSymbol,
device_info.remark,
device_info.monitoring_point_name,
basic_asset_class_big.id monitoringPointCategoryId,
basic_asset_class_big.class_name as monitoringPointCategoryName,
device_info.data_provider_id,
data_provider.name as dataProviderName,
device_info.gateway_info_id,
data_provider_gateway_info.name as gatewayInfoName
FROM
device_info
inner join alert_history on device_info.device_id = alert_history.device_id
left join basic_monitoring_asset on device_info.asset_id = basic_monitoring_asset.equipment_id
left join basic_space on basic_monitoring_asset.space_id = basic_space.space_id
left join basic_floor on basic_space.floor_id = basic_floor.floor_id
left join basic_building on basic_floor.building_id = basic_building.building_id
left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id
left join data_provider on data_provider.id = device_info.data_provider_id
left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id
WHERE
device_info.company_id = #{companyId} and alert_history.receive_ts >= #{startTime} and alert_history.handle_status = 1
and device_info.flag = 0 and basic_monitoring_asset.flag != 1
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
order by alert_history.id desc
</select>
</mapper>

2
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml

@ -19,7 +19,7 @@
bbuilding.picture_introduction
FROM
basic_building bbuilding
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bbuilding.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bbuilding.company_id
WHERE
bbuilding.flag != 1 AND bcomp.flag != 1
AND bbuilding.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>

2
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml

@ -75,7 +75,7 @@
aurora_username,
aurora_password
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE flag != 1
<if test="companyId != null">
AND id = #{companyId}

5
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml

@ -56,12 +56,15 @@
basic_role brole
WHERE
brole.flag != 1 AND brole.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
AND brole.id != IFNULL((SELECT role_id FROM basic_role_user_relation WHERE user_id = #{userId}), -9)
<if test="roleName != null and roleName != ''">
AND brole.role_name LIKE CONCAT('%',#{roleName},'%')
</if>
</select>
<select id="getRoleIdByUserId" resultType="java.lang.Long">
SELECT role_id FROM basic_role_user_relation WHERE user_id = #{userId}
</select>
</mapper>

8
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml

@ -35,7 +35,7 @@
INNER JOIN basic_role_user_relation brur ON brur.user_id = buser.id
INNER JOIN basic_role brole ON brur.role_id = brole.id
WHERE
buser.flag != 1 AND brole.flag != 1 AND buser.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
buser.flag != 1 AND buser.create_platform = 1 AND brole.flag != 1 AND buser.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="userId != null">
AND buser.id != #{userId}
</if>
@ -107,9 +107,9 @@
SELECT
count(1)
FROM
data_center_new.basic_role_user_relation rru
INNER JOIN data_center_new.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_new.basic_role_menu_relation rmr ON br.id = rmr.role_id
data_center_aeon_admin.basic_role_user_relation rru
INNER JOIN data_center_aeon_admin.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_aeon_admin.basic_role_menu_relation rmr ON br.id = rmr.role_id
WHERE rmr.menu_id = 52 AND br.flag != 1 AND rru.user_id = #{userId}
</select>

64
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dongjian.dashboard.back.dao.ex.DashboardLevelRoleMapperExt">
<select id="checkExist" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM
dashboard_level_role drole
WHERE
drole.flag != 1 AND drole.`name` = #{name} AND drole.company_id = #{companyId}
<if test="id != null">
AND drole.id != #{id}
</if>
</select>
<select id="checkBound" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM
dashboard_level_role_user
WHERE level_role_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="deleteUserRelation" resultType="java.lang.Long">
DELETE FROM dashboard_level_role_user
WHERE level_role_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="getListPage" resultType="com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO">
SELECT
drole.id,
drole.`name`,
drole.remark,
drole.created_at
FROM
dashboard_level_role drole
WHERE
drole.flag != 1 AND drole.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
AND drole.id != IFNULL((SELECT level_role_id FROM dashboard_level_role_user WHERE user_id = #{userId}), -9)
<if test="name != null and name != ''">
AND drole.`name` LIKE CONCAT('%',#{name},'%')
</if>
ORDER BY drole.id DESC
</select>
<select id="checkAdministrativePrivileges" resultType="java.lang.Integer">
SELECT
count(1)
FROM
data_center_new.basic_role_user_relation rru
INNER JOIN data_center_new.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_new.basic_role_menu_relation rmr ON br.id = rmr.role_id
WHERE rmr.menu_id = 88 AND br.flag != 1 AND rru.user_id = #{userId}
</select>
</mapper>

21
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardNoticeIgnoredMapperExt.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dongjian.dashboard.back.dao.ex.DashboardNoticeIgnoredMapperExt">
<select id="getMembersByKey" parameterType="string" resultType="string">
SELECT member_value
FROM dashboard_notice_ignored
WHERE redis_key = #{userKey}
</select>
<insert id="addMember">
INSERT IGNORE INTO dashboard_notice_ignored (redis_key, member_value, created_at)
VALUES (#{userKey}, #{memberValue}, #{createdAt})
</insert>
<delete id="removeMember">
DELETE FROM dashboard_notice_ignored
WHERE redis_key = #{userKey} AND member_value = #{memberValue}
</delete>
</mapper>

22
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml

@ -18,27 +18,19 @@
<select id="getListPage" resultType="com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO">
SELECT
dg.id deviceGroupId,
dg.building_id,
basic_building.name buildingName,
dg.group_type,
dg.company_id,
dg.`name`,
dg.remark
FROM
device_group dg
inner join basic_building on dg.building_id = basic_building.building_id
dashboard_device_group dg
WHERE
dg.flag != 1
AND dg.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="deviceGroupIdList != null">
AND dg.id IN <foreach collection="deviceGroupIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if>
<if test="name != null">
AND dg.`name` LIKE CONCAT('%',#{name},'%')
</if>
<if test="groupType != null">
AND dg.`group_type` = #{groupType}
</if>
<if test="buildingId != null">
AND dg.`building_id` = #{buildingId}
</if>
@ -84,25 +76,25 @@
basic_monitoring_asset.symbol as assetSymbol,
device_info.remark,
device_info.monitoring_point_name,
device_info.monitoring_point_category_id,
mpc.name monitoringPointCategoryName,
mpc.id monitoringPointCategoryId,
mpc.class_name monitoringPointCategoryName,
device_info.data_provider_id,
data_provider.name dataProviderName,
device_info.gateway_info_id,
data_provider_gateway_info.name gatewayInfoName
from
device_group_relation
inner join device_info on device_group_relation.device_info_id = device_info.id
dashboard_device_group_relation
inner join device_info on dashboard_device_group_relation.device_info_id = device_info.id
left join basic_monitoring_asset on device_info.asset_id = basic_monitoring_asset.equipment_id
left join basic_space on basic_monitoring_asset.space_id = basic_space.space_id
left join basic_floor on basic_space.floor_id = basic_floor.floor_id
left join basic_building on basic_floor.building_id = basic_building.building_id
left join monitoring_point_category mpc on mpc.id = device_info.monitoring_point_category_id
left join basic_asset_class_big mpc on mpc.id = basic_monitoring_asset.class_big_id
left join data_provider on data_provider.id = device_info.data_provider_id
left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id
left join type on device_info.type_id = type.id
left join basic_project on device_info.project_id = basic_project.id
where device_group_relation.device_group_id = #{deviceGroupId}
where dashboard_device_group_relation.device_group_id = #{deviceGroupId}
</select>

61
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml

@ -12,8 +12,8 @@
device_info.type_id,
device_info.retain_alert,
device_info.monitoring_point_name,
device_info.monitoring_point_category_id,
monitoring_point_category.name as monitoringPointCategoryName,
basic_asset_class_big.id monitoringPointCategoryId,
basic_asset_class_big.class_name as monitoringPointCategoryName,
data_provider.name as dataProviderName,
data_provider.thumbnail_base64 as dataProviderThumbnailBase64,
device_info.gateway_info_id,
@ -30,7 +30,7 @@
left join data_provider on data_provider.id = device_info.data_provider_id
left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id
left join type on device_info.type_id = type.id
left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id
left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id
</sql>
<sql id="deviceDataCommonWhere">
@ -64,7 +64,7 @@
ORDER BY
<choose>
<when test="sortField == 'monitoringPointCategoryName'">
monitoring_point_category.name
basic_asset_class_big.class_name
</when>
<when test="sortField == 'floorName'">
basic_floor.name
@ -113,13 +113,12 @@
2 as classId
<include refid="deviceDataFromAndJoin"/>
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id
left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id
left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id
<where>
<if test="buildingId != null">
and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId}
and basic_building.building_id = #{buildingId}
</if>
and mpcg.id = #{monitoringPointCategoryGroupId}
and ddgr.device_group_id = #{deviceGroupId}
<include refid="deviceDataCommonWhere"/>
</where>
<include refid="drrOrder"/>
@ -151,13 +150,12 @@
3 as classId
<include refid="deviceDataFromAndJoin"/>
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id
left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id
left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id
<where>
<if test="buildingId != null">
and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId}
and basic_building.building_id = #{buildingId}
</if>
and mpcg.id = #{monitoringPointCategoryGroupId}
and ddgr.device_group_id = #{deviceGroupId}
<include refid="deviceDataCommonWhere"/>
</where>
<include refid="drrOrder"/>
@ -169,7 +167,7 @@
ORDER BY
<choose>
<when test="sortField == 'monitoringPointCategoryName'">
monitoring_point_category.name
basic_asset_class_big.class_name
</when>
<when test="sortField == 'floorName'">
basic_floor.name
@ -222,14 +220,13 @@
bss.is_running runningStatus,
4 as classId
<include refid="deviceDataFromAndJoin"/>
left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id
left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id
left join ba_status_statistics bss on bss.device_info_id = device_info.id
<where>
<if test="buildingId != null">
and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId}
and basic_building.building_id = #{buildingId}
</if>
and mpcg.id = #{monitoringPointCategoryGroupId}
and ddgr.device_group_id = #{deviceGroupId}
<include refid="deviceDataCommonWhere"/>
</where>
<include refid="BaStatusOrder"/>
@ -239,7 +236,7 @@
ORDER BY
<choose>
<when test="sortField == 'monitoringPointCategoryName'">
monitoring_point_category.name
basic_asset_class_big.class_name
</when>
<when test="sortField == 'floorName'">
basic_floor.name
@ -269,7 +266,8 @@
alert_history.confirm_status,
alert_history.handle_status,
alert_history.id alertHistoryId,
1 as classId
1 as classId,
basic_monitoring_asset.`symbol` assetSymbol
from
alert_history
left join device_info on alert_history.device_id = device_info.device_id
@ -280,7 +278,7 @@
left join data_provider on data_provider.id = device_info.data_provider_id
left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id
left join type on device_info.type_id = type.id
left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id
left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id
<where>
and device_info.flag = 0 and basic_monitoring_asset.flag != 1
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
@ -317,7 +315,8 @@
alert_history.confirm_status,
alert_history.handle_status,
alert_history.id alertHistoryId,
1 as classId
1 as classId,
basic_monitoring_asset.`symbol` assetSymbol
from
alert_history
left join device_info on alert_history.device_id = device_info.device_id
@ -328,16 +327,15 @@
left join data_provider on data_provider.id = device_info.data_provider_id
left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id
left join type on device_info.type_id = type.id
left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id
left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id
left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id
left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id
<where>
and device_info.flag = 0 and basic_monitoring_asset.flag != 1
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
<if test="buildingId != null">
and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId}
and basic_building.building_id = #{buildingId}
</if>
and mpcg.id = #{monitoringPointCategoryGroupId}
and ddgr.device_group_id = #{deviceGroupId}
<include refid="deviceDataCommonWhere"/>
<choose>
<when test="searchType == 1">
@ -381,8 +379,8 @@
basic_monitoring_asset.symbol as assetSymbol,
device_info.remark,
device_info.monitoring_point_name,
device_info.monitoring_point_category_id,
mpc.name as monitoringPointCategoryName,
basic_asset_class_big.id monitoringPointCategoryId,
basic_asset_class_big.class_name as monitoringPointCategoryName,
device_info.data_provider_id,
data_provider.name as dataProviderName,
device_info.gateway_info_id,
@ -396,7 +394,7 @@
left join basic_space on basic_monitoring_asset.space_id = basic_space.space_id
left join basic_floor on basic_space.floor_id = basic_floor.floor_id
left join basic_building on basic_floor.building_id = basic_building.building_id
left join monitoring_point_category mpc on mpc.id = device_info.monitoring_point_category_id
left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id
left join data_provider on data_provider.id = device_info.data_provider_id
left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id
left join type on device_info.type_id = type.id
@ -412,13 +410,16 @@
<if test="buildingId != null">
and basic_building.building_id = #{buildingId}
</if>
<if test="monitoringPointName != null and monitoringPointName != '' ">
and device_info.monitoring_point_name LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="companyIdList != null and companyIdList.size() > 0">
and device_info.company_id in
<foreach collection="companyIdList" item="companyId" open="(" separator="," close=")">
#{companyId}
</foreach>
</if>
and device_info.flag = 0
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and device_info.type_id in
<foreach collection="typeIdList" item="typeId" open="(" separator="," close=")">
#{typeId}

9
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml

@ -9,15 +9,16 @@
bbuilding.name AS buildingName,
drr.device_id,
drr.receive_ts,
dinfo.monitoring_point_category_id,
mpc.name AS monitoringPointCategoryName
basic_asset_class_big.id AS monitoringPointCategoryId,
basic_asset_class_big.class_name AS monitoringPointCategoryName
FROM
device_rawdata_realtime drr
INNER JOIN basic_building bbuilding ON drr.building_id = bbuilding.building_id
INNER JOIN device_info dinfo ON dinfo.device_id = drr.device_id
INNER JOIN monitoring_point_category mpc ON mpc.id = dinfo.monitoring_point_category_id
INNER JOIN basic_monitoring_asset on dinfo.asset_id = basic_monitoring_asset.equipment_id
INNER JOIN basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id
WHERE
bbuilding.company_id = #{companyId} AND bbuilding.flag = 0 AND dinfo.flag = 0
bbuilding.company_id = #{companyId} AND bbuilding.flag = 0 AND dinfo.flag = 0 AND basic_monitoring_asset.flag = 0 AND basic_asset_class_big.flag = 0
AND drr.status = 'alert'
AND dinfo.type_id in
<foreach collection="typeIdList" item="typeId" open="(" separator="," close=")">

359
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml

@ -1,359 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dongjian.dashboard.back.dao.ex.LevelHierarchyMapperExt">
<select id="checkExist" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM
<choose>
<when test="type == 'BRANCH'">dashboard_branch</when>
<when test="type == 'STORE'">dashboard_store</when>
<when test="type == 'AREA'">dashboard_area</when>
<when test="type == 'SITE'">dashboard_site</when>
</choose>
WHERE name = #{levelHierarchyName} AND company_id = #{companyId} AND flag != 1
<if test="id != null">
AND id != #{id}
</if>
</select>
<select id="checkOld" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM
<choose>
<when test="type == 'BRANCH'">dashboard_branch</when>
<when test="type == 'STORE'">dashboard_store</when>
<when test="type == 'AREA'">dashboard_area</when>
<when test="type == 'SITE'">dashboard_site</when>
</choose>
WHERE id = #{id} AND flag != 1
</select>
<insert id="insertHierarchy"
parameterType="com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam"
useGeneratedKeys="true"
keyProperty="id">
INSERT INTO
<choose>
<when test="type == 'BRANCH'">dashboard_branch</when>
<when test="type == 'STORE'">dashboard_store</when>
<when test="type == 'AREA'">dashboard_area</when>
<when test="type == 'SITE'">dashboard_site</when>
</choose>
(company_id, `name`, remark, created_by, created_at)
VALUES (#{companyId}, #{levelHierarchyName}, #{remark}, #{createdBy}, #{createdAt})
</insert>
<!-- 根据 childId 删除层级关系 -->
<delete id="deleteRelations">
<choose>
<!-- 支社 ↔ 分店 -->
<when test="relationType == 'BRANCH_STORE'">
DELETE FROM dashboard_branch_store
WHERE store_id = #{childId}
</when>
<!-- 分店 ↔ 区域 -->
<when test="relationType == 'STORE_AREA'">
DELETE FROM dashboard_store_area
WHERE area_id = #{childId}
</when>
<!-- 区域 ↔ Site -->
<when test="relationType == 'AREA_SITE'">
DELETE FROM dashboard_area_site
WHERE site_id = #{childId}
</when>
<!-- Site ↔ Building -->
<when test="relationType == 'SITE_BUILDING'">
DELETE FROM dashboard_site_building
WHERE building_id = #{childId}
</when>
</choose>
</delete>
<!-- 层级关系插入 -->
<insert id="insertHierarchyRelation">
<choose>
<!-- 支社 ↔ 分店 -->
<when test="relationType == 'BRANCH_STORE'">
INSERT INTO dashboard_branch_store (branch_id, store_id, created_by, created_at)
VALUES
<foreach collection="parentIdList" item="pid" separator=",">
(#{pid}, #{childId}, #{createdBy}, #{createdAt})
</foreach>
</when>
<!-- 分店 ↔ 区域 -->
<when test="relationType == 'STORE_AREA'">
INSERT INTO dashboard_store_area (store_id, area_id, created_by, created_at)
VALUES
<foreach collection="parentIdList" item="pid" separator=",">
(#{pid}, #{childId}, #{createdBy}, #{createdAt})
</foreach>
</when>
<!-- 区域 ↔ site -->
<when test="relationType == 'AREA_SITE'">
INSERT INTO dashboard_area_site (area_id, site_id, created_by, created_at)
VALUES
<foreach collection="parentIdList" item="pid" separator=",">
(#{pid}, #{childId}, #{createdBy}, #{createdAt})
</foreach>
</when>
<!-- site ↔ building -->
<when test="relationType == 'SITE_BUILDING'">
INSERT INTO dashboard_site_building (site_id, building_id, created_by, created_at)
VALUES
<foreach collection="parentIdList" item="pid" separator=",">
(#{pid}, #{childId}, #{createdBy}, #{createdAt})
</foreach>
</when>
</choose>
</insert>
<update id="updateHierarchy" parameterType="com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam">
UPDATE
<choose>
<when test="type == 'BRANCH'">dashboard_branch</when>
<when test="type == 'STORE'">dashboard_store</when>
<when test="type == 'AREA'">dashboard_area</when>
<when test="type == 'SITE'">dashboard_site</when>
</choose>
<set>
<if test="levelHierarchyName != null and levelHierarchyName != ''">
name = #{levelHierarchyName},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
updated_at = #{updatedAt}
</set>
WHERE id = #{id}
</update>
<!-- 检查是否存在下级 -->
<select id="countChildrenByType" resultType="java.lang.Long">
<choose>
<when test="type == 'BRANCH'">
SELECT COUNT(1)
FROM dashboard_branch_store
WHERE branch_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type == 'STORE'">
SELECT COUNT(1)
FROM dashboard_store_area
WHERE store_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type == 'AREA'">
SELECT COUNT(1)
FROM dashboard_area_site
WHERE area_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type == 'SITE'">
SELECT COUNT(1)
FROM dashboard_site_building
WHERE site_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
SELECT 0
</otherwise>
</choose>
</select>
<!-- 真正删除层级 -->
<delete id="deleteHierarchyByType">
<choose>
<when test="type == 'BRANCH'">
UPDATE dashboard_branch SET flag = 1
WHERE id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type == 'STORE'">
UPDATE dashboard_store SET flag = 1
WHERE id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type == 'AREA'">
UPDATE dashboard_area SET flag = 1
WHERE id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type == 'SITE'">
UPDATE dashboard_site SET flag = 1
WHERE id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
</choose>
</delete>
<select id="getListPage" resultType="com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO">
<choose>
<!-- 支社 -->
<when test="type == 'BRANCH'">
SELECT
id,
name AS levelHierarchyName,
remark,
created_at
FROM dashboard_branch
<where>
flag != 1
<if test="levelHierarchyName != null and levelHierarchyName != ''">
AND name LIKE CONCAT('%', #{levelHierarchyName}, '%')
</if>
</where>
ORDER BY id DESC
</when>
<!-- 支店 -->
<when test="type == 'STORE'">
SELECT
id,
name AS levelHierarchyName,
remark,
created_at
FROM dashboard_store
<where>
flag != 1
<if test="levelHierarchyName != null and levelHierarchyName != ''">
AND name LIKE CONCAT('%', #{levelHierarchyName}, '%')
</if>
</where>
ORDER BY id DESC
</when>
<!-- 区域 -->
<when test="type == 'AREA'">
SELECT
id,
name AS levelHierarchyName,
remark,
created_at
FROM dashboard_area
<where>
flag != 1
<if test="levelHierarchyName != null and levelHierarchyName != ''">
AND name LIKE CONCAT('%', #{levelHierarchyName}, '%')
</if>
</where>
ORDER BY id DESC
</when>
<!-- Site -->
<when test="type == 'SITE'">
SELECT
id,
name AS levelHierarchyName,
remark,
created_at
FROM dashboard_site
<where>
flag != 1
<if test="levelHierarchyName != null and levelHierarchyName != ''">
AND name LIKE CONCAT('%', #{levelHierarchyName}, '%')
</if>
</where>
ORDER BY id DESC
</when>
</choose>
</select>
<select id="selectAllHierarchyByCompanyId"
resultType="com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO">
SELECT
b.id AS id,
b.name AS name,
'BRANCH' AS type,
b.remark AS remark,
NULL AS parentId
FROM dashboard_branch b
WHERE b.flag = 0 AND b.company_id = #{companyId}
UNION ALL
SELECT
s.id AS id,
s.name AS name,
'STORE' AS type,
s.remark AS remark,
bs.branch_id AS parentId
FROM dashboard_store s
LEFT JOIN dashboard_branch_store bs ON s.id = bs.store_id
WHERE s.flag = 0 AND s.company_id = #{companyId}
UNION ALL
SELECT
a.id AS id,
a.name AS name,
'AREA' AS type,
a.remark AS remark,
sa.store_id AS parentId
FROM dashboard_area a
LEFT JOIN dashboard_store_area sa ON a.id = sa.area_id
WHERE a.flag = 0 AND a.company_id = #{companyId}
UNION ALL
SELECT
s2.id AS id,
s2.name AS name,
'SITE' AS type,
s2.remark AS remark,
asite.area_id AS parentId
FROM dashboard_site s2
LEFT JOIN dashboard_area_site asite ON s2.id = asite.site_id
WHERE s2.flag = 0 AND s2.company_id = #{companyId}
UNION ALL
SELECT
bld.building_id AS id,
bld.name AS name,
'BUILDING' AS type,
bld.brief_introduction AS remark,
sb.site_id AS parentId
FROM basic_building bld
LEFT JOIN dashboard_site_building sb ON bld.building_id = sb.building_id
WHERE bld.flag = 0 AND bld.company_id = #{companyId}
ORDER BY type, id
</select>
</mapper>

7
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml

@ -24,10 +24,9 @@
mpc.company_id,
mpc.thumbnail_normal_base64,
mpc.thumbnail_alarm_base64,
mpc.`name`,
mpc.remark
mpc.class_name AS `name`
FROM
monitoring_point_category mpc
basic_asset_class_big mpc
WHERE
mpc.flag != 1
AND mpc.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
@ -35,7 +34,7 @@
AND mpc.id IN <foreach collection="monitoringPointCategoryIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if>
<if test="name != null">
AND mpc.`name` LIKE CONCAT('%',#{name},'%')
AND mpc.class_name LIKE CONCAT('%',#{name},'%')
</if>
order by mpc.id desc
</select>

2
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml

@ -19,7 +19,7 @@
buser.login_name `user`
FROM
dashboard_operation_log dolog
INNER JOIN data_center_new.basic_user buser ON buser.id = dolog.user_id
INNER JOIN data_center_aeon_admin.basic_user buser ON buser.id = dolog.user_id
WHERE dolog.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="startTime != null">
AND dolog.created_at >= #{startTime}

17
dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml

@ -71,12 +71,12 @@
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
<table tableName="device_group" domainObjectName="DeviceGroup" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="dashboard_device_group" domainObjectName="DeviceGroup" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
<table tableName="device_group_relation" domainObjectName="DeviceGroupRelation" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="dashboard_device_group_relation" domainObjectName="DeviceGroupRelation" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
</table>
@ -130,10 +130,19 @@
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
<table tableName="dashboard_level_role" domainObjectName="DashboardLevelRole" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="dashboard_realtime_measure" domainObjectName="DashboardRealtimeMeasure" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
</table>
<table tableName="basic_user" domainObjectName="BasicUser" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
<table tableName="dashboard_notice_ignored" domainObjectName="DashboardNoticeIgnored" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
</context>
</generatorConfiguration>

2
dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties

@ -2,6 +2,6 @@
project =src/main/java
resources=src/main/resources
jdbc_driver =com.mysql.cj.jdbc.Driver
jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc_user=zhc
jdbc_password=Youqu48bnb1

24
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskParam.java

@ -0,0 +1,24 @@
package com.dongjian.dashboard.back.dto.ai;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* @author zhc
* @time 2022年6月14日10:56:38
*/
@Setter
@Getter
public class AiAskParam {
@Schema(description = "问题详情",example = "111", required = true)
private String question;
@Schema(description = "会话ID",example = "111", required = false)
private String session_id;
@Schema(description = "返回多少文档信息",example = "1", required = false)
private Integer topK;
}

21
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskResponse.java

@ -0,0 +1,21 @@
package com.dongjian.dashboard.back.dto.ai;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
public class AiAskResponse {
@Schema(description = "AI生成的回答")
private String answer;
@Schema(description = "引用的文档片段数组")
private List<Citation> citations;
@Schema(description = "响应时间(毫秒)")
private Long latencyMs;
@Schema(description = "Bedrock返回的会话ID")
private String session_id;
}

13
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiRetrieveParam.java

@ -0,0 +1,13 @@
package com.dongjian.dashboard.back.dto.ai;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class AiRetrieveParam {
@Schema(description = "检索查询", example = "设备维护", required = true)
private String question;
@Schema(description = "检索结果数量", example = "3", required = false)
private Integer topK = 5;
}

34
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/Citation.java

@ -0,0 +1,34 @@
package com.dongjian.dashboard.back.dto.ai;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Map;
@Data
public class Citation {
@Schema(description = "引用索引")
private Integer index;
@Schema(description = "文档标题")
private String title;
@Schema(description = "相关度评分 (0-1)")
private Double score;
@Schema(description = "引用内容")
private String content;
@Schema(description = "内容长度")
private Integer contentLength;
@Schema(description = "文件名")
private String filename;
@Schema(description = "S3路径")
private String s3Path;
@Schema(description = "元数据信息")
private Map<String, Object> metadata;
}

18
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/RetrieveResponse.java

@ -0,0 +1,18 @@
package com.dongjian.dashboard.back.dto.ai;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
public class RetrieveResponse {
@Schema(description = "检索结果数组")
private List<Citation> results;
@Schema(description = "检索时间(毫秒)")
private Long latencyMs;
@Schema(description = "结果总数")
private Integer total;
}

7
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java

@ -14,8 +14,11 @@ public class DataSearchParam extends BaseSearchParams {
@Schema(description = "楼宇ID",example = "122")
private Long buildingId;
@Schema(description = "分组ID",example = "122")
private Long monitoringPointCategoryGroupId;
// @Schema(description = "分组ID",example = "122")
// private Long monitoringPointCategoryGroupId;
@Schema(description = "设备分组ID",example = "122")
private Long deviceGroupId;
@Schema(description = "设备类型",example = "[]", hidden = true)
private List<Integer> typeIdList;

5
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java

@ -14,7 +14,10 @@ public class DeviceSearchParams extends BaseSearchParams {
@Schema(description = "building ID")
private Long buildingId;
@Schema(description = "设备类型",example = "[]", hidden = true)
@Schema(description = "device type",example = "[]", hidden = true)
private List<Integer> typeIdList;
@Schema(description = "Monitoring point name", example = "Device-Monitoring")
private String monitoringPointName;
}

10
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertCloseRequest.java

@ -0,0 +1,10 @@
package com.dongjian.dashboard.back.dto.device;
import lombok.Data;
import java.util.List;
@Data
public class WindowAlertCloseRequest {
private List<Long> alertIdList;
}

15
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertQueryRequest.java

@ -0,0 +1,15 @@
package com.dongjian.dashboard.back.dto.device;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
public class WindowAlertQueryRequest {
private Long startTime;
@Schema(hidden = true)
private Long companyId;
}

5
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java

@ -12,14 +12,11 @@ import java.util.List;
@Data
public class DeviceGroupSearchParams extends BaseSearchParams {
@Schema(description = "楼宇ID",example = "222")
@Schema(description = "楼宇ID",example = "222", hidden = true)
private Long buildingId;
@Schema(description = "设备组名",example = "张三李四")
private String name;
@Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "1")
private Integer groupType;
@Schema(description = "设备组id,多个逗号连接",example = "1,47")
private String deviceGroupIds;

3
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java

@ -12,9 +12,6 @@ public class OptDeviceGroupParams{
@Schema(description = "楼宇ID",example = "222")
private Long buildingId;
@Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "2738967")
private Integer groupType;
@Schema(description = "所属企业ID",example = "2738967", hidden = true)
private Long companyId;

21
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java

@ -1,21 +0,0 @@
package com.dongjian.dashboard.back.dto.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* @author Mr.Jiang
* @time 2022年4月23日 下午1:59:33
*/
@Setter
@Getter
public class DeleteLevelHierarchyParam {
@Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true)
private String ids;
@Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true)
private String type;
}

18
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java

@ -1,18 +0,0 @@
package com.dongjian.dashboard.back.dto.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* @author Mr.Jiang
* @time 2022年4月23日 下午1:59:33
*/
@Setter
@Getter
public class DeleteLevelHierarchyRoleParam {
@Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true)
private String ids;
}

46
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java

@ -1,46 +0,0 @@
package com.dongjian.dashboard.back.dto.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @author zhc
* @time 2022年6月14日10:56:38
*/
@Setter
@Getter
public class OptLevelHierarchyParam {
@Schema(description = "层级ID, 新增时无此参数",example = "111", required = false)
private Long id;
@Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true)
private String type;
@Schema(description = "层级名称",example = "管理员", required = true)
private String levelHierarchyName;
@Schema(description = "描述",example = "这是管理员描述")
private String remark;
@Schema(description = "所属上一层级的id列表(支持多个上级)",example = "[1,2,3,4]", required = true)
private List<Long> parentIdList;
@Schema(description = "所属企业ID",example = "2", hidden = true)
private Long companyId;
@Schema(hidden = true)
private Long createdBy;
@Schema(hidden = true)
private Long createdAt;
@Schema(hidden = true)
private Long updatedAt;
}

40
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java

@ -1,40 +0,0 @@
package com.dongjian.dashboard.back.dto.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @author zhc
* @time 2022年6月14日10:56:38
*/
@Setter
@Getter
public class OptLevelHierarchyRoleParam {
@Schema(description = "ID, 新增时无此参数",example = "111", required = false)
private Long id;
@Schema(description = "名称",example = "管理员", required = true)
private String name;
@Schema(description = "描述",example = "这是管理员描述", required = false)
private String remark;
@Schema(description = "所属企业ID",example = "2", hidden = true)
private Long companyId;
@Schema(hidden = true)
private Long createdBy;
@Schema(hidden = true)
private Long createdAt;
@Schema(hidden = true)
private Long updatedAt;
}

19
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java

@ -1,19 +0,0 @@
package com.dongjian.dashboard.back.dto.levelhierarchy;
import com.dongjian.dashboard.back.dto.BaseSearchParams;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* @author Mr.zhc
* @time 2022年7月27日12:06:35
*/
@Setter
@Getter
public class PageLevelHierarchyRoleSearchParam extends BaseSearchParams{
@Schema(description = "名称",example = "test", required = false)
private String name;
}

22
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java

@ -1,22 +0,0 @@
package com.dongjian.dashboard.back.dto.levelhierarchy;
import com.dongjian.dashboard.back.dto.BaseSearchParams;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* @author Mr.zhc
* @time 2022年7月27日12:06:35
*/
@Setter
@Getter
public class PageLevelHierarchySearchParam extends BaseSearchParams{
@Schema(description = "层级名称",example = "test", required = false)
private String levelHierarchyName;
@Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true)
private String type;
}

68
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java

@ -129,6 +129,24 @@ public class BasicBuilding implements Serializable {
*/
private String briefIntroduction;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_building.latitude
*
* @mbg.generated
*/
private String latitude;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_building.longitude
*
* @mbg.generated
*/
private String longitude;
/**
*
* This field was generated by MyBatis Generator.
@ -491,6 +509,54 @@ public class BasicBuilding implements Serializable {
this.briefIntroduction = briefIntroduction == null ? null : briefIntroduction.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.latitude
*
* @return the value of basic_building.latitude
*
* @mbg.generated
*/
public String getLatitude() {
return latitude;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_building.latitude
*
* @param latitude the value for basic_building.latitude
*
* @mbg.generated
*/
public void setLatitude(String latitude) {
this.latitude = latitude == null ? null : latitude.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.longitude
*
* @return the value of basic_building.longitude
*
* @mbg.generated
*/
public String getLongitude() {
return longitude;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_building.longitude
*
* @param longitude the value for basic_building.longitude
*
* @mbg.generated
*/
public void setLongitude(String longitude) {
this.longitude = longitude == null ? null : longitude.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.floor_info_list
@ -565,6 +631,8 @@ public class BasicBuilding implements Serializable {
sb.append(", thumbnailNum=").append(thumbnailNum);
sb.append(", showSwitch2d3d=").append(showSwitch2d3d);
sb.append(", briefIntroduction=").append(briefIntroduction);
sb.append(", latitude=").append(latitude);
sb.append(", longitude=").append(longitude);
sb.append(", floorInfoList=").append(floorInfoList);
sb.append(", pictureIntroduction=").append(pictureIntroduction);
sb.append(", serialVersionUID=").append(serialVersionUID);

140
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java

@ -1083,6 +1083,146 @@ public class BasicBuildingExample {
addCriterion("brief_introduction not between", value1, value2, "briefIntroduction");
return (Criteria) this;
}
public Criteria andLatitudeIsNull() {
addCriterion("latitude is null");
return (Criteria) this;
}
public Criteria andLatitudeIsNotNull() {
addCriterion("latitude is not null");
return (Criteria) this;
}
public Criteria andLatitudeEqualTo(String value) {
addCriterion("latitude =", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotEqualTo(String value) {
addCriterion("latitude <>", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeGreaterThan(String value) {
addCriterion("latitude >", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeGreaterThanOrEqualTo(String value) {
addCriterion("latitude >=", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeLessThan(String value) {
addCriterion("latitude <", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeLessThanOrEqualTo(String value) {
addCriterion("latitude <=", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeLike(String value) {
addCriterion("latitude like", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotLike(String value) {
addCriterion("latitude not like", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeIn(List<String> values) {
addCriterion("latitude in", values, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotIn(List<String> values) {
addCriterion("latitude not in", values, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeBetween(String value1, String value2) {
addCriterion("latitude between", value1, value2, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotBetween(String value1, String value2) {
addCriterion("latitude not between", value1, value2, "latitude");
return (Criteria) this;
}
public Criteria andLongitudeIsNull() {
addCriterion("longitude is null");
return (Criteria) this;
}
public Criteria andLongitudeIsNotNull() {
addCriterion("longitude is not null");
return (Criteria) this;
}
public Criteria andLongitudeEqualTo(String value) {
addCriterion("longitude =", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotEqualTo(String value) {
addCriterion("longitude <>", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeGreaterThan(String value) {
addCriterion("longitude >", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeGreaterThanOrEqualTo(String value) {
addCriterion("longitude >=", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeLessThan(String value) {
addCriterion("longitude <", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeLessThanOrEqualTo(String value) {
addCriterion("longitude <=", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeLike(String value) {
addCriterion("longitude like", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotLike(String value) {
addCriterion("longitude not like", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeIn(List<String> values) {
addCriterion("longitude in", values, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotIn(List<String> values) {
addCriterion("longitude not in", values, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeBetween(String value1, String value2) {
addCriterion("longitude between", value1, value2, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotBetween(String value1, String value2) {
addCriterion("longitude not between", value1, value2, "longitude");
return (Criteria) this;
}
}
/**

34
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java

@ -174,6 +174,15 @@ public class BasicUser implements Serializable {
*/
private Integer superRole;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_user.create_platform
*
* @mbg.generated
*/
private Integer createPlatform;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table basic_user
@ -638,6 +647,30 @@ public class BasicUser implements Serializable {
this.superRole = superRole;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_user.create_platform
*
* @return the value of basic_user.create_platform
*
* @mbg.generated
*/
public Integer getCreatePlatform() {
return createPlatform;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_user.create_platform
*
* @param createPlatform the value for basic_user.create_platform
*
* @mbg.generated
*/
public void setCreatePlatform(Integer createPlatform) {
this.createPlatform = createPlatform;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
@ -669,6 +702,7 @@ public class BasicUser implements Serializable {
sb.append(", modifyTime=").append(modifyTime);
sb.append(", modifierId=").append(modifierId);
sb.append(", superRole=").append(superRole);
sb.append(", createPlatform=").append(createPlatform);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

60
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java

@ -1403,6 +1403,66 @@ public class BasicUserExample {
addCriterion("super_role not between", value1, value2, "superRole");
return (Criteria) this;
}
public Criteria andCreatePlatformIsNull() {
addCriterion("create_platform is null");
return (Criteria) this;
}
public Criteria andCreatePlatformIsNotNull() {
addCriterion("create_platform is not null");
return (Criteria) this;
}
public Criteria andCreatePlatformEqualTo(Integer value) {
addCriterion("create_platform =", value, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformNotEqualTo(Integer value) {
addCriterion("create_platform <>", value, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformGreaterThan(Integer value) {
addCriterion("create_platform >", value, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformGreaterThanOrEqualTo(Integer value) {
addCriterion("create_platform >=", value, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformLessThan(Integer value) {
addCriterion("create_platform <", value, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformLessThanOrEqualTo(Integer value) {
addCriterion("create_platform <=", value, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformIn(List<Integer> values) {
addCriterion("create_platform in", values, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformNotIn(List<Integer> values) {
addCriterion("create_platform not in", values, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformBetween(Integer value1, Integer value2) {
addCriterion("create_platform between", value1, value2, "createPlatform");
return (Criteria) this;
}
public Criteria andCreatePlatformNotBetween(Integer value1, Integer value2) {
addCriterion("create_platform not between", value1, value2, "createPlatform");
return (Criteria) this;
}
}
/**

302
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java

@ -1,302 +0,0 @@
package com.dongjian.dashboard.back.model;
import java.io.Serializable;
public class DashboardLevelRole implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.id
*
* @mbg.generated
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.company_id
*
* @mbg.generated
*/
private Long companyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.name
*
* @mbg.generated
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.remark
*
* @mbg.generated
*/
private String remark;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.flag
*
* @mbg.generated
*/
private Integer flag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.created_by
*
* @mbg.generated
*/
private Long createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.created_at
*
* @mbg.generated
*/
private Long createdAt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_level_role.updated_at
*
* @mbg.generated
*/
private Long updatedAt;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.id
*
* @return the value of dashboard_level_role.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.id
*
* @param id the value for dashboard_level_role.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.company_id
*
* @return the value of dashboard_level_role.company_id
*
* @mbg.generated
*/
public Long getCompanyId() {
return companyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.company_id
*
* @param companyId the value for dashboard_level_role.company_id
*
* @mbg.generated
*/
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.name
*
* @return the value of dashboard_level_role.name
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.name
*
* @param name the value for dashboard_level_role.name
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.remark
*
* @return the value of dashboard_level_role.remark
*
* @mbg.generated
*/
public String getRemark() {
return remark;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.remark
*
* @param remark the value for dashboard_level_role.remark
*
* @mbg.generated
*/
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.flag
*
* @return the value of dashboard_level_role.flag
*
* @mbg.generated
*/
public Integer getFlag() {
return flag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.flag
*
* @param flag the value for dashboard_level_role.flag
*
* @mbg.generated
*/
public void setFlag(Integer flag) {
this.flag = flag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.created_by
*
* @return the value of dashboard_level_role.created_by
*
* @mbg.generated
*/
public Long getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.created_by
*
* @param createdBy the value for dashboard_level_role.created_by
*
* @mbg.generated
*/
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.created_at
*
* @return the value of dashboard_level_role.created_at
*
* @mbg.generated
*/
public Long getCreatedAt() {
return createdAt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.created_at
*
* @param createdAt the value for dashboard_level_role.created_at
*
* @mbg.generated
*/
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_level_role.updated_at
*
* @return the value of dashboard_level_role.updated_at
*
* @mbg.generated
*/
public Long getUpdatedAt() {
return updatedAt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_level_role.updated_at
*
* @param updatedAt the value for dashboard_level_role.updated_at
*
* @mbg.generated
*/
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", name=").append(name);
sb.append(", remark=").append(remark);
sb.append(", flag=").append(flag);
sb.append(", createdBy=").append(createdBy);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

802
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java

@ -1,802 +0,0 @@
package com.dongjian.dashboard.back.model;
import java.util.ArrayList;
import java.util.List;
public class DashboardLevelRoleExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public DashboardLevelRoleExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andFlagIsNull() {
addCriterion("flag is null");
return (Criteria) this;
}
public Criteria andFlagIsNotNull() {
addCriterion("flag is not null");
return (Criteria) this;
}
public Criteria andFlagEqualTo(Integer value) {
addCriterion("flag =", value, "flag");
return (Criteria) this;
}
public Criteria andFlagNotEqualTo(Integer value) {
addCriterion("flag <>", value, "flag");
return (Criteria) this;
}
public Criteria andFlagGreaterThan(Integer value) {
addCriterion("flag >", value, "flag");
return (Criteria) this;
}
public Criteria andFlagGreaterThanOrEqualTo(Integer value) {
addCriterion("flag >=", value, "flag");
return (Criteria) this;
}
public Criteria andFlagLessThan(Integer value) {
addCriterion("flag <", value, "flag");
return (Criteria) this;
}
public Criteria andFlagLessThanOrEqualTo(Integer value) {
addCriterion("flag <=", value, "flag");
return (Criteria) this;
}
public Criteria andFlagIn(List<Integer> values) {
addCriterion("flag in", values, "flag");
return (Criteria) this;
}
public Criteria andFlagNotIn(List<Integer> values) {
addCriterion("flag not in", values, "flag");
return (Criteria) this;
}
public Criteria andFlagBetween(Integer value1, Integer value2) {
addCriterion("flag between", value1, value2, "flag");
return (Criteria) this;
}
public Criteria andFlagNotBetween(Integer value1, Integer value2) {
addCriterion("flag not between", value1, value2, "flag");
return (Criteria) this;
}
public Criteria andCreatedByIsNull() {
addCriterion("created_by is null");
return (Criteria) this;
}
public Criteria andCreatedByIsNotNull() {
addCriterion("created_by is not null");
return (Criteria) this;
}
public Criteria andCreatedByEqualTo(Long value) {
addCriterion("created_by =", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotEqualTo(Long value) {
addCriterion("created_by <>", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByGreaterThan(Long value) {
addCriterion("created_by >", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByGreaterThanOrEqualTo(Long value) {
addCriterion("created_by >=", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLessThan(Long value) {
addCriterion("created_by <", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLessThanOrEqualTo(Long value) {
addCriterion("created_by <=", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByIn(List<Long> values) {
addCriterion("created_by in", values, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotIn(List<Long> values) {
addCriterion("created_by not in", values, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByBetween(Long value1, Long value2) {
addCriterion("created_by between", value1, value2, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotBetween(Long value1, Long value2) {
addCriterion("created_by not between", value1, value2, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Long value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Long value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Long value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Long value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Long value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Long> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Long> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Long value1, Long value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Long value1, Long value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Long value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Long value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Long value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Long value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Long value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Long value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Long> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Long> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Long value1, Long value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Long value1, Long value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_level_role
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_level_role
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

166
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnored.java

@ -0,0 +1,166 @@
package com.dongjian.dashboard.back.model;
import java.io.Serializable;
public class DashboardNoticeIgnored implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notice_ignored.id
*
* @mbg.generated
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notice_ignored.redis_key
*
* @mbg.generated
*/
private String redisKey;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notice_ignored.member_value
*
* @mbg.generated
*/
private String memberValue;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notice_ignored.created_at
*
* @mbg.generated
*/
private Long createdAt;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notice_ignored.id
*
* @return the value of dashboard_notice_ignored.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notice_ignored.id
*
* @param id the value for dashboard_notice_ignored.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notice_ignored.redis_key
*
* @return the value of dashboard_notice_ignored.redis_key
*
* @mbg.generated
*/
public String getRedisKey() {
return redisKey;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notice_ignored.redis_key
*
* @param redisKey the value for dashboard_notice_ignored.redis_key
*
* @mbg.generated
*/
public void setRedisKey(String redisKey) {
this.redisKey = redisKey == null ? null : redisKey.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notice_ignored.member_value
*
* @return the value of dashboard_notice_ignored.member_value
*
* @mbg.generated
*/
public String getMemberValue() {
return memberValue;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notice_ignored.member_value
*
* @param memberValue the value for dashboard_notice_ignored.member_value
*
* @mbg.generated
*/
public void setMemberValue(String memberValue) {
this.memberValue = memberValue == null ? null : memberValue.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notice_ignored.created_at
*
* @return the value of dashboard_notice_ignored.created_at
*
* @mbg.generated
*/
public Long getCreatedAt() {
return createdAt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notice_ignored.created_at
*
* @param createdAt the value for dashboard_notice_ignored.created_at
*
* @mbg.generated
*/
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", redisKey=").append(redisKey);
sb.append(", memberValue=").append(memberValue);
sb.append(", createdAt=").append(createdAt);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

562
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnoredExample.java

@ -0,0 +1,562 @@
package com.dongjian.dashboard.back.model;
import java.util.ArrayList;
import java.util.List;
public class DashboardNoticeIgnoredExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public DashboardNoticeIgnoredExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andRedisKeyIsNull() {
addCriterion("redis_key is null");
return (Criteria) this;
}
public Criteria andRedisKeyIsNotNull() {
addCriterion("redis_key is not null");
return (Criteria) this;
}
public Criteria andRedisKeyEqualTo(String value) {
addCriterion("redis_key =", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyNotEqualTo(String value) {
addCriterion("redis_key <>", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyGreaterThan(String value) {
addCriterion("redis_key >", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyGreaterThanOrEqualTo(String value) {
addCriterion("redis_key >=", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyLessThan(String value) {
addCriterion("redis_key <", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyLessThanOrEqualTo(String value) {
addCriterion("redis_key <=", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyLike(String value) {
addCriterion("redis_key like", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyNotLike(String value) {
addCriterion("redis_key not like", value, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyIn(List<String> values) {
addCriterion("redis_key in", values, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyNotIn(List<String> values) {
addCriterion("redis_key not in", values, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyBetween(String value1, String value2) {
addCriterion("redis_key between", value1, value2, "redisKey");
return (Criteria) this;
}
public Criteria andRedisKeyNotBetween(String value1, String value2) {
addCriterion("redis_key not between", value1, value2, "redisKey");
return (Criteria) this;
}
public Criteria andMemberValueIsNull() {
addCriterion("member_value is null");
return (Criteria) this;
}
public Criteria andMemberValueIsNotNull() {
addCriterion("member_value is not null");
return (Criteria) this;
}
public Criteria andMemberValueEqualTo(String value) {
addCriterion("member_value =", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueNotEqualTo(String value) {
addCriterion("member_value <>", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueGreaterThan(String value) {
addCriterion("member_value >", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueGreaterThanOrEqualTo(String value) {
addCriterion("member_value >=", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueLessThan(String value) {
addCriterion("member_value <", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueLessThanOrEqualTo(String value) {
addCriterion("member_value <=", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueLike(String value) {
addCriterion("member_value like", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueNotLike(String value) {
addCriterion("member_value not like", value, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueIn(List<String> values) {
addCriterion("member_value in", values, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueNotIn(List<String> values) {
addCriterion("member_value not in", values, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueBetween(String value1, String value2) {
addCriterion("member_value between", value1, value2, "memberValue");
return (Criteria) this;
}
public Criteria andMemberValueNotBetween(String value1, String value2) {
addCriterion("member_value not between", value1, value2, "memberValue");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Long value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Long value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Long value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Long value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Long value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Long> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Long> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Long value1, Long value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Long value1, Long value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_notice_ignored
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

118
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java

@ -6,7 +6,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.id
* This field corresponds to the database column dashboard_device_group.id
*
* @mbg.generated
*/
@ -15,7 +15,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.company_id
* This field corresponds to the database column dashboard_device_group.company_id
*
* @mbg.generated
*/
@ -24,7 +24,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.building_id
* This field corresponds to the database column dashboard_device_group.building_id
*
* @mbg.generated
*/
@ -33,7 +33,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.name
* This field corresponds to the database column dashboard_device_group.name
*
* @mbg.generated
*/
@ -42,16 +42,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.group_type
*
* @mbg.generated
*/
private Integer groupType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.remark
* This field corresponds to the database column dashboard_device_group.remark
*
* @mbg.generated
*/
@ -60,7 +51,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.flag
* This field corresponds to the database column dashboard_device_group.flag
*
* @mbg.generated
*/
@ -69,7 +60,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.created_by
* This field corresponds to the database column dashboard_device_group.created_by
*
* @mbg.generated
*/
@ -78,7 +69,7 @@ public class DeviceGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group.created_at
* This field corresponds to the database column dashboard_device_group.created_at
*
* @mbg.generated
*/
@ -86,7 +77,7 @@ public class DeviceGroup implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group
* This field corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -94,9 +85,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.id
* This method returns the value of the database column dashboard_device_group.id
*
* @return the value of device_group.id
* @return the value of dashboard_device_group.id
*
* @mbg.generated
*/
@ -106,9 +97,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.id
* This method sets the value of the database column dashboard_device_group.id
*
* @param id the value for device_group.id
* @param id the value for dashboard_device_group.id
*
* @mbg.generated
*/
@ -118,9 +109,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.company_id
* This method returns the value of the database column dashboard_device_group.company_id
*
* @return the value of device_group.company_id
* @return the value of dashboard_device_group.company_id
*
* @mbg.generated
*/
@ -130,9 +121,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.company_id
* This method sets the value of the database column dashboard_device_group.company_id
*
* @param companyId the value for device_group.company_id
* @param companyId the value for dashboard_device_group.company_id
*
* @mbg.generated
*/
@ -142,9 +133,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.building_id
* This method returns the value of the database column dashboard_device_group.building_id
*
* @return the value of device_group.building_id
* @return the value of dashboard_device_group.building_id
*
* @mbg.generated
*/
@ -154,9 +145,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.building_id
* This method sets the value of the database column dashboard_device_group.building_id
*
* @param buildingId the value for device_group.building_id
* @param buildingId the value for dashboard_device_group.building_id
*
* @mbg.generated
*/
@ -166,9 +157,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.name
* This method returns the value of the database column dashboard_device_group.name
*
* @return the value of device_group.name
* @return the value of dashboard_device_group.name
*
* @mbg.generated
*/
@ -178,9 +169,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.name
* This method sets the value of the database column dashboard_device_group.name
*
* @param name the value for device_group.name
* @param name the value for dashboard_device_group.name
*
* @mbg.generated
*/
@ -190,33 +181,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.group_type
*
* @return the value of device_group.group_type
*
* @mbg.generated
*/
public Integer getGroupType() {
return groupType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.group_type
*
* @param groupType the value for device_group.group_type
*
* @mbg.generated
*/
public void setGroupType(Integer groupType) {
this.groupType = groupType;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.remark
* This method returns the value of the database column dashboard_device_group.remark
*
* @return the value of device_group.remark
* @return the value of dashboard_device_group.remark
*
* @mbg.generated
*/
@ -226,9 +193,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.remark
* This method sets the value of the database column dashboard_device_group.remark
*
* @param remark the value for device_group.remark
* @param remark the value for dashboard_device_group.remark
*
* @mbg.generated
*/
@ -238,9 +205,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.flag
* This method returns the value of the database column dashboard_device_group.flag
*
* @return the value of device_group.flag
* @return the value of dashboard_device_group.flag
*
* @mbg.generated
*/
@ -250,9 +217,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.flag
* This method sets the value of the database column dashboard_device_group.flag
*
* @param flag the value for device_group.flag
* @param flag the value for dashboard_device_group.flag
*
* @mbg.generated
*/
@ -262,9 +229,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.created_by
* This method returns the value of the database column dashboard_device_group.created_by
*
* @return the value of device_group.created_by
* @return the value of dashboard_device_group.created_by
*
* @mbg.generated
*/
@ -274,9 +241,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.created_by
* This method sets the value of the database column dashboard_device_group.created_by
*
* @param createdBy the value for device_group.created_by
* @param createdBy the value for dashboard_device_group.created_by
*
* @mbg.generated
*/
@ -286,9 +253,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group.created_at
* This method returns the value of the database column dashboard_device_group.created_at
*
* @return the value of device_group.created_at
* @return the value of dashboard_device_group.created_at
*
* @mbg.generated
*/
@ -298,9 +265,9 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group.created_at
* This method sets the value of the database column dashboard_device_group.created_at
*
* @param createdAt the value for device_group.created_at
* @param createdAt the value for dashboard_device_group.created_at
*
* @mbg.generated
*/
@ -310,7 +277,7 @@ public class DeviceGroup implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -324,7 +291,6 @@ public class DeviceGroup implements Serializable {
sb.append(", companyId=").append(companyId);
sb.append(", buildingId=").append(buildingId);
sb.append(", name=").append(name);
sb.append(", groupType=").append(groupType);
sb.append(", remark=").append(remark);
sb.append(", flag=").append(flag);
sb.append(", createdBy=").append(createdBy);

94
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java

@ -6,7 +6,7 @@ import java.util.List;
public class DeviceGroupExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group
* This field corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -14,7 +14,7 @@ public class DeviceGroupExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group
* This field corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -22,7 +22,7 @@ public class DeviceGroupExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group
* This field corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -30,7 +30,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -40,7 +40,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -50,7 +50,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -60,7 +60,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -70,7 +70,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -80,7 +80,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -90,7 +90,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -100,7 +100,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -112,7 +112,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -126,7 +126,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -137,7 +137,7 @@ public class DeviceGroupExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group
* This method corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -149,7 +149,7 @@ public class DeviceGroupExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table device_group
* This class corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/
@ -444,66 +444,6 @@ public class DeviceGroupExample {
return (Criteria) this;
}
public Criteria andGroupTypeIsNull() {
addCriterion("group_type is null");
return (Criteria) this;
}
public Criteria andGroupTypeIsNotNull() {
addCriterion("group_type is not null");
return (Criteria) this;
}
public Criteria andGroupTypeEqualTo(Integer value) {
addCriterion("group_type =", value, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeNotEqualTo(Integer value) {
addCriterion("group_type <>", value, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeGreaterThan(Integer value) {
addCriterion("group_type >", value, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("group_type >=", value, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeLessThan(Integer value) {
addCriterion("group_type <", value, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeLessThanOrEqualTo(Integer value) {
addCriterion("group_type <=", value, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeIn(List<Integer> values) {
addCriterion("group_type in", values, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeNotIn(List<Integer> values) {
addCriterion("group_type not in", values, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeBetween(Integer value1, Integer value2) {
addCriterion("group_type between", value1, value2, "groupType");
return (Criteria) this;
}
public Criteria andGroupTypeNotBetween(Integer value1, Integer value2) {
addCriterion("group_type not between", value1, value2, "groupType");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
@ -757,7 +697,7 @@ public class DeviceGroupExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table device_group
* This class corresponds to the database table dashboard_device_group
*
* @mbg.generated do_not_delete_during_merge
*/
@ -770,7 +710,7 @@ public class DeviceGroupExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table device_group
* This class corresponds to the database table dashboard_device_group
*
* @mbg.generated
*/

24
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java

@ -6,7 +6,7 @@ public class DeviceGroupRelation implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group_relation.device_info_id
* This field corresponds to the database column dashboard_device_group_relation.device_info_id
*
* @mbg.generated
*/
@ -15,7 +15,7 @@ public class DeviceGroupRelation implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_group_relation.device_group_id
* This field corresponds to the database column dashboard_device_group_relation.device_group_id
*
* @mbg.generated
*/
@ -23,7 +23,7 @@ public class DeviceGroupRelation implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group_relation
* This field corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -31,9 +31,9 @@ public class DeviceGroupRelation implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group_relation.device_info_id
* This method returns the value of the database column dashboard_device_group_relation.device_info_id
*
* @return the value of device_group_relation.device_info_id
* @return the value of dashboard_device_group_relation.device_info_id
*
* @mbg.generated
*/
@ -43,9 +43,9 @@ public class DeviceGroupRelation implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group_relation.device_info_id
* This method sets the value of the database column dashboard_device_group_relation.device_info_id
*
* @param deviceInfoId the value for device_group_relation.device_info_id
* @param deviceInfoId the value for dashboard_device_group_relation.device_info_id
*
* @mbg.generated
*/
@ -55,9 +55,9 @@ public class DeviceGroupRelation implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_group_relation.device_group_id
* This method returns the value of the database column dashboard_device_group_relation.device_group_id
*
* @return the value of device_group_relation.device_group_id
* @return the value of dashboard_device_group_relation.device_group_id
*
* @mbg.generated
*/
@ -67,9 +67,9 @@ public class DeviceGroupRelation implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_group_relation.device_group_id
* This method sets the value of the database column dashboard_device_group_relation.device_group_id
*
* @param deviceGroupId the value for device_group_relation.device_group_id
* @param deviceGroupId the value for dashboard_device_group_relation.device_group_id
*
* @mbg.generated
*/
@ -79,7 +79,7 @@ public class DeviceGroupRelation implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/

34
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java

@ -6,7 +6,7 @@ import java.util.List;
public class DeviceGroupRelationExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group_relation
* This field corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -14,7 +14,7 @@ public class DeviceGroupRelationExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group_relation
* This field corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -22,7 +22,7 @@ public class DeviceGroupRelationExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table device_group_relation
* This field corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -30,7 +30,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -40,7 +40,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -50,7 +50,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -60,7 +60,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -70,7 +70,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -80,7 +80,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -90,7 +90,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -100,7 +100,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -112,7 +112,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -126,7 +126,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -137,7 +137,7 @@ public class DeviceGroupRelationExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table device_group_relation
* This method corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -149,7 +149,7 @@ public class DeviceGroupRelationExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table device_group_relation
* This class corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/
@ -317,7 +317,7 @@ public class DeviceGroupRelationExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table device_group_relation
* This class corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated do_not_delete_during_merge
*/
@ -330,7 +330,7 @@ public class DeviceGroupRelationExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table device_group_relation
* This class corresponds to the database table dashboard_device_group_relation
*
* @mbg.generated
*/

3
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java

@ -30,5 +30,8 @@ public class DeviceAlarmData extends BaseData{
@Schema(description = "确认状态", example = "未確認")
private String confirmStatusStr;
@Schema(description = "资产记号",example = "122")
private String assetSymbol;
}

57
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/WindowAlertVO.java

@ -0,0 +1,57 @@
package com.dongjian.dashboard.back.vo.device;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class WindowAlertVO {
private Long alertId;
@Schema(description = "device name", example = "Device-Monitoring")
private String deviceName;
@Schema(description = "device Id", example = "Device-Monitoring")
private String deviceId;
@Schema(description = "device sn", example = "Device-Monitoring")
private String deviceSn;
private Long buildingId;
private String buildingName;
private Long floorId;
private String floorName;
private Long spaceId;
private String spaceName;
private Long assetId;
private String assetSymbol;
@Schema(description = "Monitoring point name", example = "Device-Monitoring")
private String monitoringPointName;
@Schema(description = "monitoring point category id", example = "22")
private Long monitoringPointCategoryId;
@Schema(description = "monitoring point category name", example = "2name")
private String monitoringPointCategoryName;
@Schema(description = "data provider id", example = "33")
private Long dataProviderId;
@Schema(description = "data provider", example = "33")
private String dataProviderName;
@Schema(description = "gateway info id", example = "44")
private Long gatewayInfoId;
@Schema(description = "gateway info", example = "33")
private String gatewayInfoName;
}

9
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java

@ -9,16 +9,13 @@ public class DeviceGroupPageVO {
@Schema(description = "项目唯一标识ID,新增时无此参数",example = "2738967")
private Long deviceGroupId;
@Schema(description = "楼宇ID",example = "222")
@Schema(description = "楼宇ID",example = "222", hidden = true)
private Long buildingId;
@Schema(description = "楼宇名称",example = "楼宇222")
@Schema(description = "楼宇名称",example = "楼宇222", hidden = true)
private String buildingName;
@Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "1")
private Integer groupType;
@Schema(description = "所属企业ID",example = "2738967")
@Schema(description = "所属企业ID",example = "2738967", hidden = true)
private Long companyId;
@Schema(description = "项目名称",example = "testDeviceGroup1", required = true)

25
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java

@ -1,25 +0,0 @@
package com.dongjian.dashboard.back.vo.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author Mr.Jiang
* @time 2022年5月22日 下午10:37:02
*/
@Data
public class LevelHierarchyPageDTO {
@Schema(description = "层级ID",example = "111", required = true)
private Long id;
@Schema(description = "层级名称",example = "建筑A", required = true)
private String levelHierarchyName;
@Schema(description = "描述",example = "这是管理员描述", required = true)
private String remark;
@Schema(description = "创建时间",example = "1700011000110", required = false)
private Long createdAt;
}

25
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java

@ -1,25 +0,0 @@
package com.dongjian.dashboard.back.vo.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author Mr.Jiang
* @time 2022年5月22日 下午10:37:02
*/
@Data
public class LevelHierarchyRolePageDTO {
@Schema(description = "层级ID",example = "111", required = true)
private Long id;
@Schema(description = "名称",example = "建筑A", required = true)
private String name;
@Schema(description = "描述",example = "这是管理员描述", required = true)
private String remark;
@Schema(description = "创建时间",example = "1700011000110", required = false)
private Long createdAt;
}

29
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java

@ -1,29 +0,0 @@
package com.dongjian.dashboard.back.vo.levelhierarchy;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class LevelHierarchyTreeVO {
@Schema(description = "层级ID", example = "1")
private Long id;
@Schema(description = "层级名称", example = "东京支社")
private String name;
@Schema(description = "层级类型", example = "BRANCH/STORE/AREA/SITE/BUILDING")
private String type;
@Schema(description = "备注")
private String remark;
@Schema(description = "父级ID(内存组装用)")
private Long parentId;
@Schema(description = "子节点")
private List<LevelHierarchyTreeVO> children = new ArrayList<>();
}

133
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/JpMeshHourlyForecasts.java

@ -0,0 +1,133 @@
package com.dongjian.dashboard.back.weather;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
/**
* Japan Weather Association - jp_mesh_hourly_forecasts 数据结构兼容 error 响应
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL) // 忽略为 null 的字段
public class JpMeshHourlyForecasts {
/** 正常返回的元数据 */
@JsonProperty("metadata")
private Metadata metadata;
/** 正常返回的结果集 */
@JsonProperty("results")
private Results results;
/** 错误返回 */
@JsonProperty("error")
private ErrorResponse error;
@Data
public static class Metadata {
@JsonProperty("author")
private String author;
@JsonProperty("title")
private String title;
@JsonProperty("detail")
private String detail;
@JsonProperty("parameter")
private Parameter parameter;
@JsonProperty("resultset")
private Resultset resultset;
}
@Data
public static class Parameter {
@JsonProperty("point")
private String point;
@JsonProperty("format")
private String format;
}
@Data
public static class Resultset {
@JsonProperty("count")
private int count;
}
@Data
public static class Results {
@JsonProperty("mesh_code")
private String meshCode;
@JsonProperty("reference_time")
private String referenceTime;
@JsonProperty("initial_time")
private String initialTime;
@JsonProperty("time_zone")
private String timeZone;
@JsonProperty("elevation")
private String elevation;
@JsonProperty("data")
private List<WeatherData> data;
}
@Data
public static class WeatherData {
@JsonProperty("time")
private String time;
@JsonProperty("temperature")
private Double temperature;
@JsonProperty("sunshine_duration")
private Double sunshineDuration;
@JsonProperty("wind_speed")
private Double windSpeed;
@JsonProperty("wind_direction_code")
private Integer windDirectionCode;
@JsonProperty("wind_direction")
private String windDirection;
@JsonProperty("precipitation")
private Double precipitation;
@JsonProperty("snowfall")
private Double snowfall;
@JsonProperty("humidity")
private Integer humidity;
@JsonProperty("weather_code")
private Integer weatherCode;
@JsonProperty("weather")
private String weather;
@JsonProperty("probability_precipitation")
private Integer probabilityPrecipitation;
}
/** 错误响应结构 */
@Data
public static class ErrorResponse {
@JsonProperty("code")
private int code;
@JsonProperty("title")
private String title;
@JsonProperty("detail")
private String detail;
}
}

15
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/QueryWeather.java

@ -0,0 +1,15 @@
package com.dongjian.dashboard.back.weather;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class QueryWeather {
@Schema(description = "latitude",example = "22.54466")
private String lat;
@Schema(description = "longitude",example = "114.054540")
private String lng;
}

18
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AIService.java

@ -0,0 +1,18 @@
package com.dongjian.dashboard.back.service;
import com.dongjian.dashboard.back.common.response.PageInfo;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.dto.ai.AiAskParam;
import com.dongjian.dashboard.back.dto.user.*;
import com.dongjian.dashboard.back.vo.user.UserPageDTO;
/**
* Agent Service.
*/
public interface AIService {
SimpleDataResponse ask(AiAskParam param, Long companyId, Long userId, Integer languageType);
SimpleDataResponse retrieve(AiAskParam param, Long companyId, Long userId, Integer languageType);
}

7
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java

@ -5,8 +5,11 @@ import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam;
import com.dongjian.dashboard.back.dto.data.HandleAlarmParams;
import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam;
import com.dongjian.dashboard.back.dto.device.WindowAlertCloseRequest;
import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest;
import com.dongjian.dashboard.back.vo.data.DeviceAlarmData;
import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO;
import com.dongjian.dashboard.back.vo.device.WindowAlertVO;
import java.util.List;
@ -22,4 +25,8 @@ public interface DeviceDataAlarmService {
SimpleDataResponse handleAlarm(HandleAlarmParams handleAlarmParams, Long userId, Long companyId, Integer languageType);
PageInfo<HandleHistoryDataVO> getHandleHistory(HandleHistorySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType);
SimpleDataResponse<List<WindowAlertVO>> windowList(WindowAlertQueryRequest searchParams, Long userId, Long companyId, String accessToken, Integer languageType);
SimpleDataResponse windowDismiss(WindowAlertCloseRequest windowAlertCloseRequest, Long userId, Long companyId, String accessToken, Integer languageType);
}

4
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java

@ -29,4 +29,8 @@ public interface DeviceGroupService {
SimpleDataResponse getBindedGroupByDevice(Integer deviceInfoId, Long userId, Long companyId, Integer languageType);
SimpleDataResponse getBindedDeviceByGroup(Long deviceGroupId, Long userId, Long companyId, Integer languageType);
SimpleDataResponse addDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType);
SimpleDataResponse delDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType);
}

27
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java

@ -1,27 +0,0 @@
package com.dongjian.dashboard.back.service;
import com.dongjian.dashboard.back.common.response.PageInfo;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO;
import java.util.List;
/**
* Service.
*/
public interface LevelHierarchyRoleService {
SimpleDataResponse add(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType);
SimpleDataResponse edit(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType);
SimpleDataResponse batchDelete(DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, Long companyId, Long userId, Integer languageType);
PageInfo<LevelHierarchyRolePageDTO> getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType);
SimpleDataResponse<List<LevelHierarchyTreeVO>> getHierarchyTree(Long roleId, Long companyId, Long userId, Integer languageType);
}

24
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java

@ -1,24 +0,0 @@
package com.dongjian.dashboard.back.service;
import com.dongjian.dashboard.back.common.response.PageInfo;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam;
import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO;
/**
* Service.
*/
public interface LevelHierarchyService {
SimpleDataResponse add(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType);
SimpleDataResponse edit(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType);
SimpleDataResponse batchDelete(DeleteLevelHierarchyParam deleteLevelHierarchyParam, Long companyId, Long userId, Integer languageType);
PageInfo<LevelHierarchyPageDTO> getListPage(PageLevelHierarchySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType);
}

3
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java

@ -2,6 +2,8 @@ package com.dongjian.dashboard.back.service;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.vo.data.OverviewVO;
import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts;
import com.dongjian.dashboard.back.weather.QueryWeather;
import java.util.List;
@ -12,4 +14,5 @@ public interface OverviewService {
SimpleDataResponse<List<OverviewVO>> getOverviewInfo(Long userId, Long companyId, Integer languageType, Integer UTCOffset);
SimpleDataResponse<JpMeshHourlyForecasts> getWeatherInfo(QueryWeather queryWeather, Long userId, Long companyId, Integer languageType, Integer utcOffset);
}

6
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java

@ -138,7 +138,7 @@ public class CommonOpt {
}
public String buildAuroraJdbcUrl(String dbUrl, String auroraHost) {
String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)";
String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)";
return dbUrl.replaceAll(regex, "$1" + auroraHost + "$3");
}
@ -203,7 +203,7 @@ public class CommonOpt {
if (StringUtils.isNotBlank(apikeyInfo.getAuroraUrl())) {
Class.forName("com.mysql.cj.jdbc.Driver");
String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)";
String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(dbUrl);
String newJdbcUrl = "";
@ -212,7 +212,7 @@ public class CommonOpt {
}
try (Connection conn = DriverManager.getConnection(
newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true",
newJdbcUrl.replace("data_center_aeon_admin", "third") + "&allowPublicKeyRetrieval=true",
DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT),
DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) {

203
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java

@ -1,203 +0,0 @@
package com.dongjian.dashboard.back.service.common;
import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO;
import java.util.*;
import java.util.stream.Collectors;
/**
* 动态层级树构建器支持从任意层级开始的结构
* 如果某个 BUILDING 没有对应的 SITE 上级则该 BUILDING 不会被返回避免单独楼宇作为根
*/
public class LevelHierarchyTreeBuilder {
// 层级顺序
private static final List<String> TYPE_ORDER = Arrays.asList("BRANCH", "STORE", "AREA", "SITE", "BUILDING");
/**
* SQL 返回的所有节点构建树剔除孤立的 BUILDING
* @param allList SQL 返回的所有节点每项包含 id,name,type,remark,parentId
* @return 层级树roots
*/
public static List<LevelHierarchyTreeVO> buildHierarchyTree(List<LevelHierarchyTreeVO> allList) {
if (allList == null || allList.isEmpty()) {
return Collections.emptyList();
}
// 1) 分组按 type
Map<String, List<LevelHierarchyTreeVO>> grouped =
allList.stream().collect(Collectors.groupingBy(LevelHierarchyTreeVO::getType));
// 2) 构建 type+id -> node 映射(use list to allow duplicate ids across rows if needed)
Map<String, List<LevelHierarchyTreeVO>> typeIdMap = new HashMap<>();
for (LevelHierarchyTreeVO node : allList) {
String key = typeIdKey(node.getType(), node.getId());
typeIdMap.computeIfAbsent(key, k -> new ArrayList<>()).add(node);
}
// 3) 剔除孤立 BUILDING:如果某个 building 的 parentId 指向的 SITE 在数据里不存在,则不要返回该 building(也不作为子节点)
// 这里我们从 allList 中制作一个 filteredList
Set<String> siteKeys = allList.stream()
.filter(n -> "SITE".equals(n.getType()))
.map(n -> typeIdKey(n.getType(), n.getId()))
.collect(Collectors.toSet());
List<LevelHierarchyTreeVO> filtered = new ArrayList<>();
for (LevelHierarchyTreeVO node : allList) {
if ("BUILDING".equals(node.getType())) {
// 如果 building 的 parentId 对应 site 存在,则保留;否则丢弃
if (node.getParentId() != null) {
String parentSiteKey = typeIdKey("SITE", node.getParentId());
if (siteKeys.contains(parentSiteKey)) {
filtered.add(node);
} else {
// 父 site 不存在 => 丢弃该孤立 building
}
} else {
// parentId null 的 building 也直接丢弃
}
} else {
filtered.add(node);
}
}
// 4) 用 filtered 做后续处理(避免孤立 building 干扰 parent detection)
Map<String, List<LevelHierarchyTreeVO>> filteredTypeIdMap = new HashMap<>();
for (LevelHierarchyTreeVO node : filtered) {
String key = typeIdKey(node.getType(), node.getId());
filteredTypeIdMap.computeIfAbsent(key, k -> new ArrayList<>()).add(node);
}
// 5) 构建 parentId -> children 索引(针对每个层级)
Map<String, Map<Long, List<LevelHierarchyTreeVO>>> indexByType = new HashMap<>();
for (String type : TYPE_ORDER) {
List<LevelHierarchyTreeVO> list = filtered.stream()
.filter(n -> type.equals(n.getType()))
.collect(Collectors.toList());
Map<Long, List<LevelHierarchyTreeVO>> idx = list.stream()
.filter(n -> n.getParentId() != null)
.collect(Collectors.groupingBy(LevelHierarchyTreeVO::getParentId));
indexByType.put(type, idx);
}
// 6) 找 root candidates:
// root = 节点的 parentType 不存在 或 parentId 为 null 或 parent 不在 filtered 集合中
List<LevelHierarchyTreeVO> rootCandidates = new ArrayList<>();
for (LevelHierarchyTreeVO node : filtered) {
String parentType = getParentType(node.getType());
if (parentType == null || node.getParentId() == null) {
// BRANCH 或 没有 parentId => root candidate
rootCandidates.add(node);
} else {
// 检查 parent 是否存在于 filtered
String parentKey = typeIdKey(parentType, node.getParentId());
if (!filteredTypeIdMap.containsKey(parentKey)) {
rootCandidates.add(node);
}
}
}
// 7) 去重 rootCandidates(按 type+id 去重)
List<LevelHierarchyTreeVO> rootsUnique = rootCandidates.stream()
.collect(Collectors.collectingAndThen(
Collectors.toMap(n -> typeIdKey(n.getType(), n.getId()), n -> n, (a, b) -> a),
m -> new ArrayList<>(m.values())
));
// 8) 为每个 root 递归构建子树(使用 indexByType)
List<LevelHierarchyTreeVO> roots = new ArrayList<>();
for (LevelHierarchyTreeVO root : rootsUnique) {
LevelHierarchyTreeVO built = buildSubTreeRecursive(copyNode(root), indexByType);
roots.add(built);
}
// 9) 按 type 顺序排序根节点(BRANCH 首)
roots.sort(Comparator.comparingInt(n -> typeOrderIndex(n.getType())));
// 10) 最终 deep copy,防止引用问题
return deepCopyList(roots);
}
/** 递归构造某个节点的子树(依据 indexByType) */
private static LevelHierarchyTreeVO buildSubTreeRecursive(LevelHierarchyTreeVO parent,
Map<String, Map<Long, List<LevelHierarchyTreeVO>>> indexByType) {
String nextType = getNextType(parent.getType());
if (nextType == null) {
return parent;
}
Map<Long, List<LevelHierarchyTreeVO>> nextIdx = indexByType.get(nextType);
if (nextIdx != null && parent.getId() != null) {
List<LevelHierarchyTreeVO> children = nextIdx.get(parent.getId());
if (children != null && !children.isEmpty()) {
List<LevelHierarchyTreeVO> childCopies = new ArrayList<>();
for (LevelHierarchyTreeVO ch : children) {
LevelHierarchyTreeVO childNode = copyNode(ch);
// 递归为 child 构建更深层次的子树
LevelHierarchyTreeVO builtChild = buildSubTreeRecursive(childNode, indexByType);
childCopies.add(builtChild);
}
parent.setChildren(childCopies);
}
}
return parent;
}
/* ----------------- 辅助方法 ------------------ */
private static String getParentType(String type) {
int idx = TYPE_ORDER.indexOf(type);
return (idx > 0) ? TYPE_ORDER.get(idx - 1) : null;
}
private static String getNextType(String type) {
int idx = TYPE_ORDER.indexOf(type);
return (idx >= 0 && idx < TYPE_ORDER.size() - 1) ? TYPE_ORDER.get(idx + 1) : null;
}
private static String typeIdKey(String type, Long id) {
return (type == null ? "null" : type) + "_" + (id == null ? "null" : id.toString());
}
private static LevelHierarchyTreeVO copyNode(LevelHierarchyTreeVO src) {
LevelHierarchyTreeVO copy = new LevelHierarchyTreeVO();
copy.setId(src.getId());
copy.setName(src.getName());
copy.setType(src.getType());
copy.setRemark(src.getRemark());
copy.setParentId(src.getParentId());
copy.setChildren(null);
return copy;
}
private static List<LevelHierarchyTreeVO> deepCopyList(List<LevelHierarchyTreeVO> list) {
List<LevelHierarchyTreeVO> out = new ArrayList<>();
for (LevelHierarchyTreeVO n : list) {
out.add(deepCopyNode(n));
}
return out;
}
private static LevelHierarchyTreeVO deepCopyNode(LevelHierarchyTreeVO src) {
if (src == null) return null;
LevelHierarchyTreeVO copy = copyNode(src);
if (src.getChildren() != null) {
List<LevelHierarchyTreeVO> ch = new ArrayList<>();
for (LevelHierarchyTreeVO c : src.getChildren()) {
ch.add(deepCopyNode(c));
}
copy.setChildren(ch);
}
return copy;
}
private static int typeOrderIndex(String type) {
switch (type) {
case "BRANCH": return 0;
case "STORE": return 1;
case "AREA": return 2;
case "SITE": return 3;
case "BUILDING": return 4;
default: return 10;
}
}
}

145
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AIServiceImpl.java

@ -0,0 +1,145 @@
package com.dongjian.dashboard.back.service.impl;
import com.alibaba.excel.util.StringUtils;
import com.dongjian.dashboard.back.common.Constants;
import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange;
import com.dongjian.dashboard.back.common.response.ResponseCode;
import com.dongjian.dashboard.back.common.response.SimpleDataResponse;
import com.dongjian.dashboard.back.dto.ai.AiAskParam;
import com.dongjian.dashboard.back.dto.ai.AiAskResponse;
import com.dongjian.dashboard.back.dto.ai.RetrieveResponse;
import com.dongjian.dashboard.back.service.AIService;
import com.dongjian.dashboard.back.service.S3FileService;
import com.dongjian.dashboard.back.util.DESUtil;
import com.dongjian.dashboard.back.vo.s3.TemporaryCredentials;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.sts.StsClient;
import software.amazon.awssdk.services.sts.model.AssumeRoleRequest;
import software.amazon.awssdk.services.sts.model.AssumeRoleResponse;
import software.amazon.awssdk.services.sts.model.Credentials;
import java.util.HashMap;
import java.util.Map;
@Service
public class AIServiceImpl implements AIService {
private static final Logger logger = LoggerFactory.getLogger(AIServiceImpl.class);
@Autowired
private RestTemplate restTemplate;
@Autowired
private MsgLanguageChange msgLanguageChange;
@Value("${ai.api_base}")
private String ASK_BASE_URL;
@Override
public SimpleDataResponse ask(AiAskParam param, Long companyId, Long userId, Integer languageType) {
try {
// 参数校验
if (param == null || StringUtils.isBlank(param.getQuestion())) {
throw new IllegalArgumentException("问题不能为空");
}
// 构建请求体
Map<String, Object> requestBody = new HashMap<>();
requestBody.put("question", param.getQuestion());
requestBody.put("topK", param.getTopK() != null ? param.getTopK() : 5);
if (StringUtils.isNotBlank(param.getSession_id())) {
requestBody.put("session_id", param.getSession_id());
}
// 设置请求头
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Company-Id", String.valueOf(companyId));
headers.set("User-Id", String.valueOf(userId));
headers.set("Language-Type", String.valueOf(languageType));
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers);
// 发送POST请求,返回String类型(直接获取对方接口的响应)
ResponseEntity<AiAskResponse> responseEntity = restTemplate.postForEntity(
ASK_BASE_URL+"/ask",
requestEntity,
AiAskResponse.class // 返回原始JSON字符串
);
if (responseEntity.getStatusCode().is2xxSuccessful()) {
// 直接返回对方接口的响应
return SimpleDataResponse.success(responseEntity.getBody());
} else {
logger.error("调用Bedrock问答接口失败,状态码:{}", responseEntity.getStatusCode());
return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR,msgLanguageChange.getParameterMapByCode(languageType, "serviceError"));
}
}catch (Exception e) {
logger.error("调用Bedrock问答接口异常", e);
return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR,msgLanguageChange.getParameterMapByCode(languageType, "serviceError"));
}
}
@Override
public SimpleDataResponse retrieve(AiAskParam param, Long companyId, Long userId, Integer languageType) {
try {
// 参数校验
if (param == null || StringUtils.isBlank(param.getQuestion())) {
throw new IllegalArgumentException("问题不能为空");
}
// 构建请求体
Map<String, Object> requestBody = new HashMap<>();
requestBody.put("question", param.getQuestion());
requestBody.put("topK", param.getTopK() != null ? param.getTopK() : 5);
// 设置请求头
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Company-Id", String.valueOf(companyId));
headers.set("User-Id", String.valueOf(userId));
headers.set("Language-Type", String.valueOf(languageType));
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers);
// 发送POST请求到检索接口
ResponseEntity<RetrieveResponse> responseEntity = restTemplate.postForEntity(
ASK_BASE_URL+"/retrieve", // 检索接口URL
requestEntity,
RetrieveResponse.class
);
if (responseEntity.getStatusCode().is2xxSuccessful()) {
// 返回检索结果对象
return SimpleDataResponse.success(responseEntity.getBody());
} else {
logger.error("调用Bedrock检索接口失败,状态码:{}", responseEntity.getStatusCode());
return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR,
msgLanguageChange.getParameterMapByCode(languageType, "serviceError"));
}
} catch (Exception e) {
logger.error("调用Bedrock检索接口异常", e);
return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR,
msgLanguageChange.getParameterMapByCode(languageType, "serviceError"));
}
}
}

2
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java

@ -71,7 +71,7 @@ public class DeviceDataAccumulateServiceImpl implements DeviceDataAccumulateServ
List<DeviceAccumulateData> resultList;
pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ACCUMULATE));
if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){
if (null != pageSearchParam.getDeviceGroupId()){
resultList = deviceInfoMapperExt.getDevice4AccumulateDataByGroup(pageSearchParam);
} else {
resultList = deviceInfoMapperExt.getDevice4AccumulateData(pageSearchParam);

55
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java

@ -9,6 +9,8 @@ import com.dongjian.dashboard.back.dao.ex.*;
import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam;
import com.dongjian.dashboard.back.dto.data.HandleAlarmParams;
import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam;
import com.dongjian.dashboard.back.dto.device.WindowAlertCloseRequest;
import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest;
import com.dongjian.dashboard.back.model.AlertHandleHistory;
import com.dongjian.dashboard.back.model.AlertHistory;
import com.dongjian.dashboard.back.model.DeviceRawdataRealtime;
@ -16,27 +18,27 @@ import com.dongjian.dashboard.back.service.DeviceDataAlarmService;
import com.dongjian.dashboard.back.service.common.CommonOpt;
import com.dongjian.dashboard.back.vo.data.DeviceAlarmData;
import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO;
import com.dongjian.dashboard.back.vo.device.WindowAlertVO;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService {
private static final Logger logger = LoggerFactory.getLogger(DeviceDataAlarmServiceImpl.class);
@Value("${spring.datasource.url}")
private String dbUrl;
@Autowired
private DashboardNoticeIgnoredMapperExt dashboardNoticeIgnoredMapperExt;
@Autowired
private DeviceInfoMapperExt deviceInfoMapperExt;
@Autowired
@ -77,7 +79,7 @@ public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService {
List<DeviceAlarmData> resultList;
pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ALARM));
if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){
if (null != pageSearchParam.getDeviceGroupId()){
resultList = deviceInfoMapperExt.getDevice4AlarmDataByGroup(pageSearchParam);
} else {
resultList = deviceInfoMapperExt.getDevice4AlarmData(pageSearchParam);
@ -165,4 +167,47 @@ public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService {
return new PageInfo<>(list);
}
@Override
public SimpleDataResponse<List<WindowAlertVO>> windowList(WindowAlertQueryRequest searchParams, Long userId, Long companyId, String accessToken, Integer languageType) {
List<WindowAlertVO> alerts = new ArrayList<>();
try {
searchParams.setCompanyId(companyId);
alerts = alertHistoryMapperExt.getWindowList(searchParams);
// 过滤掉当前 AccessToken 已关闭的告警
String userKey = String.format(Constants.WINDOW_ALERT_IGNORED, userId);
List<String> ignoredList = dashboardNoticeIgnoredMapperExt.getMembersByKey(userKey);
Set<String> ignored = new HashSet<>(ignoredList);
if (!ignored.isEmpty()) {
alerts = alerts.stream()
.filter(a -> !ignored.contains(String.valueOf(a.getAlertId())))
.collect(Collectors.toList());
}
return SimpleDataResponse.success(alerts);
} catch (Exception e) {
logger.error("windowList error", e);
}
return SimpleDataResponse.success(alerts);
}
@Override
public SimpleDataResponse windowDismiss(WindowAlertCloseRequest windowAlertCloseRequest, Long userId, Long companyId, String accessToken, Integer languageType) {
try {
String userKey = String.format(Constants.WINDOW_ALERT_IGNORED, userId);
long currentTime = System.currentTimeMillis();
// 插入表,防止重复
for (Long alertId : windowAlertCloseRequest.getAlertIdList()){
dashboardNoticeIgnoredMapperExt.addMember(userKey, String.valueOf(alertId), currentTime);
}
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("windowDismiss error", e);
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG);
}
}
}

2
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java

@ -63,7 +63,7 @@ public class DeviceDataBaStatusServiceImpl implements DeviceDataBaStatusService
List<DeviceBaStatusData> resultList;
pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_STATUS));
if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){
if (null != pageSearchParam.getDeviceGroupId()){
resultList = deviceInfoMapperExt.getDevice4BaStatusDataByGroup(pageSearchParam);
} else {
resultList = deviceInfoMapperExt.getDevice4BaStatusData(pageSearchParam);

2
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java

@ -75,7 +75,7 @@ public class DeviceDataMeasureServiceImpl implements DeviceDataMeasureService {
List<DeviceMeasureData> resultList;
pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_MEASURE));
if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){
if (null != pageSearchParam.getDeviceGroupId()){
resultList = deviceInfoMapperExt.getDevice4MeasureDataByGroup(pageSearchParam);
} else {
resultList = deviceInfoMapperExt.getDevice4MeasureData(pageSearchParam);

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save