package cn.iocoder.yudao.module.system.dal.mysql.agreement;

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

/**
 * 平台协议 Mapper
 *
 * @author dp
 */
@Mapper
public interface AgreementMapper extends BaseMapperX<AgreementDO> {

    default PageResult<AgreementDO> selectPage(AgreementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AgreementDO>()
                .eqIfPresent(AgreementDO::getType, reqVO.getType())
                .eqIfPresent(AgreementDO::getPath, reqVO.getPath())
                .eqIfPresent(AgreementDO::getContent, reqVO.getContent())
                .orderByDesc(AgreementDO::getId));
    }

}