package com.nantian.cloud.jljc.service.impl;

import com.nantian.cloud.jljc.entity.TradeKind;
import com.nantian.cloud.jljc.mapper.TradeKindMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nantian.cloud.jljc.service.TradeKindService;
import com.nantian.cloud.jljc.vo.TradeKindTreeVo;
import org.springframework.stereotype.Service;
import java.util.List;
import static com.nantian.cloud.jljc.vo.util.TreeVoUtil.findTree;

/**
 * <p>
 * 行业门类、大类、行业编码 服务实现类
 * </p>
 *
 * @author stz
 * @since 2020-08-10
 */
@Service("tradeKindService")
public class TradeKindServiceImpl extends ServiceImpl<TradeKindMapper, TradeKind> implements TradeKindService {

    @Override
    public TradeKind getNameByCode(TradeKind tradeKind) {
        return baseMapper.getNameByCode(tradeKind);
    }

    @Override
    public List<TradeKindTreeVo> getTradeKindTree() {
        List<TradeKindTreeVo> tradeKindTree= baseMapper.getTradeKindTree();
        tradeKindTree  = findTree(tradeKindTree);
        return tradeKindTree;
    }

    @Override
    public TradeKind selectbycode(TradeKind tradeKind) {
        return baseMapper.selectbycode(tradeKind);
    }

    @Override
    public List<TradeKind> selectCategory() {
        return baseMapper.selectCategory();
    }
}
