public MemberLevelInfo add(MemberLevelInfo memberLevelInfo) { if (memberLevelInfo.getMember_level_id() == 0) { memberLevelInfoMapper.add(memberLevelInfo); } else { memberLevelInfoMapper.update(memberLevelInfo); } return memberLevelInfoMapper.get( memberLevelInfo.getUid(), memberLevelInfo.getMember_level_id()); }
private void checkMemberLevelId(long uid, Integer memberLevelId) { if (memberLevelId == null) { return; } if (memberLevelInfoMapper.get(uid, memberLevelId) == null) { throw new IllegalArgumentException( "member_level_id is not exist. uid=" + uid + ", member_level_id=" + memberLevelId); } }
public List<MemberLevelInfo> getMemberLevelInfos(long uid) { return memberLevelInfoMapper.list(uid); }
public void deleteMemberLevelInfo(long uid, int member_level_id) { memberLevelInfoMapper.delete(uid, member_level_id); }