feat(uapbd): 添加skipNull工具方法新增skipNull静态方法用于处理空值情况,当传入对象为null或空字符串时返回空字符串,

否则返回去除首尾空格的字符串值。该方法可有效避免空指针异常和无效空格问题。
This commit is contained in:
mzr 2025-09-21 09:15:19 +08:00
parent 6cc2585572
commit 84207f18d9
1 changed files with 8 additions and 0 deletions

View File

@ -184,4 +184,12 @@ public class MyHelper {
// NCCForUAPLogger.debug(countSql);
return (Integer) dao.executeQuery(countSql, new ColumnProcessor());
}
public static String skipNull(Object value) {
if ((value == null) || (value.toString().trim().length() == 0)) {
return "";
}
return value.toString().trim();
}
}