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.PaperRequireDao;
import io.renren.modules.admin.entity.PaperRequireEntity;
import io.renren.modules.admin.service.PaperRequireService;


@Service("paperRequireService")
public class PaperRequireServiceImpl extends ServiceImpl<PaperRequireDao, PaperRequireEntity> implements PaperRequireService {

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

        return new PageUtils(page);
    }

    @Override
    public PaperRequireEntity getOneByMeetingId(Long meetingId) {
        return this.getOne(new QueryWrapper<PaperRequireEntity>().eq("meeting_id", meetingId));
    }
}