package cn.iocoder.yudao.module.employee.dal.mysql.employeeinfo;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.employee.controller.admin.employeeinfo.vo.EmployeeContractInfoPageReqVO;
import cn.iocoder.yudao.module.employee.dal.dataobject.employeeinfo.EmployeeContractInfoDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 员工合同信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface EmployeeContractInfoMapper extends BaseMapperX<EmployeeContractInfoDO> {

    default PageResult<EmployeeContractInfoDO> selectPage(EmployeeContractInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeContractInfoDO>()
                .eqIfPresent(EmployeeContractInfoDO::getInfoId, reqVO.getInfoId())
                .eqIfPresent(EmployeeContractInfoDO::getContractNumber, reqVO.getContractNumber())
                .eqIfPresent(EmployeeContractInfoDO::getEmployeeId, reqVO.getEmployeeId())
                .betweenIfPresent(EmployeeContractInfoDO::getContractStartDate, reqVO.getContractStartDate())
                .betweenIfPresent(EmployeeContractInfoDO::getContractEndDate, reqVO.getContractEndDate())
                .eqIfPresent(EmployeeContractInfoDO::getJobContent, reqVO.getJobContent())
                .eqIfPresent(EmployeeContractInfoDO::getContractStatus, reqVO.getContractStatus())
                .eqIfPresent(EmployeeContractInfoDO::getRemarks, reqVO.getRemarks())
                .eqIfPresent(EmployeeContractInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(EmployeeContractInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EmployeeContractInfoDO::getId));
    }

}