package com.foreverwin.mesnac.meapi.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.meapi.model.NcGroup;
import com.foreverwin.mesnac.meapi.mapper.NcGroupMapper;
import com.foreverwin.mesnac.meapi.service.NcGroupService;
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-06-23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class NcGroupServiceImpl extends ServiceImpl<NcGroupMapper, NcGroup> implements NcGroupService {


    @Autowired
    private NcGroupMapper ncGroupMapper;

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

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


}