package com.ywt.mg.domain.entities;

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

import java.util.List;

public interface MgSysModuleRepository extends PagingAndSortingRepository<MgSysModule, Integer> {

    /**
     * 根据appid查找对象
     * @param appid
     * @return
     */
    @Query(value = "SELECT * FROM mg_sys_module WHERE appid = ? limit 1",nativeQuery = true)
    MgSysModule findOneByAppid(String appid);

    @Query(value = "SELECT * FROM mg_sys_module ;",nativeQuery = true)
    List<MgSysModule> getAll();
}
