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

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.pms.controller.admin.information.vo.IotInformationDbPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.information.IotInformationDbDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 故障知识库 Mapper
 *
 * @author 李鹏辉
 */
@Mapper
public interface IotInformationDbMapper extends BaseMapperX<IotInformationDbDO> {

    default PageResult<IotInformationDbDO> selectPage(IotInformationDbPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotInformationDbDO>()
                .eqIfPresent(IotInformationDbDO::getDeviceType, reqVO.getDeviceType())
                .eqIfPresent(IotInformationDbDO::getFailureInfluence, reqVO.getFailureInfluence())
                .eqIfPresent(IotInformationDbDO::getFailureSystem, reqVO.getFailureSystem())
                .eqIfPresent(IotInformationDbDO::getDescription, reqVO.getDescription())
                .eqIfPresent(IotInformationDbDO::getSolutions, reqVO.getSolutions())
                .eqIfPresent(IotInformationDbDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(IotInformationDbDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(IotInformationDbDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .eqIfPresent(IotInformationDbDO::getAuditStatus, reqVO.getAuditStatus())
                .orderByDesc(IotInformationDbDO::getId));
    }

}
