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;
|
}
|
}
|