package io.renren.modules.admin.service.impl;


import org.springframework.stereotype.Service;

import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.admin.dao.AttendersDao;
import io.renren.modules.admin.entity.AttendersEntity;
import io.renren.modules.admin.service.AttendersService;

@Service("attendersService")
public class AttendersServiceImpl extends ServiceImpl<AttendersDao, AttendersEntity> implements AttendersService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<AttendersEntity> page = this.page(
                new Query<AttendersEntity>().getPage(params),
                new QueryWrapper<AttendersEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public AttendersEntity getByMMId(Long memberId, Long meetingId) {
        return this.getOne(new QueryWrapper<AttendersEntity>().eq("member_id", memberId).eq("meeting_id",meetingId));
    }

}