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.RobotWarnCodeMappingPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.robot.warn.RobotWarnCodeMappingVO;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotWarnCodeMappingDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 机器人告警码值映射 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface RobotWarnCodeMappingMapper extends BaseMapperX<RobotWarnCodeMappingDO> {

    default PageResult<RobotWarnCodeMappingDO> selectPage(RobotWarnCodeMappingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotWarnCodeMappingDO>()
                .eqIfPresent(RobotWarnCodeMappingDO::getWarnLevel, reqVO.getWarnLevel())
                .eqIfPresent(RobotWarnCodeMappingDO::getDoTask, reqVO.getDoTask())
                .eqIfPresent(RobotWarnCodeMappingDO::getWarnCode, reqVO.getWarnCode())
                .eqIfPresent(RobotWarnCodeMappingDO::getWarnMsg, reqVO.getWarnMsg())
                .eqIfPresent(RobotWarnCodeMappingDO::getWarnSolve, reqVO.getWarnSolve())
                .betweenIfPresent(RobotWarnCodeMappingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotWarnCodeMappingDO::getId));
    }

    List<RobotWarnCodeMappingVO> getAllWarnCodeList();
}