package com.ssj.service.sys.imlibuser.service;

import com.ssj.bean.sys.imlibuser.TbClassStudent;
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
import com.ssj.framework.core.common.service.BaseService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

public interface TbClassStudentService extends BaseService<TbClassStudent, String> {
	
	
	 Page<Map<String, Object>> findLibImByPage(Map<String, Object> searchParam, Pageable pageable);
	
	 /**
	  * 查询学生的分页
	  * @param searchParam
	  * @param pageable
	  * @return
	  */
	 Page<Map<String, Object>> findStudentByPage(Map<String, Object> searchParam, Pageable pageable);
	 
	 
	 TbClassStudent getTbClassTeacherByVipId(String classId,String vipId);	 
	 
	 //解绑
	 void untyingTbClassTeacherByVipId(String vipId);	
	 
	 public TbLibJoin getTbLibJoinByLeagueName(String leagueName);

	List<TbClassStudent> findByVipId(String vipId);

	int  getTbClassStudentByClassId(String classId,String libId);

    void updateTbClassTeacherByClassIdAndVipIdsAndLibId(String classId,List<String>vipIds,String libId);

	/**
	 * 找到某校区的小孩
	 * @param libId
	 * @param vipId
	 * @return
	 */
	TbClassStudent findByLibIdAndVipId(String libId, String vipId);

	/**
	 * 查询学生与馆机构内班级的关联记录
	 * @param vipId 学生id
	 * @param status 状态
	 * @return 绑定记录列表
	 */
	List<TbClassStudent> findByVipIdAndStatus(String vipId, int status);

	/**
	 * 删除班级里的学生
	 */
	void deleteByLibIdAndClassId(String libId,String classId);

	/**
	 * 将管里该学生设置为无效
	 */
	void updateByVipIdAndLibId(String vipId,String libId);

	/**
	 * 更换某个学生的班级
	 */
	void updateTbClassStudentByClassIdAndVipIdAndLibId(String classId,String vipId,String libId);


	/**
	 * 查询学生的班级
	 */
	TbClassStudent findByVipIdAndLibId(String vipId,String libId);

    /**
     * 将学生还原到原来班级
     * @param vipId
     * @param libId
     */
    void rebackStudentToClass(String vipId, String libId);
}
