package com.kym.service.admin.impl;

import com.github.pagehelper.PageHelper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.kym.common.utils.CommUtil;
import com.kym.entity.admin.RechargeRights;
import com.kym.entity.common.PageBean;
import com.kym.entity.common.PageParams;
import com.kym.mapper.admin.RechargeRightsMapper;
import com.kym.service.admin.RechargeRightsService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 充值权益表 服务实现类
 * </p>
 *
 * @author skyline
 * @since 2023-10-18
 */
@Service
public class RechargeRightsServiceImpl extends MPJBaseServiceImpl<RechargeRightsMapper, RechargeRights> implements RechargeRightsService {

    @Override
    public PageBean<RechargeRights> listRechargeRight(PageParams pageParams, String activityId) {
        PageHelper.startPage(pageParams.getPageNum(), pageParams.getPageSize());
        var list = lambdaQuery().eq(!CommUtil.isEmptyOrNull(activityId), RechargeRights::getActivityId, activityId).orderByAsc(RechargeRights::getEndTime).list();
        return new PageBean<>(list);
    }
}
