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 implements RoleService { @Override public Long getRoleIdByRoleCode(String roleCode) { Role role = getOne(new LambdaQueryWrapper() .eq(Role::getRoleCode, roleCode) .eq(Role::getStatus, 1) ); return role != null ? role.getId() : null; } }