From c5dc08e0824250daa3bc6aabbca364de95d8d0f5 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 03 十二月 2021 10:45:04 +0800 Subject: [PATCH] update 调整 角色查询部门 返回值类型 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index 9681b3d..f136de6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -80,7 +80,7 @@ * @return 閫変腑宀椾綅ID鍒楄〃 */ @Override - public List<Integer> selectPostListByUserId(Long userId) { + public List<Long> selectPostListByUserId(Long userId) { return baseMapper.selectPostListByUserId(userId); } @@ -93,9 +93,10 @@ @Override public String checkPostNameUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = getOne(new LambdaQueryWrapper<SysPost>() - .eq(SysPost::getPostName, post.getPostName()).last("limit 1")); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { + long count = count(new LambdaQueryWrapper<SysPost>() + .eq(SysPost::getPostName, post.getPostName()) + .ne(SysPost::getPostId, postId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -110,9 +111,10 @@ @Override public String checkPostCodeUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = getOne(new LambdaQueryWrapper<SysPost>() - .eq(SysPost::getPostCode, post.getPostCode()).last("limit 1")); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { + long count = count(new LambdaQueryWrapper<SysPost>() + .eq(SysPost::getPostCode, post.getPostCode()) + .ne(SysPost::getPostId, postId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; -- Gitblit v1.9.3