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

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 org.apache.ibatis.annotations.Mapper;

import cn.iocoder.yudao.module.system.controller.admin.wait.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.wait.MoveToWaitDO;
import org.apache.ibatis.annotations.Param;

/**
 * 车辆前往等待点记录 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface MoveToWaitMapper extends BaseMapperX<MoveToWaitDO> {

    default PageResult<MoveToWaitDO> selectPage(MoveToWaitPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoveToWaitDO>()
                .eqIfPresent(MoveToWaitDO::getRobotNo, reqVO.getRobotNo())
                .eqIfPresent(MoveToWaitDO::getPositionMapItemId, reqVO.getPositionMapItemId())
                .eqIfPresent(MoveToWaitDO::getWaitStatus, reqVO.getWaitStatus())
                .betweenIfPresent(MoveToWaitDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoveToWaitDO::getId));
    }

    /**
     * 更新车辆编号
     * @param oldRobotNo
     * @param newRobotNo
     */
    void updateRobotNo(@Param("oldRobotNo") String oldRobotNo, @Param("newRobotNo") String newRobotNo);
}