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 MGAdminsRepository extends PagingAndSortingRepository<MGAdmins, Integer> {
    @Query(value = "Select * From `mg_admin` Where account = ? And password = ? limit 1", nativeQuery = true)
    public MGAdmins findByAccoutAndPwd(String account, String password);

    @Query(value = "Select * From `mg_admin` Where account = ? ", nativeQuery = true)
    public List<MGAdmins> checkAccountExist(String account);
}
