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

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.renew.vo.OaRenewPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.renew.OaRenewDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 合同续签流程信息 Mapper
 *
 * @author dp
 */
@Mapper
public interface OaRenewMapper extends BaseMapperX<OaRenewDO> {

    default PageResult<OaRenewDO> selectPage(OaRenewPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OaRenewDO>()
                .likeIfPresent(OaRenewDO::getEmployeeName, reqVO.getEmployeeName())
                .likeIfPresent(OaRenewDO::getEmployeePhone, reqVO.getEmployeePhone())
                .eqIfPresent(OaRenewDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(OaRenewDO::getPostId, reqVO.getPostId())
                .betweenIfPresent(OaRenewDO::getRenewContractStartDate, reqVO.getRenewContractStartDate())
                .betweenIfPresent(OaRenewDO::getRenewContractEndDate, reqVO.getRenewContractEndDate())
                .eqIfPresent(OaRenewDO::getAuditStatus, reqVO.getAuditStatus())
                .likeIfPresent(OaRenewDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
                .betweenIfPresent(OaRenewDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OaRenewDO::getId));
    }

}