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

import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
import com.jpsoft.shinestar.modules.business.entity.WorkAttendance;
import com.jpsoft.shinestar.modules.common.dto.Sort;
import org.springframework.stereotype.Repository;

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

@Repository
public interface WorkAttendanceDAO {
	int insert(WorkAttendance entity);
	int update(WorkAttendance entity);
	int exist(String id);
	WorkAttendance get(String id);
	int delete(String id);
	List<WorkAttendance> list();
	List<WorkAttendance> search(Map<String, Object> searchParams, List<Sort> sortList);
    List<WorkAttendance> findByPersonIdAndDate(Long personId, Date startDate, Date endDate);
    int deleteByCompanyCodeAndDate(String companyCode, String alarmConfigId, Date startDate, Date endDate, String sources, List<String> excludeCompanyList);
    List<WorkAttendance> findByPeriod(Long personId, String alarmConfigId, Date recordTime);
	List<PersonInfo> queryUnAttendanceList(String companyCode, Date startDate, Date endDate);
    WorkAttendance findByPersonIdAndPeriod(Long personId, Date queryDate, String alarmConfigId);
    int deleteByPersonIdAndDate(Long personId, String alarmConfigId, Date startDate, Date endDate, String sources);
    List<WorkAttendance> findByPersonIdAndAttendanceType(Long personId, Date startDate, Date endDate, int attendanceType);
    List<WorkAttendance> findByPersonIdAndWorkStatus(Long personId, Date startDate, Date endDate, String workStatus);
}