package com.zioinfo.hrm.attendance;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@Mapper
public interface AttendanceMapper {
    List<Map<String, Object>> findByEmpAndMonth(@Param("empId") Long empId,
                                                 @Param("year") int year,
                                                 @Param("month") int month);
    List<Map<String, Object>> findAll(@Param("date") LocalDate date,
                                       @Param("deptId") Long deptId,
                                       @Param("offset") int offset,
                                       @Param("limit") int limit);
    int checkIn(Map<String, Object> rec);
    int checkOut(Map<String, Object> rec);
    List<Map<String, Object>> findLeaves(@Param("empId") Long empId,
                                          @Param("status") String status,
                                          @Param("year") int year);
    int insertLeave(Map<String, Object> leave);
    int updateLeaveStatus(@Param("id") Long id, @Param("status") String status, @Param("approvedBy") String approvedBy);
    Map<String, Object> getLeaveBalance(@Param("empId") Long empId, @Param("year") int year);
    List<Map<String, Object>> findLeaveTypes();
    int insertLeaveType(Map<String, Object> lt);
    List<Map<String, Object>> findOvertime(@Param("empId") Long empId, @Param("year") int year, @Param("month") int month);
    int insertOvertime(Map<String, Object> ot);
}
