update 优化部门下岗位名称重复

This commit is contained in:
AprilWind 2025-02-19 09:07:46 +08:00
parent 236dd6e054
commit 906a031172

View File

@ -154,6 +154,7 @@ public class SysPostServiceImpl implements ISysPostService, PostService {
public boolean checkPostNameUnique(SysPostBo post) {
boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysPost>()
.eq(SysPost::getPostName, post.getPostName())
.eq(SysPost::getDeptId, post.getDeptId())
.ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId()));
return !exist;
}