package com.foreverwin.mesnac.anomaly.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.anomaly.model.AbnormalNcCode;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalNcCodeMapper;
import com.foreverwin.mesnac.anomaly.service.AbnormalNcCodeService;
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 robert
 * @since 2021-07-01
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AbnormalNcCodeServiceImpl extends ServiceImpl<AbnormalNcCodeMapper, AbnormalNcCode> implements AbnormalNcCodeService {


    @Autowired
    private AbnormalNcCodeMapper abnormalNcCodeMapper;

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

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


}