update 优化 代码生成表名判断 使用开头判断避免误判

This commit is contained in:
疯狂的狮子Li
2024-08-29 10:38:19 +08:00
parent 0ebfcf1edd
commit f497b33e88

View File

@@ -149,11 +149,11 @@ public class GenTableServiceImpl implements IGenTableService {
boolean commentMatches = true;
// 进行表名称的模糊查询
if (StringUtils.isNotBlank(tableName)) {
nameMatches = StringUtils.containsIgnoreCase(x.getName(), tableName);
nameMatches = StringUtils.startsWithIgnoreCase(x.getName(), tableName);
}
// 进行表描述的模糊查询
if (StringUtils.isNotBlank(tableComment)) {
commentMatches = StringUtils.containsIgnoreCase(x.getComment(), tableComment);
commentMatches = StringUtils.startsWithIgnoreCase(x.getComment(), tableComment);
}
// 同时匹配名称和描述
return nameMatches && commentMatches;