package cn.iocoder.yudao.module.server.dal.mysql.interviewarticle;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.server.dal.dataobject.interviewarticle.InterviewArticleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.server.controller.admin.interviewarticle.vo.*;

/**
 * 访谈稿 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface InterviewArticleMapper extends BaseMapperX<InterviewArticleDO> {

    default PageResult<InterviewArticleDO> selectPage(InterviewArticlePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InterviewArticleDO>()
                .eqIfPresent(InterviewArticleDO::getTitle, reqVO.getTitle())
                .eqIfPresent(InterviewArticleDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(InterviewArticleDO::getPubtime, reqVO.getPubtime())
                .eqIfPresent(InterviewArticleDO::getDepartmentId, reqVO.getDepartmentId())
                .eqIfPresent(InterviewArticleDO::getReportStatus, reqVO.getReportStatus())
                .eqIfPresent(InterviewArticleDO::getReportRemark, reqVO.getReportRemark())
                .eqIfPresent(InterviewArticleDO::getAttachment, reqVO.getAttachment())
                .betweenIfPresent(InterviewArticleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InterviewArticleDO::getId));
    }

}