package cn.newfeifan.mall.module.distri.dal.mysql.applicationforwithdrawal;


import cn.newfeifan.mall.framework.common.pojo.PageResult;
import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawal.ApplicationForWithdrawalDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo.*;

/**
 * 提现申请记录 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ApplicationForWithdrawalMapper extends BaseMapperX<ApplicationForWithdrawalDO> {

    default PageResult<ApplicationForWithdrawalDO> selectPage(AppApplicationForWithdrawalPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ApplicationForWithdrawalDO>()
                .eqIfPresent(ApplicationForWithdrawalDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ApplicationForWithdrawalDO::getWithdrawalType, reqVO.getWithdrawalType())
                .eqIfPresent(ApplicationForWithdrawalDO::getAmount, reqVO.getAmount())
                .eqIfPresent(ApplicationForWithdrawalDO::getWithdrawalAccount, reqVO.getWithdrawalAccount())
                .eqIfPresent(ApplicationForWithdrawalDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ApplicationForWithdrawalDO::getApplicationForWithdrawalChannelId, reqVO.getApplicationForWithdrawalChannelId())
                .betweenIfPresent(ApplicationForWithdrawalDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ApplicationForWithdrawalDO::getId));
    }

}