package cn.quantgroup.xyqb.repository;

import cn.quantgroup.xyqb.entity.UserHashMapping;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IUserHashMappingRepository extends JpaRepository<UserHashMapping, Long> {

    UserHashMapping findByPhoneNoMd5ShortAndPhoneNoMd5(Long phoneNoMd5Short, String phoneNoMd5);

    UserHashMapping findByIdNoMd5ShortAndIdNoMd5(Long idNoMd5Short, String idNoMd5);

    List<UserHashMapping> findByIdNoMd5AndIdNoMd5Short(String idNoMd5, Long idNoMd5Short);

    UserHashMapping findByUserId(Long userId);

    @Transactional
    void deleteByUserId(Long userId);

}
