108 changed files with 2789 additions and 3320 deletions
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
@ -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; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
@ -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); |
|
||||
} |
|
||||
@ -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); |
||||
|
} |
||||
@ -1,9 +1,14 @@ |
|||||
package com.dongjian.dashboard.back.dao.ex; |
package com.dongjian.dashboard.back.dao.ex; |
||||
|
|
||||
import com.dongjian.dashboard.back.dao.auto.AlertHistoryMapper; |
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 org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
@Mapper |
@Mapper |
||||
public interface AlertHistoryMapperExt extends AlertHistoryMapper { |
public interface AlertHistoryMapperExt extends AlertHistoryMapper { |
||||
|
|
||||
|
List<WindowAlertVO> getWindowList(WindowAlertQueryRequest windowAlertQueryRequest); |
||||
} |
} |
||||
|
|||||
@ -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); |
|
||||
} |
|
||||
@ -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); |
||||
|
|
||||
|
} |
||||
@ -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); |
|
||||
} |
|
||||
@ -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> |
||||
@ -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> |
|
||||
@ -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> |
||||
@ -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> |
|
||||
@ -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; |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
|
|
||||
} |
|
||||
@ -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(); |
|
||||
} |
|
||||
} |
|
||||
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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(); |
||||
|
} |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
|
|
||||
} |
|
||||
@ -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<>(); |
|
||||
} |
|
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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); |
||||
|
|
||||
|
} |
||||
@ -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); |
|
||||
} |
|
||||
@ -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); |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -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; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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")); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue