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

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.refund.vo.RefundPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.refund.RefundDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 退款审核 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface IntegralRefundMapper extends BaseMapperX<RefundDO> {

    default PageResult<RefundDO> selectPage(RefundPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RefundDO>()
                .eqIfPresent(RefundDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(RefundDO::getMoney, reqVO.getMoney())
                .eqIfPresent(RefundDO::getStatus, reqVO.getStatus())
                .eqIfPresent(RefundDO::getUserId, reqVO.getUserId())
                .eqIfPresent(RefundDO::getMobile, reqVO.getMobile())
                .likeIfPresent(RefundDO::getUserName, reqVO.getUserName())
                .betweenIfPresent(RefundDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RefundDO::getId));
    }

}