package com.foreverwin.mesnac.common.service.impl;

import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.Printer;
import com.foreverwin.mesnac.common.mapper.PrinterMapper;
import com.foreverwin.mesnac.common.service.PrinterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Leon.L
 * @since 2021-08-11
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class PrinterServiceImpl extends ServiceImpl<PrinterMapper, Printer> implements PrinterService {


    @Autowired
    private PrinterMapper printerMapper;

    @Override
    public IPage<Printer> selectPage(FrontPage<Printer> frontPage, Printer printer) {
        QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(printer);
        return super.page(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<Printer> selectList(Printer printer) {
        QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(printer);
        return super.list(queryWrapper);
    }


}