package cn.iocoder.yudao.module.product.dal.mysql.deviceoperatelog;

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.product.dal.dataobject.deviceoperatelog.DeviceOperateLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.deviceoperatelog.vo.*;

/**
 * 设备操作日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface DeviceOperateLogMapper extends BaseMapperX<DeviceOperateLogDO> {

    default PageResult<DeviceOperateLogDO> selectPage(DeviceOperateLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceOperateLogDO>()
                .eqIfPresent(DeviceOperateLogDO::getDeviceInfoId, reqVO.getDeviceInfoId())
                .likeIfPresent(DeviceOperateLogDO::getDeviceName, reqVO.getDeviceName())
                .eqIfPresent(DeviceOperateLogDO::getLandId, reqVO.getLandId())
                .eqIfPresent(DeviceOperateLogDO::getOperateDetail, reqVO.getOperateDetail())
                .betweenIfPresent(DeviceOperateLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceOperateLogDO::getId));
    }

}
