package com.fzm.mall.server.front.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzm.mall.server.front.user.model.DrawCoinAddr;
import com.fzm.mall.server.front.user.mapper.DrawCoinAddrMapper;
import com.fzm.mall.server.front.user.service.IDrawCoinAddrService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author fzm
 * @since 2021-04-21
 */
@Service
public class DrawCoinAddrServiceImpl extends ServiceImpl<DrawCoinAddrMapper, DrawCoinAddr> implements IDrawCoinAddrService {

    @Override
    public List<DrawCoinAddr> getList(String uid) {
        QueryWrapper<DrawCoinAddr> q = new QueryWrapper<>();
        q.eq("uid",uid);
        return list(q);
    }

    @Override
    public DrawCoinAddr getByIdAndUid(Integer id, String uid) {
        QueryWrapper<DrawCoinAddr> q = new QueryWrapper<>();
        q.eq("id",id);
        q.eq("uid",uid);
        return getOne(q);
    }
}
