package com.izouma.jmrh.repo;

import com.izouma.jmrh.domain.AuthorityMenu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface AuthorityMenuRepo extends JpaRepository<AuthorityMenu, Long>, JpaSpecificationExecutor<AuthorityMenu> {
AuthorityMenu findByAuthorityName(String authorityName);
@Modifying
@Transactional
@Query(value = "update authority_menu set menu_id = ?1 where authority_name = ?2",nativeQuery = true)
    Integer updateByAuthorityName(String menuIds,String name);
}
