update CodegenEngine.java.

模块名称和表名称一样时,代码生成存在问题,如“shop”模块的“shop”表生成代码时shop都被移除了

Signed-off-by: 山野羡民 <liyujiang_tk@yeah.net>
This commit is contained in:
山野羡民 2024-06-14 06:27:42 +00:00 committed by Gitee
parent 41ea482f8d
commit ff461ea9d6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -342,7 +342,8 @@ public class CodegenEngine {
// className 相关
// 去掉指定前缀 TestDictType 转换成 DictType. 因为在 create 等方法后不需要带上 Test 前缀
String simpleClassName = removePrefix(table.getClassName(), upperFirst(table.getModuleName()));
String simpleClassName = equalsAnyIgnoreCase(table.getClassName(), table.getModuleName()) ? table.getClassName()
: removePrefix(table.getClassName(), upperFirst(table.getModuleName()));
bindingMap.put("simpleClassName", simpleClassName);
bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // DictType 转换成 dict_type
bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // DictType 转换成 dictType用于变量