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.ResourceInspectTaskParam;
import com.foreverwin.mesnac.equip.mapper.ResourceInspectTaskParamMapper;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskParamService;
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-29
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ResourceInspectTaskParamServiceImpl extends ServiceImpl<ResourceInspectTaskParamMapper, ResourceInspectTaskParam> implements ResourceInspectTaskParamService {


    @Autowired
    private ResourceInspectTaskParamMapper resourceInspectTaskParamMapper;

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

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

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


}