package com.sptg.estate.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.estate.api.entity.MemberLoginStatus;
import com.sptg.estate.biz.mapper.MemberLoginStatusMapper;
import com.sptg.estate.biz.service.MemberLoginStatusServiceInterface;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@Service
public class MemberLoginStatusServiceImpl extends ServiceImpl<MemberLoginStatusMapper, MemberLoginStatus> implements MemberLoginStatusServiceInterface {
    @Override
    public MemberLoginStatus checkMemberLoginStatus(MemberLoginStatus memberLoginStatus) {
        //构建查询条件
        Wrapper<MemberLoginStatus> wrapper = new EntityWrapper<>();
        wrapper.eq("s_member_id",memberLoginStatus.getMemberId());
        return  this.selectOne(wrapper);
    }

    @Override
    public Boolean addMemberLoginStatus(MemberLoginStatus memberLoginStatus) {
        //构建查询条件
        return  this.insert(memberLoginStatus);
    }

    @Override
    public Boolean updateMemberLoginStatus(MemberLoginStatus memberLoginStatus) {
        //构建查询条件
        return  this.updateById(memberLoginStatus);
    }
}
