package com.ssj.service.weixin.library.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.ssj.bean.weixin.libmy.domain.TbLibJoinConsume;
import com.ssj.framework.core.common.service.BaseService;

/**
 * 学币消费记录
 */
public interface ILibJoinConsumeService extends BaseService<TbLibJoinConsume, String> {

	//充值 记录
	void rechargeTbLibJoinConsume(String libId,Integer libServiceNum,Integer platformServiceNum);
	
	void rechargeMerchantConsume(String merchantId, Integer libServiceNum, Integer platformServiceNum);
	
	//消费 记录
	void consumeTbLibJoinConsume(String libId,Integer libServiceNum,Integer platformServiceNum,String vipId);

	/**
	 * 批量消费记录
	 * @param libId
	 * @param libServiceNum
	 * @param platformServiceNum
	 * @param vipIdList
	 */
	void batchConsumeTbLibJoinConsume(String libId,Integer libServiceNum,Integer platformServiceNum,List<String> vipIdList);


	//分配 记录
	void allotTbLibJoinConsume(String fromLibId,String toLibId,Integer libServiceNum,Integer platformServiceNum);
	
	//分配 记录
	void allotMerchantConsume(String fromMerchant, String toMerchant, Integer libServiceNum,Integer platformServiceNum);

	//时间段内 馆消费的总记录列表
	Integer countTbLibJoinConsumeByConsumeTime(String[] libIds,Date startTime,Date endTime);
	
	Integer countTbLibJoinDistributionByConsumeTime(String[] libIds,Date startTime,Date endTime);
	
	Integer countMerchantConsumeByConsumeTime(String[] merchantIds,Date startTime,Date endTime);
	
	Page<Map<String, Object>> findByPage(Map<String, Object> params, Pageable pageable);


}
