You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
746 B
Java
21 lines
746 B
Java
package cn.zyp.stusystem.service.impl;
|
|
|
|
import cn.zyp.stusystem.entity.Role;
|
|
import cn.zyp.stusystem.mapper.RoleMapper;
|
|
import cn.zyp.stusystem.service.RoleService;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@Service
|
|
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
|
|
|
|
@Override
|
|
public Long getRoleIdByRoleCode(String roleCode) {
|
|
Role role = getOne(new LambdaQueryWrapper<Role>()
|
|
.eq(Role::getRoleCode, roleCode)
|
|
.eq(Role::getStatus, 1)
|
|
);
|
|
return role != null ? role.getId() : null;
|
|
}
|
|
} |