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.DcGroup;
import com.foreverwin.mesnac.meapi.mapper.DcGroupMapper;
import com.foreverwin.mesnac.meapi.service.DcGroupService;
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-07-13
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DcGroupServiceImpl extends ServiceImpl<DcGroupMapper, DcGroup> implements DcGroupService {


    @Autowired
    private DcGroupMapper dcGroupMapper;

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

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


}