package com.ssj.dao.weixin.zuoyb.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.ssj.bean.weixin.zyb.domain.ZuoybWeekTeacher;


/** 
 * @author  ZhangCaibao 
 * @version 2017年9月6日 下午5:21:52 
 * 类说明 
 */
@Repository
public interface ZuoybWeekTeacherDao extends JpaRepository<ZuoybWeekTeacher, String>{

	@Query(nativeQuery = true, value = "delete from  zyb_week_teacher  where teacher_id = ?1  and  lib_id =?2 and course_hour =?3 and days=?4 ")
	@Modifying
	public void deleteByTeacherIdAndLibIdAndcourseHour(String teacherId,String libId,String hour,Integer days);
	
	@Query(nativeQuery = true, value = "select count(1) from  zyb_week_teacher  where zyb_week_id = ?1  and  teacher_id =?2  ")
	public Integer getWeekIdAndteacherIdCount(String weekId,String teacherId);
	
	@Query(nativeQuery = true, value = "delete from  zyb_week_teacher  where zyb_week_id = ?1  and  teacher_id =?2 ")
	@Modifying
	public void deleteByTeacherIdAndWeekId(String weekId,String teacherId);
}
