|
|
|
@ -7,8 +7,7 @@ import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
|
|
|
|
import com.jfinal.plugin.hikaricp.HikariCpPlugin;
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
import org.apache.log4j.Level;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -28,7 +27,7 @@ public class SelectNoXzqh {
|
|
|
|
|
dataEasePlugin.start();
|
|
|
|
|
|
|
|
|
|
// 配置ActiveRecord插件
|
|
|
|
|
ActiveRecordPlugin arp = new ActiveRecordPlugin("master", masterPlugin);
|
|
|
|
|
ActiveRecordPlugin arp = new ActiveRecordPlugin(masterPlugin);
|
|
|
|
|
arp.setDialect(new MysqlDialect());
|
|
|
|
|
|
|
|
|
|
ActiveRecordPlugin arpDataEase = new ActiveRecordPlugin(DataEaseModel.DB_NAME, dataEasePlugin);
|
|
|
|
@ -52,32 +51,21 @@ public class SelectNoXzqh {
|
|
|
|
|
DataEaseModel dm = new DataEaseModel();
|
|
|
|
|
|
|
|
|
|
//遍历所有的非省级管理员的,以excel_开头的表,找出这些表中是不是存在行政区划的列名
|
|
|
|
|
List<Record> list2 = dm.getDataSetByIdentityId(2);
|
|
|
|
|
List<Record> list3 = dm.getDataSetByIdentityId(3);
|
|
|
|
|
//开始检查
|
|
|
|
|
int cnt = 0;
|
|
|
|
|
for (Record record : list2) {
|
|
|
|
|
String tableName = record.getStr("table_name");
|
|
|
|
|
String dataSetName = record.getStr("dataset_name");
|
|
|
|
|
//这张表中存在行政区划的列名,就跳过,不处理
|
|
|
|
|
if (!dm.hasXzqhColumn(tableName)) {
|
|
|
|
|
System.out.println(dataSetName + "表:" + tableName + "没有行政区划的列名,请手动添加");
|
|
|
|
|
cnt++;
|
|
|
|
|
}
|
|
|
|
|
//否则提醒出来:当前表没有行政区划的列名,需要手动添加
|
|
|
|
|
}
|
|
|
|
|
System.out.println("市州数据集中,没有行政区划的表有" + cnt + "个");
|
|
|
|
|
System.out.println("===================================================================");
|
|
|
|
|
cnt = 0;
|
|
|
|
|
for (Record record : list3) {
|
|
|
|
|
String tableName = record.getStr("table_name");
|
|
|
|
|
String dataSetName = record.getStr("dataset_name");
|
|
|
|
|
//这张表中存在行政区划的列名,就跳过,不处理
|
|
|
|
|
if (!dm.hasXzqhColumn(tableName)) {
|
|
|
|
|
System.out.println(dataSetName + "表:" + tableName + "没有行政区划的列名,请手动添加");
|
|
|
|
|
cnt++;
|
|
|
|
|
for (int identity_id : new int[]{2, 3}) {
|
|
|
|
|
List<Record> list = dm.getDataSetByIdentityId(identity_id);
|
|
|
|
|
//开始检查
|
|
|
|
|
int cnt = 0;
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
String tableName = record.getStr("table_name");
|
|
|
|
|
String dataSetName = record.getStr("dataset_name");
|
|
|
|
|
//这张表中存在行政区划的列名,就跳过,不处理
|
|
|
|
|
if (!dm.hasXzqhColumn(tableName)) {
|
|
|
|
|
System.out.println((identity_id == 2 ? "【市州】" : "【县区】") + dataSetName + "表:" + tableName + "没有行政区划的列名,请手动添加");
|
|
|
|
|
cnt++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
System.out.println((identity_id == 2 ? "【市州】" : "【县区】") + "数据集中,没有行政区划的表有" + cnt + "个");
|
|
|
|
|
System.out.println("===================================================================");
|
|
|
|
|
}
|
|
|
|
|
System.out.println("县区数据集中,没有行政区划的表有" + cnt + "个");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|