Skip to content

Commit

Permalink
fix the exit interfaxce
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 17, 2023
1 parent 3027038 commit fe438c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dl.officialsite.member;

import com.dl.officialsite.team.teammember.TeamMember;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public MemberWithTeam getMemberWithTeamInfoByAddress(String address) {
MemberWithTeam memberWithTeam = new MemberWithTeam();
BeanUtils.copyProperties(member.get(), memberWithTeam);
ArrayList teams = new ArrayList();
List<TeamMember> teamMembers = teamMemberRepository.findByMemberId(member.get().getId());
List<TeamMember> teamMembers = teamMemberRepository.findByMemberIdAndStatus(member.get().getId(), 0);

teamMembers.stream().forEach(teamMember -> {
Team team = teamRepository.findById(teamMember.getTeamId()).get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import java.util.List;
import java.util.Optional;

import com.dl.officialsite.member.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

Expand All @@ -12,7 +15,7 @@
* @Date 2023/10/21 17:23
* @Description TeamMemberRepository
**/
public interface TeamMemberRepository extends JpaRepository<TeamMember, Long> {
public interface TeamMemberRepository extends JpaRepository<TeamMember, Long>, JpaSpecificationExecutor<Member> {

@Query(value = "select member_id from team_member where team_id = :team_id", nativeQuery = true)
List<Long> findByTeamId(@Param("team_id")Long teamId);
Expand All @@ -32,4 +35,6 @@ public interface TeamMemberRepository extends JpaRepository<TeamMember, Long> {
@Query(value = "select * from team_member where team_id = :team_id and member_id in (:memberIds)",
nativeQuery = true)
List<TeamMember> findByTeamAndMembers(@Param("team_id")Long teamId, @Param("memberIds")List<Long> memberIds);

List<TeamMember> findByMemberIdAndStatus(Long id, int i);
}

0 comments on commit fe438c7

Please sign in to comment.