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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.jljc.entity.TradeInfo;
import com.nantian.cloud.jljc.mapper.TradeInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nantian.cloud.jljc.service.TradeInfoService;
import com.nantian.cloud.jljc.vo.TreeVo;
import com.nantian.sc.cloud.common.data.datascope.DataScope;
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-05
 */
@Service("tradeInfoService")
public class TradeInfoServiceImpl extends ServiceImpl<TradeInfoMapper, TradeInfo> implements TradeInfoService {

    @Override
    public IPage<TradeInfo> getPageScope(Page page, TradeInfo tradeInfo) {
        //return baseMapper.getPageScope(page,tradeInfo,new DataScope());
        return baseMapper.getPageScope(page,tradeInfo);
    }

    @Override
    public List<TradeInfo> tradeInfoSelect() {
        return baseMapper.tradeInfoSelect();
    }

    @Override
    public List<TreeVo> tradeInfoTree() {
        List<TreeVo> treeVos = baseMapper.tradeInfoTree();
        return findTree(treeVos);
    }

}
