diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/dto.ftl b/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/dto.ftl index 57be7a6..cdcb9ea 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/dto.ftl +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/dto.ftl @@ -44,7 +44,7 @@ public class ${firstUpperTableName}DTO { 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 { <#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}) { diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/vo.ftl b/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/vo.ftl index b7cda5c..a56e57d 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/vo.ftl +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/codetemplate/default/pojo/vo.ftl @@ -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}) {