package cn.iocoder.yudao.module.member.dal.mysql.devicewarn;

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

/**
 * 设备告警次数 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface DeviceWarnMapper extends BaseMapperX<DeviceWarnDO> {

    default PageResult<DeviceWarnDO> selectPage(DeviceWarnPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceWarnDO>()
                .eqIfPresent(DeviceWarnDO::getDeviceSn, reqVO.getDeviceSn())
                .eqIfPresent(DeviceWarnDO::getStoreId, reqVO.getStoreId())
                .eqIfPresent(DeviceWarnDO::getWarnNum, reqVO.getWarnNum())
                .betweenIfPresent(DeviceWarnDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceWarnDO::getId));
    }

}