Browse Source

新增日志表

shaohongbo 3 years ago
parent
commit
fb2c529d87

+ 45 - 0
src/main/java/com/persagy/apm/diagnose/constant/EnumComputeLogType.java

@@ -0,0 +1,45 @@
+package com.persagy.apm.diagnose.constant;
+
+/**
+ * Description: 能耗分表支持的几种时间粒度常量  
+ * Company: Persagy 
+ * @author cuixubin 
+ * @version 1.0
+ * @since: 2018年8月27日: 下午7:01:08
+ * Update By cuixubin 2018年8月27日: 下午7:01:08
+ */
+public enum EnumTimeType {
+	MIN15(0, "15分钟"), HOUR(1, "1h"), DAY(2, "1d"), MONTH(3, "1month"), YEAR(4, "1year");
+	
+	private int code;
+	private String name;
+	
+	public int getCode() {
+		return code;
+	}
+	public String getName() {
+		return name;
+	}
+
+	EnumTimeType(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+	
+	/**
+	 * Description: 根据编码获取TimeDimension枚举值
+	 * @param code
+	 * @return TimeDimension
+	 * @author JiShaoJun
+	 * @since 2018年8月30日: 下午2:57:17
+	 * Update By JiShaoJun 2018年8月30日: 下午2:57:17
+	 */
+	public static EnumTimeType getTimeDimension(int code) {
+		for(EnumTimeType item : EnumTimeType.values()) {
+			if(item.getCode() == code) {
+				return item;
+			}
+		}
+		return null;
+	}
+}

+ 52 - 0
src/main/java/com/persagy/framework/ems/data/pojo/hbase/IndicatorComputeLog.java

@@ -0,0 +1,52 @@
+package com.persagy.framework.ems.data.pojo.hbase;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.persagy.framework.ems.data.core.annotation.Column;
+import com.persagy.framework.ems.data.core.annotation.Dimension;
+import com.persagy.framework.ems.data.core.annotation.Entity;
+import com.persagy.framework.ems.data.core.annotation.Index;
+import com.persagy.framework.ems.data.core.annotation.Table;
+import com.persagy.framework.ems.data.core.annotation.TimePatition;
+import com.persagy.framework.ems.data.core.enumeration.EMSDimension;
+import com.persagy.framework.ems.data.core.enumeration.Schema;
+import com.persagy.framework.ems.data.core.enumeration.TimePatitionType;
+import com.persagy.framework.ems.data.mvc.pojo.BusinessObject;
+import lombok.Data;
+
+@Entity(name = "MonitorIndicatorRecord")
+@Table(name = "monitor_indicator", comment = "设备运行诊断指标数据", schema = Schema.UDM,
+		indexes = {
+				@Index(columns = { "project", "obj_id", "monitor_indicator_id", "data_time"}, unique = true)
+})
+@Dimension
+@TimePatition(column = "data_time", type = TimePatitionType.month)
+@Data
+public class MonitorIndicatorRecord extends BusinessObject {
+
+	private static final long serialVersionUID = 9123470427203487460L;
+
+	@Column(order = 10, name = "project", length = 20, nullable = false, comment = "项目/建筑id")
+	@JsonProperty("project")
+	private String project;
+	
+	@Column(order = 20, name = "obj_id", length = 50, nullable = true, comment = "能耗模型id")
+	@JsonProperty("objId")
+	private String objId;
+	
+	@Column(order = 30, name = "monitor_indicator_id", length = 50, nullable = true, comment = "分项id")
+	@JsonProperty("monitorIndicatorId")
+	private String monitorIndicatorId;
+
+
+	@Column(order = 40, name = "data_time", length = 0, nullable = false, comment = "数据时间")
+	@JsonProperty("dataTime")
+	private Date dataTime;
+
+	@Column(order = 50, name = "data_value", length = 28, scale = 8, nullable = false, comment = "数据值")
+	@JsonProperty("dataValue")
+	private Double dataValue;
+
+
+}