package com.ssj.service.weixin.zuoyb.service;

import com.ssj.bean.weixin.zyb.domain.ZuoybKnowHowDetailsSort;
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;

/** 
 * @author  ZhangCaibao 
 * @version 2018年3月11日 上午8:27:03 
 * 类说明 
 */
public interface ZuoybKnowHowDetailsSortService extends BaseService<ZuoybKnowHowDetailsSort, String>{

	 public ZuoybKnowHowDetailsSort findByHowDetailsIdAndType(String howDetailsId,Integer type);
	 
	 public  Page<ZuoybKnowHowDetailsSort>  findByPage(Map<String, Object> params, Pageable sp);
	 public Page<Map<String, Object>> getZuoybKnowSort(Map<String, Object> searchParams, Pageable pageable);
	 public Page<Map<String, Object>> getZuoybKnowKdSort(Map<String, Object> searchParams, Pageable pageable);
	 public void  updateKnowHowDetailSortNum(String id,Integer num);
	 
	  public List<Map<String, Object>> getKonwVersion(String libId,String courseName,String grade,Integer banben,Integer semester,String howName);
	  public List<Map<String, Object>> getKonwDetailVersion(String libId,String courseName,String grade,Integer banben,Integer semester,String howDetailsName);
	  public List<Map<String, Object>> getKonwDetailKdVersion(String libId,String courseName,String grade,Integer banben,Integer semester,String howDetailsKdName);
	  /**
	   * 根据知识点，获取该年级的考点
	  * @param courseName
	  * @param grade
	  * @param banben
	  * @param semester
	  * @param howDetailsId
	  * @return
	  * 创建人：ZhangCaibao 
	  * 2018年11月7日 下午3:50:13 
	  * @String
	   */
	  public String getZuoybKnowHowDetailsKdName(String courseName,String grade,String banben,String semester,String howDetailsId); 

	  
	  public void  updateBeforeKd(String beforeKdId,String sortId);

	/**
	 * 根据考点id集合查询对应考点版本记录集合
	 */
	List<ZuoybKnowHowDetailsSort> findByHowDetailsKdIdIn(List<String> knowHowDetailsKdIdList);

	/**
	 * 根据知识点id查询对应知识点版本记录
	 */
	List<ZuoybKnowHowDetailsSort> findByHowDetailsId(String knowHowDetailId);

	/**
	 * 根据单元id查询对应知识点版本记录
	 */
	ZuoybKnowHowDetailsSort findByHowId(String howId);

	List<ZuoybKnowHowDetailsSort> findByTypeAndHowDetailsIdIn(Integer type, List<String> knowHowDetailsIdList);

	List<ZuoybKnowHowDetailsSort> findByCourseNameAndGradeAndSemesterAndTypeAndStatAndHowId(String courseName, String grade, int semester, int type, int stat, String howId);

	/**
	 * 查找单元
	 *
	 * @param type
	 * @param howId
	 * @return
	 */
	ZuoybKnowHowDetailsSort findKnowHowByTypeAndHowId(int type, String howId);

	/**
	 * 查询知识点的knowHowDetailsSort记录
	 * @param howDetailIds
	 * @param type
	 * @param semester
	 * @param grade
	 * @return
	 */
	List<ZuoybKnowHowDetailsSort> findByHowDetailIdAndTypeAndGradeAndSemester(List<String> howDetailIds, String grade, int semester, int type);

}