package cn.iocoder.yudao.module.system.dal.mysql.remote;

import java.util.*;

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.system.controller.admin.remote.vo.ControllerTaskTransferLogPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.remote.ControllerTaskTransferLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 远遥任务转移记录 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface ControllerTaskTransferLogMapper extends BaseMapperX<ControllerTaskTransferLogDO> {

    default PageResult<ControllerTaskTransferLogDO> selectPage(ControllerTaskTransferLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ControllerTaskTransferLogDO>()
                .eqIfPresent(ControllerTaskTransferLogDO::getRemoteIp, reqVO.getRemoteIp())
                .eqIfPresent(ControllerTaskTransferLogDO::getTaskDetailId, reqVO.getTaskDetailId())
                .eqIfPresent(ControllerTaskTransferLogDO::getTaskStage, reqVO.getTaskStage())
                .eqIfPresent(ControllerTaskTransferLogDO::getTaskNo, reqVO.getTaskNo())
                .eqIfPresent(ControllerTaskTransferLogDO::getRobotNo, reqVO.getRobotNo())
                .eqIfPresent(ControllerTaskTransferLogDO::getRemoteMode, reqVO.getRemoteMode())
                .eqIfPresent(ControllerTaskTransferLogDO::getTransferRobotNo, reqVO.getTransferRobotNo())
                .betweenIfPresent(ControllerTaskTransferLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ControllerTaskTransferLogDO::getId));
    }

}