package cn.iocoder.yudao.module.pms.dal.mysql.iotdevicemaxrunlog;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pms.controller.admin.iotdevicemaxrunlog.vo.IotDeviceMaxRunLogPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicemaxrunlog.IotDeviceMaxRunLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 设备运行数据记录最大值 Mapper
 *
 * @author ruiqi
 */
@Mapper
public interface IotDeviceMaxRunLogMapper extends BaseMapperX<IotDeviceMaxRunLogDO> {

    default PageResult<IotDeviceMaxRunLogDO> selectPage(IotDeviceMaxRunLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceMaxRunLogDO>()
                .eqIfPresent(IotDeviceMaxRunLogDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotDeviceMaxRunLogDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(IotDeviceMaxRunLogDO::getDeviceCode, reqVO.getDeviceCode())
                .eqIfPresent(IotDeviceMaxRunLogDO::getDeviceComp, reqVO.getDeviceComp())
                .eqIfPresent(IotDeviceMaxRunLogDO::getPointCode, reqVO.getPointCode())
                .likeIfPresent(IotDeviceMaxRunLogDO::getPointName, reqVO.getPointName())
                .eqIfPresent(IotDeviceMaxRunLogDO::getType, reqVO.getType())
                .eqIfPresent(IotDeviceMaxRunLogDO::getValue, reqVO.getValue())
                .betweenIfPresent(IotDeviceMaxRunLogDO::getTime, reqVO.getTime())
                .betweenIfPresent(IotDeviceMaxRunLogDO::getDailyRunTime, reqVO.getDailyRunTime())
                .betweenIfPresent(IotDeviceMaxRunLogDO::getTotalRunTime, reqVO.getTotalRunTime())
                .eqIfPresent(IotDeviceMaxRunLogDO::getDailyMileage, reqVO.getDailyMileage())
                .eqIfPresent(IotDeviceMaxRunLogDO::getTotalMileage, reqVO.getTotalMileage())
                .eqIfPresent(IotDeviceMaxRunLogDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(IotDeviceMaxRunLogDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(IotDeviceMaxRunLogDO::getFillContent, reqVO.getFillContent())
                .eqIfPresent(IotDeviceMaxRunLogDO::getSumId, reqVO.getSumId())
                .eqIfPresent(IotDeviceMaxRunLogDO::getIsSum, reqVO.getIsSum())
                .orderByDesc(IotDeviceMaxRunLogDO::getId));
    }

}