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

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.tdparams.vo.IotTdParamsPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.tdparams.IotTdParamsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 设备模型参数 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotTdParamsMapper extends BaseMapperX<IotTdParamsDO> {

    default PageResult<IotTdParamsDO> selectPage(IotTdParamsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotTdParamsDO>()
                .eqIfPresent(IotTdParamsDO::getDeviceId, reqVO.getDeviceId())
                .likeIfPresent(IotTdParamsDO::getDeviceName, reqVO.getDeviceName())
                .eqIfPresent(IotTdParamsDO::getYfCode, reqVO.getYfCode())
                .eqIfPresent(IotTdParamsDO::getDeviceCode, reqVO.getDeviceCode())
                .eqIfPresent(IotTdParamsDO::getIdentifier, reqVO.getIdentifier())
                .likeIfPresent(IotTdParamsDO::getModelName, reqVO.getModelName())
                .eqIfPresent(IotTdParamsDO::getModelOrder, reqVO.getModelOrder())
                .betweenIfPresent(IotTdParamsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotTdParamsDO::getId));
    }

}
