package com.jasamedika.medifirst2000.dao;

import com.jasamedika.medifirst2000.entities.LogbookRemun;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.sql.Date;
import java.util.List;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 25/04/2024
 */
public interface LogbookRemunDao extends JpaRepository<LogbookRemun, String> {

	@Modifying
	@Query(value = "delete from remun.t_logbook_remun " + "where pegawai_id in (:idPegawai) "
			+ "and bulan between :tglAwal and :tglAkhir", nativeQuery = true)
	void deleteByKelompokKerjaAndPeriod(@Param("idPegawai") List<Integer> idPegawai, @Param("tglAwal") Date tglAwal,
			@Param("tglAkhir") Date tglAkhir);
}
