package com.dbnt.faisp.main.userInfo.repository;

import com.dbnt.faisp.main.userInfo.model.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Optional;


public interface UserInfoRepository extends JpaRepository<UserInfo, Integer> {
  Optional<UserInfo> findByUserId(String userId);

  Optional<UserInfo> findByUserSeq(Integer userSeq);

  Optional<UserInfo> findByDicCode(String dicCode);
  
  @Query(value = "SELECT user_status FROM user_info WHERE user_seq=:userSeq", nativeQuery = true)
  String getUserStatus(@Param("userSeq") Integer userSeq);
}
