package com.itsol.quantrivanphong.report.leavetype.repository;

import com.itsol.quantrivanphong.model.LeaveType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface LeaveTypeRepository extends JpaRepository<LeaveType, Integer> {
    LeaveType findLeaveTypeById(int id);

    @Modifying
    @Query("update LeaveType lt set lt.name = ?1, lt.descriptions = ?2 where lt.id = ?3")
    int updateLeaveType(String name, String descriptions, int id);
}
