Newer
Older
huludao / src / main / java / com / newfiber / api / pc / service / impl / TaskUserAuthServiceImpl.java
package com.newfiber.api.pc.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.newfiber.api.pc.dao.TaskUserAuthMapper;
import com.newfiber.api.pc.model.entity.TaskUserAuth;
import com.newfiber.api.pc.service.TaskUserAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("taskUserAuthService")
public class TaskUserAuthServiceImpl extends ServiceImpl<TaskUserAuthMapper, TaskUserAuth> implements TaskUserAuthService {

    @Autowired
    private TaskUserAuthMapper taskUserAuthMapper;

    @Override
    public PageInfo<TaskUserAuth> listForPage(String searchStr, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo, pageSize);
        EntityWrapper<TaskUserAuth> wapper = new EntityWrapper<>();
        //name 模糊匹配的字段
        wapper.like("name", searchStr);
        List<TaskUserAuth> list = taskUserAuthMapper.selectList(wapper);
        PageInfo<TaskUserAuth> result = new PageInfo<>();
        if (!list.isEmpty()) {
            result = new PageInfo<TaskUserAuth>(list);
        }
        return result;
    }
}