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.RobotMaxSpeedPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.remote.RobotMaxSpeedDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 远遥车辆最大速度 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RobotMaxSpeedMapper extends BaseMapperX<RobotMaxSpeedDO> {

    default PageResult<RobotMaxSpeedDO> selectPage(RobotMaxSpeedPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotMaxSpeedDO>()
                .eqIfPresent(RobotMaxSpeedDO::getPositionMapId, reqVO.getPositionMapId())
                .eqIfPresent(RobotMaxSpeedDO::getMaxSpeed, reqVO.getMaxSpeed())
                .betweenIfPresent(RobotMaxSpeedDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotMaxSpeedDO::getId));
    }

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

    /**
     * 根据车辆编号删除
     * @param robotNo
     */
    void deleteByRobotNo(@Param("robotNo") String robotNo);
}