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

/**
 * 远遥设备信息 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RemoteControllerInformationMapper extends BaseMapperX<RemoteControllerInformationDO> {

    default PageResult<RemoteControllerInformationDO> selectPage(RemoteControllerInformationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RemoteControllerInformationDO>()
                .eqIfPresent(RemoteControllerInformationDO::getRemoteIp, reqVO.getRemoteIp())
                .eqIfPresent(RemoteControllerInformationDO::getRobotNo, reqVO.getRobotNo())
                .eqIfPresent(RemoteControllerInformationDO::getRemoteMode, reqVO.getRemoteMode())
                .eqIfPresent(RemoteControllerInformationDO::getCollaborativeControl, reqVO.getCollaborativeControl())
                .eqIfPresent(RemoteControllerInformationDO::getRemoteMsg, reqVO.getRemoteMsg())
                .betweenIfPresent(RemoteControllerInformationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RemoteControllerInformationDO::getId));
    }

    /**
     * 获取远遥的车辆编号
     * @return
     */
    List<String> getRemoteControllerRobotNos();

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

}