public static void main(String[] args) throws InterruptedException, ExecutionException { long start = System.currentTimeMillis(); Map<String, Object> flag = findAll(); System.out.println((System.currentTimeMillis() - start) / 1000 + "秒"); System.out.println(flag); } public static List<Rygl> findRyList(Rygl rygl) { List<Rygl> list = ryglDao.queryRydaglList(rygl); return list; } public static Map<String, String> findZzjg() { Map<String, String> zzMap = commonService.queryMap(); return zzMap; } public static Map<String, Object> findAll() throws InterruptedException, ExecutionException { Callable a = () -> { return findRyList(rygl); }; Callable b = () -> { return findZzjg(); }; FutureTask<List<Rygl>> ryList = new FutureTask<List<Rygl>>(a); FutureTask<Map<String, String>> zzMap = new FutureTask<Map<String, String>>(b); new Thread(ryList).start(); new Thread(zzMap).start(); List<Rygl> list = ryList.get(); Map<String, String> zzjgMap = zzMap.get(); map.put("a", list); map.put("b", zzjgMap); return map; }