package cn.iocoder.yudao.module.member.dal.mysql.rechargeamount;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.RechargeAmountPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount.RechargeAmountDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 充值金额配置 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface RechargeAmountMapper extends BaseMapperX<RechargeAmountDO> {

    default PageResult<RechargeAmountDO> selectPage(RechargeAmountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RechargeAmountDO>()
                .eqIfPresent(RechargeAmountDO::getMoney, reqVO.getMoney())
                .eqIfPresent(RechargeAmountDO::getDonateMoney, reqVO.getDonateMoney())
                .eqIfPresent(RechargeAmountDO::getStatus, reqVO.getStatus())
                .likeIfPresent(RechargeAmountDO::getName,reqVO.getName())
                .betweenIfPresent(RechargeAmountDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RechargeAmountDO::getId));
    }

}