提交 7dc811c4 编写于 作者: sq3536's avatar sq3536

columnName

上级 6cb7aea2
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.util.TypeUtils;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
......@@ -27,6 +28,7 @@ import net.ibizsys.runtime.util.IEntity;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.data.annotation.Transient;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
......@@ -912,5 +914,18 @@ public class BaseData implements IEntityDTO {
private static Set<String> _SYSTEMPROP=new BaseData().getMap().keySet();
public UpdateWrapper getUpdateWrapper(boolean clean) {
UpdateWrapper wrapper=new UpdateWrapper();
for(String nullField:getFocusNull()) {
String columnName=FieldCache.getField(this.getClass(),nullField).getColumnName();
if(!ObjectUtils.isEmpty(columnName))
wrapper.set(columnName,null);
}
if(clean) {
getFocusNull().clear();
}
return wrapper;
}
}
......@@ -3,6 +3,7 @@ package net.ibizsys.central.plugin.boot.core.helper;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.util.TypeUtils;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -98,6 +99,15 @@ public class FieldCache {
item.setLogicName(apiModelProperty.notes());
}
TableField tableField=field.getAnnotation(TableField.class);
if(!ObjectUtils.isEmpty(tableField)) {
if(tableField.exist()&&(ObjectUtils.isEmpty(tableField.value()))) {
item.setFieldName(tableField.value()).setColumnName(tableField.value());
}
else if(!tableField.exist())
item.setColumnName("");
}
if(!cacheDEKeyField.containsKey(className))
{
if(!ObjectUtils.isEmpty(field.getAnnotation(Id.class)))
......
......@@ -48,7 +48,6 @@ public class Inflector {
plural("(?:([^f])fe|([lr])f)$", "$1$2ves");
plural("(hive)$", "$1s");
plural("([^aeiouy]|qu)y$", "$1ies");
plural("([^aeiouy]|qu)ies$", "$1y");
plural("(x|ch|ss|sh)$", "$1es");
plural("(matr|vert|ind)ix|ex$", "$1ices");
plural("([m|l])ouse$", "$1ice");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册