dcs 5 mēneši atpakaļ
vecāks
revīzija
cf576defa2

+ 220 - 5
virgo.api/src/main/java/com/bosshand/virgo/api/test/model/EnergyAnalysis.java

@@ -1,5 +1,7 @@
 package com.bosshand.virgo.api.test.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
 /**
  * 用能分析
  */
@@ -7,8 +9,20 @@ public class EnergyAnalysis {
 
     private int id;
 
+    private long projectId;
+
+    /**
+     * 时间
+     */
+    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private String date;
+
+    private String startDate;
+
+    private String endDate;
+
     /**
-     * 类型 用水,用电,用气
+     * 类型 1,用水,2,用电,3,用气
      */
     private int type;
 
@@ -17,6 +31,26 @@ public class EnergyAnalysis {
      */
     private String unit;
 
+    /**
+     * 日用量
+     */
+    private String dayValue;
+
+    /**
+     * 日额定用量
+     */
+    private String ratedDayValue;
+
+    /**
+     * 日环比
+     */
+    private String chainDayValue;
+
+    /**
+     * 日约定额
+     */
+    private String stipulationDayValue;
+
     /**
      * 月用量
      */
@@ -27,6 +61,16 @@ public class EnergyAnalysis {
      */
     private String ratedMonthValue;
 
+    /**
+     * 月环比
+     */
+    private String chainMonthValue;
+
+    /**
+     * 月约定额
+     */
+    private String stipulationMonthValue;
+
     /**
      * 季用量
      */
@@ -37,6 +81,16 @@ public class EnergyAnalysis {
      */
     private String ratedSeasonValue;
 
+    /**
+     * 季环比
+     */
+    private String chainSeasonValue;
+
+    /**
+     * 季约定额
+     */
+    private String stipulationSeasonValue;
+
     /**
      * 年用量
      */
@@ -47,6 +101,31 @@ public class EnergyAnalysis {
      */
     private String ratedYearValue;
 
+    /**
+     * 年环比
+     */
+    private String chainYearValue;
+
+    /**
+     * 年约定额
+     */
+    private String stipulationYearValue;
+
+    /**
+     * 预留字段1
+     */
+    private String  column1;
+
+    /**
+     * 预留字段2
+     */
+    private String  column2;
+
+    /**
+     * 预留字段3
+     */
+    private String  column3;
+
     public int getId() {
         return id;
     }
@@ -55,12 +134,12 @@ public class EnergyAnalysis {
         this.id = id;
     }
 
-    public String getUnit() {
-        return unit;
+    public long getProjectId() {
+        return projectId;
     }
 
-    public void setUnit(String unit) {
-        this.unit = unit;
+    public void setProjectId(long projectId) {
+        this.projectId = projectId;
     }
 
     public int getType() {
@@ -71,6 +150,70 @@ public class EnergyAnalysis {
         this.type = type;
     }
 
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getDayValue() {
+        return dayValue;
+    }
+
+    public void setDayValue(String dayValue) {
+        this.dayValue = dayValue;
+    }
+
+    public String getRatedDayValue() {
+        return ratedDayValue;
+    }
+
+    public void setRatedDayValue(String ratedDayValue) {
+        this.ratedDayValue = ratedDayValue;
+    }
+
+    public String getChainDayValue() {
+        return chainDayValue;
+    }
+
+    public void setChainDayValue(String chainDayValue) {
+        this.chainDayValue = chainDayValue;
+    }
+
+    public String getStipulationDayValue() {
+        return stipulationDayValue;
+    }
+
+    public void setStipulationDayValue(String stipulationDayValue) {
+        this.stipulationDayValue = stipulationDayValue;
+    }
+
     public String getMonthValue() {
         return monthValue;
     }
@@ -87,6 +230,22 @@ public class EnergyAnalysis {
         this.ratedMonthValue = ratedMonthValue;
     }
 
+    public String getChainMonthValue() {
+        return chainMonthValue;
+    }
+
+    public void setChainMonthValue(String chainMonthValue) {
+        this.chainMonthValue = chainMonthValue;
+    }
+
+    public String getStipulationMonthValue() {
+        return stipulationMonthValue;
+    }
+
+    public void setStipulationMonthValue(String stipulationMonthValue) {
+        this.stipulationMonthValue = stipulationMonthValue;
+    }
+
     public String getSeasonValue() {
         return seasonValue;
     }
@@ -103,6 +262,22 @@ public class EnergyAnalysis {
         this.ratedSeasonValue = ratedSeasonValue;
     }
 
+    public String getChainSeasonValue() {
+        return chainSeasonValue;
+    }
+
+    public void setChainSeasonValue(String chainSeasonValue) {
+        this.chainSeasonValue = chainSeasonValue;
+    }
+
+    public String getStipulationSeasonValue() {
+        return stipulationSeasonValue;
+    }
+
+    public void setStipulationSeasonValue(String stipulationSeasonValue) {
+        this.stipulationSeasonValue = stipulationSeasonValue;
+    }
+
     public String getYearValue() {
         return yearValue;
     }
@@ -118,4 +293,44 @@ public class EnergyAnalysis {
     public void setRatedYearValue(String ratedYearValue) {
         this.ratedYearValue = ratedYearValue;
     }
+
+    public String getChainYearValue() {
+        return chainYearValue;
+    }
+
+    public void setChainYearValue(String chainYearValue) {
+        this.chainYearValue = chainYearValue;
+    }
+
+    public String getStipulationYearValue() {
+        return stipulationYearValue;
+    }
+
+    public void setStipulationYearValue(String stipulationYearValue) {
+        this.stipulationYearValue = stipulationYearValue;
+    }
+
+    public String getColumn1() {
+        return column1;
+    }
+
+    public void setColumn1(String column1) {
+        this.column1 = column1;
+    }
+
+    public String getColumn2() {
+        return column2;
+    }
+
+    public void setColumn2(String column2) {
+        this.column2 = column2;
+    }
+
+    public String getColumn3() {
+        return column3;
+    }
+
+    public void setColumn3(String column3) {
+        this.column3 = column3;
+    }
 }

+ 36 - 2
virgo.api/src/main/resources/mapper/EnergyAnalysisMapper.xml

@@ -6,28 +6,62 @@
 
     <resultMap type="com.bosshand.virgo.api.test.model.EnergyAnalysis" id="IResult" >
         <id column="id" property="id"/>
+        <result column="projectId" property="projectId"/>
         <result column="type" property="type"/>
+        <result column="date" property="date"/>
         <result column="unit" property="unit"/>
+
+        <result column="dayValue" property="dayValue"/>
+        <result column="ratedDayValue" property="ratedDayValue"/>
+        <result column="chainDayValue" property="chainDayValue"/>
+        <result column="stipulationDayValue" property="stipulationDayValue"/>
+
         <result column="monthValue" property="monthValue"/>
+        <result column="chainMonthValue" property="chainMonthValue"/>
+        <result column="stipulationMonthValue" property="stipulationMonthValue"/>
         <result column="ratedMonthValue" property="ratedMonthValue"/>
+
         <result column="seasonValue" property="seasonValue"/>
+        <result column="chainSeasonValue" property="chainSeasonValue"/>
+        <result column="stipulationSeasonValue" property="stipulationSeasonValue"/>
         <result column="ratedSeasonValue" property="ratedSeasonValue"/>
+
         <result column="yearValue" property="yearValue"/>
         <result column="ratedYearValue" property="ratedYearValue"/>
+        <result column="chainYearValue" property="chainYearValue"/>
+        <result column="stipulationYearValue" property="stipulationYearValue"/>
+
+        <result column="column1" property="column1"/>
+        <result column="column2" property="column2"/>
+        <result column="column3" property="column3"/>
+
     </resultMap>
 
     <select id="get" resultMap="IResult">
         SELECT * FROM test_i
         <where>
+            <if test="projectId != 0">
+                and projectId = #{projectId}
+            </if>
             <if test="type != 0">
                 and type = #{type}
             </if>
+            <if test="startDate != null">
+                and date <![CDATA[ >= ]]> #{startDate}
+            </if>
+            <if test="endDate != null">
+                and date <![CDATA[ <= ]]> #{endDate}
+            </if>
         </where>
     </select>
 
     <insert id="save" parameterType="com.bosshand.virgo.api.test.model.EnergyAnalysis" useGeneratedKeys="true" keyProperty="id">
-        INSERT into test_i(`type`, `unit`, `monthValue`, `ratedMonthValue`, `seasonValue`, `ratedSeasonValue`, `yearValue`, `ratedYearValue`)
-        values (#{type}, #{unit}, #{monthValue}, #{ratedMonthValue}, #{seasonValue}, #{ratedSeasonValue}, #{yearValue}, #{ratedYearValue})
+        INSERT into test_i(`projectId`, `date`, `type`, `unit`, `dayValue`, `ratedDayValue`, `chainDayValue`, `stipulationDayValue`, `monthValue`, `ratedMonthValue`,
+                           `chainMonthValue`, `stipulationMonthValue`, `seasonValue`, `ratedSeasonValue`,`chainSeasonValue`, `stipulationSeasonValue`, `yearValue`,
+                           `ratedYearValue`, `chainYearValue`, `stipulationYearValue`, `column1`, `column2`, `column3`)
+        values (#{projectId}, now(), #{type}, #{unit}, #{dayValue}, #{ratedDayValue}, #{chainDayValue}, #{stipulationDayValue}, #{monthValue},
+                #{ratedMonthValue}, #{chainMonthValue}, #{stipulationMonthValue}, #{seasonValue}, #{ratedSeasonValue}, #{chainSeasonValue}, #{stipulationSeasonValue}, #{yearValue},
+                #{ratedYearValue}, #{chainYearValue}, #{stipulationYearValue}, #{column1}, #{column2}, #{column3})
     </insert>
 
 </mapper>