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

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

/**
 * 车辆行走路线耗时记录 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RobotTaskLineTimeConsumingMapper extends BaseMapperX<RobotTaskLineTimeConsumingDO> {

    default PageResult<RobotTaskLineTimeConsumingDO> selectPage(RobotTaskLineTimeConsumingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotTaskLineTimeConsumingDO>()
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getTaskNo, reqVO.getTaskNo())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getTaskDetailId, reqVO.getTaskDetailId())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getTotalDistance, reqVO.getTotalDistance())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getLineType, reqVO.getLineType())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getFromSortNum, reqVO.getFromSortNum())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getToSortNum, reqVO.getToSortNum())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getTotalTimeConsuming, reqVO.getTotalTimeConsuming())
                .eqIfPresent(RobotTaskLineTimeConsumingDO::getAverageSpeed, reqVO.getAverageSpeed())
                .betweenIfPresent(RobotTaskLineTimeConsumingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotTaskLineTimeConsumingDO::getId));
    }

}