package cn.iocoder.yudao.module.pms.dal.mysql.yanfan.media;

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.yanfan.media.vo.YfMediaServerPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.yanfan.media.YfMediaServerDO;
import liquibase.pro.packaged.Y;
import org.apache.ibatis.annotations.Mapper;

/**
 * yf流媒体服务器配置 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface YfMediaServerMapper extends BaseMapperX<YfMediaServerDO> {
    List<YfMediaServerDO> selectMediaServerBytenantId(Long tenantId);
    default PageResult<YfMediaServerDO> selectPage(YfMediaServerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<YfMediaServerDO>()
                .eqIfPresent(YfMediaServerDO::getServerId, reqVO.getServerId())
                .likeIfPresent(YfMediaServerDO::getTenantName, reqVO.getTenantName())
                .eqIfPresent(YfMediaServerDO::getEnabled, reqVO.getEnabled())
                .eqIfPresent(YfMediaServerDO::getProtocol, reqVO.getProtocol())
                .eqIfPresent(YfMediaServerDO::getIp, reqVO.getIp())
                .eqIfPresent(YfMediaServerDO::getDomain, reqVO.getDomain())
                .eqIfPresent(YfMediaServerDO::getHookurl, reqVO.getHookurl())
                .eqIfPresent(YfMediaServerDO::getSecret, reqVO.getSecret())
                .eqIfPresent(YfMediaServerDO::getPortHttp, reqVO.getPortHttp())
                .eqIfPresent(YfMediaServerDO::getPortHttps, reqVO.getPortHttps())
                .eqIfPresent(YfMediaServerDO::getPortRtmp, reqVO.getPortRtmp())
                .eqIfPresent(YfMediaServerDO::getPortRtsp, reqVO.getPortRtsp())
                .eqIfPresent(YfMediaServerDO::getRtpProxyPort, reqVO.getRtpProxyPort())
                .eqIfPresent(YfMediaServerDO::getRtpEnable, reqVO.getRtpEnable())
                .eqIfPresent(YfMediaServerDO::getRtpPortRange, reqVO.getRtpPortRange())
                .eqIfPresent(YfMediaServerDO::getRecordPort, reqVO.getRecordPort())
                .eqIfPresent(YfMediaServerDO::getAutoConfig, reqVO.getAutoConfig())
                .eqIfPresent(YfMediaServerDO::getStatus, reqVO.getStatus())
                .eqIfPresent(YfMediaServerDO::getDelFlag, reqVO.getDelFlag())
                .eqIfPresent(YfMediaServerDO::getCreateBy, reqVO.getCreateBy())
                .eqIfPresent(YfMediaServerDO::getUpdateBy, reqVO.getUpdateBy())
                .eqIfPresent(YfMediaServerDO::getRemark, reqVO.getRemark())
                .eqIfPresent(YfMediaServerDO::getPortWs, reqVO.getPortWs())
                .betweenIfPresent(YfMediaServerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(YfMediaServerDO::getId));
    }

}
