package com.ssj.service.course.service;

import com.ssj.bean.course.domain.CourseSeriesJoin;
import com.ssj.framework.core.common.service.BaseService;
import com.ssj.service.course.req.CourseSeriesAddReq;
import com.ssj.service.course.req.CourseSeriesAddVip;
import com.ssj.service.course.res.CourseSeriesCalendarRes;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

/**
 * @author  ZhangCaibao
 * @version 2018年10月18日 下午3:20:46
 * 类说明
 */
public interface CourseSeriesJoinService extends BaseService<CourseSeriesJoin, String> {
	/**
	 * 查询是否已加入
	 * @param courseDetailsId
	 * @param libId
	 * @return
	 * 创建人：ZhangCaibao
	 * 2018年10月18日 下午6:00:51
	 * @int
	 */
	int findCourseSeriesJoinBycourseDetailsIdAndLibId(String courseDetailsId, String libId, String vipId);


	void saveCousreSeriesJoin(CourseSeriesAddReq req, String userId);
	void saveCousreSeriesJoin(CourseSeriesAddVip req, String userId);


	public CourseSeriesCalendarRes findCourseSeriesJoinByUserId(String userId, String vipId, String id, String libId);


	public List<Map<String, Object>> findCourseSeriesFeedbackByUserId(String userId, String vipId);


	public Page<Map<String, Object>> findFeedbackPageByUserId(Map<String, Object> searchParams, Pageable pageable);


	void updateBeginTime(String libId, String courseDetailId);


	public List<Map<String, Object>> findVipIsBuy(String userId, String courseDetailsId, String libId);


	void courseUpdateTime(String courseDetailId, String libId);


	void updateStateSend(String courseDetailsId, String vipId, String libId);

	void updateJoinDate(String courseDetailsId, String libId, int num, Date date);

	void updateJoinDate2(String courseDetailsId, String libId, int num);

	void saveOrUpdateJoinDate(String courseDetailsId,String libId,int num ,Date date,List<String> vipIds,String courseSeriesId);

	public List<Map<String, Object>> findCourseRecordList(String userId, String vipId);

	public List<String> findByVipIdAndCourseSeriesIdAndLibId(String libId,String courseSeriesId);


	void delByAnyReq(String libId, String courseSeriesId, String vipId);


	CourseSeriesJoin findOneDataByAny(String libId, String courseSeriesId);


	void updateDetailsData(String courseDetailId, String newTime, String libId,int num);


	int findStudentCount(String libId, String courseSeriesId);


	List<CourseSeriesJoin> findbyLibJoinList(String seriesId, String libId);


	List<CourseSeriesJoin> findbyLibAndVip(String libId, String seriesId, String vipId, int num, Date openTime);

	CourseSeriesJoin findOneDataByDetail(String libId, String detailId);

	CourseSeriesJoin findOneDataByDetailAndTime(String libId, String detailId, Date openTime);
}