package com.huijy.management.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huijy.management.mapper.MemberMapper;
import com.huijy.management.domain.Member;
import com.huijy.management.service.IMemberService;

/**
 * 会员信息(游客)Service业务层处理
 *
 * @author luobo
 * @date 2021-09-12
 */
@Service
public class MemberServiceImpl implements IMemberService
{
    @Autowired
    private MemberMapper memberMapper;

    /**
     * 查询会员信息(游客)
     *
     * @param memberId 会员信息(游客)主键
     * @return 会员信息(游客)
     */
    @Override
    public Member selectMemberByMemberId(Long memberId)
    {
        return memberMapper.selectMemberByMemberId(memberId);
    }

    /**
     * 查询会员信息(游客)列表
     *
     * @param member 会员信息(游客)
     * @return 会员信息(游客)
     */
    @Override
    public List<Member> selectMemberList(Member member)
    {
        return memberMapper.selectMemberList(member);
    }

    /**
     * 新增会员信息(游客)
     *
     * @param member 会员信息(游客)
     * @return 结果
     */
    @Override
    public int insertMember(Member member)
    {
        return memberMapper.insertMember(member);
    }

    /**
     * 修改会员信息(游客)
     *
     * @param member 会员信息(游客)
     * @return 结果
     */
    @Override
    public int updateMember(Member member)
    {
        return memberMapper.updateMember(member);
    }

    /**
     * 批量删除会员信息(游客)
     *
     * @param memberIds 需要删除的会员信息(游客)主键
     * @return 结果
     */
    @Override
    public int deleteMemberByMemberIds(Long[] memberIds)
    {
        return memberMapper.deleteMemberByMemberIds(memberIds);
    }

    /**
     * 删除会员信息(游客)信息
     *
     * @param memberId 会员信息(游客)主键
     * @return 结果
     */
    @Override
    public int deleteMemberByMemberId(Long memberId)
    {
        return memberMapper.deleteMemberByMemberId(memberId);
    }

    @Override
    public Member getMemberByOpenId(String openId) {
        return memberMapper.selectByOpenId(openId);
    }
}
