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

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.robot.vo.RobotTaskAutoMovePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskAutoMoveDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 机器人自动移库 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RobotTaskAutoMoveMapper extends BaseMapperX<RobotTaskAutoMoveDO> {

    default PageResult<RobotTaskAutoMoveDO> selectPage(RobotTaskAutoMovePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotTaskAutoMoveDO>()
                .eqIfPresent(RobotTaskAutoMoveDO::getRobotTaskId, reqVO.getRobotTaskId())
                .eqIfPresent(RobotTaskAutoMoveDO::getRobotTaskDetailId, reqVO.getRobotTaskDetailId())
                .eqIfPresent(RobotTaskAutoMoveDO::getFromLocationNo, reqVO.getFromLocationNo())
                .eqIfPresent(RobotTaskAutoMoveDO::getFromLocationId, reqVO.getFromLocationId())
                .eqIfPresent(RobotTaskAutoMoveDO::getToLocationNo, reqVO.getToLocationNo())
                .eqIfPresent(RobotTaskAutoMoveDO::getToLocationId, reqVO.getToLocationId())
                .eqIfPresent(RobotTaskAutoMoveDO::getTaskStatus, reqVO.getTaskStatus())
                .eqIfPresent(RobotTaskAutoMoveDO::getPriority, reqVO.getPriority())
                .eqIfPresent(RobotTaskAutoMoveDO::getRobotNo, reqVO.getRobotNo())
                .eqIfPresent(RobotTaskAutoMoveDO::getTaskType, reqVO.getTaskType())
                .eqIfPresent(RobotTaskAutoMoveDO::getMoveType, reqVO.getMoveType())
                .betweenIfPresent(RobotTaskAutoMoveDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(RobotTaskAutoMoveDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(RobotTaskAutoMoveDO::getTaskAutoMoveId, reqVO.getTaskAutoMoveId())
                .betweenIfPresent(RobotTaskAutoMoveDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotTaskAutoMoveDO::getId));
    }

}