package cn.iocoder.yudao.module.server.dal.mysql.reverseproxy;

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

/**
 * 反向代理配置 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ReverseProxyMapper extends BaseMapperX<ReverseProxyDO> {

    default PageResult<ReverseProxyDO> selectPage(ReverseProxyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReverseProxyDO>()
                .eqIfPresent(ReverseProxyDO::getWebsiteId, reqVO.getWebsiteId())
                .eqIfPresent(ReverseProxyDO::getBusinessSystem, reqVO.getBusinessSystem())
                .eqIfPresent(ReverseProxyDO::getInternalUrl, reqVO.getInternalUrl())
                .eqIfPresent(ReverseProxyDO::getExternalPath, reqVO.getExternalPath())
                .eqIfPresent(ReverseProxyDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(ReverseProxyDO::getProxyDate, reqVO.getProxyDate())
                .eqIfPresent(ReverseProxyDO::getAttachment, reqVO.getAttachment())
                .betweenIfPresent(ReverseProxyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ReverseProxyDO::getId));
    }

}