mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2025-12-26 05:48:33 +08:00
修复处理number/decimal(x,x)类型的逻辑(感谢@arthaschan的反馈),修复JdbcTemplates模板两处错误(感谢@everflourish的反馈)。
This commit is contained in:
parent
d2283b4507
commit
6fb2cbae63
@ -16,6 +16,7 @@ SpringBootCodeGenerator
|
||||
<tr><td>CSDN博客</td> <td>http://blog.csdn.net/moshowgame</td></tr>
|
||||
<tr><td></td> <td></td></tr>
|
||||
<tr><td>更新日期</td> <td>更新内容</td></tr>
|
||||
<tr><td>20190106<td>修复处理number/decimal(x,x)类型的逻辑(感谢@arthaschan的反馈),修复JdbcTemplates模板两处错误(感谢@everflourish的反馈)。</td></tr>
|
||||
<tr><td>20181212<td>首页UI优化,新增MybatisPlus模块(感谢@三叔同事的建议),修复作者名和包名获取失败问题(感谢@Yanch1994的反馈)。</td></tr>
|
||||
<tr><td>20181122<td>优化正则表达式点号的处理,优化处理字段类型,对number类型增加int,long,BigDecimal的区分判断(感谢@lshz0088的指导)。</td></tr>
|
||||
<tr><td>20181108<td>修复非字段描述"KEY FK_xxxx (xxxx)"导致生成KEY字段情况(感谢@tornadoorz反馈)。</td></tr>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.softdev.system.generator.util;
|
||||
|
||||
|
||||
|
||||
import com.softdev.system.generator.entity.ClassInfo;
|
||||
import com.softdev.system.generator.entity.FieldInfo;
|
||||
|
||||
@ -185,9 +184,17 @@ public class TableParseUtil {
|
||||
if(startKh>=0){
|
||||
int endKh=columnLine.indexOf(")",startKh);
|
||||
String[] fanwei=columnLine.substring(startKh+1,endKh).split(",");
|
||||
if("0".equals(fanwei[1])){
|
||||
//如果没有小数位数
|
||||
//2019-1-5 zhengk 修复@arthaschan反馈的超出范围错误
|
||||
//System.out.println("fanwei"+ JSON.toJSONString(fanwei));
|
||||
// //number(20,6) fanwei["20","6"]
|
||||
// //number(0,6) fanwei["0","6"]
|
||||
// //number(20,0) fanwei["20","0"]
|
||||
// //number(20) fanwei["20"]
|
||||
//如果括号里是1位或者2位且第二位为0,则进行特殊处理。只有有小数位,都设置为BigDecimal。
|
||||
if((fanwei.length>1&&"0".equals(fanwei[1]))||fanwei.length==1){
|
||||
int length=Integer.valueOf(fanwei[0]);
|
||||
if(fanwei.length>1) length=Integer.valueOf(fanwei[1]);
|
||||
//数字范围9位及一下用Integer,大的用Long
|
||||
if(length<=9){
|
||||
fieldClass = Integer.class.getSimpleName();
|
||||
}else{
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.List;
|
||||
* ${classInfo.classComment}
|
||||
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
|
||||
*/
|
||||
public interface IAccountDAO {
|
||||
public interface I${classInfo.className}DAO {
|
||||
|
||||
int add(${classInfo.classComment} ${classInfo.className?uncap_first});
|
||||
|
||||
|
||||
@ -28,8 +28,7 @@ public class ${classInfo.className}DaoImpl implements I${classInfo.className}Dao
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0 >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}(),</#if></#list>
|
||||
<#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0 >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}()</#if></#list>
|
||||
|
||||
</#if>
|
||||
</#if>;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user