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

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.expertinfo.ExpertInfoDO;
import org.apache.ibatis.annotations.Mapper;
import com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo.*;

/**
 * 专家信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ExpertInfoMapper extends BaseMapperX<ExpertInfoDO> {

    default PageResult<ExpertInfoDO> selectPage(ExpertInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpertInfoDO>()
                .likeIfPresent(ExpertInfoDO::getExpertName, reqVO.getExpertName())
                .eqIfPresent(ExpertInfoDO::getGender, reqVO.getGender())
                .eqIfPresent(ExpertInfoDO::getPoliticalStatus, reqVO.getPoliticalStatus())
                .eqIfPresent(ExpertInfoDO::getPhone, reqVO.getPhone())
                .eqIfPresent(ExpertInfoDO::getJobStatus, reqVO.getJobStatus())
                .eqIfPresent(ExpertInfoDO::getEthnicity, reqVO.getEthnicity())
                .eqIfPresent(ExpertInfoDO::getBirthplace, reqVO.getBirthplace())
                .eqIfPresent(ExpertInfoDO::getEmail, reqVO.getEmail())
                .betweenIfPresent(ExpertInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExpertInfoDO::getId));
    }

}