package com.zioinfo.hrm.training;

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

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

@Mapper
public interface TrainingMapper {
    List<Map<String, Object>> findCourses(@Param("keyword") String keyword, @Param("type") String type,
                                           @Param("offset") int offset, @Param("limit") int limit);
    long countCourses(@Param("keyword") String keyword, @Param("type") String type);
    Map<String, Object> findCourseById(@Param("id") Long id);
    int insertCourse(Map<String, Object> course);
    int updateCourse(Map<String, Object> course);
    List<Map<String, Object>> findEnrollments(@Param("empId") Long empId, @Param("courseId") Long courseId,
                                               @Param("year") int year);
    int insertEnrollment(Map<String, Object> enrollment);
    int updateEnrollmentStatus(@Param("id") Long id, @Param("status") String status, @Param("completedAt") java.time.LocalDate completedAt);
    Map<String, Object> getLegalTrainingStatus(@Param("empId") Long empId, @Param("year") int year);
    List<Map<String, Object>> findLegalCourses();
}
