Commit b6f1c848 authored by itcast's avatar itcast

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/application-local.yml
parents d89a3f87 8875e5a3
......@@ -46,11 +46,11 @@ public class OcpApiDetailsController {
return ocpApiAuditService.getOcpApiAuditList(ocpApiAudit);
}
@ApiOperation("服务大事记-查询详情")
@PostMapping("/getocpapidetails")
public ResponseVO<List<OcpApiAudit>> getOcpApiDetails(@RequestBody OcpApiAudit ocpApiAudit){
return ocpApiAuditService.sById(ocpApiAudit);
}
// @ApiOperation("服务大事记-查询详情")
// @PostMapping("/getocpapidetails")
// public ResponseVO<List<OcpApiAudit>> getOcpApiDetails(@RequestBody OcpApiAudit ocpApiAudit){
// return ocpApiAuditService.sById(ocpApiAudit);
// }
@ApiOperation("服务大事记-查询详情-变更内容")
@PostMapping("/getocpapi")
......@@ -58,6 +58,12 @@ public class OcpApiDetailsController {
return ocpApiAuditService.OaaById(ocpApiAudit);
}
@ApiOperation("服务大事记-历史版本")
@PostMapping("/versionid")
public ResponseVO<List<OcpApiAudit>> versionId(@RequestBody OcpApiAudit ocpApiAudit){
return ocpApiAuditService.versionId(ocpApiAudit);
}
@ApiOperation("服务与应用拓扑图-查询")
@PostMapping("/getoatrlist")
public ResponseVO<List<OcpApiTenantRel>> getOatrList(@RequestBody OcpApiTenantRel ocpApiTenantRel) {
......
......@@ -34,16 +34,16 @@ public class OcpApiTreeController {
*/
@GetMapping("/getTree")
@ApiOperation("服务树分类")
public ResponseVO< List<OcpApiGroup>> getTree(String apiGroupPromotionType,String apiGroupCode){
List<OcpApiGroup> byGroup = service.getByGroup(apiGroupPromotionType, apiGroupCode);
public ResponseVO< List<OcpApiGroup>> getTree(OcpApiGroup ocpApiGroup){
List<OcpApiGroup> byGroup = service.getByGroup(ocpApiGroup.getApiGroupPromotionType(), ocpApiGroup.getApiGroupCode());
return ResponseVO.ok(byGroup);
}
@PostMapping("/instertree")
@ApiOperation("服务树分类--新增")
public ResponseVO inseter(@RequestBody OcpApiGroupDtos ocpApiGroupDtos){
boolean flag = service.insertTree(ocpApiGroupDtos);
public ResponseVO inseter(@RequestBody OcpApiGroup ocpApiGroup){
boolean flag = service.insertTree(ocpApiGroup);
if (flag){
return ResponseVO.ok();
}
......@@ -51,9 +51,9 @@ public class OcpApiTreeController {
}
@PostMapping("/getone")
@GetMapping("/getone")
@ApiOperation("服务树分类--分级数据")
public ResponseVO<Page<OcpApiGroup>> getOne(@RequestBody PageGroupDto pageGroupDto){
public ResponseVO<Page<OcpApiGroup>> getOne(PageGroupDto pageGroupDto){
Page<OcpApiGroup> onePages = service.getOnePages(pageGroupDto);
return ResponseVO.ok(onePages);
}
......
......@@ -40,8 +40,8 @@ public class OcpTenantController {
}
@GetMapping("/tenantselect")
@ApiModelProperty("应用树分类--查询")
private Page<OcpTenantGroup> getselect(String tenantGroupCode,String tenantGroupCompanyCode,int currentPage,int pageSize){
Page<OcpTenantGroup> tree= tenantService.getselects(tenantGroupCode,tenantGroupCompanyCode,currentPage,pageSize);
private Page<OcpTenantGroup> getselect(String tenantGroupCode,String tenantGroupCompanyCode,int currentPage,int pageSize,String keyword){
Page<OcpTenantGroup> tree= tenantService.getselects(tenantGroupCode,tenantGroupCompanyCode,currentPage,pageSize,keyword);
return tree;
}
......
......@@ -10,13 +10,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.Result;
import java.util.List;
@Slf4j
......@@ -50,11 +49,6 @@ public class OcpTenantDetailsController {
return ocpTenantAuditService.getOtaList(ocpTenantAudit);
}
@ApiOperation("应用大事记-查询详情")
@PostMapping("/getotaListById")
public ResponseVO<List<OcpApiAudit>> getOtaListById(@RequestBody OcpTenantAudit ocpTenantAudit) {
return ocpTenantAuditService.getOtaListById(ocpTenantAudit);
}
@ApiOperation("应用订阅记录-查询")
@PostMapping("/getOcpTenantList")
......@@ -78,4 +72,12 @@ public class OcpTenantDetailsController {
public ResponseVO<List<OcpTenantAudit>> getOcpTenant(@RequestBody OcpTenantAudit ocpTenantAudit){
return ocpTenantAuditService.OtaById(ocpTenantAudit);
}
@ApiOperation("应用大事记-查询详情-历史版本")
@PostMapping("/versionId")
public ResponseVO<List<OcpTenantAudit>> versionId(@RequestBody OcpTenantAudit ocpTenantAudit){
return ocpTenantAuditService.versionId(ocpTenantAudit);
}
}
......@@ -20,4 +20,6 @@ public interface OcpApiAuditMapper extends BaseMapper<OcpApiAudit> {
List<OcpApiAudit> sById(OcpApiAudit ocpApiAudit);
List<OcpApiAudit> versionId (OcpApiAudit ocpApiAudit);
}
......@@ -26,8 +26,14 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
* @param apiGroupPromotionType
* @return
*/
List<OcpApiGroup> selectTwoApiGroups(String apiGroupPromotionType);
List<OcpApiGroup> selectTwoApiGroups(Long apiGroupPromotionType);
//三级数
List<OcpApiGroup> selectThreeApiGroupsList(String apiGroupPromotionType, String apiGroupCode);
List<OcpApiGroup> selectThreeApiGroupsList(Long apiGroupPromotionType, String apiGroupCode);
List<OcpApiGroup> selectLists(Long apiGroupPromotionType, String apiGroupCode,Long apiGroupLevel);
//code重复问题
List<OcpApiGroup> selectGroupCode();
}
......@@ -11,4 +11,6 @@ public interface OcpTenantAuditMapper extends BaseMapper<OcpTenantAudit> {
List<OcpTenantAudit> getOtaListById(OcpTenantAudit ocpTenantAudit);
List<OcpTenantAudit> OtaById(OcpTenantAudit ocpTenantAudit);
List<OcpTenantAudit> versionId(OcpTenantAudit ocpTenantAudit);
}
......@@ -29,6 +29,10 @@ public interface TenantMapper extends BaseMapper<OcpTenantGroup> {
List<OcpTenantGroup> selectGroups(String tenantGroupCompanyCode);
//模糊查询
List<OcpTenantGroup> queryLike(String keyword);
}
......@@ -16,6 +16,7 @@ import java.util.List;
@TableName("ocp_api_group")
@ApiModel("服务分类表")
public class OcpApiGroup {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty("主键ID")
private String objId;
......@@ -186,4 +187,5 @@ public class OcpApiGroup {
}
}
......@@ -18,4 +18,6 @@ public interface OcpApiAuditService extends IService<OcpApiAudit> {
ResponseVO sById(OcpApiAudit ocpApiAudit);
void exportExcel(OcpApiAudit ocpApiAudit, HttpServletRequest request, HttpServletResponse response);
ResponseVO versionId(OcpApiAudit ocpApiAudit);
}
......@@ -16,12 +16,12 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> {
/**
* 服务树分类
*/
List<OcpApiGroup> getByGroup(String apiGroupPromotionType,String apiGroupCode);
List<OcpApiGroup> getByGroup(Long apiGroupPromotionType,String apiGroupCode);
/**
* 新增服务分类
*/
boolean insertTree(OcpApiGroupDtos ocpApiGroupDtos);
boolean insertTree(OcpApiGroup ocpApiGroup);
/*
......
......@@ -16,4 +16,6 @@ public interface OcpTenantAuditService extends IService<OcpTenantAudit> {
void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response);
ResponseVO OtaById(OcpTenantAudit ocpTenantAudit);
ResponseVO versionId(OcpTenantAudit ocpTenantAudit);
}
......@@ -6,4 +6,7 @@ import com.pms.ocp.model.vo.ResponseVO;
public interface OcpTenantBaseService extends IService<OcpTenantBase> {
ResponseVO getOtbList(OcpTenantBase ocpTenantBase);
}
......@@ -48,17 +48,6 @@ public interface TenantService extends IService<OcpTenantGroup> {
* @param tenantGroupCompanyCode
* @return
*/
Page<OcpTenantGroup> getselects(String tenantGroupCode,String tenantGroupCompanyCode,int currentPage,int pageSize);
Page<OcpTenantGroup> getselects(String tenantGroupCode,String tenantGroupCompanyCode,int currentPage,int pageSize,String text);
/*// 应用分类--一级
OcpTenantGroupDto getTenantOneTree();
// 应用分类--二级
List<TwoTenanList> getTenantTwoTree(String code);*/
/* *//**
* // 应用分类--三级
* @param code
* @return
*//*
List<ThreeTenanList> getTenantThreeTree(String code);*/
}
......@@ -58,5 +58,11 @@ public class OcpApiAuditServiceImpl extends ServiceImpl<OcpApiAuditMapper,OcpApi
ExportUtils.exportExcel(response, AnalysisConstant.exportOcpApiAuditName.OCP_API_AUDIT,workbook);
}
@Override
public ResponseVO versionId(OcpApiAudit ocpApiAudit) {
List<OcpApiAudit> ocpApiAuditList = ocpApiAuditMapper.versionId(ocpApiAudit);
return ResponseVO.ok(ocpApiAuditList);
}
}
......@@ -41,7 +41,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
*/
@Override
public List<OcpApiGroup> getByGroup(String apiGroupPromotionType,String apiGroupCode) {
public List<OcpApiGroup> getByGroup(Long apiGroupPromotionType,String apiGroupCode) {
// if (StringUtils.isBlank(apiGroupPromotionType) && StringUtils.isBlank(apiGroupCode)) {
// List<OcpApiGroup> ocpApiGroups = mapper.selectApiGroups();
......@@ -59,140 +59,22 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
}
/* //服务树全表数据
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
//服务树分类对象
ApiTreeGroupDto apiTreeGroupList = new ApiTreeGroupDto();
//1中台层
List<OneTreeUpList> oneTreeUpLists = new ArrayList<>();
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
//判断数据状态
if (!(ocpApiGroup.getIsDelete() == 0)) {
//一级服务对象
OneTreeUpList oneTreeUpList = new OneTreeUpList();
// 判断数据是否有上级服务分类
if (ocpApiGroup.getApiGroupLevel() == 1) {
BeanUtils.copyProperties(ocpApiGroup, oneTreeUpList);
oneTreeUpLists.add(oneTreeUpList);
}
}
}
List<TwoDownList> twoDownLists = twoTreeLists(oneTreeUpLists, ocpApiGroups);
List<ThreeTreeList> threeTreeLists = threeTreeLists(twoDownLists, ocpApiGroups);
List<FourTreeList> fourTreeLists = fourTreeLists(threeTreeLists, ocpApiGroups);
apiTreeGroupList.setOneList(oneTreeUpLists);
apiTreeGroupList.setTwoList(twoDownLists);
apiTreeGroupList.setThreeList(threeTreeLists);
apiTreeGroupList.setFourList(fourTreeLists);
return apiTreeGroupList;
}
*//**
* 2中心层
*
* @param oneTreeUpLists
* @return
*//*
public List<TwoDownList> twoTreeLists(List<OneTreeUpList> oneTreeUpLists, List<OcpApiGroup> ocpApiGroups) {
*//* List<OcpApiGroup> groupList = new ArrayList<>();*//*
List<TwoDownList> twoTreeLists = new ArrayList<>();
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
TwoDownList twoDownList = new TwoDownList();
if (!(ocpApiGroup.getIsDelete() == 0)) {
if (ocpApiGroup.getApiGroupLevel() == 2) {
BeanUtils.copyProperties(ocpApiGroup, twoDownList);
twoTreeLists.add(twoDownList);
} else {
continue;
}
}
}
return twoTreeLists;
}
*//**
* 3服务组层
*
* @param twoDownLists
* @return
*//*
public List<ThreeTreeList> threeTreeLists(List<TwoDownList> twoDownLists, List<OcpApiGroup> ocpApiGroups) {
List<ThreeTreeList> threeTreeLists = new ArrayList<>();
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
ThreeTreeList threeTreeList = new ThreeTreeList();
if (!(ocpApiGroup.getIsDelete() == 0)) {
if (ocpApiGroup.getApiGroupLevel() == 3) {
BeanUtils.copyProperties(ocpApiGroup, threeTreeList);
threeTreeLists.add(threeTreeList);
}
} else {
continue;
}
}
return threeTreeLists;
}
*//**
* 4服务层
*
* @param threeTreeLists
* @return
*//*
public List<FourTreeList> fourTreeLists(List<ThreeTreeList> threeTreeLists, List<OcpApiGroup> ocpApiGroups) {
List<FourTreeList> foureTreeList = new ArrayList<>();
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
if (!(ocpApiGroup.getIsDelete() == 0)) {
if (ocpApiGroup.getApiGroupLevel() == 4) {
FourTreeList fourTreeList = new FourTreeList();
BeanUtils.copyProperties(ocpApiGroup, fourTreeList);
foureTreeList.add(fourTreeList);
}
} else {
continue;
}
}
return foureTreeList;
}
*/
/**
* 新增服务分类
*
* @param ocpApiGroupDtos
* @param
*/
@Override
public boolean insertTree(OcpApiGroupDtos ocpApiGroupDtos) {
public boolean insertTree(OcpApiGroup ocpApiGroup) {
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
String code = RandomStringUtils.getRandomString(6);
boolean flag = true;
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
if (ocpApiGroup.getApiGroupCode().equals(ocpApiGroupDtos.getApiGroupCode())) {
flag = false;
break;
}
}
if (flag == true) {
OcpApiGroup ocpApiGroup1 = new OcpApiGroup();
ocpApiGroup1.setObjId("");
ocpApiGroup1.setApiGroupMtime(timestamp);
ocpApiGroup1.setApiGroupCtime(timestamp);
BeanUtils.copyProperties(ocpApiGroupDtos, ocpApiGroup1);
ocpApiGroup1.setApiGroupCode(code);
mapper.insert(ocpApiGroup1);
}
ocpApiGroup.setObjId("");
ocpApiGroup.setApiGroupMtime(timestamp);
ocpApiGroup.setApiGroupCtime(timestamp);
ocpApiGroup.setApiGroupPcode(ocpApiGroup.getApiGroupCode());
ocpApiGroup.setApiGroupCode(code);
mapper.insert(ocpApiGroup);
return flag;
}
......@@ -244,22 +126,6 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
}
/* *//**
* 一级服务
*
* @param
*//*
@Override
public List<OcpApiGroup> getOnePage(int pageSize, int pageNum, int apiGroupLevel) {
Page pageInfo = new Page(pageSize,pageNum);
LambdaQueryWrapper<OcpApiGroup> queryWrapper = new LambdaQueryWrapper();
LambdaQueryWrapper<OcpApiGroup> eq = queryWrapper.eq(OcpApiGroup::getApiGroupLevel, apiGroupLevel);
List<OcpApiGroup> ocpApiGroups = mapper.selectList(eq);
return ocpApiGroups;
}*/
/**
* 服务列表分级查询
*
......@@ -270,44 +136,18 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
public Page<OcpApiGroup> getOnePages(PageGroupDto pageGroupDto) {
Page pageInfo = new Page(pageGroupDto.getPageSize(), pageGroupDto.getPageNum());
if (pageGroupDto.getApiGroupLevel() == 1 && "".equals(pageGroupDto.getApiGroupPcode())){
LambdaQueryWrapper<OcpApiGroup> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(OcpApiGroup::getApiGroupLevel, pageGroupDto.getApiGroupLevel());
mapper.selectPage(pageInfo,queryWrapper);
}else if (pageGroupDto.getApiGroupLevel() == 2){
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
if (pageGroupDto.getApiGroupCode().equals(ocpApiGroup.getApiGroupCode())){
LambdaQueryWrapper<OcpApiGroup> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(OcpApiGroup::getApiGroupLevel, pageGroupDto.getApiGroupLevel());
mapper.selectPage(pageInfo,queryWrapper);
}
}
}else if (pageGroupDto.getApiGroupLevel() == 3){
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
if (pageGroupDto.getApiGroupCode() == ocpApiGroup.getApiGroupCode()) {
LambdaQueryWrapper<OcpApiGroup> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(OcpApiGroup::getApiGroupLevel, pageGroupDto.getApiGroupLevel());
mapper.selectPage(pageInfo, queryWrapper);
}
}
}else {
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
if (pageGroupDto.getApiGroupCode() == ocpApiGroup.getApiGroupCode()) {
LambdaQueryWrapper<OcpApiGroup> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(OcpApiGroup::getApiGroupLevel, pageGroupDto.getApiGroupLevel());
mapper.selectPage(pageInfo, queryWrapper);
}
}
if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())){
List<OcpApiGroup> ocpApiGroups = mapper.selectTwoApiGroups(pageGroupDto.getApiGroupPromotionType());
pageInfo.setRecords(ocpApiGroups);
LambdaQueryWrapper<OcpApiGroup> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(OcpApiGroup::getApiGroupPromotionType,pageGroupDto.getApiGroupPromotionType());
mapper.selectPage(pageInfo,lambdaQueryWrapper);
}else if (!(StringUtils.isBlank(pageGroupDto.getApiGroupCode()))){
List<OcpApiGroup> ocpApiGroups = mapper.selectLists(pageGroupDto.getApiGroupPromotionType(),pageGroupDto.getApiGroupCode(),pageGroupDto.getApiGroupLevel());
LambdaQueryWrapper<OcpApiGroup> lwq = new LambdaQueryWrapper<>();
pageInfo.setRecords(ocpApiGroups);
mapper.selectPage(pageInfo, lwq);
}
return pageInfo;
}
}
......@@ -41,7 +41,7 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper,
@Override
public void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response) {
List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.getOtaListById(ocpTenantAudit);
List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.versionId(ocpTenantAudit);
ExportParams param = new ExportParams(AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API);
Workbook workbook = ExcelExportUtil.exportExcel(param, OcpTenantAudit.class,otaListById);
ExportUtils.exportExcel(response, AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,workbook);
......@@ -52,4 +52,12 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper,
List<OcpTenantAudit> oatrList = ocpTenantAuditMapper.OtaById(ocpTenantAudit);
return ResponseVO.ok(oatrList);
}
@Override
public ResponseVO versionId(OcpTenantAudit ocpTenantAudit) {
List<OcpTenantAudit> ocpTenantAudits = ocpTenantAuditMapper.versionId(ocpTenantAudit);
return ResponseVO.ok(ocpTenantAudits);
}
}
package com.pms.ocp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pms.ocp.common.constants.*;
import com.pms.ocp.common.exception.ServiceException;
import com.pms.ocp.mapper.OcpTenantBaseMapper;
import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.vo.ResponseVO;
......@@ -8,10 +10,16 @@ import com.pms.ocp.service.OcpTenantBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
@Service
public class OcpTenantBaseServiceImpl extends ServiceImpl<OcpTenantBaseMapper,OcpTenantBase> implements OcpTenantBaseService {
@Autowired
private OcpTenantBaseMapper ocpTenantBaseMapper;
@Override
......@@ -19,4 +27,9 @@ public class OcpTenantBaseServiceImpl extends ServiceImpl<OcpTenantBaseMapper,Oc
List<OcpTenantBase> otbList = ocpTenantBaseMapper.getOtbList(ocpTenantBase);
return ResponseVO.ok(otbList);
}
}
......@@ -12,6 +12,7 @@ import com.pms.ocp.model.dto.*;
import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.entity.OcpTenantGroup;
import com.pms.ocp.service.TenantService;
import com.zaxxer.hikari.util.IsolationLevel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -85,13 +86,10 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
ocpTenantGroup.setTenantGroupVersion("1.0");
}
OcpTenantBase ocpTenantBase = new OcpTenantBase();
BeanUtils.copyProperties(tenanBaseDto,ocpTenantBase);
if ("null".equals(tenanBaseDto.getTenantGroupCode())){
group.setTenantGroupCode(randomString);
}
tenantMapper.insert(tenanBaseDto);
tenantBasicMapper.insert(ocpTenantBase);
return falg;
}
......@@ -152,21 +150,35 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
* @return
*/
@Override
public Page<OcpTenantGroup> getselects(String tenantGroupCode,String tenantGroupCompanyCode,int currentPage,int pageSize) {
Page<OcpTenantGroup> page = new Page<>(currentPage,pageSize);
if (StringUtils.isBlank(tenantGroupCode)){
//顶级目录
List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.selectTenantGroup(tenantGroupCompanyCode);
page.setRecords(ocpTenantGroupList);
public Page<OcpTenantGroup> getselects(String tenantGroupCode,String tenantGroupCompanyCode,int currentPage,int pageSize,String keyword) {
LambdaQueryWrapper<OcpTenantGroup> qw = new LambdaQueryWrapper<>();
List<OcpTenantGroup> ocpTenantGroupList1 = tenantMapper.selectList(null);
Page<OcpTenantGroup> page = new Page<>(currentPage, pageSize);
if ("".equals(keyword)) {
if (StringUtils.isBlank(tenantGroupCode)) {
for (OcpTenantGroup ocpTenantGroup : ocpTenantGroupList1) {
if (ocpTenantGroup.getTenantGroupPcode().equals(tenantGroupCode) && ocpTenantGroup.getTenantGroupCompanyCode().equals(tenantGroupCompanyCode)){
List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.selectTenantGroup(tenantGroupCompanyCode);
page.setRecords(ocpTenantGroupList);
tenantMapper.selectPage(page,qw);
}
}
} else {
for (OcpTenantGroup ocpTenantGroup : ocpTenantGroupList1) {
if (ocpTenantGroup.getTenantGroupPcode().equals(tenantGroupCode) && ocpTenantGroup.getTenantGroupCompanyCode().equals(tenantGroupCompanyCode)) {
List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.selectTenantGroups(tenantGroupCode, tenantGroupCompanyCode);
page.setRecords(ocpTenantGroupList);
tenantMapper.selectPage(page,qw);
}
}
}
return page;
}else {
List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.selectTenantGroups(tenantGroupCode,tenantGroupCompanyCode);
List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.queryLike(keyword);
page.setRecords(ocpTenantGroupList);
tenantMapper.selectPage(page,qw);
return page;
}
return page;
}
}
}
......@@ -6,7 +6,7 @@
select * from ocp_api_audit oaa
LEFT JOIN ocp_api_base oab
on oaa.api_code = oab.api_code
where oaa.obj_id = #{objId}
where oaa.api_code = #{apiCode}
</select>
<select id="getOcpApiSubsList" resultType="com.pms.ocp.model.entity.OcpApiAudit">
......@@ -16,4 +16,12 @@
<select id="sById" resultType="com.pms.ocp.model.entity.OcpApiAudit">
select * from ocp_api_audit where obj_id = #{objId}
</select>
<select id="versionId" resultType="com.pms.ocp.model.entity.OcpApiAudit">
select * from ocp_api_audit oaa
LEFT JOIN ocp_api_base oab
on oaa.api_code = oab.api_code
where oaa.api_code = #{apiCode}
</select>
</mapper>
\ No newline at end of file
<?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.OcpApiTreeMapper">
<!-- 一级树-->
<!-- 一级树-->
<select id="selectApiGroups" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM (select *,ROW_NUMBER() over(partition by api_group_promotion_type) as rn from ocp_api_group) as u where u.rn= 1;
</select>
<!-- 级树-->
<!-- 级树-->
<select id="selectTwoApiGroups" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType};
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_level = '1';
</select>
<!--级-->
<!--级-->
<select id="selectThreeApiGroupsList" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode};
</select>
<!--服务树 -查询-->
<select id="selectLists" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode} and api_group_level = #{apiGroupLevel};
</select>
<!-- code值重复问题 -->
<select id="selectGroupCode" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT api_group_code FROM ocp_api_group;
</select>
</mapper>
\ No newline at end of file
......@@ -13,6 +13,13 @@
select * from ocp_tenant_audit ota
LEFT JOIN ocp_tenant_base otb
on ota.tenant_code = otb.tenant_code
where ota.obj_id = #{objId}
where ota.tenant_code = #{tenantCode}
</select>
<select id="versionId" resultType="com.pms.ocp.model.entity.OcpTenantAudit">
select * from ocp_tenant_audit ota
LEFT JOIN ocp_tenant_base otb
on ota.tenant_code = otb.tenant_code
where ota.tenant_code = #{tenantCode}
</select>
</mapper>
\ No newline at end of file
......@@ -25,6 +25,52 @@
<select id="selectGroups" resultType="com.pms.ocp.model.entity.OcpTenantGroup">
SELECT * FROM ocp_tenant_group WHERE tenant_group_company_code = #{tenantGroupCompanyCode} and tenant_group_level = '1' ;
</select>
<!-- 模糊查询-->
<select id="queryLike" resultType="com.pms.ocp.model.entity.OcpTenantGroup">
select * from ocp_tenant_group
<where>
<if test="keyword !=null and keyword != '' ">
and tenant_group_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_company_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_pcode like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_type like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_version like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_order_no like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_user_id like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_user_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_ctime like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_mtime like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and is_delete like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_level like CONCAT('%', #{keyword}::text,'%')
</if>
</where>
</select>
</mapper>
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