wu
2023-12-01 8a0ae6d19d78d2295a10b1cc97bfe17e651234ea
springboot-vue3/src/main/java/com/example/springboot/service/impl/RoleMenuListServiceImpl.java
New file
@@ -0,0 +1,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;
    }
}