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

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

/**
 * 机器人告警信息 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RobotWarnMsgMapper extends BaseMapperX<RobotWarnMsgDO> {

    default PageResult<RobotWarnMsgDO> selectPage(RobotWarnMsgPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotWarnMsgDO>()
                .eqIfPresent(RobotWarnMsgDO::getRobotNo, reqVO.getRobotNo())
                .eqIfPresent(RobotWarnMsgDO::getWarnLevel, reqVO.getWarnLevel())
                .likeIfPresent(RobotWarnMsgDO::getWarnCode, reqVO.getWarnCode())
                .eqIfPresent(RobotWarnMsgDO::getWarnMsg, reqVO.getWarnMsg())
                .eqIfPresent(RobotWarnMsgDO::getWarnSolve, reqVO.getWarnSolve())
                .betweenIfPresent(RobotWarnMsgDO::getSolveTime, reqVO.getSolveTime())
                .betweenIfPresent(RobotWarnMsgDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotWarnMsgDO::getId));
    }

}