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.dto.RobotWalkingDistanceDTO;
import cn.iocoder.yudao.module.system.controller.admin.log.vo.RobotTaskTimeConsumingPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.log.RobotTaskTimeConsumingDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 车辆任务行程耗时 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RobotTaskTimeConsumingMapper extends BaseMapperX<RobotTaskTimeConsumingDO> {

    default PageResult<RobotTaskTimeConsumingDO> selectPage(RobotTaskTimeConsumingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotTaskTimeConsumingDO>()
                .eqIfPresent(RobotTaskTimeConsumingDO::getTaskNo, reqVO.getTaskNo())
                .eqIfPresent(RobotTaskTimeConsumingDO::getTaskDetailId, reqVO.getTaskDetailId())
                .eqIfPresent(RobotTaskTimeConsumingDO::getFromLocationStorey, reqVO.getFromLocationStorey())
                .eqIfPresent(RobotTaskTimeConsumingDO::getToLocationStorey, reqVO.getToLocationStorey())
                .eqIfPresent(RobotTaskTimeConsumingDO::getFromLocationNo, reqVO.getFromLocationNo())
                .eqIfPresent(RobotTaskTimeConsumingDO::getToLocationNo, reqVO.getToLocationNo())
                .eqIfPresent(RobotTaskTimeConsumingDO::getTotalDistance, reqVO.getTotalDistance())
                .eqIfPresent(RobotTaskTimeConsumingDO::getTotalTimeConsuming, reqVO.getTotalTimeConsuming())
                .eqIfPresent(RobotTaskTimeConsumingDO::getCheckDistance, reqVO.getCheckDistance())
                .eqIfPresent(RobotTaskTimeConsumingDO::getCheckTimeConsuming, reqVO.getCheckTimeConsuming())
                .eqIfPresent(RobotTaskTimeConsumingDO::getPickTimeConsuming, reqVO.getPickTimeConsuming())
                .eqIfPresent(RobotTaskTimeConsumingDO::getDropTimeConsuming, reqVO.getDropTimeConsuming())
                .betweenIfPresent(RobotTaskTimeConsumingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotTaskTimeConsumingDO::getId));
    }

    void updateEntity(RobotTaskTimeConsumingDO data);
}