FriendListRepository.java 1.2 KB
Newer Older
7
Update  
7wc98#14 已提交
1 2 3 4 5 6 7 8 9 10 11 12
//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;
7
modify  
7wc98#14 已提交
13 14 15 16 17
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
7
Update  
7wc98#14 已提交
18 19

public interface FriendListRepository extends JpaRepository<FriendList,Long> {
7
modify  
7wc98#14 已提交
20 21 22 23 24 25
    @Modifying
    @Transactional
    @Query("select fl from FriendList fl where fl.fromName=?1 and fl.status=false ")
    List<FriendList> toNameIsFalseByFromName(String fromName);
    @Modifying
    @Transactional
7
modify  
7wc98#14 已提交
26 27 28 29
    @Query("select fl from FriendList fl where fl.toName=?1 and fl.status=false ")
    List<FriendList> toNameIsFalseByToName(String toName);
    @Modifying
    @Transactional
7
modify  
7wc98#14 已提交
30 31 32 33 34 35 36
    @Query("select fl from FriendList fl where fl.fromName=?1 and fl.status=true ")
    List<FriendList> findMyFriendsByFromName(String fromName);
    @Modifying
    @Transactional
    @Query("select fl from FriendList fl where fl.toName=?1 and fl.status=true")
    List<FriendList> findMyFriendsByToName(String toName);

7
Update  
7wc98#14 已提交
37
}