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.InspectPlanUserGroup;
import com.foreverwin.mesnac.equip.mapper.InspectPlanUserGroupMapper;
import com.foreverwin.mesnac.equip.service.InspectPlanUserGroupService;
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-18
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class InspectPlanUserGroupServiceImpl extends ServiceImpl<InspectPlanUserGroupMapper, InspectPlanUserGroup> implements InspectPlanUserGroupService {


    @Autowired
    private InspectPlanUserGroupMapper inspectPlanUserGroupMapper;

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

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

    @Override
    public void deleteAll(InspectPlanUserGroup inspectPlanUserGroup) {
        QueryWrapper<InspectPlanUserGroup> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(inspectPlanUserGroup);
        super.remove(queryWrapper);
    }


}