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

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

/**
 * PMS成套 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotDeviceGroupMapper extends BaseMapperX<IotDeviceGroupDO> {

    default PageResult<IotDeviceGroupDO> selectPage(IotDeviceGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceGroupDO>()
                .likeIfPresent(IotDeviceGroupDO::getName, reqVO.getName())
                .eqIfPresent(IotDeviceGroupDO::getCode, reqVO.getCode())
                .eqIfPresent(IotDeviceGroupDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotDeviceGroupDO::getDeptId, reqVO.getDeptId())
                .betweenIfPresent(IotDeviceGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotDeviceGroupDO::getId));
    }

}
