zoukankan      html  css  js  c++  java
  • 查询运营商的所有下级运营商

    /*
         * 
         * 描述:递归查询子运营商id
         * @author heluwei
         * @date 2019年3月7日
         */
        public  List<String> getChild(String id,List<String> list_operator){
            //根据当前运营商id查询所有子运营商的id
            List<String> list = operatorMapper.getNextOperator(id);
            for(int i=0;i<list.size();i++){
                list_operator.add(list.get(i));
                getChild((String)list.get(i),list_operator);//递归查询
            }
            return list_operator ;
        }
    /**
         * 
         * 描述:查询运营商的所有子运营商
         * @author heluwei
         * @date 2019年3月9日
         */
        @Override
        public List<Operator> getAllOperator(String operatorId) {
            List<String> tempList = new ArrayList<>();
            // 将父id先存入集合
            tempList.add(operatorId);
            // 递归查找所有子运营商id
            tempList = getChild(operatorId, tempList);
            return allOperator = operatorMapper.getAllOperator(tempList);
        }
  • 相关阅读:
    Linux Apache服务(一)
    mysql基础
    linux面试题一
    linux shell(2)
    linux基础汇总2
    python列表生成式、生成器,迭代器与二分法
    python的函数
    python函数
    java 翁老师学习笔记-持续更
    责任链模式
  • 原文地址:https://www.cnblogs.com/bulrush/p/10501632.html
Copyright © 2011-2022 走看看