package com.zt.plat.module.qms.business.other.dal.mapper;

import java.util.*;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.business.other.controller.vo.*;
import com.zt.plat.module.qms.business.other.dal.dataobject.OtherSystemConfigDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 第三方系统配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface OtherSystemConfigMapper extends BaseMapperX<OtherSystemConfigDO> {

    default PageResult<OtherSystemConfigDO> selectPage(OtherSystemConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OtherSystemConfigDO>()
                .eqIfPresent(OtherSystemConfigDO::getOtherSystem, reqVO.getOtherSystem())
                .eqIfPresent(OtherSystemConfigDO::getBaseUrl, reqVO.getBaseUrl())
                .eqIfPresent(OtherSystemConfigDO::getAccount, reqVO.getAccount())
                .eqIfPresent(OtherSystemConfigDO::getPassword, reqVO.getPassword())
                .eqIfPresent(OtherSystemConfigDO::getToken, reqVO.getToken())
                .betweenIfPresent(OtherSystemConfigDO::getTokenEffectiveTime, reqVO.getTokenEffectiveTime())
                .betweenIfPresent(OtherSystemConfigDO::getTokenExpirationTime, reqVO.getTokenExpirationTime())
                .eqIfPresent(OtherSystemConfigDO::getExternalConfig, reqVO.getExternalConfig())
                .eqIfPresent(OtherSystemConfigDO::getIsEnableProxy, reqVO.getIsEnableProxy())
                .eqIfPresent(OtherSystemConfigDO::getProxyHost, reqVO.getProxyHost())
                .eqIfPresent(OtherSystemConfigDO::getProxyPort, reqVO.getProxyPort())
                .eqIfPresent(OtherSystemConfigDO::getProxyUser, reqVO.getProxyUser())
                .eqIfPresent(OtherSystemConfigDO::getProxyPassword, reqVO.getProxyPassword())
                .eqIfPresent(OtherSystemConfigDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(OtherSystemConfigDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OtherSystemConfigDO::getRemark, reqVO.getRemark())
                .orderByDesc(OtherSystemConfigDO::getId));
    }

}