|
|
@@ -2,7 +2,9 @@ package com.tuoheng.api.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.tuoheng.api.constants.DictConstants; |
|
|
|
import com.tuoheng.api.entity.domain.*; |
|
|
|
import com.tuoheng.api.entity.request.IdentityQuery; |
|
|
@@ -48,7 +50,9 @@ public class IdentityServiceImpl extends BaseServiceImpl<IdentityMapper, Identit |
|
|
|
return JsonResult.error("租户ID为空!"); |
|
|
|
} |
|
|
|
List<Identity> identityList = identityMapper.selectList(new LambdaQueryWrapper<Identity>() |
|
|
|
.eq(Identity::getTenantId, identityQuery.getTenantId())); |
|
|
|
.eq(Identity::getTenantId, identityQuery.getTenantId()) |
|
|
|
.eq(Identity::getMark, 1) |
|
|
|
.orderByDesc(Identity::getCreateTime)); |
|
|
|
return JsonResult.success(identityList); |
|
|
|
} |
|
|
|
|
|
|
@@ -100,4 +104,22 @@ public class IdentityServiceImpl extends BaseServiceImpl<IdentityMapper, Identit |
|
|
|
} |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JsonResult queryPage(IdentityQuery query) { |
|
|
|
if (null == query.getPage() || null == query.getLimit()) { |
|
|
|
return JsonResult.error("参数为空!"); |
|
|
|
} |
|
|
|
if (null == query.getTenantId()) { |
|
|
|
return JsonResult.error("租户ID为空!"); |
|
|
|
} |
|
|
|
// 获取分页数据 |
|
|
|
IPage<Identity> page = new Page<>(query.getPage(), query.getLimit()); |
|
|
|
IPage<Identity> pageData = identityMapper.selectPage(page, new LambdaQueryWrapper<Identity>() |
|
|
|
.eq(Identity::getTenantId, query.getTenantId()) |
|
|
|
.eq(Identity::getMark, 1) |
|
|
|
.orderByDesc(Identity::getCreateTime)); |
|
|
|
|
|
|
|
return JsonResult.success(pageData); |
|
|
|
} |
|
|
|
} |