package cn.iocoder.yudao.module.pay.dal.mysql.wxprofitsharingreturn;

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

/**
 * 微信分账回退 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface WxProfitsharingReturnMapper extends BaseMapperX<WxProfitsharingReturnDO> {

    default PageResult<WxProfitsharingReturnDO> selectPage(WxProfitsharingReturnPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WxProfitsharingReturnDO>()
                .eqIfPresent(WxProfitsharingReturnDO::getPayWxProfitsharingId, reqVO.getPayWxProfitsharingId())
                .eqIfPresent(WxProfitsharingReturnDO::getOutReturnNo, reqVO.getOutReturnNo())
                .eqIfPresent(WxProfitsharingReturnDO::getReturnId, reqVO.getReturnId())
                .eqIfPresent(WxProfitsharingReturnDO::getReturnMchid, reqVO.getReturnMchid())
                .eqIfPresent(WxProfitsharingReturnDO::getTotalPrice, reqVO.getTotalPrice())
                .eqIfPresent(WxProfitsharingReturnDO::getAmount, reqVO.getAmount())
                .eqIfPresent(WxProfitsharingReturnDO::getDescription, reqVO.getDescription())
                .eqIfPresent(WxProfitsharingReturnDO::getResult, reqVO.getResult())
                .eqIfPresent(WxProfitsharingReturnDO::getFailReason, reqVO.getFailReason())
                .betweenIfPresent(WxProfitsharingReturnDO::getDCreateTime, reqVO.getDCreateTime())
                .betweenIfPresent(WxProfitsharingReturnDO::getDFinishTime, reqVO.getDFinishTime())
                .betweenIfPresent(WxProfitsharingReturnDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WxProfitsharingReturnDO::getId));
    }

}