mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2026-03-22 15:39:04 +08:00
| 2025.03.16 | 修复由于SQL类型大写导致无法转换的问题。(感谢@zzy-design的反馈)<br> JPA模板:修复不开启Lombok情况下Set/Get方法生成问题;修复importDdate判断为true后没有引入日期类的问题(感谢@PenroseYang的反馈)
This commit is contained in:
@@ -308,7 +308,8 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
fieldName = columnName;
|
||||
}
|
||||
columnLine = columnLine.substring(columnLine.indexOf("`") + 1).trim();
|
||||
String mysqlType = columnLine.split("\\s+")[1];
|
||||
//2025-03-16 修复由于类型大写导致无法转换的问题
|
||||
String mysqlType = columnLine.split("\\s+")[1].toLowerCase(Locale.ROOT);
|
||||
if(mysqlType.contains("(")){
|
||||
mysqlType = mysqlType.substring(0, mysqlType.indexOf("("));
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#if importDdate?exists && importDdate==true>import java.util.Date;</#if>
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
@@ -40,8 +40,10 @@ public class ${classInfo.className} implements Serializable {
|
||||
</#list>
|
||||
public ${classInfo.className}() {
|
||||
}
|
||||
</#if>
|
||||
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
<#if isLombok?exists && isLombok==false>
|
||||
public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
|
||||
return ${fieldItem.fieldName};
|
||||
@@ -51,4 +53,6 @@ public class ${classInfo.className} implements Serializable {
|
||||
this.${fieldItem.fieldName} = ${fieldItem.fieldName};
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
</#if></#if>
|
||||
@@ -8,6 +8,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#if importDdate?exists && importDdate==true>import java.util.Date;</#if>
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
@@ -21,6 +22,4 @@ import org.springframework.stereotype.Repository;
|
||||
@Repository
|
||||
public interface ${classInfo.className}Repository extends JpaRepository<${classInfo.className},Integer> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#if importDdate?exists && importDdate==true>import java.util.Date;</#if>
|
||||
import java.util.List;
|
||||
import io.mybatis.mapper.Mapper;
|
||||
</#if>
|
||||
|
||||
Reference in New Issue
Block a user