package cn.iocoder.yudao.module.pms.dal.mysql.yanfan.sip.relation;

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.yanfan.sip.relation.vo.IotYfSipRelationPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.yanfan.sip.relation.IotYfSipRelationDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * yf监控设备关联 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotYfSipRelationMapper extends BaseMapperX<IotYfSipRelationDO> {

    default PageResult<IotYfSipRelationDO> selectPage(IotYfSipRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotYfSipRelationDO>()
                .eqIfPresent(IotYfSipRelationDO::getChannelId, reqVO.getChannelId())
                .eqIfPresent(IotYfSipRelationDO::getReDeviceId, reqVO.getReDeviceId())
                .eqIfPresent(IotYfSipRelationDO::getReSceneModelId, reqVO.getReSceneModelId())
                .eqIfPresent(IotYfSipRelationDO::getCreateBy, reqVO.getCreateBy())
                .eqIfPresent(IotYfSipRelationDO::getUpdateBy, reqVO.getUpdateBy())
                .eqIfPresent(IotYfSipRelationDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(IotYfSipRelationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotYfSipRelationDO::getId));
    }

    List<IotYfSipRelationDO> selectSipRelationList(IotYfSipRelationPageReqVO sipRelation);
}
