package com.jpsoft.shinestar.modules.base.dao;

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

import com.jpsoft.shinestar.modules.base.entity.WorkPersonScheduling;
import org.springframework.stereotype.Repository;

import java.util.Map;
import com.jpsoft.shinestar.modules.common.dto.Sort;

@Repository
public interface WorkPersonSchedulingDAO {
	int insert(WorkPersonScheduling entity);
	int update(WorkPersonScheduling entity);
	int exist(String id);
	WorkPersonScheduling get(String id);
	int delete(String id);
	List<WorkPersonScheduling> list();
	List<WorkPersonScheduling> search(Map<String,Object> searchParams,List<Sort> sortList);

    WorkPersonScheduling findByYearMonthDayPersonId(int year, int month, int day, Long personId);

	int deleteByPersonIdSchedulingDay(int year, int month, int day, Long personId);

    List<WorkPersonScheduling> findByPersonIdSchedulingDay(Long personId, Date dateTime);

	List<WorkPersonScheduling> findByPersonIdYearMonth(Long personId,int year,int month);

	List<WorkPersonScheduling> findByPersonIdYearMonths(Long personId,int year,List<Integer> months,boolean isQueryRest);

	List<WorkPersonScheduling> findByPersonIdSDateAndEDate(Long personId,Date startDate,Date endDate,boolean isQueryRest);

	List<Date> findSchedulingDayByPersonIdSDateAndEDate(Long personId,Date startDate,Date endDate,boolean isQueryRest);

	List<Date> findRepeatSchedulingDay(Long personId);

	List<Map> findRedundantSchedule(Date startDate,Date endDate);
}