package com.foreverwin.mesnac.equip.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.equip.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.mapper.ResourceInspectTaskSpareMapper;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
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 pavel.Liu
 * @since 2021-06-30
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ResourceInspectTaskSpareServiceImpl extends ServiceImpl<ResourceInspectTaskSpareMapper, ResourceInspectTaskSpare> implements ResourceInspectTaskSpareService {


    @Autowired
    private ResourceInspectTaskSpareMapper resourceInspectTaskSpareMapper;

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

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

    @Override
    public void removeAll(ResourceInspectTaskSpare resourceInspectTaskSpare) {
        QueryWrapper<ResourceInspectTaskSpare> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(resourceInspectTaskSpare);
        super.remove(queryWrapper);
    }


}