package com.hxzk.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hxzk.mapper.DaoHangDao; import com.hxzk.pojo.*; import com.hxzk.service.TbDaoHangService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service public class DaoHangServiceImpl extends ServiceImpl implements TbDaoHangService { @Autowired DaoHangDao daoHangDao; @Override public Init findDaoHangAll() { QueryWrapper queryWrapper = new QueryWrapper<>(); List daohangs = baseMapper.selectList(queryWrapper); queryWrapper.eq("level","1"); queryWrapper.eq("ishow","1"); List Yidaohang = baseMapper.selectList(queryWrapper); Init init = new Init(); homeInfo homeInfo = new homeInfo(); homeInfo.setTitle("管理后台"); homeInfo.setHref("../HouTai/ShouYe.jsp"); init.setHomeInfo(homeInfo); menuInfo menuInfo = new menuInfo(); menuInfo.setTitle("常规管理"); menuInfo.setIcon("fa fa-address-book"); menuInfo.setHref(""); menuInfo.setTarget("_self"); init2 init2 = new init2(); init2.setHref(daohangs.get(0).getSrc()); init2.setTitle(" "+daohangs.get(0).getName()); init2.setTarget("_blank"); List child = new ArrayList<>(); child.add(init2); for (int i = 1; i  " + Yidaohang.get(i).getName()); //根据parent 查询子级菜单 List ErDaohang = new ArrayList<>(); QueryWrapper queryWrapper1 = new QueryWrapper<>(); queryWrapper1.eq("parents",Yidaohang.get(i).getParent()); queryWrapper1.eq("ishow","1"); ErDaohang = baseMapper.selectList(queryWrapper1); List ziint = new ArrayList<>(); for (int j = 0 ; j menuInfos = new ArrayList<>(); menuInfos.add(menuInfo); init.setMenuInfo(menuInfos); return init; } @Override public PageInfo findAll(Integer page, Integer limit) { QueryWrapper queryWrapper = new QueryWrapper<>(); PageHelper.startPage(page,limit); List cardList = baseMapper.selectList(queryWrapper); PageInfo info = new PageInfo<>(cardList); return info; } @Override public void UpDaoHang(TbDaohang daohang) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("id",daohang.getId()); baseMapper.update(daohang,queryWrapper); } @Override public TbDaohang findOne(Integer id) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("id",id); return baseMapper.selectOne(queryWrapper); } @Override public void UpDaoHangIshow(String parents) { daoHangDao.upDaoHangIshow(parents); } }