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

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.devicegroup.IotDeviceGroupDetailPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.devicegroup.IotDeviceGroupDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * PMS成套明细 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotDeviceGroupDetailMapper extends BaseMapperX<IotDeviceGroupDetailDO> {

    default PageResult<IotDeviceGroupDetailDO> selectPage(IotDeviceGroupDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceGroupDetailDO>()
                .eqIfPresent(IotDeviceGroupDetailDO::getGroupId, reqVO.getGroupId())
                .eqIfPresent(IotDeviceGroupDetailDO::getDeviceId, reqVO.getDeviceId())
                .likeIfPresent(IotDeviceGroupDetailDO::getDeviceName, reqVO.getDeviceName())
                .eqIfPresent(IotDeviceGroupDetailDO::getDeviceCode, reqVO.getDeviceCode())
                .eqIfPresent(IotDeviceGroupDetailDO::getIfMaster, reqVO.getIfMaster())
                .eqIfPresent(IotDeviceGroupDetailDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotDeviceGroupDetailDO::getDeptId, reqVO.getDeptId())
                .betweenIfPresent(IotDeviceGroupDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotDeviceGroupDetailDO::getIfMaster));
    }

}
