|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package org.yangliu.codegenerate;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.google.common.base.CaseFormat;
|
|
|
|
|
import freemarker.cache.ClassTemplateLoader;
|
|
|
|
|
import freemarker.core.XMLOutputFormat;
|
|
|
|
@ -68,13 +69,28 @@ public class Main {
|
|
|
|
|
String user = "enjoy";
|
|
|
|
|
String password = "Nomi1234";
|
|
|
|
|
//2.选择表配置
|
|
|
|
|
String table= "oqc_nspection_level_cl";
|
|
|
|
|
String entityName="OqcNspectionLevelCl";//实体类
|
|
|
|
|
String description = "检验水平-样本代字";//备注
|
|
|
|
|
String primaryKeyField = "id";//主键
|
|
|
|
|
List<TableEntityVo> tableEntityVoList = printTableStructure(driver, url, user, password, table);
|
|
|
|
|
//3.生成
|
|
|
|
|
generate(bussi_package, table,primaryKeyField,entityName,description, tableEntityVoList);
|
|
|
|
|
String json="{\"oqc_spot_check_record\":\"抽检记录\",\"oqc_shipment_record\":\"成品出货记录\",\"oqc_1008_record\":\"1008仓台账\",\"oqc_after_sales_record\":\"售后记录\",\"oqc_special_sample\":\"特殊样件\",\"oqc_product_record\":\"产品追溯\",\"oqc_ncr_record\":\"NCR明细\",\"oqc_qrqc_record\":\"QRQC明细\"}";
|
|
|
|
|
JSONObject tables = JSONObject.parseObject(json);
|
|
|
|
|
for (String table : tables.keySet()) {
|
|
|
|
|
String entityName = TableFieldUtil.tableNameToEntityName(table);
|
|
|
|
|
String description = tables.getString(table);
|
|
|
|
|
System.out.println(String.format("表名:%s,实体类:%s,备注:%s",table,entityName,description));
|
|
|
|
|
String primaryKeyField = "id";//主键
|
|
|
|
|
List<TableEntityVo> tableEntityVoList = printTableStructure(driver, url, user, password, table);
|
|
|
|
|
//3.生成
|
|
|
|
|
generate(bussi_package, table,primaryKeyField,entityName,description, tableEntityVoList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*if(!true){
|
|
|
|
|
String table= "oqc_nspection_level_cl";
|
|
|
|
|
String entityName="OqcNspectionLevelCl";//实体类
|
|
|
|
|
String description = "检验水平-样本代字";//备注
|
|
|
|
|
String primaryKeyField = "id";//主键
|
|
|
|
|
List<TableEntityVo> tableEntityVoList = printTableStructure(driver, url, user, password, table);
|
|
|
|
|
//3.生成
|
|
|
|
|
generate(bussi_package, table,primaryKeyField,entityName,description, tableEntityVoList);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|