package com.ywt.mg.domain.entities;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface MgRolesRepository extends PagingAndSortingRepository<MgRoles, Integer> {

    /**
     * 判断表中是否有引用mg_sys_module对应的id
     * @param id
     * @return
     */
    @Query(value = " SELECT count(1) FROM mg_roles WHERE sys_module_id = ? ",nativeQuery = true)
    int checkSysModuleCount(int id);
}
