Commit 4a9b4db8 authored by itcast's avatar itcast

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/application-local.yml
parents 760df5fe a8c56be5
......@@ -2,9 +2,8 @@ package com.pms.ocp.common.aspectj;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.PropertyFilter;
import com.pms.ocp.model.entity.ModelNote;
import com.pms.ocp.service.ModelNoteService;
import com.sun.xml.internal.bind.v2.TODO;
import com.pms.ocp.model.entity.ModelAudit;
import com.pms.ocp.service.ModelAuditService;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -39,7 +38,7 @@ import java.time.LocalDateTime;
public class OperLogAspect {
@Autowired
private ModelNoteService modelNoteService;
private ModelAuditService modelAuditService;
private static Logger logger = LoggerFactory.getLogger(OperLogAspect.class);
......@@ -65,25 +64,25 @@ public class OperLogAspect {
private void saveSysLog(ProceedingJoinPoint point, long time, Object obj) {
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.getMethod();
ModelNote modelNote = new ModelNote();
ModelAudit modelAudit = new ModelAudit();
OperLog operLog = method.getAnnotation(OperLog.class);
if (operLog != null) {
String content = operLog.value();
modelNote.setAuditType(operLog.auditType());
modelNote.setAuditMessageJson(content);
modelAudit.setAuditType(operLog.auditType());
modelAudit.setAuditMessageJson(content);
}
//请求的方法名
// String className = point.getTarget().getClass().getName();
String methodName = signature.getName();
// dto.setMethod(className + "." + methodName + "()");
//设置操作类型
if (modelNote.getAuditType() == 3) {
modelNote.setOperStatus(getOperateType(methodName, operLog.operStatus()));
if (modelAudit.getAuditType() == 3) {
modelAudit.setOperStatus(getOperateType(methodName, operLog.operStatus()));
}
//获取request
HttpServletRequest request = getHttpServletRequest();
//请求的参数
modelNote.setAuditMessageJson(getRequestParams(request, point));
modelAudit.setAuditMessageJson(getRequestParams(request, point));
// //设置ip地址
// dto.setIp(getIpAddr(request));
//获取用户登录信息
......@@ -94,9 +93,9 @@ public class OperLogAspect {
// modelNote.setUsername(user.getPassWord());
// }
// modelNote.setCostTime(time);
modelNote.setAuditCtime(LocalDateTime.now());
modelAudit.setAuditCtime(LocalDateTime.now());
modelNoteService.createModelNote(modelNote);
modelAuditService.createModelAudit(modelAudit);
}
private int getOperateType(String methodName, int operateType) {
......
......@@ -17,12 +17,11 @@ public class ExportUtils {
/**
* 校验Header Manipulation
*
* @param header 参数
* @return 数据
*/
public static String headerManipulation(String header) {
if (StringUtils.isNullOrEmpty(header)) {
if(StringUtils.isNullOrEmpty(header)){
return header;
}
String regex = "[`~!@#$%^&*()\\+\\=\\{}|:\"?><【】\\/r\\/n]";
......@@ -57,9 +56,9 @@ public class ExportUtils {
out.flush();
} catch (IOException e) {
e.printStackTrace();
throw new ServiceException(ResultCode.INTERNAL_SERVER_ERROR);
throw new ServiceException(com.pms.ocp.common.constants.ResultCode.INTERNAL_SERVER_ERROR);
} finally {
if (out != null) {
if (out != null){
try {
out.close();
} catch (IOException e) {
......@@ -80,7 +79,6 @@ public class ExportUtils {
/**
* Workbook导出浏览器
* 文件导出添加跨域 Access-Control-Allow-Origin
*
* @param response
* @param fileName
* @param workbook
......
package com.pms.ocp.common.utils;
import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Auther: wangjian
* @Date: 2022/3/12 13:29
* @Description:数据结构处理工具类
*/
public class DataStructureHandleUtils {
/**
* List<Map<String, Object>> 到 List<T> 数据转换
*/
public static <T> List<T> setList(final List<Map<String, Object>> srcList, Class<T> clazz) {
List<T> list = new ArrayList<>();
for (int i = 0; i < srcList.size(); i++) {
try {
T t = clazz.newInstance();
Field[] fields = t.getClass().getDeclaredFields();
for (Field field : fields) {
if (!"serialVersionUID".equals(field.getName())) {
//设置对象的访问权限,保证对private的属性的访问
field.setAccessible(true);
//读取配置转换字段名,并从map中取出数据
Object v = srcList.get(i).get(field.getName());
field.set(t, convert(v, field.getType()));
}
}
list.add(t);
} catch (Exception ex) {
ex.toString();
}
}
;
return list;
}
/**
* 字段类型转换
*/
private static <T> T convert(Object obj, Class<T> type) throws ParseException {
if (obj != null && StringUtils.isNotBlank(obj.toString())) {
if (type.equals(String.class)) {
return (T) obj.toString();
} else if (type.equals(BigDecimal.class)) {
return (T) new BigDecimal(obj.toString());
} else if (type.equals(Double.class)) {
return (T) Double.valueOf(obj.toString());
} else if (type.equals(Integer.class)) {
return (T) Integer.valueOf(obj.toString());
} else if (type.equals(Date.class)) {
if (obj != null) {
String timeStr = String.valueOf(obj);
String s[] = timeStr.split("T");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return (T) sdf.parse(s[0] + " " + s[1]);
} else {
return null;
}
} else {
//其他类型转换
return (T) obj.toString();
}
}
return null;
}
}
package com.pms.ocp.common.utils;
import java.util.*;
/**
* @Author: admin
* @Description:
* @Date: 2021/12/8 9:31
* @Version: V1.0
*/
public class MapUtils {
/**
* Map 排序
*
* @param map
* @return Map
*/
public static <T> Map<Date, List<T>> treeMapDesc(Map<Date, List<T>> map) {
Map<Date, List<T>> treeMapDesc = new TreeMap<>(new Comparator<Date>() {
@Override
public int compare(Date o1, Date o2) {
return o2.compareTo(o1);
}
});
for (Map.Entry<Date, List<T>> e : map.entrySet()) {
treeMapDesc.put(e.getKey(), e.getValue());
}
return treeMapDesc;
}
}
......@@ -10,7 +10,7 @@ import lombok.Data;
* @author admin
*/
@Data
@ApiModel(value = "分页工具类",description = "分页工具类")
@ApiModel(value = "分页工具类", description = "分页工具类")
public class PageRequest<T> {
private static final long serialVersionUID = 8167917284229912157L;
......
package com.pms.ocp.common.utils;
import org.apache.commons.lang3.RandomStringUtils;
import java.util.Random;
/**
* @author zhaochengming
* 随机生成字符串
*/
public class RandomStringUtil {
public class RandomStringUtils {
/**
* length 字符串长度
......
......@@ -2,10 +2,7 @@ package com.pms.ocp.common.utils;
import com.pms.ocp.model.entity.TreeNode;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author huxiuwu
......@@ -20,7 +17,7 @@ public class TreeUtils {
List<T> treeList = new ArrayList<>();
for(T treeNode : treeNodes) {
if (pid.equals(treeNode.getPid())) {
if (pid.equals(treeNode.getpCode())) {
treeList.add(findChildren(treeNodes, treeNode));
}
}
......@@ -33,7 +30,7 @@ public class TreeUtils {
*/
private static <T extends TreeNode> T findChildren(List<T> treeNodes, T rootNode) {
for(T treeNode : treeNodes) {
if(rootNode.getId().equals(treeNode.getPid())) {
if(rootNode.getCode().equals(treeNode.getpCode())) {
rootNode.getChildren().add(findChildren(treeNodes, treeNode));
}
}
......@@ -47,18 +44,21 @@ public class TreeUtils {
List<T> result = new ArrayList<>();
//list转map
Map<Long, T> nodeMap = new LinkedHashMap<>(treeNodes.size());
Map<String, T> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(T treeNode : treeNodes){
nodeMap.put(treeNode.getId(), treeNode);
nodeMap.put(treeNode.getCode(), treeNode);
}
for(T node : nodeMap.values()) {
T parent = nodeMap.get(node.getPid());
if(parent != null && !(node.getId().equals(parent.getId()))){
T parent = nodeMap.get(node.getpCode());
if(parent != null && (node.getpCode().equals(parent.getCode()))
&& (!"".equals(node.getpCode())|| !"".equals(parent.getCode()))){
if (parent.getChildren() == null){
parent.setChildren(new LinkedList<>());
}
parent.getChildren().add(node);
continue;
}
result.add(node);
}
......
......@@ -197,17 +197,17 @@ public class ApiBasicManagementController {
return apiBasicManagementService.getBaseByGroupCode(ApiBaseReq);
}
//@ApiOperation("服务树一级")
//@GetMapping("/apiBaseTree")
public ResponseVO<List<OcpApiGroup>> apiBaseTree(String apiGroupCompanyCode) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTree(apiGroupCompanyCode);
@ApiOperation("服务树一级")
@GetMapping("/apiBaseTree")
public ResponseVO<List<OcpApiGroup>> apiBaseTree(String apiGroupCompanyCode, Integer apiGroupPromotionType) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,null,apiGroupPromotionType);
return ResponseVO.ok(apiTreeGroupDtos);
}
@ApiOperation("服务树层级")
@GetMapping("/apiBaseTreeOther")
public ResponseVO<List<OcpApiGroup>> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode, Integer apiGroupPromotionType) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,apiGroupPcode,apiGroupPromotionType);
public ResponseVO<List<OcpApiGroup>> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupCode, Integer apiGroupPromotionType) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,apiGroupCode,apiGroupPromotionType);
return ResponseVO.ok(apiTreeGroupDtos);
}
......
package com.pms.ocp.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pms.ocp.common.utils.ExcelUtils;
import com.pms.ocp.model.dto.ModelDTO;
import com.pms.ocp.model.dto.ModelIssueDTO;
import com.pms.ocp.model.dto.ModelSubscribeDTO;
import com.pms.ocp.model.dto.ModelPropertyDTO;
import com.pms.ocp.model.dto.ModelRelationDTO;
import com.pms.ocp.model.entity.Model;
import com.pms.ocp.model.entity.ModelNote;
import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.entity.ModelAudit;
import com.pms.ocp.model.vo.ModelAuditVO;
import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -21,8 +25,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import static com.pms.ocp.common.constants.CodeEnum.REQUIRED_PARAMETER_EMPTY;
import java.util.stream.Collectors;
/**
* @Auther: wangjian
......@@ -43,13 +46,23 @@ public class ModelBaseController {
private ModelPropertyService modelPropertyService;
@Autowired
private ModelNoteService modelNoteService;
private ModelAuditService modelAuditService;
@Autowired
private ModelIssueService modelIssueService;
private ModelSubscribeService modelSubscribeService;
@Autowired
private ModelRelationService modelRelationService;
/**
* 模型分类-查询
*
* @return
*/
// @ApiOperation("模型分类-查询")
// @GetMapping("/get/model/type")
// public ResponseVO getModelType() {
// return modelGroupService.getModelType();
// }
/**
* 模型-增加
......@@ -71,8 +84,15 @@ public class ModelBaseController {
@ApiOperation("模型-查询")
@GetMapping("/get/model")
public ResponseVO getModel(@ApiParam(value = "模型订阅编号") @RequestParam(value = "objId", required = false) String objId,
@ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode) {
return ResponseVO.ok(modelService.getModelList(objId, modelCode));
@ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode,
@ApiParam(value = "当前页") @RequestParam(value = "currentPage", required = false) Integer currentPage,
@ApiParam(value = "每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize) {
PageHelper.startPage(currentPage, pageSize);
List<Model> modelList = modelService.getModelList(objId, modelCode);
PageInfo<Model> pageInfo = new PageInfo<>(modelList);
return ResponseVO.ok(pageInfo);
}
/**
......@@ -139,8 +159,8 @@ public class ModelBaseController {
*/
@ApiOperation("模型订阅-增加")
@PostMapping("/create/model/subscribe")
public ResponseVO createModelSubscribe(@RequestBody ModelIssueDTO modelIssueDTO) {
return ResponseVO.ok(modelIssueService.createModelIssue(modelIssueDTO));
public ResponseVO createModelSubscribe(@RequestBody ModelSubscribeDTO modelSubscribeDTO) {
return ResponseVO.ok(modelSubscribeService.createModelSubscribe(modelSubscribeDTO));
}
/**
......@@ -151,7 +171,7 @@ public class ModelBaseController {
@ApiOperation("模型订阅-删除/批量删除")
@PostMapping("/delete/model/subscribe")
public ResponseVO deleteModelSubscribe(@ApiParam(value = "订阅编号集合") @RequestBody List<String> ids) {
return ResponseVO.ok(modelIssueService.deleteBatchModelIssue(ids));
return ResponseVO.ok(modelSubscribeService.deleteBatchModelSubscribe(ids));
}
/**
......@@ -163,8 +183,15 @@ public class ModelBaseController {
@GetMapping("/get/model/subscribe")
public ResponseVO getModelSubscribe(@ApiParam(value = "模型订阅编号") @RequestParam(value = "objId", required = false) String objId,
@ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode,
@ApiParam(value = "订阅公司编码") @RequestParam(value = "subsCompanyCode", required = false) String subsCompanyCode) {
return ResponseVO.ok(modelIssueService.getModelIssueList(objId, modelCode, subsCompanyCode));
@ApiParam(value = "订阅公司编码") @RequestParam(value = "subsCompanyCode", required = false) String subsCompanyCode,
@ApiParam(value = "当前页") @RequestParam(value = "currentPage", required = false) Integer currentPage,
@ApiParam(value = "每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize) {
PageHelper.startPage(currentPage, pageSize);
List<ModelSubscribe> modelSubscribeList = modelSubscribeService.getModelSubscribeList(objId, modelCode, subsCompanyCode);
PageInfo<ModelSubscribe> pageInfo = new PageInfo<>(modelSubscribeList);
return ResponseVO.ok(pageInfo);
}
/**
......@@ -176,9 +203,9 @@ public class ModelBaseController {
@GetMapping("/get/model/note")
public ResponseVO getModelNote(@RequestParam(value = "modelCode") String modelCode) {
List<ModelNote> modelNoteList = modelNoteService.getModelNoteList(modelCode);
List<ModelAudit> modelAuditList = modelAuditService.getModelAuditList(modelCode);
return ResponseVO.ok(modelNoteList);
return ResponseVO.ok(modelAuditList);
}
/**
......@@ -201,9 +228,17 @@ public class ModelBaseController {
@PostMapping("export/model/note")
public ResponseVO exportModelNote(HttpServletResponse response,
@ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode) throws IOException {
// 查询要导出的数据
List<ModelNote> modelNoteList = modelNoteService.getModelNoteList(modelCode);
ExcelUtils.exportExcel(response, "测试导出模型事记", "测试导出模型事记", "测试导出模型事记.xlsx", modelNoteList, ModelNote.class);
// 查询要导出的数据
List<ModelAudit> modelAuditList = modelAuditService.getModelAuditList(modelCode);
//users集合转成export集合
List<ModelAuditVO> exportVOList = modelAuditList.stream().map(modelNote -> {
ModelAuditVO vo = new ModelAuditVO();
BeanUtils.copyProperties(modelNote, vo);
return vo;
}).collect(Collectors.toList());
ExcelUtils.exportExcel(response, "测试导出模型事记", "测试导出模型事记", "测试导出模型事记.xlsx", exportVOList, ModelAuditVO.class);
return ResponseVO.ok();
}
......@@ -294,4 +329,10 @@ public class ModelBaseController {
return ResponseVO.ok(modelRelationService.deleteModelRelation(objId, modelCode));
}
@ApiOperation("模型列表-导航树")
@GetMapping("/delete/model/modelListNavigation")
public ResponseVO modelListNavigation(@RequestParam(required = false) String searchCondition) {
return modelSubscribeService.modelListNavigation(searchCondition);
}
}
package com.pms.ocp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pms.ocp.model.entity.Model;
import com.pms.ocp.model.entity.ModelNote;
import com.pms.ocp.model.entity.ModelAudit;
import org.apache.ibatis.annotations.Mapper;
/**
......@@ -12,5 +11,5 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ModelNoteMapper extends BaseMapper<ModelNote> {
public interface ModelAuditMapper extends BaseMapper<ModelAudit> {
}
package com.pms.ocp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pms.ocp.model.entity.ModelIssue;
import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.entity.TreeNode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Auther: wangjian
......@@ -11,5 +15,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ModelIssueMapper extends BaseMapper<ModelIssue> {
public interface ModelSubscribeMapper extends BaseMapper<ModelSubscribe> {
List<TreeNode> selectOrganData();
List<TreeNode> selectModelAndModelGroup(@Param("searchCondition") String searchCondition);
}
......@@ -2,7 +2,7 @@ package com.pms.ocp.model;
public interface Response {
boolean SUCCESS = true;
int SUCCESS_CODE = 0;
public static final boolean SUCCESS = true;
public static final int SUCCESS_CODE = 0;
}
......@@ -16,7 +16,7 @@ import java.time.LocalDateTime;
@ApiModel(value = "模型订阅DTO对象")
@Data
public class ModelIssueDTO {
public class ModelSubscribeDTO {
/**
* 模型属性编号
......
package com.pms.ocp.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
......@@ -24,7 +26,7 @@ public class Model {
* 模型关系编号
* 主键
*/
@TableField("obj_id")
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
......
......@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
@Data
@TableName("ocp_model_audit")
public class ModelNote {
public class ModelAudit {
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
......
package com.pms.ocp.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -23,7 +24,7 @@ public class ModelClassify {
/**
* 模型分类编号
*/
@TableId
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
......
package com.pms.ocp.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -27,7 +28,7 @@ public class ModelProperty{
/**
* 模型属性编号
*/
@TableId
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
......
package com.pms.ocp.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -25,7 +26,7 @@ public class ModelRelation {
* 模型关系编号
* 主键
*/
@TableId(value = "obj_id")
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
......
package com.pms.ocp.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -19,12 +20,12 @@ import java.util.Date;
@Data
@Accessors(chain = true)
@TableName("ocp_model_subs")
public class ModelIssue {
public class ModelSubscribe {
/**
* 模型订阅编号
*/
@TableId(value = "obj_id")
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
......@@ -56,14 +57,14 @@ public class ModelIssue {
* 订阅时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime subsCtime;
/**
* 修改时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime subsMtime;
}
......
package com.pms.ocp.model.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -9,43 +12,42 @@ import java.util.List;
* @version 1.0
* @date 2022/3/8 17:53
*/
public class TreeNode<T> implements Serializable {
@Data
@ApiModel("树节点表")
public class TreeNode implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
@ApiModelProperty("编码")
private String code;
/**
* 上级ID
*/
private Long pid;
/**
* 子节点列表
*/
private List<T> children = new ArrayList<>();
@ApiModelProperty("父类编码")
private String pCode;
public Long getId() {
return id;
}
@ApiModelProperty("名称")
private String name;
public void setId(Long id) {
this.id = id;
}
@ApiModelProperty("公司编码")
private String companyCode;
public Long getPid() {
return pid;
}
@ApiModelProperty("子类")
private List<TreeNode> children;
public void setPid(Long pid) {
this.pid = pid;
}
@ApiModelProperty("子类")
private int belongLevel;
public List<T> getChildren() {
return children;
public String getCode() {
return code == null ? "":code;
}
public void setChildren(List<T> children) {
this.children = children;
public String getpCode() {
return pCode == null ? "": pCode;
}
public String getCompanyCode() {
return companyCode == null ? "":companyCode;
}
}
package com.pms.ocp.model.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Auther: wangjian
* @Date: 2022/2/22 16:52
* @Description:模型事记记录对象VO
*/
@ApiModel(value = "模型事记VO对象")
@Data
public class ModelAuditVO {
/**
* 模型事记编号
*/
@ApiModelProperty(value = "模型事记编号")
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
* 模型编码
*/
@ApiModelProperty(value = "模型事记编号")
private int modelCode;
/**
* 属性编码
*/
@ApiModelProperty(value = "属性代码")
private int propCode;
/**
* 事记类型 0:人工操作,1:流程管控,3:总部下发
*/
@ApiModelProperty(value = "事记类型 0:人工操作,1:流程管控,3:总部下发")
private int auditType;
/**
* 模型异动详情
*/
@ApiModelProperty(value = "模型异动详情")
private String auditMessageJson;
/**
* 异动类型 0:新增,1:迭代
*/
@ApiModelProperty(value = "异动类型 0:新增,1:迭代")
private int operStatus;
/**
* 异动申请人编号
*/
@ApiModelProperty(value = "异动申请人编号")
private String applyUserId;
/**
* 异动申请人姓名
*/
@ApiModelProperty(value = "异动申请人姓名")
private String applyUserName;
/**
* 异动时间
*/
@ApiModelProperty(value = "异动时间")
private long applyTime;
/**
* 版本
*/
@ApiModelProperty(value = "版本")
private String applyVersion;
/**
* 新增时间
*/
@ApiModelProperty(value = "新增时间")
private LocalDateTime auditCtime;
/**
* 异动公司编码
*/
@ApiModelProperty(value = "异动公司编码")
private String auditCompanyCode;
/**
* 提交人编号
*/
@ApiModelProperty(value = "提交人编号")
private String auditUserId;
/**
* 提交人姓名
*/
@ApiModelProperty(value = "提交人姓名")
private String auditUserName;
/**
* 修改时间
*/
@ApiModelProperty(value = "模型事记修改时间")
private LocalDateTime auditMtime;
}
//
// COMMENT ON COLUMN public.ocp_model_audit.obj_id IS '主键是';
// COMMENT ON COLUMN public.ocp_model_audit.model_code IS '模型代码是';
// COMMENT ON COLUMN public.ocp_model_audit.prop_code IS '属性代码';
// COMMENT ON COLUMN public.ocp_model_audit.oper_status IS '异动类型0:新增,1:迭代';
// COMMENT ON COLUMN public.ocp_model_audit.oper_target IS '操作对象0:表,1:属性';
// COMMENT ON COLUMN public.ocp_model_audit.audit_type IS '事记类型0:人工操作,1:流程管控,3:总部下发';
// COMMENT ON COLUMN public.ocp_model_audit.audit_message_json IS '模型异动详情';
// COMMENT ON COLUMN public.ocp_model_audit.apply_user_id IS '异动申请人id';
// COMMENT ON COLUMN public.ocp_model_audit.apply_user_name IS '异动申请人';
// COMMENT ON COLUMN public.ocp_model_audit.apply_time IS '异动时间';
// COMMENT ON COLUMN public.ocp_model_audit.audit_ctime IS '申请时间';
// COMMENT ON COLUMN public.ocp_model_audit.audit_mtime IS '修改时间';
// COMMENT ON COLUMN public.ocp_model_audit.apply_version IS '版本';
// COMMENT ON COLUMN public.ocp_model_audit.audit_company_code IS '异动公司code';
// COMMENT ON COLUMN public.ocp_model_audit.audit_user_id IS '提交人id';
// COMMENT ON COLUMN public.ocp_model_audit.audit_user_name IS '提交人姓名';
package com.pms.ocp.model.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
......@@ -8,6 +10,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.Date;
import java.util.List;
......@@ -26,6 +29,7 @@ public class OcpModelGroupVO implements Serializable {
* 主键
*/
@ApiModelProperty(value = "主键")
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId;
/**
* 模型分类名称
......
package com.pms.ocp.service;
import com.pms.ocp.model.entity.ModelNote;
import com.pms.ocp.model.entity.ModelAudit;
import java.util.List;
......@@ -10,15 +10,15 @@ import java.util.List;
* @Description:模型事记业务层接口
*/
public interface ModelNoteService {
public interface ModelAuditService {
/**
* 创建模型事记
*
* @param modelNote
* @param modelAudit
* @return
*/
Integer createModelNote(ModelNote modelNote);
Integer createModelAudit(ModelAudit modelAudit);
/**
* 删除模型事记
......@@ -26,15 +26,15 @@ public interface ModelNoteService {
* @param modelId
* @return
*/
Integer deleteModelNote(String modelId);
Integer deleteModelAudit(String modelId);
/**
* 更新模型事记
*
* @param modelNote
* @param modelAudit
* @return
*/
Integer updateModelNote(ModelNote modelNote);
Integer updateModelAudit(ModelAudit modelAudit);
/**
* 获取模型事记
......@@ -42,7 +42,7 @@ public interface ModelNoteService {
* @param
* @return
*/
List<ModelNote> getModelNoteList(String modelCode);
List<ModelAudit> getModelAuditList(String modelCode);
/**
* 获取模型事记列表
......@@ -50,13 +50,6 @@ public interface ModelNoteService {
* @param modelId
* @return
*/
ModelNote getModelNote(String modelId);
// /**
// * 获取模型事记
// *
// * @param
// * @return
// */
// Boolean exportModelNote(String modelCode);
ModelAudit getModelAudit(String modelId);
}
package com.pms.ocp.service;
import com.pms.ocp.model.dto.ModelIssueDTO;
import com.pms.ocp.model.entity.ModelIssue;
import com.pms.ocp.model.dto.ModelSubscribeDTO;
import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.vo.ResponseVO;
import java.util.List;
......@@ -10,15 +11,15 @@ import java.util.List;
* @Date: 2022/2/22 16:07
* @Description:模型订阅业务层接口
*/
public interface ModelIssueService {
public interface ModelSubscribeService {
/**
* 创建模型订阅
*
* @param modelIssueDTO
* @param modelSubscribeDTO
* @return
*/
Integer createModelIssue(ModelIssueDTO modelIssueDTO);
Integer createModelSubscribe(ModelSubscribeDTO modelSubscribeDTO);
/**
* 删除模型订阅
......@@ -26,7 +27,7 @@ public interface ModelIssueService {
* @param modelId
* @return
*/
Integer deleteModelIssue(String modelId);
Integer deleteModelSubscribe(String modelId);
/**
* 批量删除模型订阅
......@@ -34,15 +35,15 @@ public interface ModelIssueService {
* @param ids
* @return
*/
Integer deleteBatchModelIssue(List<String> ids);
Integer deleteBatchModelSubscribe(List<String> ids);
/**
* 更新模型订阅
*
* @param modelIssue
* @param modelSubscribe
* @return
*/
Integer updateModelIssue(ModelIssue modelIssue);
Integer updateModelSubscribe(ModelSubscribe modelSubscribe);
/**
* 获取模型订阅
......@@ -50,7 +51,7 @@ public interface ModelIssueService {
* @param
* @return
*/
List<ModelIssue> getModelIssueList(String objId, String modelCode, String subsCompanyCode);
List<ModelSubscribe> getModelSubscribeList(String objId, String modelCode, String subsCompanyCode);
/**
* 获取模型订阅列表
......@@ -58,5 +59,8 @@ public interface ModelIssueService {
* @param modelId
* @return
*/
ModelIssueDTO getModelIssue(String modelId);
ModelSubscribeDTO getModelSubscribe(String modelId);
ResponseVO modelListNavigation(String searchCondition);
}
package com.pms.ocp.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pms.ocp.common.utils.ExcelUtils;
import com.pms.ocp.mapper.ModelNoteMapper;
import com.pms.ocp.model.entity.ModelNote;
import com.pms.ocp.service.ModelNoteService;
import com.pms.ocp.mapper.ModelAuditMapper;
import com.pms.ocp.model.entity.ModelAudit;
import com.pms.ocp.service.ModelAuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -17,45 +16,37 @@ import java.util.List;
*/
@Service
public class ModelNoteServiceImpl implements ModelNoteService {
public class ModelAuditServiceImpl implements ModelAuditService {
@Autowired
private ModelNoteMapper modelNoteMapper;
private ModelAuditMapper modelAuditMapper;
@Override
public Integer createModelNote(ModelNote modelNote) {
return modelNoteMapper.insert(modelNote);
public Integer createModelAudit(ModelAudit modelAudit) {
return modelAuditMapper.insert(modelAudit);
}
@Override
public Integer deleteModelNote(String modelId) {
public Integer deleteModelAudit(String modelId) {
return null;
}
@Override
public Integer updateModelNote(ModelNote modelNote) {
public Integer updateModelAudit(ModelAudit modelAudit) {
return null;
}
@Override
public List<ModelNote> getModelNoteList(String modelCode) {
public List<ModelAudit> getModelAuditList(String modelCode) {
QueryWrapper<ModelNote> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(ModelNote::getModelCode, modelCode);
return modelNoteMapper.selectList(wrapper);
QueryWrapper<ModelAudit> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(ModelAudit::getModelCode, modelCode);
return modelAuditMapper.selectList(wrapper);
}
@Override
public ModelNote getModelNote(String modelId) {
public ModelAudit getModelAudit(String modelId) {
return null;
}
// @Override
// public Boolean exportModelNote(String modelCode) {
// List<ModelNote> modelNoteList = getModelNoteList(modelCode);
//
// ExcelUtils.exportExcel(modelNoteList, "导出事记", "导出事记", ModelNote.class, "测试user.xls", re
//
// return true;
// }
}
......@@ -136,7 +136,6 @@ public class ModelClassifyServiceImpl implements ModelClassifyService {
return childList;
}
/**
* 构建树节点
* @author huxiuwu
......
package com.pms.ocp.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pms.ocp.mapper.ModelIssueMapper;
import com.pms.ocp.model.dto.ModelIssueDTO;
import com.pms.ocp.model.entity.ModelIssue;
import com.pms.ocp.service.ModelIssueService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
/**
* @Auther: wangjian
* @Date: 2022/2/22 16:22
* @Description:模型订阅业务层实现
*/
@Service
public class ModelIssueServiceImpl implements ModelIssueService {
@Autowired
private ModelIssueMapper modelIssueMapper;
@Override
public Integer createModelIssue(ModelIssueDTO modelIssueDTO) {
ModelIssue modelIssue = new ModelIssue();
BeanUtils.copyProperties(modelIssueDTO, modelIssue);
modelIssue.setSubsCtime(LocalDateTime.now());
return modelIssueMapper.insert(modelIssue);
}
@Override
public Integer deleteModelIssue(String modelId) {
return null;
}
/**
* 批量删除模型订阅
*
* @param ids
* @return
*/
@Override
public Integer deleteBatchModelIssue(List<String> ids) {
return modelIssueMapper.deleteBatchIds(ids);
}
@Override
public Integer updateModelIssue(ModelIssue modelIssue) {
return null;
}
@Override
public List<ModelIssue> getModelIssueList(String objId, String modelCode, String subsCompanyCode) {
QueryWrapper<ModelIssue> queryWrapper = new QueryWrapper();
if (StringUtils.isNotEmpty(objId)) {
queryWrapper.lambda().eq(ModelIssue::getObjId, objId);
}
if (StringUtils.isNotEmpty(modelCode)) {
queryWrapper.lambda().eq(ModelIssue::getModelCode, modelCode);
}
if (StringUtils.isNotEmpty(subsCompanyCode)) {
queryWrapper.lambda().eq(ModelIssue::getSubsCompanyCode, subsCompanyCode);
}
return modelIssueMapper.selectList(queryWrapper);
}
@Override
public ModelIssueDTO getModelIssue(String modelId) {
return null;
}
}
package com.pms.ocp.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pms.ocp.common.constants.CodeEnum;
import com.pms.ocp.common.utils.TreeUtils;
import com.pms.ocp.mapper.ModelSubscribeMapper;
import com.pms.ocp.model.dto.ModelSubscribeDTO;
import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.entity.TreeNode;
import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.service.ModelSubscribeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;
/**
* @Auther: wangjian
* @Date: 2022/2/22 16:22
* @Description:模型订阅业务层实现
*/
@Service
public class ModelSubscribeServiceImpl implements ModelSubscribeService {
@Autowired
private ModelSubscribeMapper modelSubscribeMapper;
@Override
public Integer createModelSubscribe(ModelSubscribeDTO modelSubscribeDTO) {
ModelSubscribe modelSubscribe = new ModelSubscribe();
BeanUtils.copyProperties(modelSubscribeDTO, modelSubscribe);
modelSubscribe.setSubsCtime(LocalDateTime.now());
return modelSubscribeMapper.insert(modelSubscribe);
}
@Override
public Integer deleteModelSubscribe(String modelId) {
return null;
}
/**
* 批量删除模型订阅
*
* @param ids
* @return
*/
@Override
public Integer deleteBatchModelSubscribe(List<String> ids) {
return modelSubscribeMapper.deleteBatchIds(ids);
}
@Override
public Integer updateModelSubscribe(ModelSubscribe modelSubscribe) {
return null;
}
@Override
public List<ModelSubscribe> getModelSubscribeList(String objId, String modelCode, String subsCompanyCode) {
QueryWrapper<ModelSubscribe> queryWrapper = new QueryWrapper();
if (StringUtils.isNotEmpty(objId)) {
queryWrapper.lambda().eq(ModelSubscribe::getObjId, objId);
}
if (StringUtils.isNotEmpty(modelCode)) {
queryWrapper.lambda().eq(ModelSubscribe::getModelCode, modelCode);
}
if (StringUtils.isNotEmpty(subsCompanyCode)) {
queryWrapper.lambda().eq(ModelSubscribe::getSubsCompanyCode, subsCompanyCode);
}
return modelSubscribeMapper.selectList(queryWrapper);
}
@Override
public ModelSubscribeDTO getModelSubscribe(String modelId) {
return null;
}
/**
* 服务列表导航树
* @author huxiuwu
* @date 2022/3/11
*
* @return pms.ocp.model.vo.ResponseVO
**/
@Override
public ResponseVO modelListNavigation(String searchCondition) {
//查询模型和模型属性表列表
List<TreeNode> modelProperList = modelSubscribeMapper.selectModelAndModelGroup(searchCondition);
if (CollectionUtil.isEmpty(modelProperList)){
return ResponseVO.error(CodeEnum.NO_DATA);
}
List<TreeNode> modelGroupList = TreeUtils.build(modelProperList);
//查询组织机构表
List<TreeNode> organList = modelSubscribeMapper.selectOrganData();
//将分类放入各自所属于的组织机构下
organList.forEach(org
->{
modelGroupList.forEach(group->{
if (org.getCompanyCode().equals(group.getCompanyCode())){
if(org.getChildren() == null){
org.setChildren(new LinkedList<>());
}
org.getChildren().add(group);
}
});
});
List<TreeNode> result = TreeUtils.build(organList);
return ResponseVO.ok(result);
}
}
......@@ -5,11 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pms.ocp.common.utils.RandomStringUtil;
import com.pms.ocp.common.utils.RandomStringUtils;
import com.pms.ocp.mapper.OcpApiBaseMapper;
import com.pms.ocp.mapper.OcpApiTreeMapper;
import com.pms.ocp.model.dto.*;
import com.pms.ocp.model.entity.OcpApiBase;
import com.pms.ocp.model.entity.OcpApiGroup;
import com.pms.ocp.service.OcpApiTreeService;
......@@ -19,11 +18,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
@Service
......@@ -162,7 +159,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
public boolean insertTree(OcpApiGroupDtos ocpApiGroupDtos) {
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
String code = RandomStringUtil.getRandomString(6);
String code = RandomStringUtils.getRandomString(6);
boolean flag = true;
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
......
......@@ -3,15 +3,12 @@ package com.pms.ocp.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pms.ocp.common.utils.RandomStringUtil;
import com.pms.ocp.common.utils.RandomStringUtils;
import com.pms.ocp.mapper.TenantBasicManagementMapper;
import com.pms.ocp.mapper.TenantMapper;
import com.pms.ocp.model.dto.*;
import com.pms.ocp.model.entity.OcpApiGroup;
import com.pms.ocp.model.entity.OcpTenantAudit;
import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.entity.OcpTenantGroup;
import com.pms.ocp.service.TenantService;
......@@ -118,7 +115,7 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
break;
}
}
String randomString = RandomStringUtil.getRandomString(6);
String randomString = RandomStringUtils.getRandomString(6);
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
OcpTenantGroup ocpTenantGroup = new OcpTenantGroup();
BeanUtils.copyProperties(tenanBaseDto,ocpTenantGroup);
......
<?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.pms.ocp.mapper.ModelSubscribeMapper">
<resultMap id="modelAndModelGroupMap" type="com.pms.ocp.model.entity.TreeNode" >
<result column="model_group_code" property="code"/>
<result column="model_group_pcode" property="pCode"/>
<result column="group_company_code" property="companyCode"/>
<result column="model_group_name" property="name"/>
<result column="groupModelBelongLevel" property="belongLevel"/>
<collection property="children" ofType="com.pms.ocp.model.entity.TreeNode">
<result column="model_name" property="name"/>
<result column="model_code" property="code"/>
<result column="modelLevel" property="belongLevel"/>
</collection>
</resultMap>
<select id="selectModelAndModelGroup" parameterType="java.lang.String" resultMap="modelAndModelGroupMap">
select
2 AS groupModelBelongLevel,
3 AS modelLevel,
omg.model_group_pcode,
omg.group_company_code,
omg.model_group_name,
omg.model_group_code,
omb.model_name,
omb.model_code
from
ocp_model_group as omg
left join
ocp_model_base omb
on omg.model_group_code = omb.model_group_code
<if test="_parameter != null and _parameter != '' ">
where
model_name LIKE concat('%',#{searchCondition}::text ,'%')
</if>
</select>
<select id="selectOrganData" resultType="com.pms.ocp.model.entity.TreeNode">
select
1 AS belongLevel,
parent_id AS pCode,
org_name AS name ,
org_id AS code,
org_code AS companyCode
from
t_public_organization
where
trim(org_level) != ''
and
org_level::int4 &lt;= 4
</select>
</mapper>
\ No newline at end of file
......@@ -19,7 +19,7 @@
</resultMap>
<select id="selectTreeList" resultType="com.pms.ocp.model.entity.OcpApiGroup">
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where where is_delete = 0
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where is_delete = 0
<if test="apiGroupPcode == null">
and api_group_pcode is null
......@@ -58,8 +58,8 @@
<if test="apiGroupCode !=null and apiGroupCode!=''">
and oab.api_group_code = #{apiGroupCode}
</if>
<if test="apiGroupCompanyCode !=null and apiGroupCompanyCode!=''">
and oab.api_unit = #{apiGroupCompanyCode}
<if test="apiUnit !=null and apiUnit!=''">
and oab.api_unit = #{apiUnit}
</if>
<if test="apiPromotion !=null and apiPromotion!=''">
and oab.api_promotion = #{apiPromotion}
......
......@@ -8,6 +8,6 @@
on oamr.model_code = omb.model_code
INNER JOIN ocp_api_base oab
on oamr.api_code = oab.api_code
where oamr.api_code = #{apiCode}
where oamr.obj_id = #{objId}
</select>
</mapper>
\ No newline at end of file
......@@ -7,7 +7,7 @@
oa LEFT JOIN ocp_api_base ab on
oa.api_code = ab.api_code INNER JOIN
ocp_tenant_base ot on ot.tenant_code =
oa.tenant_code where oa.api_code = #{apiCode}
oa.tenant_code where oa.obj_id = #{objId}
</select>
......
......@@ -10,11 +10,9 @@
</select>
<select id="OtaById" resultType="com.pms.ocp.model.entity.OcpTenantAudit">
SELECT * from ocp_api_tenant_rel oatr
LEFT JOIN ocp_tenant_audit ota
on oatr.tenant_code = ota.tenant_code
INNER JOIN ocp_api_base oab
on oatr.api_code = oab.api_code
where oatr.tenant_code = #{tenantCode}
select * from ocp_tenant_audit ota
LEFT JOIN ocp_tenant_base otb
on ota.tenant_code = otb.tenant_code
where ota.obj_id = #{objId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment