提交 33f09d77 authored 作者: Live's avatar Live 提交者: Gitee

生成domain 如果是浮点型 统一用BigDecimal

上级 7afc5acc
...@@ -58,11 +58,11 @@ public class GenUtils ...@@ -58,11 +58,11 @@ public class GenUtils
{ {
column.setHtmlType(GenConstants.HTML_INPUT); column.setHtmlType(GenConstants.HTML_INPUT);
// 如果是浮点型 // 如果是浮点型 统一用BigDecimal
String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ",");
if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0)
{ {
column.setJavaType(GenConstants.TYPE_DOUBLE); column.setJavaType(GenConstants.TYPE_BIGDECIMAL);
} }
// 如果是整形 // 如果是整形
else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论