|
|
|
@ -206,18 +206,18 @@ public class GenerateCode {
|
|
|
|
|
Map<String, String> fields = (Map<String, String>) jo.get("fields");
|
|
|
|
|
Map<String, String> fieldsComment = (Map<String, String>) jo.get("fieldsComment");
|
|
|
|
|
|
|
|
|
|
String fullParameters = "";//带数据类型+字段名称
|
|
|
|
|
String parasWithoutPrimaryKey = "";//带数据类型+字段名称
|
|
|
|
|
String daoFillParameters = "";//不带数据类型,只有字段名称
|
|
|
|
|
for (Map.Entry<String, String> entry : fields.entrySet()) {
|
|
|
|
|
if (!entry.getKey().equals("create_time") && !entry.getKey().equals("b_use")) {
|
|
|
|
|
fullParameters += entry.getValue() + " " + entry.getKey() + " , ";//这里必须是反着来的,否则数据类型会重复
|
|
|
|
|
parasWithoutPrimaryKey += entry.getValue() + " " + entry.getKey() + " , ";//这里必须是反着来的,否则数据类型会重复
|
|
|
|
|
daoFillParameters += entry.getKey() + " , ";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//移除最后一个逗号
|
|
|
|
|
fullParameters = fullParameters.substring(0, fullParameters.length() - 1);
|
|
|
|
|
if (fullParameters.endsWith(",")) {//去掉最后的逗号
|
|
|
|
|
fullParameters = fullParameters.substring(0, fullParameters.length() - 1);
|
|
|
|
|
parasWithoutPrimaryKey = parasWithoutPrimaryKey.substring(0, parasWithoutPrimaryKey.length() - 1);
|
|
|
|
|
if (parasWithoutPrimaryKey.endsWith(",")) {//去掉最后的逗号
|
|
|
|
|
parasWithoutPrimaryKey = parasWithoutPrimaryKey.substring(0, parasWithoutPrimaryKey.length() - 1);
|
|
|
|
|
}
|
|
|
|
|
daoFillParameters = daoFillParameters.substring(0, daoFillParameters.length() - 1);
|
|
|
|
|
if (daoFillParameters.endsWith(",")) {
|
|
|
|
@ -253,7 +253,7 @@ public class GenerateCode {
|
|
|
|
|
dataModel.put("paraList", paraList);//用于注释,显示@para 参数名 参数含义
|
|
|
|
|
dataModel.put("daoName", PropKit.get("daoName"));//显示dao的名称,比如ym
|
|
|
|
|
dataModel.put("beanName", beanName);//实体Bean的名称,用于构建方法名
|
|
|
|
|
dataModel.put("fullParameters", fullParameters);//包括主键的参数列表,用于构建方法的参数
|
|
|
|
|
dataModel.put("parasWithoutPrimaryKey", parasWithoutPrimaryKey);//包括主键的参数列表,用于构建方法的参数
|
|
|
|
|
dataModel.put("daoFillParameters", daoFillParameters);//不包括主键的参数列表,用于构建方法的参数
|
|
|
|
|
dataModel.put("key", key);//主键名称
|
|
|
|
|
dataModel.put("key_type", key_type);//主键类型
|
|
|
|
|