style: 调整代码风格 null != xx => xx != null(更符合大众风格)

This commit is contained in:
2025-05-21 22:21:39 +08:00
parent 0f3e94f32f
commit a07a2dcd65
12 changed files with 26 additions and 27 deletions

View File

@@ -134,7 +134,7 @@ public class GeneratorServiceImpl implements GeneratorService {
GenConfigDO lastGenConfig = genConfigMapper.selectOne(Wrappers.lambdaQuery(GenConfigDO.class)
.orderByDesc(GenConfigDO::getCreateTime)
.last("LIMIT 1"));
if (null != lastGenConfig) {
if (lastGenConfig != null) {
genConfig.setAuthor(lastGenConfig.getAuthor());
}
}
@@ -163,7 +163,7 @@ public class GeneratorServiceImpl implements GeneratorService {
FieldConfigDO fieldConfig = Optional.ofNullable(fieldConfigMap.get(column.getName()))
.orElseGet(() -> new FieldConfigDO(column));
// 更新已有字段配置
if (null != fieldConfig.getCreateTime()) {
if (fieldConfig.getCreateTime() != null) {
fieldConfig.setColumnType(column.getTypeName());
fieldConfig.setColumnSize(column.getSize());
}
@@ -213,7 +213,7 @@ public class GeneratorServiceImpl implements GeneratorService {
// 保存或更新生成配置信息
GenConfigDO newGenConfig = req.getGenConfig();
GenConfigDO oldGenConfig = genConfigMapper.selectById(tableName);
if (null != oldGenConfig) {
if (oldGenConfig != null) {
BeanUtil.copyProperties(newGenConfig, oldGenConfig);
genConfigMapper.updateById(oldGenConfig);
} else {