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


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

/**
 * 消费分异动日志记录 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ConsumptionErrorLogMapper extends BaseMapperX<ConsumptionErrorLogDO> {

    default PageResult<ConsumptionErrorLogDO> selectPage(ConsumptionErrorLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConsumptionErrorLogDO>()
                .eqIfPresent(ConsumptionErrorLogDO::getErrorUsersCount, reqVO.getErrorUsersCount())
                .eqIfPresent(ConsumptionErrorLogDO::getErrorConsumptionPointsTotal, reqVO.getErrorConsumptionPointsTotal())
                .betweenIfPresent(ConsumptionErrorLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ConsumptionErrorLogDO::getId));
    }

}