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


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.consumptiontransferlog.ConsumptionTransferLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog.vo.*;

/**
 * 消费分转让记录 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ConsumptionTransferLogMapper extends BaseMapperX<ConsumptionTransferLogDO> {

    default PageResult<ConsumptionTransferLogDO> selectPage(ConsumptionTransferLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConsumptionTransferLogDO>()
                .eqIfPresent(ConsumptionTransferLogDO::getTransferUserId, reqVO.getTransferUserId())
                .likeIfPresent(ConsumptionTransferLogDO::getTransferUserName, reqVO.getTransferUserName())
                .eqIfPresent(ConsumptionTransferLogDO::getConsumptionPoints, reqVO.getConsumptionPoints())
                .eqIfPresent(ConsumptionTransferLogDO::getRecipientUserId, reqVO.getRecipientUserId())
                .likeIfPresent(ConsumptionTransferLogDO::getRecipientUserName, reqVO.getRecipientUserName())
                .betweenIfPresent(ConsumptionTransferLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ConsumptionTransferLogDO::getId));
    }

}