package com.ssj.dao.sys.cardinfo.dao;

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

import com.ssj.bean.sys.cardinfo.domain.TbCardInfo;


@Repository
public interface ICardInfoDao extends JpaRepository<TbCardInfo, String> {

	@Query(value="select * from tb_card_info where user_id = ?1 and state=?2 limit 1",nativeQuery=true)
	TbCardInfo findByUserIdAndState(String userId, int state);
	@Query(value="select * from tb_card_info where user_id = ?1 and state >0 limit 1",nativeQuery=true)
	TbCardInfo findByUserIdValid(String userId);
	@Query(value="select * from tb_card_info where lib_id = ?1 and state >0 limit 1",nativeQuery=true)
	TbCardInfo findByLibId(String joinid);

}
