package cn.iocoder.yudao.module.bpm.dal.mysql.oa.conversion;

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.bpm.controller.admin.oa.conversion.vo.OaConversionPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.conversion.OaConversionDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 转正流程信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OaConversionMapper extends BaseMapperX<OaConversionDO> {

    default PageResult<OaConversionDO> selectPage(OaConversionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OaConversionDO>()
                .eqIfPresent(OaConversionDO::getEmployeeName, reqVO.getEmployeeName())
                .eqIfPresent(OaConversionDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(OaConversionDO::getPosition, reqVO.getPosition())
                .likeIfPresent(OaConversionDO::getEmployeePhone, reqVO.getEmployeePhone())
                .betweenIfPresent(OaConversionDO::getConversionDate, reqVO.getConversionDate())
                .eqIfPresent(OaConversionDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
                .betweenIfPresent(OaConversionDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OaConversionDO::getAuditStatus, reqVO.getAuditStatus())
                .orderByDesc(OaConversionDO::getId));
    }

}