模板String get返回增加 trim 方法

This commit is contained in:
wenc000 2020-06-18 15:31:40 +08:00
parent 2f6387288a
commit da3477d87d
2 changed files with 9 additions and 9 deletions

View File

@ -44,7 +44,7 @@ public class ${firstUpperTableName}DTO {
</#list>
public String get${firstUpperTableName}Id() {
return ${firstLowerTableName}Id == null ? "" : ${firstLowerTableName}Id;
return ${firstLowerTableName}Id == null ? "" : ${firstLowerTableName}Id.trim();
}
public void set${firstUpperTableName}Id(String ${firstLowerTableName}Id) {
@ -72,7 +72,7 @@ public class ${firstUpperTableName}DTO {
<#elseif field.fieldType == "radio" || field.fieldType == "checkbox" || field.fieldType == "select">
public String get${field.firstUpperFieldName}() {
return ${field.fieldName} == null ? "" : ${field.fieldName};
return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
}
public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
@ -80,7 +80,7 @@ public class ${firstUpperTableName}DTO {
}
public String get${field.firstUpperFieldName}DictionaryName() {
return ${field.fieldName}DictionaryName == null ? "" : ${field.fieldName}DictionaryName;
return ${field.fieldName}DictionaryName == null ? "" : ${field.fieldName}DictionaryName.trim();
}
public void set${field.firstUpperFieldName}DictionaryName(String ${field.fieldName}DictionaryName) {
@ -88,7 +88,7 @@ public class ${firstUpperTableName}DTO {
}
<#elseif field.fieldType == "innerJoin" || field.fieldType == "leftJoin" || field.fieldType == "rightJoin">
public String get${field.firstUpperFieldName}() {
return ${field.fieldName} == null ? "" : ${field.fieldName};
return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
}
public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
@ -98,7 +98,7 @@ public class ${firstUpperTableName}DTO {
<#list field.listJoinTableField! as joinTableField>
<#if joinTableField.listShow == 1>
public String get${field.firstUpperJoinTable}${joinTableField.firstUpperFieldName}() {
return ${field.joinTable}${joinTableField.firstUpperFieldName} == null ? "" : ${field.joinTable}${joinTableField.firstUpperFieldName};
return ${field.joinTable}${joinTableField.firstUpperFieldName} == null ? "" : ${field.joinTable}${joinTableField.firstUpperFieldName}.trim();
}
public void set${field.firstUpperJoinTable}${joinTableField.firstUpperFieldName}(String ${field.joinTable}${joinTableField.firstUpperFieldName}) {
@ -109,7 +109,7 @@ public class ${firstUpperTableName}DTO {
</#list>
<#else>
public String get${field.firstUpperFieldName}() {
return ${field.fieldName} == null ? "" : ${field.fieldName};
return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
}
public void set${field.firstUpperFieldName}(String ${field.fieldName}) {

View File

@ -62,7 +62,7 @@ public class ${firstUpperTableName}VO {
<#list fieldList! as field>
<#if field.fieldType == "join">
public String get${field.firstUpperFieldName}() {
return ${field.fieldName} == null ? "" : ${field.fieldName};
return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
}
public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
@ -89,7 +89,7 @@ public class ${firstUpperTableName}VO {
<#elseif field.fieldType == "date" || field.fieldType == "datetime">
public String get${field.firstUpperFieldName}() {
return ${field.fieldName} == null ? "" : ${field.fieldName};
return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
}
public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
@ -98,7 +98,7 @@ public class ${firstUpperTableName}VO {
<#else>
public String get${field.firstUpperFieldName}() {
return ${field.fieldName} == null ? "" : ${field.fieldName};
return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
}
public void set${field.firstUpperFieldName}(String ${field.fieldName}) {