package com.copy.trade.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.copy.trade.dao.TraderSymbolMapper;

import com.copy.trade.entity.po.TraderSymbol;

import com.copy.trade.service.ITraderSymbolService;

import org.springframework.stereotype.Service;


/**
 * <p>
 * 交易员带单合约 服务实现类
 * </p>
 *
 * @author wz
 * @since 2022-11-08
 */
@Service
public class TraderSymbolServiceImpl extends ServiceImpl<TraderSymbolMapper, TraderSymbol> implements ITraderSymbolService {

    @Override
    public TraderSymbol getByTraderAndSymbol(Long traderId, String symbol) {
        QueryWrapper<TraderSymbol> traderSymbolQueryWrapper = new QueryWrapper<>();
        traderSymbolQueryWrapper.eq("trader_id",traderId)
                .eq("symbol",symbol);
        return getOne(traderSymbolQueryWrapper);
    }
}
