whycxzp
2021-07-13 ea2ce207cb45501831436c405df8c0ad4be35497
src/main/java/com/whyc/service/ClearTableService.java
@@ -130,6 +130,24 @@
        tableList.add(new TableDTO("web_site","tb_devtmp_record"));
        tableList.add(new TableDTO("web_site","tb_stationtraffic"));
        //进行一次过滤,查询出来所有的库中表
        List<TableDTO> tableList2 = mapper.findAllTables();
        for (int i = 0; i < tableList.size(); i++) {
            boolean compareFlag = false;
            for (int j = 0; j < tableList2.size(); j++) {
                if((tableList.get(i).getDbName()+tableList.get(i).getTableName())
                .equals(tableList2.get(j).getDbName()+tableList2.get(j).getTableName())){
                    compareFlag = true;
                    break;
                }
            }
            //匹配ok
            if(!compareFlag){
                tableList.remove(i);
                i--;
            }
        }
        mapper.clearTable(tableList);
    }