package com.zioinfo.hrm.payroll;

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

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

@Mapper
public interface PayrollMapper {
    List<Map<String, Object>> findPayrolls(@Param("year") int year, @Param("month") int month,
                                            @Param("deptId") Long deptId, @Param("offset") int offset,
                                            @Param("limit") int limit);
    long countPayrolls(@Param("year") int year, @Param("month") int month, @Param("deptId") Long deptId);
    Map<String, Object> findPayslip(@Param("empId") Long empId, @Param("year") int year, @Param("month") int month);
    int insertPayroll(Map<String, Object> payroll);
    int updatePayrollStatus(@Param("id") Long id, @Param("status") String status);
    List<Map<String, Object>> findPayslipsByEmp(@Param("empId") Long empId, @Param("year") int year);
    List<Map<String, Object>> findSalaryItems();
    Map<String, Object> findSalaryByEmpId(@Param("empId") Long empId);
    int upsertSalary(Map<String, Object> salary);
    Map<String, Object> getYearlySummary(@Param("empId") Long empId, @Param("year") int year);
}
