wuyouming666
2023-12-21 ad71edbf0f9d2cf2bc46cd2ba1e0239f80949e68
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
33
package com.example.springboot.service.impl;
 
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.example.springboot.mapper.MenuListMapper;
import com.example.springboot.mapper.RoleMapper;
import com.example.springboot.mapper.RoleMenuListMapper;
import com.example.springboot.service.RoleMenuListService;
import com.example.springboot.entity.RoleMenuList;
import com.example.springboot.entity.vo.RoleMenuListVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
@Service
@Slf4j
public class RoleMenuListServiceImpl extends ServiceImpl<RoleMenuListMapper, RoleMenuList> implements RoleMenuListService {
    @Autowired
    private MenuListMapper menuListDao;
    @Autowired
    private RoleMapper roleDao;
 
    @Override
    public IPage<RoleMenuList> selectPage(RoleMenuListVo roleMenuListVO) {
        IPage<RoleMenuList> roleMenuListIPage = lambdaQuery().page(new Page<>(roleMenuListVO.getPageNum(), roleMenuListVO.getPageSize()));
        roleMenuListIPage.getRecords().forEach(rm -> {
            rm.setMenuList(menuListDao.selectById(rm.getMenuListId()));
            rm.setRole(roleDao.selectById(rm.getRoleId()));
        });
        return roleMenuListIPage;
    }
}