package com.yolo.keyboard.dal.mysql.userquotatotal;

import java.util.*;

import com.yolo.keyboard.framework.common.pojo.PageResult;
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
import com.yolo.keyboard.dal.dataobject.userquotatotal.KeyboardUserQuotaTotalDO;
import org.apache.ibatis.annotations.Mapper;
import com.yolo.keyboard.controller.admin.userquotatotal.vo.*;

/**
 * 用户免费功能永久总次数额度表（所有功能共用） Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KeyboardUserQuotaTotalMapper extends BaseMapperX<KeyboardUserQuotaTotalDO> {

    default PageResult<KeyboardUserQuotaTotalDO> selectPage(KeyboardUserQuotaTotalPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardUserQuotaTotalDO>()
                .eqIfPresent(KeyboardUserQuotaTotalDO::getTotalQuota, reqVO.getTotalQuota())
                .eqIfPresent(KeyboardUserQuotaTotalDO::getUsedQuota, reqVO.getUsedQuota())
                .eqIfPresent(KeyboardUserQuotaTotalDO::getVersion, reqVO.getVersion())
                .eqIfPresent(KeyboardUserQuotaTotalDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(KeyboardUserQuotaTotalDO::getUpdatedAt, reqVO.getUpdatedAt())
                .orderByDesc(KeyboardUserQuotaTotalDO::getUserId));
    }

}