|
|
|
@ -250,6 +250,9 @@ public class GenerateCode {
|
|
|
|
|
paraList.add(record);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(parasWithoutPrimaryKey.endsWith(" ")){
|
|
|
|
|
parasWithoutPrimaryKey = parasWithoutPrimaryKey.substring(0, parasWithoutPrimaryKey.length() - 1);
|
|
|
|
|
}
|
|
|
|
|
dataModel.put("paraList", paraList);//用于注释,显示@para 参数名 参数含义
|
|
|
|
|
dataModel.put("daoName", PropKit.get("daoName"));//显示dao的名称,比如ym
|
|
|
|
|
dataModel.put("beanName", beanName);//实体Bean的名称,用于构建方法名
|
|
|
|
@ -259,6 +262,19 @@ public class GenerateCode {
|
|
|
|
|
dataModel.put("primary_key_type", primary_key_type);//主键类型
|
|
|
|
|
dataModel.put("tableName", tableName);//表名
|
|
|
|
|
|
|
|
|
|
String updateParas = "";
|
|
|
|
|
for (String s : parasWithoutPrimaryKeyAndDataType.split(",")) {
|
|
|
|
|
if (s.equals("create_time")) {
|
|
|
|
|
updateParas += s+"=now(),";
|
|
|
|
|
} else {
|
|
|
|
|
updateParas += s + "=?,";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (updateParas.endsWith(",")) {
|
|
|
|
|
updateParas = updateParas.substring(0, updateParas.length() - 1);
|
|
|
|
|
}
|
|
|
|
|
dataModel.put("updateParas", updateParas);
|
|
|
|
|
|
|
|
|
|
System.out.println(dataModel);
|
|
|
|
|
|
|
|
|
|
//调用FreeMarker模板引擎
|
|
|
|
|