| | |
| | | package com.ruoyi.projectManagement.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.projectManagement.mapper.RolesMapper; |
| | | import com.ruoyi.projectManagement.pojo.Roles; |
| | | import com.ruoyi.projectManagement.service.RolesService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @AllArgsConstructor |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class RolesServiceImpl extends ServiceImpl<RolesMapper, Roles> implements RolesService { |
| | | |
| | | private final RolesMapper rolesmapper; |
| | | |
| | | @Override |
| | | public IPage<Roles> listPage(Page<Roles> page, Roles roles) { |
| | | return rolesmapper.selectPage(page, null); |
| | | LambdaQueryWrapper<Roles> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (roles.getName() != null) { |
| | | queryWrapper.like(Roles::getName, roles.getName()); |
| | | } |
| | | if (roles.getStatus() != null) { |
| | | queryWrapper.eq(Roles::getStatus, roles.getStatus()); |
| | | } |
| | | return rolesmapper.selectPage(page, queryWrapper); |
| | | } |
| | | } |