package com.diagbot.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.diagbot.dto.RenewalsInfosDTO;
import com.diagbot.entity.UserRenewals;
import com.diagbot.entity.wrapper.UserRenewalsWrapper;
import com.diagbot.mapper.UserRenewalsMapper;
import com.diagbot.service.UserRenewalsService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户续费申请表 服务实现类
 * </p>
 *
 * @author gaodm
 * @since 2018-10-12
 */
@Service
public class UserRenewalsServiceImpl extends ServiceImpl<UserRenewalsMapper, UserRenewals> implements UserRenewalsService {

    @Override
    public List<Long> selectProductIdByUserId(Map map) {
        return baseMapper.selectProductIdByUserId(map);
    }

    @Override
    public IPage<RenewalsInfosDTO> selectUserRenewals(Page page, @Param("renewalsInfosVO") UserRenewalsWrapper userRenewalsWrapper) {
        return baseMapper.selectUserRenewals(page,userRenewalsWrapper);
    }

	@Override
	public boolean updateRenewalStatus(UserRenewals userRenewals) {
		// TODO Auto-generated method stub
		return baseMapper.updateRenewalStatus(userRenewals);
	}
	/**
     *查詢用户的待续费数量
     * @param userRenewals
     * @return
     */
	@Override
	public int getUserWaitingRenewal(UserRenewals userRenewals){
		return baseMapper.getUserWaitingRenewal(userRenewals);
	}
}
