package cn.iocoder.yudao.module.pms.dal.mysql.maintain.record;

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.maintain.record.vo.IotJdRecordPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.record.IotJdRecordDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 基地维修记录 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotJdRecordMapper extends BaseMapperX<IotJdRecordDO> {

    default PageResult<IotJdRecordDO> selectPage(IotJdRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotJdRecordDO>()
                .eqIfPresent(IotJdRecordDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(IotJdRecordDO::getRepairId, reqVO.getRepairId())
                .betweenIfPresent(IotJdRecordDO::getRepairTime, reqVO.getRepairTime())
                .eqIfPresent(IotJdRecordDO::getRepairContent, reqVO.getRepairContent())
                .eqIfPresent(IotJdRecordDO::getPic, reqVO.getPic())
                .eqIfPresent(IotJdRecordDO::getSolution, reqVO.getSolution())
                .eqIfPresent(IotJdRecordDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(IotJdRecordDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(IotJdRecordDO::getDeviceName, reqVO.getDeviceName())
                .orderByDesc(IotJdRecordDO::getId));
    }

}
