52 changed files with 6753 additions and 14 deletions
@ -0,0 +1,103 @@ |
|||||
|
package com.techsor.datacenter.business.controller; |
||||
|
|
||||
|
import com.techsor.datacenter.business.common.exception.BusinessException; |
||||
|
import com.techsor.datacenter.business.common.response.PageInfo; |
||||
|
import com.techsor.datacenter.business.common.response.PageResponse; |
||||
|
import com.techsor.datacenter.business.common.response.ResponseCode; |
||||
|
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
||||
|
import com.techsor.datacenter.business.configurator.interceptor.AccessRequired; |
||||
|
import com.techsor.datacenter.business.dto.level.DeleteLevelParam; |
||||
|
import com.techsor.datacenter.business.dto.level.OptLevelParam; |
||||
|
import com.techsor.datacenter.business.dto.level.PageLevelSearchParam; |
||||
|
import com.techsor.datacenter.business.service.LevelService; |
||||
|
import com.techsor.datacenter.business.vo.level.LevelPageDTO; |
||||
|
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.*; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别管理Controller |
||||
|
* 实现物件级别的增删改查功能 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@AccessRequired |
||||
|
@RequestMapping("/level") |
||||
|
@Tag(name = "物件级别管理的相关接口", description = "物件级别的增删改查操作") |
||||
|
@SuppressWarnings("unchecked") |
||||
|
public class LevelController { |
||||
|
|
||||
|
private static Logger logger = LoggerFactory.getLogger(LevelController.class); |
||||
|
|
||||
|
@Autowired |
||||
|
private LevelService levelService; |
||||
|
|
||||
|
@AccessRequired |
||||
|
@Operation(summary = "添加物件级别") |
||||
|
@RequestMapping(value = "/add", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse add( |
||||
|
@RequestBody OptLevelParam optLevelParam, |
||||
|
@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 levelService.add(optLevelParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@AccessRequired |
||||
|
@Operation(summary = "编辑物件级别") |
||||
|
@RequestMapping(value = "/edit", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse edit( |
||||
|
@RequestBody OptLevelParam optLevelParam, |
||||
|
@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 levelService.edit(optLevelParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@AccessRequired |
||||
|
@Operation(summary = "删除物件级别") |
||||
|
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse batchDelete( |
||||
|
@RequestBody DeleteLevelParam deleteLevelParam, |
||||
|
@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 levelService.batchDelete(deleteLevelParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@AccessRequired |
||||
|
@Operation(summary = "获取物件级别列表") |
||||
|
@RequestMapping(value = "/getListPage", method = RequestMethod.GET) |
||||
|
public PageResponse<PageInfo<LevelPageDTO>> 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, |
||||
|
PageLevelSearchParam pageLevelSearchParam |
||||
|
) throws BusinessException { |
||||
|
|
||||
|
pageLevelSearchParam.setUserId(UserId); |
||||
|
PageResponse<PageInfo<LevelPageDTO>> pageResponse = new PageResponse<>(); |
||||
|
try { |
||||
|
pageResponse.setData(levelService.getListPage(pageLevelSearchParam, 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; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,204 @@ |
|||||
|
package com.techsor.datacenter.business.controller; |
||||
|
|
||||
|
import com.techsor.datacenter.business.TreeMenusDTO; |
||||
|
import com.techsor.datacenter.business.common.exception.BusinessException; |
||||
|
import com.techsor.datacenter.business.common.response.PageInfo; |
||||
|
import com.techsor.datacenter.business.common.response.PageResponse; |
||||
|
import com.techsor.datacenter.business.common.response.ResponseCode; |
||||
|
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
||||
|
import com.techsor.datacenter.business.configurator.interceptor.AccessRequired; |
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.*; |
||||
|
import com.techsor.datacenter.business.service.LevelRoleService; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.LevelRolePageDTO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBindLevelRoleVO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBoundRolePageDTO; |
||||
|
import com.techsor.datacenter.business.vo.user.UserBindBuildingVO; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别管理Controller |
||||
|
* 实现物件级别的增删改查功能 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@AccessRequired |
||||
|
@RequestMapping("/levelRole") |
||||
|
@Tag(name = "物件角色管理的相关接口", description = "物件角色管理的相关接口") |
||||
|
@SuppressWarnings("unchecked") |
||||
|
public class LevelRoleController { |
||||
|
|
||||
|
private static Logger logger = LoggerFactory.getLogger(LevelRoleController.class); |
||||
|
|
||||
|
@Autowired |
||||
|
private LevelRoleService levelRoleService; |
||||
|
|
||||
|
@Operation(summary = "添加级别角色") |
||||
|
@RequestMapping(value = "/add", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse add( |
||||
|
@RequestBody OptLevelRoleParam optLevelRoleParam, |
||||
|
@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 levelRoleService.add(optLevelRoleParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "编辑级别角色") |
||||
|
@RequestMapping(value = "/edit", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse edit( |
||||
|
@RequestBody OptLevelRoleParam optLevelRoleParam, |
||||
|
@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 levelRoleService.edit(optLevelRoleParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "删除级别角色") |
||||
|
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse batchDelete( |
||||
|
@RequestBody DeleteLevelRoleParam deleteLevelRoleParam, |
||||
|
@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 levelRoleService.batchDelete(deleteLevelRoleParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "获取级别角色列表") |
||||
|
@RequestMapping(value = "/getListPage", method = RequestMethod.GET) |
||||
|
public PageResponse<PageInfo<LevelRolePageDTO>> 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, |
||||
|
PageLevelRoleSearchParam pageLevelRoleSearchParam |
||||
|
) throws BusinessException { |
||||
|
|
||||
|
pageLevelRoleSearchParam.setUserId(UserId); |
||||
|
PageResponse<PageInfo<LevelRolePageDTO>> pageResponse = new PageResponse<>(); |
||||
|
try { |
||||
|
pageResponse.setData(levelRoleService.getListPage(pageLevelRoleSearchParam, 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; |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "获取可以绑定层级角色的用户列表") |
||||
|
@RequestMapping(value = "/getCanBeBoundUserPage",method = RequestMethod.GET) |
||||
|
public PageResponse<PageInfo<UserBindLevelRoleVO>> getCanBeBoundUserPage( |
||||
|
BaseSearchParams baseSearchParams, |
||||
|
@Parameter(name="LoginName",description ="登录名",required=true,schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, |
||||
|
@Parameter(name="AccessToken",description ="鉴权token",required=true) @RequestHeader(required=true) String AccessToken, |
||||
|
@Parameter(name="UserId",description ="用户ID",required=true,schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, |
||||
|
@Parameter(name="CompanyId",description ="用户所属企业ID",required=false,schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, |
||||
|
@Parameter(name="LanguageType",description ="语言类型 0:中文 1:英文 2:日文",required=true,schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, |
||||
|
@Parameter(name="UTCOffset",description ="格林威治时间与本地时间的差值,单位是分钟,比如东八区是 -480",required=true,schema = @Schema(defaultValue = "-480")) @RequestHeader(required=true) Integer UTCOffset |
||||
|
) throws BusinessException { |
||||
|
|
||||
|
baseSearchParams.setUserId(UserId); |
||||
|
PageResponse<PageInfo<UserBindLevelRoleVO>> pageResponse = new PageResponse<>(); |
||||
|
try { |
||||
|
pageResponse.setData(levelRoleService.getCanBeBoundUserPage(baseSearchParams, CompanyId, UserId, LanguageType, UTCOffset)); |
||||
|
pageResponse.setCode(ResponseCode.SUCCESS); |
||||
|
pageResponse.setMsg("success"); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("获取用户绑定的级别角色报错", e); |
||||
|
pageResponse.setCode(ResponseCode.SERVER_ERROR); |
||||
|
pageResponse.setMsg("service error"); |
||||
|
} |
||||
|
return pageResponse; |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "用户增加绑定层级角色") |
||||
|
@RequestMapping(value = "/bound/bindUser", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse bindUser( |
||||
|
@RequestBody BindUserParam bindUserParam, |
||||
|
@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 levelRoleService.bindUser(bindUserParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "解绑用户已有的层级角色关系") |
||||
|
@RequestMapping(value = "/bound/unbindUser", method = RequestMethod.POST) |
||||
|
public SimpleDataResponse unbindUser( |
||||
|
@RequestBody UnbindUserParam unbindUserParam, |
||||
|
@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 levelRoleService.unbindUser(unbindUserParam, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "获取用户已绑定的级别角色列表") |
||||
|
@RequestMapping(value = "/bound/getAlreadyBoundUserPage", method = RequestMethod.GET) |
||||
|
public PageResponse<PageInfo<UserBoundRolePageDTO>> getAlreadyBoundUserPage( |
||||
|
@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, |
||||
|
PageBoundRoleSearchParam pageBoundRoleSearchParam |
||||
|
) throws BusinessException { |
||||
|
|
||||
|
pageBoundRoleSearchParam.setUserId(UserId); |
||||
|
PageResponse<PageInfo<UserBoundRolePageDTO>> pageResponse = new PageResponse<>(); |
||||
|
try { |
||||
|
pageResponse.setData(levelRoleService.getAlreadyBoundUserPage(pageBoundRoleSearchParam, 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; |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "根据角色ID获取对应层级ID") |
||||
|
@GetMapping("/bound/getBoundLevelByRole/{roleId}") |
||||
|
public SimpleDataResponse<List<String>> getBoundLevelByRole( |
||||
|
@PathVariable 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 levelRoleService.getBoundLevelByRole(roleId, CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "获取当前登录用户绑定的层级树结构", description = "用于管理设置勾选层级ID") |
||||
|
@GetMapping("/bound/getBoundLevel") |
||||
|
public SimpleDataResponse<List<TreeMenusDTO>> getBoundLevel( |
||||
|
@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 levelRoleService.getBoundLevel(CompanyId, UserId, LanguageType); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,132 @@ |
|||||
|
-- --------------------------- |
||||
|
-- 1) 层级主表 |
||||
|
-- --------------------------- |
||||
|
CREATE TABLE dashboard_level_branch ( |
||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
||||
|
company_id bigint DEFAULT NULL, |
||||
|
name VARCHAR(255) NOT NULL, |
||||
|
remark VARCHAR(255) NOT NULL, |
||||
|
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '支社表'; |
||||
|
|
||||
|
CREATE TABLE dashboard_level_store ( |
||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
||||
|
company_id bigint DEFAULT NULL, |
||||
|
name VARCHAR(255) NOT NULL, |
||||
|
remark VARCHAR(255) NOT NULL, |
||||
|
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '分店表'; |
||||
|
|
||||
|
CREATE TABLE dashboard_level_area ( |
||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
||||
|
company_id bigint DEFAULT NULL, |
||||
|
name VARCHAR(255) NOT NULL, |
||||
|
remark VARCHAR(255) NOT NULL, |
||||
|
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '区域表'; |
||||
|
|
||||
|
CREATE TABLE dashboard_level_site ( |
||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
||||
|
company_id bigint DEFAULT NULL, |
||||
|
name VARCHAR(255) NOT NULL, |
||||
|
remark VARCHAR(255) NOT NULL, |
||||
|
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT 'site表'; |
||||
|
|
||||
|
-- --------------------------- |
||||
|
-- 2) 层级关系表(多对多) |
||||
|
-- --------------------------- |
||||
|
-- 支社 ↔ 各支店 |
||||
|
CREATE TABLE dashboard_level_relation_branch_store ( |
||||
|
branch_id BIGINT NOT NULL, |
||||
|
store_id BIGINT NOT NULL, |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
INDEX idx_branch_store_branch_id (branch_id), |
||||
|
INDEX idx_branch_store_store_id (store_id) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '支社-支店关系表'; |
||||
|
|
||||
|
-- 各支店 ↔ 区域(area) |
||||
|
CREATE TABLE dashboard_level_relation_store_area ( |
||||
|
store_id BIGINT NOT NULL, |
||||
|
area_id BIGINT NOT NULL, |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
INDEX idx_store_area_store_id (store_id), |
||||
|
INDEX idx_store_area_area_id (area_id) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '支店-区域关系表'; |
||||
|
|
||||
|
-- 区域(area)↔ (site) |
||||
|
CREATE TABLE dashboard_level_relation_area_site ( |
||||
|
area_id BIGINT NOT NULL, |
||||
|
site_id BIGINT NOT NULL, |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
INDEX idx_area_site_area_id (area_id), |
||||
|
INDEX idx_area_site_site_id (site_id) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '区域-site关系表'; |
||||
|
|
||||
|
-- 站点(site)↔ 物件(building) |
||||
|
CREATE TABLE dashboard_level_relation_site_building ( |
||||
|
site_id BIGINT NOT NULL, |
||||
|
building_id BIGINT NOT NULL, |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
INDEX idx_site_building_site_id (site_id), |
||||
|
INDEX idx_site_building_building_id (building_id) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT 'site-楼宇关系表'; |
||||
|
|
||||
|
|
||||
|
CREATE TABLE dashboard_level_role ( |
||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
||||
|
company_id bigint DEFAULT NULL, |
||||
|
name VARCHAR(100) NOT NULL, |
||||
|
remark VARCHAR(255) NOT NULL, |
||||
|
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '支社、分店等多层级控制角色'; |
||||
|
|
||||
|
CREATE TABLE dashboard_level_role_object ( |
||||
|
level_role_id BIGINT NOT NULL, |
||||
|
ref_type ENUM('BRANCH','STORE','AREA','SITE','BUILDING') NOT NULL COMMENT '角色绑定的实体类型(指向哪个表)', |
||||
|
ref_id BIGINT NOT NULL COMMENT '对应层级表中的实体ID,例如:ref_type=SITE, ref_id=15 表示绑定了id=15的site', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL, |
||||
|
UNIQUE KEY ux_role_ref (ref_type, ref_id, level_role_id) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '角色绑定的层级关系表'; |
||||
|
|
||||
|
CREATE TABLE dashboard_level_role_user ( |
||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
||||
|
user_id BIGINT NOT NULL, |
||||
|
level_role_id BIGINT NOT NULL, |
||||
|
ref_type INT NOT NULL DEFAULT '0' COMMENT '0-普通用户,1-管理员', |
||||
|
created_by BIGINT NULL, |
||||
|
created_at BIGINT NULL, |
||||
|
updated_at BIGINT NULL, |
||||
|
updated_by BIGINT NULL, |
||||
|
UNIQUE KEY uk_user_role_ref (user_id, level_role_id, ref_type) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '层级角色和用户关系表'; |
||||
|
|
||||
|
|
||||
|
|
||||
@ -0,0 +1,96 @@ |
|||||
|
package com.techsor.datacenter.business.dao.auto; |
||||
|
|
||||
|
import com.techsor.datacenter.business.model.DashboardLevelRole; |
||||
|
import com.techsor.datacenter.business.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,64 @@ |
|||||
|
package com.techsor.datacenter.business.dao.auto; |
||||
|
|
||||
|
import com.techsor.datacenter.business.model.DashboardLevelRoleObject; |
||||
|
import com.techsor.datacenter.business.model.DashboardLevelRoleObjectExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface DashboardLevelRoleObjectMapper { |
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
long countByExample(DashboardLevelRoleObjectExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int deleteByExample(DashboardLevelRoleObjectExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int insert(DashboardLevelRoleObject record); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int insertSelective(DashboardLevelRoleObject record); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
List<DashboardLevelRoleObject> selectByExample(DashboardLevelRoleObjectExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int updateByExampleSelective(@Param("record") DashboardLevelRoleObject record, @Param("example") DashboardLevelRoleObjectExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int updateByExample(@Param("record") DashboardLevelRoleObject record, @Param("example") DashboardLevelRoleObjectExample example); |
||||
|
} |
||||
@ -0,0 +1,96 @@ |
|||||
|
package com.techsor.datacenter.business.dao.auto; |
||||
|
|
||||
|
import com.techsor.datacenter.business.model.DashboardLevelRoleUser; |
||||
|
import com.techsor.datacenter.business.model.DashboardLevelRoleUserExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface DashboardLevelRoleUserMapper { |
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
long countByExample(DashboardLevelRoleUserExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int deleteByExample(DashboardLevelRoleUserExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int insert(DashboardLevelRoleUser record); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int insertSelective(DashboardLevelRoleUser record); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
List<DashboardLevelRoleUser> selectByExample(DashboardLevelRoleUserExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
DashboardLevelRoleUser selectByPrimaryKey(Long id); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int updateByExampleSelective(@Param("record") DashboardLevelRoleUser record, @Param("example") DashboardLevelRoleUserExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int updateByExample(@Param("record") DashboardLevelRoleUser record, @Param("example") DashboardLevelRoleUserExample example); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int updateByPrimaryKeySelective(DashboardLevelRoleUser record); |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
int updateByPrimaryKey(DashboardLevelRoleUser record); |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.techsor.datacenter.business.dao.ex; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dto.level.LevelEntity; |
||||
|
import com.techsor.datacenter.business.dto.level.LevelRelationEntity; |
||||
|
import com.techsor.datacenter.business.dto.level.OptLevelParam; |
||||
|
import com.techsor.datacenter.business.dto.level.PageLevelSearchParam; |
||||
|
import com.techsor.datacenter.business.vo.level.LevelPageDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface LevelMapperExt { |
||||
|
|
||||
|
long checkExist(OptLevelParam param); |
||||
|
|
||||
|
void saveLevel(LevelEntity levelEntity); |
||||
|
|
||||
|
void saveLevelRelation(LevelRelationEntity levelRelationEntity); |
||||
|
|
||||
|
long countParentLevel(OptLevelParam param); |
||||
|
|
||||
|
void updateLevel(LevelEntity levelEntity); |
||||
|
|
||||
|
void deleteLevelRelation(LevelRelationEntity param); |
||||
|
|
||||
|
long checkIfReferencedByChildren(@Param("param") LevelRelationEntity param, @Param("idList") List<Long> idList); |
||||
|
|
||||
|
void deleteLevelByIdList(@Param("tableName") String tableName, @Param("idList") List<Long> idList); |
||||
|
|
||||
|
void deleteLevelRelationByIdList(@Param("param") LevelRelationEntity param, @Param("idList") List<Long> idList); |
||||
|
|
||||
|
List<LevelPageDTO> getListPage(PageLevelSearchParam pageSearchParam); |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.techsor.datacenter.business.dao.ex; |
||||
|
|
||||
|
import com.techsor.datacenter.business.TreeMenusDTO; |
||||
|
import com.techsor.datacenter.business.dao.auto.DashboardLevelRoleMapper; |
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.OptLevelRoleParam; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.PageBoundRoleSearchParam; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.PageLevelRoleSearchParam; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.LevelRolePageDTO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.RefKey; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBindLevelRoleVO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBoundRolePageDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface LevelRoleMapperExt extends DashboardLevelRoleMapper { |
||||
|
|
||||
|
long checkExist(OptLevelRoleParam param); |
||||
|
|
||||
|
List<LevelRolePageDTO> getListPage(PageLevelRoleSearchParam pageSearchParam); |
||||
|
|
||||
|
List<RefKey> selectAllBranches(Map<String, Object> levelMap); |
||||
|
|
||||
|
List<RefKey> selectAllStores(Map<String, Object> levelMap); |
||||
|
|
||||
|
List<RefKey> selectAllAreas(Map<String, Object> levelMap); |
||||
|
|
||||
|
List<RefKey> selectAllSites(Map<String, Object> levelMap); |
||||
|
|
||||
|
List<RefKey> selectAllBuildings(Map<String, Object> levelMap); |
||||
|
|
||||
|
List<RefKey> selectUserRefs(Map<String, Object> param); |
||||
|
|
||||
|
List<String> getBoundLevelByRole(Long roleId); |
||||
|
|
||||
|
List<UserBoundRolePageDTO> getAlreadyBoundUserPage(PageBoundRoleSearchParam pageSearchParam); |
||||
|
|
||||
|
List<UserBindLevelRoleVO> getCanBeBoundUserPage(BaseSearchParams pageSearchParam); |
||||
|
|
||||
|
Integer checkLevelManager(Long userId); |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.techsor.datacenter.business.dao.ex; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dao.auto.DashboardLevelRoleMapper; |
||||
|
import com.techsor.datacenter.business.dao.auto.DashboardLevelRoleObjectMapper; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.OptLevelRoleParam; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface LevelRoleObjectMapperExt extends DashboardLevelRoleObjectMapper { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
package com.techsor.datacenter.business.dao.ex; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dao.auto.DashboardLevelRoleUserMapper; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface LevelRoleUserMapperExt extends DashboardLevelRoleUserMapper { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,334 @@ |
|||||
|
<?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.techsor.datacenter.business.dao.auto.DashboardLevelRoleMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.DashboardLevelRole"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="company_id" jdbcType="BIGINT" property="companyId" /> |
||||
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
||||
|
<result column="flag" jdbcType="INTEGER" property="flag" /> |
||||
|
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> |
||||
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" /> |
||||
|
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
id, company_id, `name`, remark, flag, created_by, created_at, updated_at, updated_by |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleExample" resultMap="BaseResultMap"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
'true' as QUERYID, |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from dashboard_level_role |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from dashboard_level_role |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
delete from dashboard_level_role |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleExample"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
delete from dashboard_level_role |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.techsor.datacenter.business.model.DashboardLevelRole"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> |
||||
|
SELECT LAST_INSERT_ID() |
||||
|
</selectKey> |
||||
|
insert into dashboard_level_role (company_id, `name`, remark, |
||||
|
flag, created_by, created_at, |
||||
|
updated_at, updated_by) |
||||
|
values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, |
||||
|
#{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, |
||||
|
#{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardLevelRole"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> |
||||
|
SELECT LAST_INSERT_ID() |
||||
|
</selectKey> |
||||
|
insert into dashboard_level_role |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="companyId != null"> |
||||
|
company_id, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
`name`, |
||||
|
</if> |
||||
|
<if test="remark != null"> |
||||
|
remark, |
||||
|
</if> |
||||
|
<if test="flag != null"> |
||||
|
flag, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
created_by, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
updated_by, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="companyId != null"> |
||||
|
#{companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
#{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="remark != null"> |
||||
|
#{remark,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="flag != null"> |
||||
|
#{flag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
#{createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
#{updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleExample" resultType="java.lang.Long"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select count(*) from dashboard_level_role |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.companyId != null"> |
||||
|
company_id = #{record.companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.name != null"> |
||||
|
`name` = #{record.name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.remark != null"> |
||||
|
remark = #{record.remark,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.flag != null"> |
||||
|
flag = #{record.flag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.createdBy != null"> |
||||
|
created_by = #{record.createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.updatedBy != null"> |
||||
|
updated_by = #{record.updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
company_id = #{record.companyId,jdbcType=BIGINT}, |
||||
|
`name` = #{record.name,jdbcType=VARCHAR}, |
||||
|
remark = #{record.remark,jdbcType=VARCHAR}, |
||||
|
flag = #{record.flag,jdbcType=INTEGER}, |
||||
|
created_by = #{record.createdBy,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=BIGINT}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=BIGINT}, |
||||
|
updated_by = #{record.updatedBy,jdbcType=BIGINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.techsor.datacenter.business.model.DashboardLevelRole"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role |
||||
|
<set> |
||||
|
<if test="companyId != null"> |
||||
|
company_id = #{companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
`name` = #{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="remark != null"> |
||||
|
remark = #{remark,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="flag != null"> |
||||
|
flag = #{flag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
created_by = #{createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
updated_by = #{updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.techsor.datacenter.business.model.DashboardLevelRole"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role |
||||
|
set company_id = #{companyId,jdbcType=BIGINT}, |
||||
|
`name` = #{name,jdbcType=VARCHAR}, |
||||
|
remark = #{remark,jdbcType=VARCHAR}, |
||||
|
flag = #{flag,jdbcType=INTEGER}, |
||||
|
created_by = #{createdBy,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=BIGINT}, |
||||
|
updated_at = #{updatedAt,jdbcType=BIGINT}, |
||||
|
updated_by = #{updatedBy,jdbcType=BIGINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
||||
@ -0,0 +1,244 @@ |
|||||
|
<?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.techsor.datacenter.business.dao.auto.DashboardLevelRoleObjectMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.DashboardLevelRoleObject"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<result column="level_role_id" jdbcType="BIGINT" property="levelRoleId" /> |
||||
|
<result column="ref_type" jdbcType="CHAR" property="refType" /> |
||||
|
<result column="ref_id" jdbcType="BIGINT" property="refId" /> |
||||
|
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> |
||||
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" /> |
||||
|
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
level_role_id, ref_type, ref_id, created_by, created_at, updated_at, updated_by |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleObjectExample" resultMap="BaseResultMap"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
'true' as QUERYID, |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from dashboard_level_role_object |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleObjectExample"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
delete from dashboard_level_role_object |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleObject"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
insert into dashboard_level_role_object (level_role_id, ref_type, ref_id, |
||||
|
created_by, created_at, updated_at, |
||||
|
updated_by) |
||||
|
values (#{levelRoleId,jdbcType=BIGINT}, #{refType,jdbcType=CHAR}, #{refId,jdbcType=BIGINT}, |
||||
|
#{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, |
||||
|
#{updatedBy,jdbcType=BIGINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleObject"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
insert into dashboard_level_role_object |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="levelRoleId != null"> |
||||
|
level_role_id, |
||||
|
</if> |
||||
|
<if test="refType != null"> |
||||
|
ref_type, |
||||
|
</if> |
||||
|
<if test="refId != null"> |
||||
|
ref_id, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
created_by, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
updated_by, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="levelRoleId != null"> |
||||
|
#{levelRoleId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="refType != null"> |
||||
|
#{refType,jdbcType=CHAR}, |
||||
|
</if> |
||||
|
<if test="refId != null"> |
||||
|
#{refId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
#{createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
#{updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleObjectExample" resultType="java.lang.Long"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select count(*) from dashboard_level_role_object |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role_object |
||||
|
<set> |
||||
|
<if test="record.levelRoleId != null"> |
||||
|
level_role_id = #{record.levelRoleId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.refType != null"> |
||||
|
ref_type = #{record.refType,jdbcType=CHAR}, |
||||
|
</if> |
||||
|
<if test="record.refId != null"> |
||||
|
ref_id = #{record.refId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdBy != null"> |
||||
|
created_by = #{record.createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.updatedBy != null"> |
||||
|
updated_by = #{record.updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role_object |
||||
|
set level_role_id = #{record.levelRoleId,jdbcType=BIGINT}, |
||||
|
ref_type = #{record.refType,jdbcType=CHAR}, |
||||
|
ref_id = #{record.refId,jdbcType=BIGINT}, |
||||
|
created_by = #{record.createdBy,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=BIGINT}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=BIGINT}, |
||||
|
updated_by = #{record.updatedBy,jdbcType=BIGINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
</mapper> |
||||
@ -0,0 +1,319 @@ |
|||||
|
<?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.techsor.datacenter.business.dao.auto.DashboardLevelRoleUserMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.DashboardLevelRoleUser"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="user_id" jdbcType="BIGINT" property="userId" /> |
||||
|
<result column="level_role_id" jdbcType="BIGINT" property="levelRoleId" /> |
||||
|
<result column="ref_type" jdbcType="INTEGER" property="refType" /> |
||||
|
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> |
||||
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" /> |
||||
|
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
id, user_id, level_role_id, ref_type, created_by, created_at, updated_at, updated_by |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUserExample" resultMap="BaseResultMap"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
'true' as QUERYID, |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from dashboard_level_role_user |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from dashboard_level_role_user |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
delete from dashboard_level_role_user |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUserExample"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
delete from dashboard_level_role_user |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUser"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
insert into dashboard_level_role_user (id, user_id, level_role_id, |
||||
|
ref_type, created_by, created_at, |
||||
|
updated_at, updated_by) |
||||
|
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{levelRoleId,jdbcType=BIGINT}, |
||||
|
#{refType,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, |
||||
|
#{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUser"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
insert into dashboard_level_role_user |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
user_id, |
||||
|
</if> |
||||
|
<if test="levelRoleId != null"> |
||||
|
level_role_id, |
||||
|
</if> |
||||
|
<if test="refType != null"> |
||||
|
ref_type, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
created_by, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
updated_by, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
#{userId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="levelRoleId != null"> |
||||
|
#{levelRoleId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="refType != null"> |
||||
|
#{refType,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
#{createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
#{updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUserExample" resultType="java.lang.Long"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
select count(*) from dashboard_level_role_user |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role_user |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.userId != null"> |
||||
|
user_id = #{record.userId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.levelRoleId != null"> |
||||
|
level_role_id = #{record.levelRoleId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.refType != null"> |
||||
|
ref_type = #{record.refType,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.createdBy != null"> |
||||
|
created_by = #{record.createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.updatedBy != null"> |
||||
|
updated_by = #{record.updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role_user |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
user_id = #{record.userId,jdbcType=BIGINT}, |
||||
|
level_role_id = #{record.levelRoleId,jdbcType=BIGINT}, |
||||
|
ref_type = #{record.refType,jdbcType=INTEGER}, |
||||
|
created_by = #{record.createdBy,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=BIGINT}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=BIGINT}, |
||||
|
updated_by = #{record.updatedBy,jdbcType=BIGINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUser"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role_user |
||||
|
<set> |
||||
|
<if test="userId != null"> |
||||
|
user_id = #{userId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="levelRoleId != null"> |
||||
|
level_role_id = #{levelRoleId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="refType != null"> |
||||
|
ref_type = #{refType,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createdBy != null"> |
||||
|
created_by = #{createdBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="updatedBy != null"> |
||||
|
updated_by = #{updatedBy,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.techsor.datacenter.business.model.DashboardLevelRoleUser"> |
||||
|
<!-- |
||||
|
WARNING - @mbg.generated |
||||
|
This element is automatically generated by MyBatis Generator, do not modify. |
||||
|
--> |
||||
|
update dashboard_level_role_user |
||||
|
set user_id = #{userId,jdbcType=BIGINT}, |
||||
|
level_role_id = #{levelRoleId,jdbcType=BIGINT}, |
||||
|
ref_type = #{refType,jdbcType=INTEGER}, |
||||
|
created_by = #{createdBy,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=BIGINT}, |
||||
|
updated_at = #{updatedAt,jdbcType=BIGINT}, |
||||
|
updated_by = #{updatedBy,jdbcType=BIGINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
||||
@ -0,0 +1,183 @@ |
|||||
|
<?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.techsor.datacenter.business.dao.ex.LevelMapperExt"> |
||||
|
|
||||
|
<!-- 根据levelType选择对应的表名 --> |
||||
|
<sql id="selectTable"> |
||||
|
<choose> |
||||
|
<when test="levelType == 1">dashboard_level_branch</when> |
||||
|
<when test="levelType == 2">dashboard_level_store</when> |
||||
|
<when test="levelType == 3">dashboard_level_area</when> |
||||
|
<when test="levelType == 4">dashboard_level_site</when> |
||||
|
</choose> |
||||
|
</sql> |
||||
|
|
||||
|
<sql id="selectParentTable"> |
||||
|
<choose> |
||||
|
<when test="levelType == 2">dashboard_level_branch</when> |
||||
|
<when test="levelType == 3">dashboard_level_store</when> |
||||
|
<when test="levelType == 4">dashboard_level_area</when> |
||||
|
</choose> |
||||
|
</sql> |
||||
|
|
||||
|
<!-- 检查级别名称是否存在 --> |
||||
|
<select id="checkExist" resultType="java.lang.Long"> |
||||
|
SELECT |
||||
|
COUNT(1) |
||||
|
FROM |
||||
|
<include refid="selectTable" /> |
||||
|
WHERE `flag` = 0 AND name = #{levelName} AND company_id = #{companyId} |
||||
|
<if test="id != null"> |
||||
|
AND id != #{id} |
||||
|
</if> |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
<select id="countParentLevel" resultType="java.lang.Long"> |
||||
|
SELECT |
||||
|
COUNT(1) |
||||
|
FROM |
||||
|
<include refid="selectParentTable" /> |
||||
|
WHERE `flag` = 0 AND company_id = #{companyId} |
||||
|
AND id IN <foreach collection="parentIdList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</select> |
||||
|
|
||||
|
<!-- 保存级别信息到对应表 --> |
||||
|
<insert id="saveLevel" useGeneratedKeys="true" keyProperty="id" keyColumn="id"> |
||||
|
INSERT INTO |
||||
|
<include refid="selectTable" /> |
||||
|
(company_id, name, remark, created_by, created_at) |
||||
|
VALUES |
||||
|
(#{companyId}, #{name}, #{remark}, #{createdBy}, #{createdAt}) |
||||
|
</insert> |
||||
|
|
||||
|
<!-- 保存级别信息到对应表 --> |
||||
|
<insert id="saveLevelRelation"> |
||||
|
INSERT INTO |
||||
|
${tableName} |
||||
|
(${parentField}, ${childField}, created_by, created_at) |
||||
|
VALUES |
||||
|
(#{parentId}, #{childId}, #{createdBy}, #{createdAt}) |
||||
|
</insert> |
||||
|
|
||||
|
<delete id="deleteLevelRelation"> |
||||
|
delete from ${tableName} WHERE ${childField} = #{childId} |
||||
|
</delete> |
||||
|
|
||||
|
<!-- 更新级别信息到对应表 --> |
||||
|
<update id="updateLevel"> |
||||
|
UPDATE |
||||
|
<include refid="selectTable" /> |
||||
|
SET |
||||
|
name = #{name}, |
||||
|
remark = #{remark}, |
||||
|
updated_at = #{updatedAt}, |
||||
|
updated_by = #{updatedBy} |
||||
|
WHERE id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<select id="checkIfReferencedByChildren" resultType="java.lang.Long"> |
||||
|
SELECT |
||||
|
COUNT(1) |
||||
|
FROM |
||||
|
${param.tableName} |
||||
|
WHERE ${param.parentField} IN <foreach collection="idList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</select> |
||||
|
|
||||
|
<update id="deleteLevelByIdList"> |
||||
|
UPDATE |
||||
|
${tableName} |
||||
|
SET |
||||
|
`flag` = 1 |
||||
|
WHERE id IN <foreach collection="idList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteLevelRelationByIdList"> |
||||
|
delete from ${param.tableName} |
||||
|
WHERE ${param.childField} |
||||
|
IN <foreach collection="idList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<sql id="commonField"> |
||||
|
base.`id`, |
||||
|
base.company_id, |
||||
|
base.`name` AS levelName, |
||||
|
base.remark, |
||||
|
base.created_by, |
||||
|
base.created_at, |
||||
|
base.updated_by, |
||||
|
base.updated_at |
||||
|
</sql> |
||||
|
|
||||
|
<sql id="commonWhere"> |
||||
|
base.flag =0 |
||||
|
<if test="idList != null and idList.size() > 0"> |
||||
|
AND base.`id` IN <foreach collection="idList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</if> |
||||
|
<if test="levelName != null and levelName != ''"> |
||||
|
AND base.`name` like CONCAT('%',#{levelName},'%') |
||||
|
</if> |
||||
|
<if test="parentIdList != null and parentIdList.size() > 0"> |
||||
|
AND pa.id IN <foreach collection="parentIdList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</if> |
||||
|
</sql> |
||||
|
|
||||
|
<!-- 分页查询级别列表 --> |
||||
|
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.level.LevelPageDTO"> |
||||
|
<choose> |
||||
|
<when test="levelType == 1"> |
||||
|
SELECT |
||||
|
1 AS levelType, |
||||
|
<include refid="commonField" /> |
||||
|
FROM |
||||
|
dashboard_level_branch base |
||||
|
WHERE |
||||
|
<include refid="commonWhere" /> |
||||
|
</when> |
||||
|
<when test="levelType == 2"> |
||||
|
SELECT |
||||
|
2 AS levelType, |
||||
|
GROUP_CONCAT(pa.id) AS parentIds, |
||||
|
GROUP_CONCAT(pa.`name`) AS parentNames, |
||||
|
<include refid="commonField" /> |
||||
|
FROM |
||||
|
dashboard_level_store base |
||||
|
LEFT JOIN dashboard_level_relation_branch_store rela ON base.`id` = rela.store_id |
||||
|
LEFT JOIN dashboard_level_branch pa ON rela.branch_id = pa.`id` |
||||
|
WHERE |
||||
|
<include refid="commonWhere" /> |
||||
|
GROUP BY base.`id` |
||||
|
</when> |
||||
|
<when test="levelType == 3"> |
||||
|
SELECT |
||||
|
3 AS levelType, |
||||
|
GROUP_CONCAT(pa.id) AS parentIds, |
||||
|
GROUP_CONCAT(pa.`name`) AS parentNames, |
||||
|
<include refid="commonField" /> |
||||
|
FROM |
||||
|
dashboard_level_area base |
||||
|
LEFT JOIN dashboard_level_relation_store_area rela ON base.`id` = rela.area_id |
||||
|
LEFT JOIN dashboard_level_store pa ON rela.store_id = pa.`id` |
||||
|
WHERE |
||||
|
<include refid="commonWhere" /> |
||||
|
GROUP BY base.`id` |
||||
|
</when> |
||||
|
<when test="levelType == 4"> |
||||
|
SELECT |
||||
|
4 AS levelType, |
||||
|
GROUP_CONCAT(pa.id) AS parentIds, |
||||
|
GROUP_CONCAT(pa.`name`) AS parentNames, |
||||
|
<include refid="commonField" /> |
||||
|
FROM |
||||
|
dashboard_level_site base |
||||
|
LEFT JOIN dashboard_level_relation_area_site rela ON base.`id` = rela.site_id |
||||
|
LEFT JOIN dashboard_level_area pa ON rela.area_id = pa.`id` |
||||
|
WHERE |
||||
|
<include refid="commonWhere" /> |
||||
|
GROUP BY base.`id` |
||||
|
</when> |
||||
|
</choose> |
||||
|
order BY base.`id` desc |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,182 @@ |
|||||
|
<?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.techsor.datacenter.business.dao.ex.LevelRoleMapperExt"> |
||||
|
|
||||
|
<select id="checkExist" resultType="java.lang.Long"> |
||||
|
SELECT |
||||
|
COUNT(1) |
||||
|
FROM |
||||
|
dashboard_level_role |
||||
|
WHERE |
||||
|
flag != 1 AND name = #{levelRoleName} |
||||
|
<if test="companyId != null"> |
||||
|
AND company_id = #{companyId} |
||||
|
</if> |
||||
|
<if test="id != null"> |
||||
|
AND id != #{id} |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.levelrole.LevelRolePageDTO"> |
||||
|
SELECT |
||||
|
dlr.id, |
||||
|
dlr.company_id, |
||||
|
dlr.name levelRoleName, |
||||
|
dlr.remark, |
||||
|
dlr.created_at |
||||
|
FROM |
||||
|
dashboard_level_role dlr |
||||
|
WHERE |
||||
|
dlr.flag != 1 |
||||
|
AND dlr.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
<if test="idList != null"> |
||||
|
AND dlr.id IN <foreach collection="idList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</if> |
||||
|
<if test="levelRoleName != null and levelRoleName != '' "> |
||||
|
AND dlr.name LIKE CONCAT('%',#{levelRoleName},'%') |
||||
|
</if> |
||||
|
ORDER BY dlr.id DESC |
||||
|
</select> |
||||
|
|
||||
|
<!-- 全量查 Branch --> |
||||
|
<select id="selectAllBranches" resultType="com.techsor.datacenter.business.vo.levelrole.RefKey"> |
||||
|
SELECT |
||||
|
id, |
||||
|
name, |
||||
|
NULL AS parentId, |
||||
|
'BRANCH' AS type |
||||
|
FROM dashboard_level_branch |
||||
|
WHERE flag = 0 and company_id = #{companyId} |
||||
|
</select> |
||||
|
|
||||
|
<!-- 全量查 Store --> |
||||
|
<select id="selectAllStores" resultType="com.techsor.datacenter.business.vo.levelrole.RefKey"> |
||||
|
SELECT s.id, |
||||
|
s.name, |
||||
|
r.branch_id AS parentId, |
||||
|
'STORE' AS type |
||||
|
FROM dashboard_level_store s |
||||
|
LEFT JOIN dashboard_level_relation_branch_store r |
||||
|
ON s.id = r.store_id |
||||
|
WHERE s.flag = 0 and s.company_id = #{companyId} |
||||
|
</select> |
||||
|
|
||||
|
<!-- 全量查 Area --> |
||||
|
<select id="selectAllAreas" resultType="com.techsor.datacenter.business.vo.levelrole.RefKey"> |
||||
|
SELECT a.id, |
||||
|
a.name, |
||||
|
r.store_id AS parentId, |
||||
|
'AREA' AS type |
||||
|
FROM dashboard_level_area a |
||||
|
LEFT JOIN dashboard_level_relation_store_area r |
||||
|
ON a.id = r.area_id |
||||
|
WHERE a.flag = 0 and a.company_id = #{companyId} |
||||
|
</select> |
||||
|
|
||||
|
<!-- 全量查 Site --> |
||||
|
<select id="selectAllSites" resultType="com.techsor.datacenter.business.vo.levelrole.RefKey"> |
||||
|
SELECT s.id, |
||||
|
s.name, |
||||
|
r.area_id AS parentId, |
||||
|
'SITE' AS type |
||||
|
FROM dashboard_level_site s |
||||
|
LEFT JOIN dashboard_level_relation_area_site r |
||||
|
ON s.id = r.site_id |
||||
|
WHERE s.flag = 0 and s.company_id = #{companyId} |
||||
|
</select> |
||||
|
|
||||
|
<!-- 全量查 Building --> |
||||
|
<select id="selectAllBuildings" resultType="com.techsor.datacenter.business.vo.levelrole.RefKey"> |
||||
|
SELECT b.building_id AS id, |
||||
|
b.name, |
||||
|
r.site_id AS parentId, |
||||
|
'BUILDING' AS type |
||||
|
FROM basic_building b |
||||
|
LEFT JOIN dashboard_level_relation_site_building r |
||||
|
ON b.building_id = r.building_id |
||||
|
WHERE b.flag = 0 and b.company_id = #{companyId} |
||||
|
</select> |
||||
|
|
||||
|
<!-- 查用户绑定节点 --> |
||||
|
<select id="selectUserRefs" resultType="com.techsor.datacenter.business.vo.levelrole.RefKey"> |
||||
|
SELECT o.ref_type AS type, |
||||
|
o.ref_id AS id |
||||
|
FROM dashboard_level_role_user u |
||||
|
JOIN dashboard_level_role_object o |
||||
|
ON u.level_role_id = o.level_role_id |
||||
|
WHERE u.user_id = #{userId} |
||||
|
<if test="refType != null"> |
||||
|
AND u.ref_type = #{refType} |
||||
|
</if> |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
<select id="getBoundLevelByRole" resultType="java.lang.String"> |
||||
|
SELECT |
||||
|
CONCAT(dlro.ref_type, '-', dlro.ref_id) AS id |
||||
|
FROM |
||||
|
dashboard_level_role_object dlro |
||||
|
INNER JOIN dashboard_level_role dlr ON dlr.id = dlro.level_role_id |
||||
|
WHERE |
||||
|
dlr.flag != 1 AND dlr.id = #{roleId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="getAlreadyBoundUserPage" resultType="com.techsor.datacenter.business.vo.levelrole.UserBoundRolePageDTO"> |
||||
|
SELECT |
||||
|
dlr.id, |
||||
|
dlr.company_id, |
||||
|
dlr.name levelRoleName, |
||||
|
dlr.remark, |
||||
|
dlr.created_at, |
||||
|
dlru.id AS relationId, |
||||
|
dlru.ref_type, |
||||
|
buser.id AS userId, |
||||
|
buser.mobile_number, |
||||
|
buser.login_name, |
||||
|
buser.email |
||||
|
FROM |
||||
|
dashboard_level_role dlr |
||||
|
INNER JOIN dashboard_level_role_user dlru ON dlr.id = dlru.level_role_id |
||||
|
INNER JOIN data_center_aeon_admin.basic_user buser ON buser.id = dlru.user_id |
||||
|
WHERE |
||||
|
dlr.flag != 1 |
||||
|
AND buser.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
<if test="targetUserId != null"> |
||||
|
AND dlru.user_id = #{targetUserId} |
||||
|
</if> |
||||
|
ORDER BY dlru.created_at DESC, dlru.level_role_id DESC |
||||
|
</select> |
||||
|
|
||||
|
<select id="getCanBeBoundUserPage" resultType="com.techsor.datacenter.business.vo.levelrole.UserBindLevelRoleVO"> |
||||
|
SELECT |
||||
|
u.id userId, |
||||
|
u.username, |
||||
|
u.email, |
||||
|
u.mobile_number |
||||
|
FROM |
||||
|
data_center_aeon_admin.basic_user u |
||||
|
WHERE u.id NOT IN ( |
||||
|
SELECT DISTINCT |
||||
|
rru.user_id |
||||
|
FROM |
||||
|
data_center_aeon_admin.basic_role_user_relation rru |
||||
|
INNER JOIN data_center_aeon_admin.basic_role br ON br.id = rru.role_id |
||||
|
INNER JOIN data_center_aeon_admin.basic_role_menu_relation rmr ON br.id = rmr.role_id |
||||
|
WHERE rmr.menu_id = 88 AND br.flag != 1 |
||||
|
) |
||||
|
AND u.flag != 1 AND u.user_type = 2 |
||||
|
AND u.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</select> |
||||
|
|
||||
|
<select id="checkLevelManager" resultType="java.lang.Integer"> |
||||
|
SELECT |
||||
|
count(1) |
||||
|
FROM |
||||
|
data_center_aeon_admin.basic_role_user_relation rru |
||||
|
INNER JOIN data_center_aeon_admin.basic_role br ON br.id = rru.role_id |
||||
|
INNER JOIN data_center_aeon_admin.basic_role_menu_relation rmr ON br.id = rmr.role_id |
||||
|
WHERE rmr.menu_id = 88 AND br.flag != 1 AND rru.user_id = #{userId} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.techsor.datacenter.business; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class TreeMenusDTO { |
||||
|
|
||||
|
@Schema(description = "节点ID",example = "11", required = true) |
||||
|
private String key; |
||||
|
|
||||
|
@Schema(description = "父节点ID",example = "2", hidden = true) |
||||
|
private String parentKey; |
||||
|
|
||||
|
@Schema(description = "节点名称",example = "添加", required = true) |
||||
|
private String label; |
||||
|
|
||||
|
@Schema(description = "子节点",example = "[]", required = false) |
||||
|
private List<TreeMenusDTO> children; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.techsor.datacenter.business.dto.level; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别删除参数类 |
||||
|
* 用于批量删除物件级别 |
||||
|
*/ |
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class DeleteLevelParam { |
||||
|
|
||||
|
/** |
||||
|
* 要删除的物件级别ID列表 |
||||
|
*/ |
||||
|
@Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) |
||||
|
private String ids; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别类型(1-支社、2-各支店、3-area、4-site) |
||||
|
*/ |
||||
|
@Schema(description = "物件级别类型(1-支社、2-各支店、3-area、4-site)",example = "2", required = true) |
||||
|
private Integer levelType; |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
package com.techsor.datacenter.business.dto.level; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别实体类 |
||||
|
*/ |
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class LevelEntity { |
||||
|
|
||||
|
private Long companyId; |
||||
|
|
||||
|
/** |
||||
|
* 主键ID |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别类型:1-支社 2-各支店 3-area 4-site |
||||
|
*/ |
||||
|
private Integer levelType; |
||||
|
|
||||
|
/** |
||||
|
* 描述 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Long createdAt; |
||||
|
|
||||
|
/** |
||||
|
* 创建人ID |
||||
|
*/ |
||||
|
private Long createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Long updatedAt; |
||||
|
|
||||
|
/** |
||||
|
* 更新人ID |
||||
|
*/ |
||||
|
private Long updatedBy; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.techsor.datacenter.business.dto.level; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别关系操作实体类 |
||||
|
*/ |
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class LevelRelationEntity { |
||||
|
|
||||
|
private String parentField; |
||||
|
|
||||
|
private String childField; |
||||
|
|
||||
|
private Long parentId; |
||||
|
|
||||
|
private Long childId; |
||||
|
|
||||
|
private String tableName; |
||||
|
|
||||
|
private Long createdAt; |
||||
|
|
||||
|
private Long createdBy; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
package com.techsor.datacenter.business.dto.level; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别操作参数类 |
||||
|
* 用于添加和编辑物件级别 |
||||
|
*/ |
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class OptLevelParam { |
||||
|
|
||||
|
/** |
||||
|
* 主键ID(编辑时必填) |
||||
|
*/ |
||||
|
@Schema(description = "物件级别id,新增时不需要)",example = "2", required = true) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别名称 |
||||
|
*/ |
||||
|
@Schema(description = "名称)",example = "2", required = true) |
||||
|
private String levelName; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别类型:1-支社 2-各支店 3-area 4-site |
||||
|
*/ |
||||
|
@Schema(description = "级别类型:1-支社 2-各支店 3-area 4-site",example = "2", required = true) |
||||
|
private Integer levelType; |
||||
|
|
||||
|
/** |
||||
|
* 父级ID |
||||
|
*/ |
||||
|
@Schema(description = "上一层级ID,可以属于多个上级层级, levelType=1时不需要传",example = "[]", required = true) |
||||
|
private List<Long> parentIdList; |
||||
|
|
||||
|
/** |
||||
|
* 描述 |
||||
|
*/ |
||||
|
@Schema(description = "备注",example = "2") |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
@Schema(description = "所属企业ID",example = "2", hidden = true) |
||||
|
private Long companyId; |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.techsor.datacenter.business.dto.level; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别分页查询参数类 |
||||
|
* 用于分页查询物件级别列表 |
||||
|
*/ |
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class PageLevelSearchParam extends BaseSearchParams { |
||||
|
|
||||
|
@Schema(description = "层级id") |
||||
|
private String ids; |
||||
|
|
||||
|
@Schema(description = "层级id", hidden = true) |
||||
|
private List<Long> idList; |
||||
|
|
||||
|
@Schema(description = "父级层级id") |
||||
|
private String parentIds; |
||||
|
|
||||
|
@Schema(description = "父级层级id", hidden = true) |
||||
|
private List<Long> parentIdList; |
||||
|
|
||||
|
@Schema(description = "名称",example = "jyk2") |
||||
|
private String levelName; |
||||
|
|
||||
|
@Schema(description = "级别类型:1-支社 2-各支店 3-area 4-site",example = "2", required = true) |
||||
|
private Integer levelType; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.techsor.datacenter.business.dto.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class BindUserParam { |
||||
|
|
||||
|
@Schema(description = "用户id",example = "3", required = true) |
||||
|
private Long userId; |
||||
|
|
||||
|
@Schema(description = "层级角色ID",example = "[]", required = true) |
||||
|
private List<Long> levelRoleId; |
||||
|
|
||||
|
@Schema(description = "关联类型,0-普通用户(只是查询),1-管理员(可以给别的角色设置)",example = "0", required = true) |
||||
|
private Integer refType; |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.techsor.datacenter.business.dto.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class DeleteLevelRoleParam { |
||||
|
|
||||
|
@Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) |
||||
|
private String ids; |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.techsor.datacenter.business.dto.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class OptLevelRoleParam { |
||||
|
|
||||
|
/** |
||||
|
* 主键ID(编辑时必填) |
||||
|
*/ |
||||
|
@Schema(description = "物件级别id,新增时不需要)",example = "2", required = true) |
||||
|
private Long id; |
||||
|
|
||||
|
@Schema(description = "名称)",example = "2", required = true) |
||||
|
private String levelRoleName; |
||||
|
|
||||
|
@Schema(description = "备注",example = "2") |
||||
|
private String remark; |
||||
|
|
||||
|
@Schema(description = "绑定的层级信息,数组格式,[BRANCH-1,STORE-2,AREA-3]",example = "[]") |
||||
|
private List<String> levelList; |
||||
|
|
||||
|
@Schema(description = "所属企业ID",example = "2", hidden = true) |
||||
|
private Long companyId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.techsor.datacenter.business.dto.levelrole; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class PageBoundRoleSearchParam extends BaseSearchParams { |
||||
|
|
||||
|
@Schema(description = "需要查询的用户") |
||||
|
private Long targetUserId; |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.techsor.datacenter.business.dto.levelrole; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class PageLevelRoleSearchParam extends BaseSearchParams { |
||||
|
|
||||
|
@Schema(description = "id") |
||||
|
private String ids; |
||||
|
|
||||
|
@Schema(description = "id", hidden = true) |
||||
|
private List<Long> idList; |
||||
|
|
||||
|
@Schema(description = "名称",example = "jyk2") |
||||
|
private String levelRoleName; |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.techsor.datacenter.business.dto.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class UnbindUserParam { |
||||
|
|
||||
|
@Schema(description = "绑定关系id,数组格式,可以传多个",example = "[3]", required = true) |
||||
|
private List<Long> relationIdList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,336 @@ |
|||||
|
package com.techsor.datacenter.business.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 column dashboard_level_role.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 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 returns the value of the database column dashboard_level_role.updated_by |
||||
|
* |
||||
|
* @return the value of dashboard_level_role.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getUpdatedBy() { |
||||
|
return updatedBy; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role.updated_by |
||||
|
* |
||||
|
* @param updatedBy the value for dashboard_level_role.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setUpdatedBy(Long updatedBy) { |
||||
|
this.updatedBy = updatedBy; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 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(", updatedBy=").append(updatedBy); |
||||
|
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,862 @@ |
|||||
|
package com.techsor.datacenter.business.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; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIsNull() { |
||||
|
addCriterion("updated_by is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIsNotNull() { |
||||
|
addCriterion("updated_by is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByEqualTo(Long value) { |
||||
|
addCriterion("updated_by =", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotEqualTo(Long value) { |
||||
|
addCriterion("updated_by <>", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByGreaterThan(Long value) { |
||||
|
addCriterion("updated_by >", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("updated_by >=", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByLessThan(Long value) { |
||||
|
addCriterion("updated_by <", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("updated_by <=", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIn(List<Long> values) { |
||||
|
addCriterion("updated_by in", values, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotIn(List<Long> values) { |
||||
|
addCriterion("updated_by not in", values, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByBetween(Long value1, Long value2) { |
||||
|
addCriterion("updated_by between", value1, value2, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("updated_by not between", value1, value2, "updatedBy"); |
||||
|
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,268 @@ |
|||||
|
package com.techsor.datacenter.business.model; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
public class DashboardLevelRoleObject implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.level_role_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long levelRoleId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.ref_type |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private String refType; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.ref_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long refId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.created_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long createdBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.created_at |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long createdAt; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.updated_at |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long updatedAt; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_object.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @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_object.level_role_id |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.level_role_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getLevelRoleId() { |
||||
|
return levelRoleId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_object.level_role_id |
||||
|
* |
||||
|
* @param levelRoleId the value for dashboard_level_role_object.level_role_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setLevelRoleId(Long levelRoleId) { |
||||
|
this.levelRoleId = levelRoleId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_object.ref_type |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.ref_type |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public String getRefType() { |
||||
|
return refType; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_object.ref_type |
||||
|
* |
||||
|
* @param refType the value for dashboard_level_role_object.ref_type |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setRefType(String refType) { |
||||
|
this.refType = refType == null ? null : refType.trim(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_object.ref_id |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.ref_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getRefId() { |
||||
|
return refId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_object.ref_id |
||||
|
* |
||||
|
* @param refId the value for dashboard_level_role_object.ref_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setRefId(Long refId) { |
||||
|
this.refId = refId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_object.created_by |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.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_object.created_by |
||||
|
* |
||||
|
* @param createdBy the value for dashboard_level_role_object.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_object.created_at |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.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_object.created_at |
||||
|
* |
||||
|
* @param createdAt the value for dashboard_level_role_object.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_object.updated_at |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.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_object.updated_at |
||||
|
* |
||||
|
* @param updatedAt the value for dashboard_level_role_object.updated_at |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setUpdatedAt(Long updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_object.updated_by |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_object.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getUpdatedBy() { |
||||
|
return updatedBy; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_object.updated_by |
||||
|
* |
||||
|
* @param updatedBy the value for dashboard_level_role_object.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setUpdatedBy(Long updatedBy) { |
||||
|
this.updatedBy = updatedBy; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", levelRoleId=").append(levelRoleId); |
||||
|
sb.append(", refType=").append(refType); |
||||
|
sb.append(", refId=").append(refId); |
||||
|
sb.append(", createdBy=").append(createdBy); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", updatedBy=").append(updatedBy); |
||||
|
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,732 @@ |
|||||
|
package com.techsor.datacenter.business.model; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class DashboardLevelRoleObjectExample { |
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
protected boolean distinct; |
||||
|
|
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public DashboardLevelRoleObjectExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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 andLevelRoleIdIsNull() { |
||||
|
addCriterion("level_role_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdIsNotNull() { |
||||
|
addCriterion("level_role_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdEqualTo(Long value) { |
||||
|
addCriterion("level_role_id =", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdNotEqualTo(Long value) { |
||||
|
addCriterion("level_role_id <>", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdGreaterThan(Long value) { |
||||
|
addCriterion("level_role_id >", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("level_role_id >=", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdLessThan(Long value) { |
||||
|
addCriterion("level_role_id <", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("level_role_id <=", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdIn(List<Long> values) { |
||||
|
addCriterion("level_role_id in", values, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdNotIn(List<Long> values) { |
||||
|
addCriterion("level_role_id not in", values, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("level_role_id between", value1, value2, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("level_role_id not between", value1, value2, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeIsNull() { |
||||
|
addCriterion("ref_type is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeIsNotNull() { |
||||
|
addCriterion("ref_type is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeEqualTo(String value) { |
||||
|
addCriterion("ref_type =", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotEqualTo(String value) { |
||||
|
addCriterion("ref_type <>", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeGreaterThan(String value) { |
||||
|
addCriterion("ref_type >", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("ref_type >=", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeLessThan(String value) { |
||||
|
addCriterion("ref_type <", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeLessThanOrEqualTo(String value) { |
||||
|
addCriterion("ref_type <=", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeLike(String value) { |
||||
|
addCriterion("ref_type like", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotLike(String value) { |
||||
|
addCriterion("ref_type not like", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeIn(List<String> values) { |
||||
|
addCriterion("ref_type in", values, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotIn(List<String> values) { |
||||
|
addCriterion("ref_type not in", values, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeBetween(String value1, String value2) { |
||||
|
addCriterion("ref_type between", value1, value2, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotBetween(String value1, String value2) { |
||||
|
addCriterion("ref_type not between", value1, value2, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdIsNull() { |
||||
|
addCriterion("ref_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdIsNotNull() { |
||||
|
addCriterion("ref_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdEqualTo(Long value) { |
||||
|
addCriterion("ref_id =", value, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdNotEqualTo(Long value) { |
||||
|
addCriterion("ref_id <>", value, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdGreaterThan(Long value) { |
||||
|
addCriterion("ref_id >", value, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("ref_id >=", value, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdLessThan(Long value) { |
||||
|
addCriterion("ref_id <", value, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("ref_id <=", value, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdIn(List<Long> values) { |
||||
|
addCriterion("ref_id in", values, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdNotIn(List<Long> values) { |
||||
|
addCriterion("ref_id not in", values, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("ref_id between", value1, value2, "refId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("ref_id not between", value1, value2, "refId"); |
||||
|
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; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIsNull() { |
||||
|
addCriterion("updated_by is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIsNotNull() { |
||||
|
addCriterion("updated_by is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByEqualTo(Long value) { |
||||
|
addCriterion("updated_by =", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotEqualTo(Long value) { |
||||
|
addCriterion("updated_by <>", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByGreaterThan(Long value) { |
||||
|
addCriterion("updated_by >", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("updated_by >=", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByLessThan(Long value) { |
||||
|
addCriterion("updated_by <", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("updated_by <=", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIn(List<Long> values) { |
||||
|
addCriterion("updated_by in", values, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotIn(List<Long> values) { |
||||
|
addCriterion("updated_by not in", values, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByBetween(Long value1, Long value2) { |
||||
|
addCriterion("updated_by between", value1, value2, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("updated_by not between", value1, value2, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This class was generated by MyBatis Generator. |
||||
|
* This class corresponds to the database table dashboard_level_role_object |
||||
|
* |
||||
|
* @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_object |
||||
|
* |
||||
|
* @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,302 @@ |
|||||
|
package com.techsor.datacenter.business.model; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
public class DashboardLevelRoleUser implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.user_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.level_role_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long levelRoleId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.ref_type |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Integer refType; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.created_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long createdBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.created_at |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long createdAt; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.updated_at |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long updatedAt; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database column dashboard_level_role_user.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
private Long updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @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_user.id |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.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_user.id |
||||
|
* |
||||
|
* @param id the value for dashboard_level_role_user.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_user.user_id |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.user_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getUserId() { |
||||
|
return userId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_user.user_id |
||||
|
* |
||||
|
* @param userId the value for dashboard_level_role_user.user_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setUserId(Long userId) { |
||||
|
this.userId = userId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_user.level_role_id |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.level_role_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getLevelRoleId() { |
||||
|
return levelRoleId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_user.level_role_id |
||||
|
* |
||||
|
* @param levelRoleId the value for dashboard_level_role_user.level_role_id |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setLevelRoleId(Long levelRoleId) { |
||||
|
this.levelRoleId = levelRoleId; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_user.ref_type |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.ref_type |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Integer getRefType() { |
||||
|
return refType; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_user.ref_type |
||||
|
* |
||||
|
* @param refType the value for dashboard_level_role_user.ref_type |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setRefType(Integer refType) { |
||||
|
this.refType = refType; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_user.created_by |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.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_user.created_by |
||||
|
* |
||||
|
* @param createdBy the value for dashboard_level_role_user.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_user.created_at |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.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_user.created_at |
||||
|
* |
||||
|
* @param createdAt the value for dashboard_level_role_user.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_user.updated_at |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.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_user.updated_at |
||||
|
* |
||||
|
* @param updatedAt the value for dashboard_level_role_user.updated_at |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setUpdatedAt(Long updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method returns the value of the database column dashboard_level_role_user.updated_by |
||||
|
* |
||||
|
* @return the value of dashboard_level_role_user.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public Long getUpdatedBy() { |
||||
|
return updatedBy; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method sets the value of the database column dashboard_level_role_user.updated_by |
||||
|
* |
||||
|
* @param updatedBy the value for dashboard_level_role_user.updated_by |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public void setUpdatedBy(Long updatedBy) { |
||||
|
this.updatedBy = updatedBy; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @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(", userId=").append(userId); |
||||
|
sb.append(", levelRoleId=").append(levelRoleId); |
||||
|
sb.append(", refType=").append(refType); |
||||
|
sb.append(", createdBy=").append(createdBy); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", updatedBy=").append(updatedBy); |
||||
|
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,782 @@ |
|||||
|
package com.techsor.datacenter.business.model; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class DashboardLevelRoleUserExample { |
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
protected boolean distinct; |
||||
|
|
||||
|
/** |
||||
|
* This field was generated by MyBatis Generator. |
||||
|
* This field corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public DashboardLevelRoleUserExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @mbg.generated |
||||
|
*/ |
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method was generated by MyBatis Generator. |
||||
|
* This method corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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 andUserIdIsNull() { |
||||
|
addCriterion("user_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdIsNotNull() { |
||||
|
addCriterion("user_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdEqualTo(Long value) { |
||||
|
addCriterion("user_id =", value, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdNotEqualTo(Long value) { |
||||
|
addCriterion("user_id <>", value, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdGreaterThan(Long value) { |
||||
|
addCriterion("user_id >", value, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("user_id >=", value, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdLessThan(Long value) { |
||||
|
addCriterion("user_id <", value, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("user_id <=", value, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdIn(List<Long> values) { |
||||
|
addCriterion("user_id in", values, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdNotIn(List<Long> values) { |
||||
|
addCriterion("user_id not in", values, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("user_id between", value1, value2, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUserIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("user_id not between", value1, value2, "userId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdIsNull() { |
||||
|
addCriterion("level_role_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdIsNotNull() { |
||||
|
addCriterion("level_role_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdEqualTo(Long value) { |
||||
|
addCriterion("level_role_id =", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdNotEqualTo(Long value) { |
||||
|
addCriterion("level_role_id <>", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdGreaterThan(Long value) { |
||||
|
addCriterion("level_role_id >", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("level_role_id >=", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdLessThan(Long value) { |
||||
|
addCriterion("level_role_id <", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("level_role_id <=", value, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdIn(List<Long> values) { |
||||
|
addCriterion("level_role_id in", values, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdNotIn(List<Long> values) { |
||||
|
addCriterion("level_role_id not in", values, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("level_role_id between", value1, value2, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelRoleIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("level_role_id not between", value1, value2, "levelRoleId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeIsNull() { |
||||
|
addCriterion("ref_type is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeIsNotNull() { |
||||
|
addCriterion("ref_type is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeEqualTo(Integer value) { |
||||
|
addCriterion("ref_type =", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotEqualTo(Integer value) { |
||||
|
addCriterion("ref_type <>", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeGreaterThan(Integer value) { |
||||
|
addCriterion("ref_type >", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeGreaterThanOrEqualTo(Integer value) { |
||||
|
addCriterion("ref_type >=", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeLessThan(Integer value) { |
||||
|
addCriterion("ref_type <", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeLessThanOrEqualTo(Integer value) { |
||||
|
addCriterion("ref_type <=", value, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeIn(List<Integer> values) { |
||||
|
addCriterion("ref_type in", values, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotIn(List<Integer> values) { |
||||
|
addCriterion("ref_type not in", values, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeBetween(Integer value1, Integer value2) { |
||||
|
addCriterion("ref_type between", value1, value2, "refType"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRefTypeNotBetween(Integer value1, Integer value2) { |
||||
|
addCriterion("ref_type not between", value1, value2, "refType"); |
||||
|
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; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIsNull() { |
||||
|
addCriterion("updated_by is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIsNotNull() { |
||||
|
addCriterion("updated_by is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByEqualTo(Long value) { |
||||
|
addCriterion("updated_by =", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotEqualTo(Long value) { |
||||
|
addCriterion("updated_by <>", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByGreaterThan(Long value) { |
||||
|
addCriterion("updated_by >", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("updated_by >=", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByLessThan(Long value) { |
||||
|
addCriterion("updated_by <", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("updated_by <=", value, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByIn(List<Long> values) { |
||||
|
addCriterion("updated_by in", values, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotIn(List<Long> values) { |
||||
|
addCriterion("updated_by not in", values, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByBetween(Long value1, Long value2) { |
||||
|
addCriterion("updated_by between", value1, value2, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedByNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("updated_by not between", value1, value2, "updatedBy"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This class was generated by MyBatis Generator. |
||||
|
* This class corresponds to the database table dashboard_level_role_user |
||||
|
* |
||||
|
* @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_user |
||||
|
* |
||||
|
* @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,55 @@ |
|||||
|
package com.techsor.datacenter.business.vo.level; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别分页查询DTO类 |
||||
|
* 用于返回物件级别分页查询结果 |
||||
|
*/ |
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class LevelPageDTO { |
||||
|
|
||||
|
/** |
||||
|
* 主键ID(编辑时必填) |
||||
|
*/ |
||||
|
@Schema(description = "物件级别id,新增时不需要)",example = "2", required = true) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别名称 |
||||
|
*/ |
||||
|
@Schema(description = "名称)",example = "2", required = true) |
||||
|
private String levelName; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别类型:1-支社 2-各支店 3-area 4-site |
||||
|
*/ |
||||
|
@Schema(description = "级别类型:1-支社 2-各支店 3-area 4-site",example = "2", required = true) |
||||
|
private Integer levelType; |
||||
|
|
||||
|
/** |
||||
|
* 父级ID |
||||
|
*/ |
||||
|
@Schema(description = "上一层级ID",example = "2", required = true) |
||||
|
private String parentIds; |
||||
|
|
||||
|
/** |
||||
|
* 父级名称 |
||||
|
*/ |
||||
|
@Schema(description = "上一层级名称",example = "2") |
||||
|
private String parentNames; |
||||
|
|
||||
|
/** |
||||
|
* 描述 |
||||
|
*/ |
||||
|
@Schema(description = "备注",example = "2") |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
@Schema(description = "创建时间,毫秒级时间戳",example = "2") |
||||
|
private Long createdAt; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.techsor.datacenter.business.vo.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class LevelRolePageDTO { |
||||
|
|
||||
|
/** |
||||
|
* 主键ID(编辑时必填) |
||||
|
*/ |
||||
|
@Schema(description = "层级角色id,新增时不需要)",example = "2", required = true) |
||||
|
private Long id; |
||||
|
|
||||
|
@Schema(description = "名称)",example = "2", required = true) |
||||
|
private String levelRoleName; |
||||
|
|
||||
|
@Schema(description = "备注",example = "2") |
||||
|
private String remark; |
||||
|
|
||||
|
@Schema(description = "创建时间,毫秒级时间戳",example = "2") |
||||
|
private Long createdAt; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.techsor.datacenter.business.vo.levelrole; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class RefKey { |
||||
|
private String type; // BRANCH / STORE / AREA / SITE / BUILDING
|
||||
|
private String name; |
||||
|
private Long id; |
||||
|
private Long parentId; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.techsor.datacenter.business.vo.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author Mr.Jiang |
||||
|
* @time 2022年7月21日 下午8:50:31 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserBindLevelRoleVO { |
||||
|
|
||||
|
@Schema(description ="用户ID",example = "111", required = false) |
||||
|
private Long userId; |
||||
|
|
||||
|
@Schema(description ="用户名",example = "管理员", required = true) |
||||
|
private String username; |
||||
|
|
||||
|
@Schema(description ="用户邮箱",example = "1057897@qq.com", required = true) |
||||
|
private String email; |
||||
|
|
||||
|
@Schema(description ="手机号码,这里要加上国际区号,比如日本是+81,传给后台的就是+81-08041165856,中国是+86,传给后台的就是+86-18841165856",example = "+81-08041165856", required = false) |
||||
|
private String mobileNumber; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.techsor.datacenter.business.vo.levelrole; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class UserBoundRolePageDTO extends LevelRolePageDTO{ |
||||
|
|
||||
|
@Schema(description = "绑定关系id",example = "3", required = true) |
||||
|
private Long relationId; |
||||
|
|
||||
|
@Schema(description = "关联类型,0-普通用户,1-管理员",example = "0", required = true) |
||||
|
private Integer refType; |
||||
|
|
||||
|
@Schema(description = "用户id",example = "2", required = true) |
||||
|
private Long userId; |
||||
|
|
||||
|
@Schema(description = "用户邮箱",example = "1057897@qq.com", required = true) |
||||
|
private String email; |
||||
|
|
||||
|
@Schema(description = "登录名",example = "1057897@qq.com", required = true) |
||||
|
private String loginName; |
||||
|
|
||||
|
@Schema(description ="手机号码,这里要加上国际区号,比如日本是+81,传给后台的就是+81-08041165856,中国是+86,传给后台的就是+86-18841165856",example = "+81-08041165856", required = false) |
||||
|
private String mobileNumber; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.techsor.datacenter.business.service; |
||||
|
|
||||
|
import com.techsor.datacenter.business.TreeMenusDTO; |
||||
|
import com.techsor.datacenter.business.common.response.PageInfo; |
||||
|
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.*; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.LevelRolePageDTO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBindLevelRoleVO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBoundRolePageDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface LevelRoleService { |
||||
|
|
||||
|
SimpleDataResponse add(OptLevelRoleParam optLevelRoleParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse edit(OptLevelRoleParam optLevelRoleParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse batchDelete(DeleteLevelRoleParam deleteLevelRoleParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
PageInfo<LevelRolePageDTO> getListPage(PageLevelRoleSearchParam pageLevelRoleSearchParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse<List<TreeMenusDTO>> getBoundLevel(Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse<List<String>> getBoundLevelByRole(Long roleId, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse bindUser(BindUserParam bindUserParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse unbindUser(UnbindUserParam unbindUserParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
PageInfo<UserBoundRolePageDTO> getAlreadyBoundUserPage(PageBoundRoleSearchParam pageBoundRoleSearchParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
PageInfo<UserBindLevelRoleVO> getCanBeBoundUserPage(BaseSearchParams baseSearchParams, Long companyId, Long userId, Integer languageType, Integer utcOffset); |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.techsor.datacenter.business.service; |
||||
|
|
||||
|
import com.techsor.datacenter.business.common.response.PageInfo; |
||||
|
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
||||
|
import com.techsor.datacenter.business.dto.level.DeleteLevelParam; |
||||
|
import com.techsor.datacenter.business.dto.level.OptLevelParam; |
||||
|
import com.techsor.datacenter.business.dto.level.PageLevelSearchParam; |
||||
|
import com.techsor.datacenter.business.vo.level.LevelPageDTO; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别Service接口 |
||||
|
* 定义物件级别的增删改查操作 |
||||
|
*/ |
||||
|
public interface LevelService { |
||||
|
|
||||
|
SimpleDataResponse add(OptLevelParam optLevelParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse edit(OptLevelParam optLevelParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse batchDelete(DeleteLevelParam deleteLevelParam, Long companyId, Long userId, Integer languageType); |
||||
|
|
||||
|
PageInfo<LevelPageDTO> getListPage(PageLevelSearchParam pageLevelSearchParam, Long companyId, Long userId, Integer languageType); |
||||
|
} |
||||
@ -0,0 +1,482 @@ |
|||||
|
package com.techsor.datacenter.business.service.impl; |
||||
|
|
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import com.techsor.datacenter.business.TreeMenusDTO; |
||||
|
import com.techsor.datacenter.business.common.language.msg.MsgLanguageChange; |
||||
|
import com.techsor.datacenter.business.common.response.PageInfo; |
||||
|
import com.techsor.datacenter.business.common.response.ResponseCode; |
||||
|
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
||||
|
import com.techsor.datacenter.business.dao.ex.LevelRoleMapperExt; |
||||
|
import com.techsor.datacenter.business.dao.ex.LevelRoleObjectMapperExt; |
||||
|
import com.techsor.datacenter.business.dao.ex.LevelRoleUserMapperExt; |
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import com.techsor.datacenter.business.dto.levelrole.*; |
||||
|
import com.techsor.datacenter.business.model.*; |
||||
|
import com.techsor.datacenter.business.service.LevelRoleService; |
||||
|
import com.techsor.datacenter.business.service.common.CommonOpt; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.LevelRolePageDTO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.RefKey; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBindLevelRoleVO; |
||||
|
import com.techsor.datacenter.business.vo.levelrole.UserBoundRolePageDTO; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别Service实现类 |
||||
|
* 实现物件级别的业务逻辑 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class LevelRoleServiceImpl implements LevelRoleService { |
||||
|
|
||||
|
private static Logger logger = LoggerFactory.getLogger(LevelRoleServiceImpl.class); |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private CommonOpt commonOpt; |
||||
|
@Autowired |
||||
|
private MsgLanguageChange msgLanguageChange; |
||||
|
|
||||
|
@Autowired |
||||
|
private LevelRoleMapperExt levelRoleMapperExt; |
||||
|
@Autowired |
||||
|
private LevelRoleObjectMapperExt levelRoleObjectMapperExt; |
||||
|
@Autowired |
||||
|
private LevelRoleUserMapperExt levelRoleUserMapperExt; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse add(OptLevelRoleParam param, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
param.setCompanyId(companyId); |
||||
|
param.setId(null); |
||||
|
//校验参数
|
||||
|
SimpleDataResponse checkResult = checkParam(param, languageType); |
||||
|
if (200 != checkResult.getCode()) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
//重复校验
|
||||
|
if (checkExist(param) > 0) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "levelRoleNameExist")); |
||||
|
} |
||||
|
|
||||
|
long currentUnix = System.currentTimeMillis(); |
||||
|
DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); |
||||
|
BeanUtils.copyProperties(param, dashboardLevelRole); |
||||
|
dashboardLevelRole.setName(param.getLevelRoleName()); |
||||
|
dashboardLevelRole.setCreatedBy(userId); |
||||
|
dashboardLevelRole.setCreatedAt(currentUnix); |
||||
|
dashboardLevelRole.setCompanyId(companyId); |
||||
|
levelRoleMapperExt.insertSelective(dashboardLevelRole); |
||||
|
|
||||
|
//插入关联
|
||||
|
insertRoleObjectRelation(param, dashboardLevelRole, 1); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("添加层级角色报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void insertRoleObjectRelation(OptLevelRoleParam param, DashboardLevelRole dashboardLevelRole, int optType) { |
||||
|
if (2 == optType){ |
||||
|
DashboardLevelRoleObjectExample dashboardLevelRoleObjectExample = new DashboardLevelRoleObjectExample(); |
||||
|
dashboardLevelRoleObjectExample.createCriteria().andLevelRoleIdEqualTo(dashboardLevelRole.getId()); |
||||
|
levelRoleObjectMapperExt.deleteByExample(dashboardLevelRoleObjectExample); |
||||
|
} |
||||
|
if (CollectionUtils.isNotEmpty(param.getLevelList())){ |
||||
|
for (String levelInfo : param.getLevelList()){ |
||||
|
String[] parts = levelInfo.split("-");//levelInfo的值为BRANCH-1,STORE-2,AREA-3
|
||||
|
DashboardLevelRoleObject dashboardLevelRoleObject = new DashboardLevelRoleObject(); |
||||
|
dashboardLevelRoleObject.setLevelRoleId(dashboardLevelRole.getId()); |
||||
|
dashboardLevelRoleObject.setRefType(parts[0]); |
||||
|
dashboardLevelRoleObject.setRefId(Long.valueOf(parts[1])); |
||||
|
if (1 == optType) { |
||||
|
dashboardLevelRoleObject.setCreatedAt(dashboardLevelRole.getCreatedAt()); |
||||
|
dashboardLevelRoleObject.setCreatedBy(dashboardLevelRole.getCreatedBy()); |
||||
|
} else if (2 == optType) { |
||||
|
dashboardLevelRoleObject.setCreatedAt(dashboardLevelRole.getUpdatedAt()); |
||||
|
dashboardLevelRoleObject.setCreatedBy(dashboardLevelRole.getUpdatedBy()); |
||||
|
} |
||||
|
levelRoleObjectMapperExt.insertSelective(dashboardLevelRoleObject); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private long checkExist(OptLevelRoleParam param) { |
||||
|
return levelRoleMapperExt.checkExist(param); |
||||
|
} |
||||
|
|
||||
|
private SimpleDataResponse checkParam(OptLevelRoleParam param, Integer languageType) { |
||||
|
if(StringUtils.isBlank(param.getLevelRoleName()) || param.getLevelRoleName().length() > 100){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [levelRoleName] error"); |
||||
|
} |
||||
|
if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 255){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [remark] error"); |
||||
|
} |
||||
|
return SimpleDataResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SimpleDataResponse edit(OptLevelRoleParam param, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
param.setCompanyId(companyId); |
||||
|
//校验参数
|
||||
|
SimpleDataResponse checkResult = checkParam(param, languageType); |
||||
|
if (200 != checkResult.getCode()) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
//重复校验
|
||||
|
if (checkExist(param) > 0) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "levelRoleNameExist")); |
||||
|
} |
||||
|
|
||||
|
long currentUnix = System.currentTimeMillis(); |
||||
|
DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); |
||||
|
BeanUtils.copyProperties(param, dashboardLevelRole); |
||||
|
dashboardLevelRole.setName(param.getLevelRoleName()); |
||||
|
dashboardLevelRole.setUpdatedBy(userId); |
||||
|
dashboardLevelRole.setUpdatedAt(currentUnix); |
||||
|
if (StringUtils.isBlank(param.getRemark())){ |
||||
|
dashboardLevelRole.setRemark(""); |
||||
|
} |
||||
|
levelRoleMapperExt.updateByPrimaryKeySelective(dashboardLevelRole); |
||||
|
|
||||
|
//插入关联
|
||||
|
insertRoleObjectRelation(param, dashboardLevelRole, 2); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("编辑层级角色报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse batchDelete(DeleteLevelRoleParam deleteLevelRoleParam, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
List<Long> idList = Arrays.asList(deleteLevelRoleParam.getIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); |
||||
|
|
||||
|
// 检查是否有绑定
|
||||
|
DashboardLevelRoleUserExample dashboardLevelRoleUserExample = new DashboardLevelRoleUserExample(); |
||||
|
dashboardLevelRoleUserExample.createCriteria().andLevelRoleIdIn(idList); |
||||
|
if (levelRoleUserMapperExt.countByExample(dashboardLevelRoleUserExample) > 0) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "roleHasBinded")); |
||||
|
} |
||||
|
|
||||
|
//基础表
|
||||
|
DashboardLevelRoleExample deleteLevelRoleExample = new DashboardLevelRoleExample(); |
||||
|
deleteLevelRoleExample.createCriteria().andIdIn(idList); |
||||
|
DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); |
||||
|
dashboardLevelRole.setFlag(1); |
||||
|
levelRoleMapperExt.updateByExampleSelective(dashboardLevelRole, deleteLevelRoleExample); |
||||
|
|
||||
|
//角色和层级关联表
|
||||
|
DashboardLevelRoleObjectExample deleteRoleObjectExample = new DashboardLevelRoleObjectExample(); |
||||
|
deleteRoleObjectExample.createCriteria().andLevelRoleIdIn(idList); |
||||
|
levelRoleObjectMapperExt.deleteByExample(deleteRoleObjectExample); |
||||
|
|
||||
|
//角色和用户关联表
|
||||
|
DashboardLevelRoleUserExample deleteRoleUserExample = new DashboardLevelRoleUserExample(); |
||||
|
deleteRoleUserExample.createCriteria().andLevelRoleIdIn(idList); |
||||
|
levelRoleUserMapperExt.deleteByExample(deleteRoleUserExample); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("删除层级角色报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageInfo<LevelRolePageDTO> getListPage(PageLevelRoleSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { |
||||
|
//list防${}注入
|
||||
|
if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { |
||||
|
pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); |
||||
|
} else { |
||||
|
pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(pageSearchParam.getIds())) { |
||||
|
pageSearchParam.setIdList(Arrays.asList(pageSearchParam.getIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList())); |
||||
|
} |
||||
|
|
||||
|
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); |
||||
|
List<LevelRolePageDTO> resultList = levelRoleMapperExt.getListPage(pageSearchParam); |
||||
|
|
||||
|
return new PageInfo<>(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse bindUser(BindUserParam bindUserParam, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
SimpleDataResponse checkResult = checkBindParam(bindUserParam, languageType); |
||||
|
if (200 != checkResult.getCode()) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
|
||||
|
long currentUnix = System.currentTimeMillis(); |
||||
|
for (Long levelRoleId : bindUserParam.getLevelRoleId()){ |
||||
|
//数据库存在就不用管了
|
||||
|
DashboardLevelRoleUserExample countRoleUserExample = new DashboardLevelRoleUserExample(); |
||||
|
countRoleUserExample.createCriteria() |
||||
|
.andLevelRoleIdEqualTo(levelRoleId) |
||||
|
.andUserIdEqualTo(bindUserParam.getUserId()) |
||||
|
.andRefTypeEqualTo(bindUserParam.getRefType()); |
||||
|
if (levelRoleUserMapperExt.countByExample(countRoleUserExample) > 0){ |
||||
|
continue; |
||||
|
} |
||||
|
//不存在则插入
|
||||
|
DashboardLevelRoleUser dashboardLevelRoleUser = new DashboardLevelRoleUser(); |
||||
|
dashboardLevelRoleUser.setUserId(bindUserParam.getUserId()); |
||||
|
dashboardLevelRoleUser.setLevelRoleId(levelRoleId); |
||||
|
dashboardLevelRoleUser.setRefType(bindUserParam.getRefType()); |
||||
|
dashboardLevelRoleUser.setCreatedAt(currentUnix); |
||||
|
dashboardLevelRoleUser.setCreatedBy(userId); |
||||
|
levelRoleUserMapperExt.insertSelective(dashboardLevelRoleUser); |
||||
|
} |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("用户绑定层级角色报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private SimpleDataResponse checkBindParam(BindUserParam bindUserParam, Integer languageType) { |
||||
|
if (null == bindUserParam.getUserId()) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "userId required"); |
||||
|
} |
||||
|
if (CollectionUtils.isEmpty(bindUserParam.getLevelRoleId())) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "levelRoleId required"); |
||||
|
} |
||||
|
if (null == bindUserParam.getRefType()) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "refType required"); |
||||
|
} |
||||
|
return SimpleDataResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse unbindUser(UnbindUserParam unbindUserParam, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
DashboardLevelRoleUserExample deleteRoleUserExample = new DashboardLevelRoleUserExample(); |
||||
|
deleteRoleUserExample.createCriteria().andIdIn(unbindUserParam.getRelationIdList()); |
||||
|
levelRoleUserMapperExt.deleteByExample(deleteRoleUserExample); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("用户解绑层级角色报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageInfo<UserBindLevelRoleVO> getCanBeBoundUserPage(BaseSearchParams pageSearchParam, Long companyId, |
||||
|
Long userId, Integer languageType, Integer utcOffset) { |
||||
|
//list防${}注入
|
||||
|
if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { |
||||
|
pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); |
||||
|
} else { |
||||
|
pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); |
||||
|
} |
||||
|
|
||||
|
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); |
||||
|
List<UserBindLevelRoleVO> resultList = levelRoleMapperExt.getCanBeBoundUserPage(pageSearchParam); |
||||
|
|
||||
|
return new PageInfo<>(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageInfo<UserBoundRolePageDTO> getAlreadyBoundUserPage(PageBoundRoleSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { |
||||
|
//list防${}注入
|
||||
|
if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { |
||||
|
pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); |
||||
|
} else { |
||||
|
pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); |
||||
|
} |
||||
|
|
||||
|
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); |
||||
|
List<UserBoundRolePageDTO> resultList = levelRoleMapperExt.getAlreadyBoundUserPage(pageSearchParam); |
||||
|
|
||||
|
return new PageInfo<>(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SimpleDataResponse<List<String>> getBoundLevelByRole(Long roleId, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
return SimpleDataResponse.success(levelRoleMapperExt.getBoundLevelByRole(roleId)); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("获取层级角色菜单出错", e); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SimpleDataResponse<List<TreeMenusDTO>> getBoundLevel(Long companyId, Long userId, Integer languageType) { |
||||
|
|
||||
|
// 查询全量层级
|
||||
|
Map<String, Object> levelMap = new HashMap<>(); |
||||
|
levelMap.put("companyId", companyId); |
||||
|
List<RefKey> branches = levelRoleMapperExt.selectAllBranches(levelMap); |
||||
|
List<RefKey> stores = levelRoleMapperExt.selectAllStores(levelMap); |
||||
|
List<RefKey> areas = levelRoleMapperExt.selectAllAreas(levelMap); |
||||
|
List<RefKey> sites = levelRoleMapperExt.selectAllSites(levelMap); |
||||
|
List<RefKey> buildings = levelRoleMapperExt.selectAllBuildings(levelMap); |
||||
|
|
||||
|
// 用户绑定、管理的节点
|
||||
|
List<RefKey> userRefs = new ArrayList<>(); |
||||
|
if (levelRoleMapperExt.checkLevelManager(userId) > 0){ |
||||
|
userRefs.addAll(branches); |
||||
|
userRefs.addAll(stores); |
||||
|
userRefs.addAll(areas); |
||||
|
userRefs.addAll(sites); |
||||
|
userRefs.addAll(buildings); |
||||
|
} else { |
||||
|
Map<String, Object> paramMap = new HashMap<>(); |
||||
|
paramMap.put("userId", userId); |
||||
|
paramMap.put("refType", 1); |
||||
|
userRefs = levelRoleMapperExt.selectUserRefs(paramMap); |
||||
|
// 名称填充
|
||||
|
fillNames(userRefs, branches, stores, areas, sites, buildings); |
||||
|
} |
||||
|
|
||||
|
// 构建 parentId → List<RefKey> 的多值 Map
|
||||
|
Map<Long, List<RefKey>> storeMap = groupByParent(stores); |
||||
|
Map<Long, List<RefKey>> areaMap = groupByParent(areas); |
||||
|
Map<Long, List<RefKey>> siteMap = groupByParent(sites); |
||||
|
Map<Long, List<RefKey>> buildingMap = groupByParent(buildings); |
||||
|
|
||||
|
// 用于去重,避免重复根节点
|
||||
|
Set<String> visitedKeys = new HashSet<>(); |
||||
|
|
||||
|
// 组装树结构
|
||||
|
List<TreeMenusDTO> result = new ArrayList<>(); |
||||
|
|
||||
|
for (RefKey ref : userRefs) { |
||||
|
// 每个用户绑定的节点都是一棵独立的根
|
||||
|
TreeMenusDTO root = new TreeMenusDTO(); |
||||
|
String rootKey = ref.getType() + "-" + ref.getId(); |
||||
|
|
||||
|
if (visitedKeys.contains(rootKey)) continue; // 已存在跳过
|
||||
|
visitedKeys.add(rootKey); |
||||
|
|
||||
|
root.setKey(rootKey); |
||||
|
root.setLabel(ref.getName()); |
||||
|
root.setParentKey(null); |
||||
|
|
||||
|
// 构建该节点下的子树
|
||||
|
root.setChildren(buildTree( |
||||
|
ref.getType(), ref.getId(), rootKey, |
||||
|
storeMap, areaMap, siteMap, buildingMap, visitedKeys |
||||
|
)); |
||||
|
result.add(root); |
||||
|
} |
||||
|
|
||||
|
return SimpleDataResponse.success(result); |
||||
|
} |
||||
|
|
||||
|
private Map<Long, String> toNameMap(List<RefKey> list) { |
||||
|
return list.stream().collect(Collectors.toMap( |
||||
|
RefKey::getId, |
||||
|
RefKey::getName, |
||||
|
(a, b) -> a |
||||
|
)); |
||||
|
} |
||||
|
|
||||
|
private void fillNames(List<RefKey> userRefs, |
||||
|
List<RefKey> branches, |
||||
|
List<RefKey> stores, |
||||
|
List<RefKey> areas, |
||||
|
List<RefKey> sites, |
||||
|
List<RefKey> buildings) { |
||||
|
|
||||
|
Map<Long, String> branchName = toNameMap(branches); |
||||
|
Map<Long, String> storeName = toNameMap(stores); |
||||
|
Map<Long, String> areaName = toNameMap(areas); |
||||
|
Map<Long, String> siteName = toNameMap(sites); |
||||
|
Map<Long, String> buildingName = toNameMap(buildings); |
||||
|
|
||||
|
for (RefKey r : userRefs) { |
||||
|
switch (r.getType()) { |
||||
|
case "BRANCH" -> r.setName(branchName.get(r.getId())); |
||||
|
case "STORE" -> r.setName(storeName.get(r.getId())); |
||||
|
case "AREA" -> r.setName(areaName.get(r.getId())); |
||||
|
case "SITE" -> r.setName(siteName.get(r.getId())); |
||||
|
case "BUILDING" -> r.setName(buildingName.get(r.getId())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private Map<Long, List<RefKey>> groupByParent(List<RefKey> items) { |
||||
|
return items.stream() |
||||
|
.filter(r -> r.getParentId() != null) |
||||
|
.collect(Collectors.groupingBy( |
||||
|
RefKey::getParentId |
||||
|
)); |
||||
|
} |
||||
|
|
||||
|
private List<TreeMenusDTO> buildTree(String type, |
||||
|
Long parentId, |
||||
|
String parentKey, |
||||
|
Map<Long, List<RefKey>> storeMap, |
||||
|
Map<Long, List<RefKey>> areaMap, |
||||
|
Map<Long, List<RefKey>> siteMap, |
||||
|
Map<Long, List<RefKey>> buildingMap, |
||||
|
Set<String> visitedKeys) { |
||||
|
|
||||
|
Map<Long, List<RefKey>> childMap = switch (type) { |
||||
|
case "BRANCH" -> storeMap; |
||||
|
case "STORE" -> areaMap; |
||||
|
case "AREA" -> siteMap; |
||||
|
case "SITE" -> buildingMap; |
||||
|
default -> null; |
||||
|
}; |
||||
|
if (childMap == null) return Collections.emptyList(); |
||||
|
|
||||
|
// 直接取 parentId 的子节点
|
||||
|
List<RefKey> children = childMap.get(parentId); |
||||
|
if (children == null) return Collections.emptyList(); |
||||
|
|
||||
|
List<TreeMenusDTO> list = new ArrayList<>(); |
||||
|
|
||||
|
for (RefKey c : children) { |
||||
|
String key = c.getType() + "-" + c.getId(); |
||||
|
|
||||
|
if (visitedKeys.contains(key)) continue; // 已存在跳过
|
||||
|
visitedKeys.add(key); |
||||
|
|
||||
|
TreeMenusDTO node = new TreeMenusDTO(); |
||||
|
node.setKey(key); |
||||
|
node.setParentKey(parentKey); |
||||
|
node.setLabel(c.getName()); |
||||
|
|
||||
|
node.setChildren(buildTree( |
||||
|
c.getType(), c.getId(), key, |
||||
|
storeMap, areaMap, siteMap, buildingMap, visitedKeys |
||||
|
)); |
||||
|
|
||||
|
list.add(node); |
||||
|
} |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,297 @@ |
|||||
|
package com.techsor.datacenter.business.service.impl; |
||||
|
|
||||
|
import com.techsor.datacenter.business.common.language.msg.MsgLanguageChange; |
||||
|
import com.techsor.datacenter.business.common.response.PageInfo; |
||||
|
import com.techsor.datacenter.business.common.response.ResponseCode; |
||||
|
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
||||
|
import com.techsor.datacenter.business.dao.ex.LevelMapperExt; |
||||
|
import com.techsor.datacenter.business.dto.level.*; |
||||
|
import com.techsor.datacenter.business.service.LevelService; |
||||
|
import com.techsor.datacenter.business.service.common.CommonOpt; |
||||
|
import com.techsor.datacenter.business.vo.level.LevelPageDTO; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import org.apache.commons.collections.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 物件级别Service实现类 |
||||
|
* 实现物件级别的业务逻辑 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class LevelServiceImpl implements LevelService { |
||||
|
|
||||
|
private static Logger logger = LoggerFactory.getLogger(LevelServiceImpl.class); |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private CommonOpt commonOpt; |
||||
|
@Autowired |
||||
|
private MsgLanguageChange msgLanguageChange; |
||||
|
|
||||
|
@Autowired |
||||
|
private LevelMapperExt levelMapperExt; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse add(OptLevelParam param, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
param.setCompanyId(companyId); |
||||
|
param.setId(null); |
||||
|
//校验参数
|
||||
|
SimpleDataResponse checkResult = checkParam(param, languageType); |
||||
|
if (200 != checkResult.getCode()) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
//重复校验
|
||||
|
if (checkExist(param) > 0) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "levelNameExist")); |
||||
|
} |
||||
|
//父级id是否有效
|
||||
|
if (1 != param.getLevelType() && isParentLevelInvalid(param)){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "invalidParentLevel")); |
||||
|
} |
||||
|
|
||||
|
long currentUnix = System.currentTimeMillis(); |
||||
|
LevelEntity levelEntity = new LevelEntity(); |
||||
|
BeanUtils.copyProperties(param, levelEntity); |
||||
|
levelEntity.setName(param.getLevelName()); |
||||
|
levelEntity.setCreatedBy(userId); |
||||
|
levelEntity.setCreatedAt(currentUnix); |
||||
|
levelEntity.setCompanyId(companyId); |
||||
|
levelMapperExt.saveLevel(levelEntity); |
||||
|
|
||||
|
if (1 != param.getLevelType()) { |
||||
|
//插入关联
|
||||
|
insertLevelRelation(param, levelEntity, 1); |
||||
|
} |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("添加层级报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void insertLevelRelation(OptLevelParam param, LevelEntity levelEntity, int optType) { |
||||
|
for (Long parentId : param.getParentIdList()){ |
||||
|
LevelRelationEntity levelRelationEntity =new LevelRelationEntity(); |
||||
|
switch (param.getLevelType()){ |
||||
|
case 2: |
||||
|
levelRelationEntity.setParentField("branch_id"); |
||||
|
levelRelationEntity.setChildField("store_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_branch_store"); |
||||
|
break; |
||||
|
case 3: |
||||
|
levelRelationEntity.setParentField("store_id"); |
||||
|
levelRelationEntity.setChildField("area_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_store_area"); |
||||
|
break; |
||||
|
case 4: |
||||
|
levelRelationEntity.setParentField("area_id"); |
||||
|
levelRelationEntity.setChildField("site_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_area_site"); |
||||
|
break; |
||||
|
} |
||||
|
levelRelationEntity.setParentId(parentId); |
||||
|
levelRelationEntity.setChildId(levelEntity.getId()); |
||||
|
if (1 == optType){ |
||||
|
levelRelationEntity.setCreatedBy(levelEntity.getCreatedBy()); |
||||
|
levelRelationEntity.setCreatedAt(levelEntity.getCreatedAt()); |
||||
|
} else if (2 == optType){ |
||||
|
levelRelationEntity.setCreatedBy(levelEntity.getUpdatedBy()); |
||||
|
levelRelationEntity.setCreatedAt(levelEntity.getUpdatedAt()); |
||||
|
} |
||||
|
|
||||
|
levelMapperExt.saveLevelRelation(levelRelationEntity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private boolean isParentLevelInvalid(OptLevelParam param) { |
||||
|
long checkSize = levelMapperExt.countParentLevel(param); |
||||
|
return checkSize != param.getParentIdList().size(); |
||||
|
} |
||||
|
|
||||
|
private long checkExist(OptLevelParam param) { |
||||
|
return levelMapperExt.checkExist(param); |
||||
|
} |
||||
|
|
||||
|
private SimpleDataResponse checkParam(OptLevelParam param, Integer languageType) { |
||||
|
if(StringUtils.isBlank(param.getLevelName()) || param.getLevelName().length() > 255){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [levelName] error"); |
||||
|
} |
||||
|
if(null == param.getLevelType() || param.getLevelType() < 1 || param.getLevelType() > 4){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [levelType] error"); |
||||
|
} |
||||
|
if(1 != param.getLevelType() && CollectionUtils.isEmpty(param.getParentIdList())){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "parentIdList can not be null"); |
||||
|
} |
||||
|
return SimpleDataResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SimpleDataResponse edit(OptLevelParam param, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
param.setCompanyId(companyId); |
||||
|
//校验参数
|
||||
|
SimpleDataResponse checkResult = checkParam(param, languageType); |
||||
|
if (200 != checkResult.getCode()) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
//重复校验
|
||||
|
if (checkExist(param) > 0) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "levelNameExist")); |
||||
|
} |
||||
|
//父级id是否有效
|
||||
|
if (1 != param.getLevelType() && isParentLevelInvalid(param)){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "invalidParentLevel")); |
||||
|
} |
||||
|
|
||||
|
long currentUnix = System.currentTimeMillis(); |
||||
|
LevelEntity levelEntity = new LevelEntity(); |
||||
|
BeanUtils.copyProperties(param, levelEntity); |
||||
|
levelEntity.setName(param.getLevelName()); |
||||
|
levelEntity.setUpdatedBy(userId); |
||||
|
levelEntity.setUpdatedAt(currentUnix); |
||||
|
levelMapperExt.updateLevel(levelEntity); |
||||
|
|
||||
|
if (1 != param.getLevelType()){ |
||||
|
//先删除关联关系
|
||||
|
LevelRelationEntity deleteLevelRelationEntity = new LevelRelationEntity(); |
||||
|
deleteLevelRelationEntity.setChildId(param.getId()); |
||||
|
switch (param.getLevelType()){ |
||||
|
case 2: |
||||
|
deleteLevelRelationEntity.setChildField("store_id"); |
||||
|
deleteLevelRelationEntity.setTableName("dashboard_level_relation_branch_store"); |
||||
|
break; |
||||
|
case 3: |
||||
|
deleteLevelRelationEntity.setChildField("area_id"); |
||||
|
deleteLevelRelationEntity.setTableName("dashboard_level_relation_store_area"); |
||||
|
break; |
||||
|
case 4: |
||||
|
deleteLevelRelationEntity.setChildField("site_id"); |
||||
|
deleteLevelRelationEntity.setTableName("dashboard_level_relation_area_site"); |
||||
|
break; |
||||
|
} |
||||
|
levelMapperExt.deleteLevelRelation(deleteLevelRelationEntity); |
||||
|
//插入关联
|
||||
|
insertLevelRelation(param, levelEntity, 2); |
||||
|
} |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("编辑层级报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SimpleDataResponse batchDelete(DeleteLevelParam deleteLevelParam, Long companyId, Long userId, Integer languageType) { |
||||
|
try { |
||||
|
List<Long> idList = Arrays.asList(deleteLevelParam.getIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); |
||||
|
|
||||
|
// 检查是否有下级引用(支社、支店、area级别需要检查,site级别没有下级)
|
||||
|
Integer levelType = deleteLevelParam.getLevelType(); |
||||
|
LevelRelationEntity levelRelationEntity =new LevelRelationEntity(); |
||||
|
switch (levelType){ |
||||
|
case 1: |
||||
|
levelRelationEntity.setParentField("branch_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_branch_store"); |
||||
|
break; |
||||
|
case 2: |
||||
|
levelRelationEntity.setParentField("store_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_store_area"); |
||||
|
break; |
||||
|
case 3: |
||||
|
levelRelationEntity.setParentField("area_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_area_site"); |
||||
|
break; |
||||
|
case 4: |
||||
|
levelRelationEntity.setParentField("site_id"); |
||||
|
levelRelationEntity.setTableName("dashboard_level_relation_site_building"); |
||||
|
break; |
||||
|
} |
||||
|
if (levelMapperExt.checkIfReferencedByChildren(levelRelationEntity, idList) > 0){ |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "levelReferencedByChildren")); |
||||
|
} |
||||
|
|
||||
|
//基础表删除
|
||||
|
String tableName = switch (levelType) { |
||||
|
case 1 -> "dashboard_level_branch"; |
||||
|
case 2 -> "dashboard_level_store"; |
||||
|
case 3 -> "dashboard_level_area"; |
||||
|
case 4 -> "dashboard_level_site"; |
||||
|
default -> ""; |
||||
|
}; |
||||
|
levelMapperExt.deleteLevelByIdList(tableName, idList); |
||||
|
|
||||
|
//删除关联表
|
||||
|
LevelRelationEntity deleteEntity =new LevelRelationEntity(); |
||||
|
switch (levelType){ |
||||
|
case 1: |
||||
|
deleteEntity.setChildField("branch_id"); |
||||
|
deleteEntity.setTableName("dashboard_level_relation_branch_store"); |
||||
|
break; |
||||
|
case 2: |
||||
|
deleteEntity.setChildField("store_id"); |
||||
|
deleteEntity.setTableName("dashboard_level_relation_branch_store"); |
||||
|
break; |
||||
|
case 3: |
||||
|
deleteEntity.setChildField("area_id"); |
||||
|
deleteEntity.setTableName("dashboard_level_relation_store_area"); |
||||
|
break; |
||||
|
case 4: |
||||
|
deleteEntity.setChildField("site_id"); |
||||
|
deleteEntity.setTableName("dashboard_level_relation_area_site"); |
||||
|
break; |
||||
|
} |
||||
|
levelMapperExt.deleteLevelRelationByIdList(deleteEntity, idList); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("删除层级报错", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageInfo<LevelPageDTO> getListPage(PageLevelSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { |
||||
|
Integer levelType = pageSearchParam.getLevelType(); |
||||
|
if (null == levelType){ |
||||
|
logger.error("leveType required........"); |
||||
|
return PageInfo.emptyPageInfo(); |
||||
|
} |
||||
|
//list防${}注入
|
||||
|
if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { |
||||
|
pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); |
||||
|
} else { |
||||
|
pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(pageSearchParam.getIds())) { |
||||
|
pageSearchParam.setIdList(Arrays.asList(pageSearchParam.getIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList())); |
||||
|
} |
||||
|
if (1 != levelType && StringUtils.isNotBlank(pageSearchParam.getParentIds())){ |
||||
|
pageSearchParam.setParentIdList(Arrays.asList(pageSearchParam.getParentIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList())); |
||||
|
} |
||||
|
|
||||
|
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); |
||||
|
List<LevelPageDTO> resultList = levelMapperExt.getListPage(pageSearchParam); |
||||
|
|
||||
|
return new PageInfo<>(resultList); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue