//IntelliJ IDEA //campus //FriendListRepository //2020/12/28 // Author:御承扬 //E-mail:2923616405@qq.com package com.pyc.campus.dao; import com.pyc.campus.domain.FriendList; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.transaction.annotation.Transactional; import java.util.List; public interface FriendListRepository extends JpaRepository { @Modifying @Transactional @Query("select fl from FriendList fl where fl.fromName=?1 and fl.status=false ") List toNameIsFalseByFromName(String fromName); @Modifying @Transactional @Query("select fl from FriendList fl where fl.toName=?1 and fl.status=false ") List toNameIsFalseByToName(String toName); @Modifying @Transactional @Query("select fl from FriendList fl where fl.fromName=?1 and fl.status=true ") List findMyFriendsByFromName(String fromName); @Modifying @Transactional @Query("select fl from FriendList fl where fl.toName=?1 and fl.status=true") List findMyFriendsByToName(String toName); }