package cn.iocoder.yudao.module.product.dal.mysql.slavedevice;

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.product.dal.dataobject.slavedevice.SlaveDeviceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.slavedevice.vo.*;

/**
 * 从(子)设备信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SlaveDeviceMapper extends BaseMapperX<SlaveDeviceDO> {

    default PageResult<SlaveDeviceDO> selectPage(SlaveDevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SlaveDeviceDO>()
                .likeIfPresent(SlaveDeviceDO::getDeviceName, reqVO.getDeviceName())
                .eqIfPresent(SlaveDeviceDO::getEnvType, reqVO.getEnvType())
                .eqIfPresent(SlaveDeviceDO::getBelongBusinessId, reqVO.getBelongBusinessId())
                .orderByDesc(SlaveDeviceDO::getId));
    }

}
