package com.cy.guoyan.admin.module.guoyan.dal.mysql.researchtopicinfo;

import java.util.*;

import com.cy.guoyan.admin.framework.common.pojo.PageResult;
import com.cy.guoyan.admin.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cy.guoyan.admin.framework.mybatis.core.mapper.BaseMapperX;
import com.cy.guoyan.admin.module.guoyan.dal.dataobject.researchtopicinfo.ResearchTopicInfoDO;
import org.apache.ibatis.annotations.Mapper;
import com.cy.guoyan.admin.module.guoyan.controller.admin.researchtopicinfo.vo.*;

/**
 * 国资研究专题信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ResearchTopicInfoMapper extends BaseMapperX<ResearchTopicInfoDO> {

    default PageResult<ResearchTopicInfoDO> selectPage(ResearchTopicInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResearchTopicInfoDO>()
                .eqIfPresent(ResearchTopicInfoDO::getOid, reqVO.getOid())
                .eqIfPresent(ResearchTopicInfoDO::getInfoNumber, reqVO.getInfoNumber())
                .likeIfPresent(ResearchTopicInfoDO::getTitle, reqVO.getTitle())
                .eqIfPresent(ResearchTopicInfoDO::getAuthor, reqVO.getAuthor())
                .eqIfPresent(ResearchTopicInfoDO::getAuthorOrg, reqVO.getAuthorOrg())
                .betweenIfPresent(ResearchTopicInfoDO::getOriginalPubDate, reqVO.getOriginalPubDate())
                .eqIfPresent(ResearchTopicInfoDO::getOriginalPubYear, reqVO.getOriginalPubYear())
                .eqIfPresent(ResearchTopicInfoDO::getKeywords, reqVO.getKeywords())
                .eqIfPresent(ResearchTopicInfoDO::getSummary, reqVO.getSummary())
                .eqIfPresent(ResearchTopicInfoDO::getContent, reqVO.getContent())
                .eqIfPresent(ResearchTopicInfoDO::getSource, reqVO.getSource())
                .eqIfPresent(ResearchTopicInfoDO::getTopicCategory1, reqVO.getTopicCategory1())
                .eqIfPresent(ResearchTopicInfoDO::getTopicCategory, reqVO.getTopicCategory())
                .eqIfPresent(ResearchTopicInfoDO::getTopicCategoryCode, reqVO.getTopicCategoryCode())
                .eqIfPresent(ResearchTopicInfoDO::getSourceCategory, reqVO.getSourceCategory())
                .eqIfPresent(ResearchTopicInfoDO::getSourceCategoryCode, reqVO.getSourceCategoryCode())
                .betweenIfPresent(ResearchTopicInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ResearchTopicInfoDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ResearchTopicInfoDO::getAuditStatus, reqVO.getAuditStatus())
                .eqIfPresent(ResearchTopicInfoDO::getAuditor, reqVO.getAuditor())
                .eqIfPresent(ResearchTopicInfoDO::getImage, reqVO.getImage())
                .betweenIfPresent(ResearchTopicInfoDO::getImageDate, reqVO.getImageDate())
                .eqIfPresent(ResearchTopicInfoDO::getImported, reqVO.getImported())
                .betweenIfPresent(ResearchTopicInfoDO::getAuditTime, reqVO.getAuditTime())
                .eqIfPresent(ResearchTopicInfoDO::getViewCount, reqVO.getViewCount())
                .orderByDesc(ResearchTopicInfoDO::getId));
    }

}