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


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

/**
 * 消费分异动用户 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ConsumptionErrorUserMapper extends BaseMapperX<ConsumptionErrorUserDO> {

    default PageResult<ConsumptionErrorUserDO> selectPage(ConsumptionErrorUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConsumptionErrorUserDO>()
                .eqIfPresent(ConsumptionErrorUserDO::getConsumptionErrorLogId, reqVO.getConsumptionErrorLogId())
                .eqIfPresent(ConsumptionErrorUserDO::getUserId, reqVO.getUserId())
                .likeIfPresent(ConsumptionErrorUserDO::getUserName, reqVO.getUserName())
                .eqIfPresent(ConsumptionErrorUserDO::getConsumptionPointsTotal, reqVO.getConsumptionPointsTotal())
                .eqIfPresent(ConsumptionErrorUserDO::getNowConsumptionPointsTotal, reqVO.getNowConsumptionPointsTotal())
                .eqIfPresent(ConsumptionErrorUserDO::getCurrentConsumptionPointsTotal, reqVO.getCurrentConsumptionPointsTotal())
                .eqIfPresent(ConsumptionErrorUserDO::getUsedConsumptionPointsTotal, reqVO.getUsedConsumptionPointsTotal())
                .eqIfPresent(ConsumptionErrorUserDO::getErrorConsumptionPointsTotal, reqVO.getErrorConsumptionPointsTotal())
                .betweenIfPresent(ConsumptionErrorUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ConsumptionErrorUserDO::getId));
    }

}