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.MessageType;
import com.foreverwin.mesnac.meapi.mapper.MessageTypeMapper;
import com.foreverwin.mesnac.meapi.service.MessageTypeService;
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 Philip
 * @since 2021-07-20
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MessageTypeServiceImpl extends ServiceImpl<MessageTypeMapper, MessageType> implements MessageTypeService {


    @Autowired
    private MessageTypeMapper messageTypeMapper;

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

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


}