| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.hxzkmonitor.mapper.TbUserMapper; |
| | | import com.hxzkmonitor.pojo.TbBaidumap; |
| | | import com.hxzkmonitor.pojo.TbBaidumap; |
| | | import com.hxzkmonitor.mapper.TbBaidumapMapper; |
| | | import com.hxzkmonitor.pojo.TbDuanxinlog; |
| | | import com.hxzkmonitor.pojo.TbUser; |
| | | import com.hxzkmonitor.service.TbBaidumapService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-08-22 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor(onConstructor = @__(@Autowired)) |
| | | public class TbBaidumapServiceImpl extends ServiceImpl<TbBaidumapMapper, TbBaidumap> implements TbBaidumapService { |
| | | |
| | | private final TbUserMapper tbUserMapper; |
| | | @Override |
| | | public IPage<TbBaidumap> searchBaidumap(Page page, String keyword) { |
| | | QueryWrapper<TbBaidumap> queryWrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<TbBaidumap> getBaidumapPage(Page page) { |
| | | QueryWrapper queryWrapper = new QueryWrapper<>(); |
| | | IPage<TbBaidumap> userPage = baseMapper.selectPage(page, queryWrapper); |
| | | return userPage; |
| | | public IPage<TbBaidumap> getBaidumapPage(Page page, String username) { |
| | | |
| | | QueryWrapper queryWrapper2 = new QueryWrapper<>(); |
| | | queryWrapper2.eq("username", username); |
| | | TbUser tbUser = tbUserMapper.selectOne(queryWrapper2); |
| | | if (Objects.equals(tbUser.getRole(), "超级管理员")) { |
| | | QueryWrapper queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.orderByDesc("addtime"); |
| | | IPage<TbBaidumap> userPage = baseMapper.selectPage(page, queryWrapper); |
| | | return userPage; |
| | | |
| | | } else { |
| | | QueryWrapper queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("companyname", tbUser.getCaname()); |
| | | queryWrapper.orderByDesc("addtime"); |
| | | IPage<TbBaidumap> userPage = baseMapper.selectPage(page, queryWrapper); |
| | | return userPage; |
| | | } |
| | | // QueryWrapper queryWrapper = new QueryWrapper<>(); |
| | | // IPage<TbBaidumap> userPage = baseMapper.selectPage(page, queryWrapper); |
| | | // return userPage; |
| | | } |
| | | } |