huminmin
昨天 3ca9f3c5224f83ca8d1bc848ea4d452fef3c9fbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
public class RolesServiceImpl extends ServiceImpl<RolesMapper, Roles> implements RolesService {
 
    private final RolesMapper rolesmapper;
 
    @Override
    public IPage<Roles> listPage(Page<Roles> page, Roles roles) {
        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);
    }
}