package com.ywt.outpatient.domain.entity.center;

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

public interface SnsUserRepository extends JpaRepository<SnsUser, Integer> {


    @Query(value = "select * From sns_user where open_id = ? and deleted = 0 limit 1;", nativeQuery = true)
    SnsUser getSnsUserByOpenId(String openId);

    @Query(value = "select * From sns_user where user_id = ? and deleted = 0 limit 1;", nativeQuery = true)
    SnsUser getSnsUserByUserId(int userId);

    @Query(value = "select * from sns_user where union_id = ? and deleted = 0 limit 1;", nativeQuery = true)
    SnsUser getSnsUserByUnionId(String unionId);
}
