package com.muyu.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.system.domain.SysMember;
import com.muyu.system.mapper.SysMemberMapper;
import com.muyu.system.service.SysMemberService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysMemberServiceImpl extends
        ServiceImpl<SysMemberMapper, SysMember>
        implements SysMemberService {


    @Override
    public List<SysMember> selectSysMemberList(SysMember sysMember) {
        LambdaQueryWrapper<SysMember> queryWrapper = new LambdaQueryWrapper<>();
        if(sysMember.getMemberId()!=null){
            queryWrapper.eq(SysMember::getMemberId, sysMember.getMemberId());
        }
        return this.list(queryWrapper);
    }

    @Override
    public SysMember selectSysMemberListById(Long memberId) {
        LambdaQueryWrapper<SysMember> queryWrapper = new LambdaQueryWrapper<>();
        if(memberId!=null){
            queryWrapper.eq(SysMember::getMemberId, memberId);
        }
        return this.getOne(queryWrapper);
    }
}
