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

import com.github.pagehelper.Page;
import com.jpsoft.shinestar.modules.base.entity.AlarmConfig;
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 java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface WorkAttendanceService {
	WorkAttendance get(String id);
	boolean exist(String id);
	int insert(WorkAttendance model);
	int update(WorkAttendance model);
	int delete(String id);
	List<WorkAttendance> list();
	Page<WorkAttendance> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, 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);

	/**
	 * 打卡
	 * @param personId
	 * @param recordDate
	 */
	boolean punchIn(String deviceNo, Long personId, BigDecimal temperature, Date recordDate);

    List<PersonInfo> queryUnAttendanceList(String companyCode, Date startDate, Date endDate);

	WorkAttendance findByPersonIdAndPeriod(Long personId, Date queryDate, String alarmConfigId);

	int recordUnAttendance(String companyId, AlarmConfig alarmConfig, Date toDate, Date toDate1, Date toDate2, String missing);

	int batchUpdate(String companyId, String alarmConfigId, Date startDate, Date endDate);

    int deleteByPersonIdAndDate(Long personId, String alarmConfigId, Date startDate, Date endDate, String sources);
}