LAPTOP-KB9HII50\70708 2 年 前
コミット
87909a1f8d

+ 140 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/ehr/standard/MStdDatasetRelation.java

@ -0,0 +1,140 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.yihu.jw.restmodel.ehr.standard;
import java.io.Serializable;
public class MStdDatasetRelation implements Serializable {
    private Integer id;
    private Long parentDatasetId;
    private String parentDatasetCode;
    private String parentDatasetName;
    private Long parentMetadataId;
    private String parentMetadataCode;
    private String parentMetadataName;
    private String relation;
    private Long childDatasetId;
    private String childDatasetCode;
    private String childDatasetName;
    private Long childMetadataId;
    private String childMetadataCode;
    private String childMetadataName;
    public MStdDatasetRelation() {
    }
    public Integer getId() {
        return this.id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Long getParentDatasetId() {
        return this.parentDatasetId;
    }
    public void setParentDatasetId(Long parentDatasetId) {
        this.parentDatasetId = parentDatasetId;
    }
    public String getParentDatasetCode() {
        return this.parentDatasetCode;
    }
    public void setParentDatasetCode(String parentDatasetCode) {
        this.parentDatasetCode = parentDatasetCode;
    }
    public String getParentDatasetName() {
        return this.parentDatasetName;
    }
    public void setParentDatasetName(String parentDatasetName) {
        this.parentDatasetName = parentDatasetName;
    }
    public Long getParentMetadataId() {
        return this.parentMetadataId;
    }
    public void setParentMetadataId(Long parentMetadataId) {
        this.parentMetadataId = parentMetadataId;
    }
    public String getParentMetadataCode() {
        return this.parentMetadataCode;
    }
    public void setParentMetadataCode(String parentMetadataCode) {
        this.parentMetadataCode = parentMetadataCode;
    }
    public String getParentMetadataName() {
        return this.parentMetadataName;
    }
    public void setParentMetadataName(String parentMetadataName) {
        this.parentMetadataName = parentMetadataName;
    }
    public String getRelation() {
        return this.relation;
    }
    public void setRelation(String relation) {
        this.relation = relation;
    }
    public Long getChildDatasetId() {
        return this.childDatasetId;
    }
    public void setChildDatasetId(Long childDatasetId) {
        this.childDatasetId = childDatasetId;
    }
    public String getChildDatasetCode() {
        return this.childDatasetCode;
    }
    public void setChildDatasetCode(String childDatasetCode) {
        this.childDatasetCode = childDatasetCode;
    }
    public String getChildDatasetName() {
        return this.childDatasetName;
    }
    public void setChildDatasetName(String childDatasetName) {
        this.childDatasetName = childDatasetName;
    }
    public Long getChildMetadataId() {
        return this.childMetadataId;
    }
    public void setChildMetadataId(Long childMetadataId) {
        this.childMetadataId = childMetadataId;
    }
    public String getChildMetadataCode() {
        return this.childMetadataCode;
    }
    public void setChildMetadataCode(String childMetadataCode) {
        this.childMetadataCode = childMetadataCode;
    }
    public String getChildMetadataName() {
        return this.childMetadataName;
    }
    public void setChildMetadataName(String childMetadataName) {
        this.childMetadataName = childMetadataName;
    }
}

+ 53 - 0
common/common-util/src/main/java/com/yihu/jw/util/sql/SqlCreator.java

@ -28,6 +28,59 @@ public class SqlCreator {
        transformer = new BeanTransformer(tClass);
    }
    public String insertDataToSQL(String tabelName, JsonNode jsonNode) {
        this.setTableName(tabelName);
        Iterator var3 = this.transformer.columnToProperty.keySet().iterator();
        while(var3.hasNext()) {
            Object key = var3.next();
            String property = StringUtil.toString(this.transformer.columnToProperty.get(key));
            JsonNode propertyJsonNode = jsonNode.get(property);
            if (propertyJsonNode != null) {
                this.itemList.add(StringUtil.toString(key));
                this.itemValueList.add(":" + property);
                this.setKeyValueMapByType(property, propertyJsonNode, this.keyValueMap);
            }
        }
        return this.insertDataToSql();
    }
    public String insertDataToSql() {
        StringBuilder sqlBuffer = new StringBuilder();
        sqlBuffer.append(" INSERT INTO " + this.tableName + "(");
        Iterator var2 = this.itemList.iterator();
        while(var2.hasNext()) {
            String item = (String)var2.next();
            sqlBuffer.append(item + ",");
        }
        sqlBuffer.deleteCharAt(sqlBuffer.length() - 1);
        sqlBuffer.append(") VALUES (");
        var2 = this.keyValueMap.entrySet().iterator();
        while(true) {
            while(var2.hasNext()) {
                Map.Entry<String, Object> entry = (Map.Entry)var2.next();
                Object value = entry.getValue();
                if (value == null) {
                    sqlBuffer.append(entry.getValue() + ",");
                } else if (!(value instanceof Integer) && !(value instanceof Long) && !(value instanceof Double) && !(value instanceof Float) && !(value instanceof Short) && !(value instanceof Byte)) {
                    if (value instanceof Character || value instanceof String) {
                        sqlBuffer.append("'" + entry.getValue() + "',");
                    }
                } else {
                    sqlBuffer.append(entry.getValue() + ",");
                }
            }
            sqlBuffer.deleteCharAt(sqlBuffer.length() - 1);
            sqlBuffer.append(");");
            return sqlBuffer.toString();
        }
    }
    public String insertData() {
        StringBuilder sqlBuffer = new StringBuilder();

+ 10 - 0
common/commons-ehr-constants/src/main/java/com/yihu/ehr/constants/ServiceApi.java

@ -1787,4 +1787,14 @@ public class ServiceApi {
    }
    public static class StdRelation {
        public static final String Modify = "/stdRelation";
        public static final String DeleteById = "/stdRelation/{ids}";
        public static final String List = "stdRelation/list";
        public static final String ListNoPage = "stdRelation/listNoPage";
        public static final String IsUnique = "stdRelation/isUnique";
        public StdRelation() {
        }
    }
}