package com.example.erp.service.userInfo; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.example.erp.entity.userInfo.Role; import com.example.erp.mapper.userInfo.RoleMapper; import org.springframework.stereotype.Service; import java.util.List; @Service @DS("user_info") public class RoleService { private final RoleMapper roleMapper; public RoleService(RoleMapper roleMapper) { this.roleMapper = roleMapper; } public List findAll() { return roleMapper.selectList( new QueryWrapper() .ne("role","admin") ); } public Boolean add(Role role) { return roleMapper.insert(role) > 0; } }