瀏覽代碼

计量模型修改

lv.wenbin 11 月之前
父節點
當前提交
dffa1458d0

+ 2 - 54
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElecPgSupplyH.java

@@ -61,30 +61,14 @@ public class ElecPgSupplyH extends BaseEntity
     @Excel(name = "单位电价")
     private Double meterUnitPrice;
 
-    /** 用电读数 */
-    @Excel(name = "用电读数")
-    private Double useElecReading;
-
     /** 用电量(kW-h) */
-    @Excel(name = "用电量", readConverterExp = "k=W-h")
+    @Excel(name = "用电量")
     private Double useElecQuantity;
 
     /** 用电电费(元) */
-    @Excel(name = "用电电费", readConverterExp = "元=")
+    @Excel(name = "用电电费")
     private Double useElecCost;
 
-    /** 上网读数 */
-    @Excel(name = "上网读数")
-    private Double upElecReading;
-
-    /** 上网电量(kW-h) */
-    @Excel(name = "上网电量", readConverterExp = "k=W-h")
-    private Double upElecQuantity;
-
-    /** 上网收益(元) */
-    @Excel(name = "上网收益", readConverterExp = "元=")
-    private Double upElecEarn;
-
     public Long getId() {
         return id;
     }
@@ -173,14 +157,6 @@ public class ElecPgSupplyH extends BaseEntity
         this.meterUnitPrice = meterUnitPrice;
     }
 
-    public Double getUseElecReading() {
-        return useElecReading;
-    }
-
-    public void setUseElecReading(Double useElecReading) {
-        this.useElecReading = useElecReading;
-    }
-
     public Double getUseElecQuantity() {
         return useElecQuantity;
     }
@@ -197,30 +173,6 @@ public class ElecPgSupplyH extends BaseEntity
         this.useElecCost = useElecCost;
     }
 
-    public Double getUpElecReading() {
-        return upElecReading;
-    }
-
-    public void setUpElecReading(Double upElecReading) {
-        this.upElecReading = upElecReading;
-    }
-
-    public Double getUpElecQuantity() {
-        return upElecQuantity;
-    }
-
-    public void setUpElecQuantity(Double upElecQuantity) {
-        this.upElecQuantity = upElecQuantity;
-    }
-
-    public Double getUpElecEarn() {
-        return upElecEarn;
-    }
-
-    public void setUpElecEarn(Double upElecEarn) {
-        this.upElecEarn = upElecEarn;
-    }
-
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -232,12 +184,8 @@ public class ElecPgSupplyH extends BaseEntity
                 .append("timeIndex", getTimeIndex())
                 .append("meterType", getMeterType())
                 .append("meterUnitPrice", getMeterUnitPrice())
-                .append("useElecReading", getUseElecReading())
                 .append("useElecQuantity", getUseElecQuantity())
                 .append("useElecCost", getUseElecCost())
-                .append("upElecReading", getUpElecReading())
-                .append("upElecQuantity", getUpElecQuantity())
-                .append("upElecEarn", getUpElecEarn())
                 .toString();
     }
 }

+ 0 - 25
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElecUseH.java

@@ -57,18 +57,11 @@ public class ElecUseH extends BaseEntity
     @Excel(name = "时间序列")
     private Long timeIndex;
 
-    /** 电表读数 */
-    @Excel(name = "电表读数")
-    private Long elecReading;
 
     /** 用电量 单位:kW-h(千瓦时) */
     @Excel(name = "用电量 单位:kW-h", readConverterExp = "千=瓦时")
     private Long elecQuantity;
 
-    /** 电费 单位: ¥(元) */
-    @Excel(name = "电费 单位: ¥", readConverterExp = "元=")
-    private Long elecCost;
-
     public Long getId() {
         return id;
     }
@@ -157,14 +150,6 @@ public class ElecUseH extends BaseEntity
         this.timeIndex = timeIndex;
     }
 
-    public Long getElecReading() {
-        return elecReading;
-    }
-
-    public void setElecReading(Long elecReading) {
-        this.elecReading = elecReading;
-    }
-
     public Long getElecQuantity() {
         return elecQuantity;
     }
@@ -173,14 +158,6 @@ public class ElecUseH extends BaseEntity
         this.elecQuantity = elecQuantity;
     }
 
-    public Long getElecCost() {
-        return elecCost;
-    }
-
-    public void setElecCost(Long elecCost) {
-        this.elecCost = elecCost;
-    }
-
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -192,9 +169,7 @@ public class ElecUseH extends BaseEntity
             .append("date", getDate())
             .append("time", getTime())
             .append("timeIndex", getTimeIndex())
-            .append("elecReading", getElecReading())
             .append("elecQuantity", getElecQuantity())
-            .append("elecCost", getElecCost())
             .toString();
     }
 }

+ 83 - 43
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/PvSupplyH.java

@@ -1,15 +1,12 @@
 package com.ruoyi.ems.domain;
 
-import java.sql.Time;
-import java.util.Date;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.web.domain.BaseEntity;
 
+import java.sql.Time;
+import java.util.Date;
+
 /**
  * 光伏并网计量-小时对象 adm_ems_pv_supply_h
  *
@@ -27,16 +24,31 @@ public class PvSupplyH extends BaseEntity {
     /**
      * 园区代码
      */
-    @Excel(name = "园区代码")
     private String areaCode;
 
     /**
+     * 园区名称
+     */
+    @Excel(name = "园区名称")
+    private String areaName;
+
+    /**
+     * 园区简称
+     */
+    private String areaShortName;
+
+    /**
      * 设施代码
      */
-    @Excel(name = "设施代码")
     private String facsCode;
 
     /**
+     * 设施名称
+     */
+    @Excel(name = "设施名称")
+    private String facsName;
+
+    /**
      * 日期 yyyy-MM-dd
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
@@ -57,34 +69,34 @@ public class PvSupplyH extends BaseEntity {
     private Long timeIndex;
 
     /**
-     * 计量类型 1:峰电计量  2:谷电计量
+     * 上网电价(1度电)
      */
-    @Excel(name = "计量类型 1:峰电计量  2:谷电计量")
-    private Long meterType;
+    @Excel(name = "单位电价")
+    private Double upUnitPrice;
 
     /**
-     * 单位电价(1度电
+     * 发电量 单位:kW-h(千瓦时
      */
-    @Excel(name = "单位电价", readConverterExp = "1=度电")
-    private Double meterUnitPrice;
+    @Excel(name = "发电量 单位:kW-h")
+    private Double genElecQuantity;
 
     /**
-     * 用电读数
+     * 自用电量 单位:kW-h(千瓦时)
      */
-    @Excel(name = "用电读数")
-    private Double elecReading;
+    @Excel(name = "自用电量 单位:kW-h")
+    private Double useElecQuantity;
 
     /**
-     * 电量 单位:kW-h(千瓦时)
+     * 上网电量 单位:kW-h(千瓦时)
      */
-    @Excel(name = "发电量 单位:kW-h", readConverterExp = "千=瓦时")
-    private Double elecQuantity;
+    @Excel(name = "上网电量 单位:kW-h")
+    private Double upElecQuantity;
 
     /**
      * 发电收益 单位: ¥(元)
      */
-    @Excel(name = "发电收益 单位: ¥", readConverterExp = "元=")
-    private Double elecEarn;
+    @Excel(name = "发电收益 单位: ¥")
+    private Double upElecEarn;
 
     public Long getId() {
         return id;
@@ -102,6 +114,22 @@ public class PvSupplyH extends BaseEntity {
         this.areaCode = areaCode;
     }
 
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
+
+    public String getAreaShortName() {
+        return areaShortName;
+    }
+
+    public void setAreaShortName(String areaShortName) {
+        this.areaShortName = areaShortName;
+    }
+
     public String getFacsCode() {
         return facsCode;
     }
@@ -110,6 +138,14 @@ public class PvSupplyH extends BaseEntity {
         this.facsCode = facsCode;
     }
 
+    public String getFacsName() {
+        return facsName;
+    }
+
+    public void setFacsName(String facsName) {
+        this.facsName = facsName;
+    }
+
     public Date getDate() {
         return date;
     }
@@ -134,48 +170,52 @@ public class PvSupplyH extends BaseEntity {
         this.timeIndex = timeIndex;
     }
 
-    public Long getMeterType() {
-        return meterType;
+    public Double getUpUnitPrice() {
+        return upUnitPrice;
     }
 
-    public void setMeterType(Long meterType) {
-        this.meterType = meterType;
+    public void setUpUnitPrice(Double upUnitPrice) {
+        this.upUnitPrice = upUnitPrice;
     }
 
-    public Double getMeterUnitPrice() {
-        return meterUnitPrice;
+    public Double getGenElecQuantity() {
+        return genElecQuantity;
     }
 
-    public void setMeterUnitPrice(Double meterUnitPrice) {
-        this.meterUnitPrice = meterUnitPrice;
+    public void setGenElecQuantity(Double genElecQuantity) {
+        this.genElecQuantity = genElecQuantity;
     }
 
-    public Double getElecReading() {
-        return elecReading;
+    public Double getUseElecQuantity() {
+        return useElecQuantity;
     }
 
-    public void setElecReading(Double elecReading) {
-        this.elecReading = elecReading;
+    public void setUseElecQuantity(Double useElecQuantity) {
+        this.useElecQuantity = useElecQuantity;
     }
 
-    public Double getElecQuantity() {
-        return elecQuantity;
+    public Double getUpElecQuantity() {
+        return upElecQuantity;
     }
 
-    public void setElecQuantity(Double elecQuantity) {
-        this.elecQuantity = elecQuantity;
+    public void setUpElecQuantity(Double upElecQuantity) {
+        this.upElecQuantity = upElecQuantity;
     }
 
-    public Double getElecEarn() {
-        return elecEarn;
+    public Double getUpElecEarn() {
+        return upElecEarn;
     }
 
-    public void setElecEarn(Double elecEarn) {
-        this.elecEarn = elecEarn;
+    public void setUpElecEarn(Double upElecEarn) {
+        this.upElecEarn = upElecEarn;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("areaCode", getAreaCode()).append("facsCode", getFacsCode()).append("date", getDate()).append("time", getTime()).append("timeIndex", getTimeIndex()).append("meterType", getMeterType()).append("meterUnitPrice", getMeterUnitPrice()).append("elecReading", getElecReading()).append("elecQuantity", getElecQuantity()).append("elecEarn", getElecEarn()).toString();
+        return "PvSupplyH{" + "id=" + id + ", areaCode='" + areaCode + '\'' + ", areaName='" + areaName + '\''
+            + ", areaShortName='" + areaShortName + '\'' + ", facsCode='" + facsCode + '\'' + ", facsName='" + facsName
+            + '\'' + ", date=" + date + ", time=" + time + ", timeIndex=" + timeIndex + ", upUnitPrice=" + upUnitPrice
+            + ", genElecQuantity=" + genElecQuantity + ", useElecQuantity=" + useElecQuantity + ", upElecQuantity="
+            + upElecQuantity + ", upElecEarn=" + upElecEarn + '}';
     }
 }

+ 2 - 22
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElecPgSupplyHMapper.xml

@@ -16,23 +16,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="timeIndex"    column="time_index"    />
         <result property="meterType"    column="meter_type"    />
         <result property="meterUnitPrice"    column="meter_unit_price"    />
-        <result property="useElecReading"    column="use_elec_reading"    />
         <result property="useElecQuantity"    column="use_elec_quantity"    />
         <result property="useElecCost"    column="use_elec_cost"    />
-        <result property="upElecReading"    column="up_elec_reading"    />
-        <result property="upElecQuantity"    column="up_elec_quantity"    />
-        <result property="upElecEarn"    column="up_elec_earn"    />
     </resultMap>
 
     <sql id="selectPgSupplyHVo">
         select
-            pg.`id`, pg.`area_code`, a.`area_name`, a.`short_name` as area_short_name, pg.`facs_code`, f.`facs_name`, pg.`date`, pg.`time`, pg.`time_index`, pg.`meter_type`, pg.`meter_unit_price`, pg.`use_elec_reading`, pg.`use_elec_quantity`, pg.`use_elec_cost`, pg.`up_elec_reading`, pg.`up_elec_quantity`, pg.`up_elec_earn`
+            pg.`id`, pg.`area_code`, a.`area_name`, a.`short_name` as area_short_name, pg.`facs_code`, f.`facs_name`, pg.`date`, pg.`time`, pg.`time_index`, pg.`meter_type`, pg.`meter_unit_price`, pg.`use_elec_quantity`, pg.`use_elec_cost`
         from adm_ems_pg_supply_h pg
             LEFT JOIN adm_service_area a ON pg.`area_code` = a.`area_code`
             LEFT JOIN adm_ems_facs f ON pg.`facs_code` = f.`facs_code`
     </sql>
 
-    <select id="selectEmsPgSupplyHList" parameterType="com.ruoyi.ems.domain.ElecPgSupplyH" resultMap="PgSupplyHResult">
+    <select id="selectPgSupplyHList" parameterType="com.ruoyi.ems.domain.ElecPgSupplyH" resultMap="PgSupplyHResult">
         <include refid="selectPgSupplyHVo"/>
         <where>
             <if test="areaCode != null  and areaCode != ''"> and pg.`area_code` = #{areaCode}</if>
@@ -42,12 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="timeIndex != null "> and pg.`time_index` = #{timeIndex}</if>
             <if test="meterType != null "> and pg.`meter_type` = #{meterType}</if>
             <if test="meterUnitPrice != null "> and pg.`meter_unit_price` = #{meterUnitPrice}</if>
-            <if test="useElecReading != null "> and pg.`use_elec_reading` = #{useElecReading}</if>
             <if test="useElecQuantity != null "> and pg.`use_elec_quantity` = #{useElecQuantity}</if>
             <if test="useElecCost != null "> and pg.`use_elec_cost` = #{useElecCost}</if>
-            <if test="upElecReading != null "> and pg.`up_elec_reading` = #{upElecReading}</if>
-            <if test="upElecQuantity != null "> and pg.`up_elec_quantity` = #{upElecQuantity}</if>
-            <if test="upElecEarn != null "> and pg.`up_elec_earn` = #{upElecEarn}</if>
         </where>
     </select>
 
@@ -66,12 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="timeIndex != null">time_index,</if>
             <if test="meterType != null">meter_type,</if>
             <if test="meterUnitPrice != null">meter_unit_price,</if>
-            <if test="useElecReading != null">use_elec_reading,</if>
             <if test="useElecQuantity != null">use_elec_quantity,</if>
             <if test="useElecCost != null">use_elec_cost,</if>
-            <if test="upElecReading != null">up_elec_reading,</if>
-            <if test="upElecQuantity != null">up_elec_quantity,</if>
-            <if test="upElecEarn != null">up_elec_earn,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
@@ -81,12 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="timeIndex != null">#{timeIndex},</if>
             <if test="meterType != null">#{meterType},</if>
             <if test="meterUnitPrice != null">#{meterUnitPrice},</if>
-            <if test="useElecReading != null">#{useElecReading},</if>
             <if test="useElecQuantity != null">#{useElecQuantity},</if>
             <if test="useElecCost != null">#{useElecCost},</if>
-            <if test="upElecReading != null">#{upElecReading},</if>
-            <if test="upElecQuantity != null">#{upElecQuantity},</if>
-            <if test="upElecEarn != null">#{upElecEarn},</if>
          </trim>
     </insert>
 
@@ -100,12 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="timeIndex != null">time_index = #{timeIndex},</if>
             <if test="meterType != null">meter_type = #{meterType},</if>
             <if test="meterUnitPrice != null">meter_unit_price = #{meterUnitPrice},</if>
-            <if test="useElecReading != null">use_elec_reading = #{useElecReading},</if>
             <if test="useElecQuantity != null">use_elec_quantity = #{useElecQuantity},</if>
             <if test="useElecCost != null">use_elec_cost = #{useElecCost},</if>
-            <if test="upElecReading != null">up_elec_reading = #{upElecReading},</if>
-            <if test="upElecQuantity != null">up_elec_quantity = #{upElecQuantity},</if>
-            <if test="upElecEarn != null">up_elec_earn = #{upElecEarn},</if>
         </trim>
         where id = #{id}
     </update>

+ 46 - 34
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/PvSupplyHMapper.xml → ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElecPvSupplyHMapper.xml

@@ -6,38 +6,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.ruoyi.ems.domain.PvSupplyH" id="PvSupplyHResult">
         <result property="id"    column="id"    />
         <result property="areaCode"    column="area_code"    />
+        <result property="areaName"    column="area_name"    />
+        <result property="areaShortName"    column="area_short_name"    />
         <result property="facsCode"    column="facs_code"    />
+        <result property="facsName"    column="facs_name"    />
         <result property="date"    column="date"  jdbcType="DATE"  />
         <result property="time"    column="time"    />
         <result property="timeIndex"    column="time_index"    />
-        <result property="meterType"    column="meter_type"    />
-        <result property="meterUnitPrice"    column="meter_unit_price"    />
-        <result property="elecReading"    column="elec_reading"    />
-        <result property="elecQuantity"    column="elec_quantity"    />
-        <result property="elecEarn"    column="elec_earn"    />
+        <result property="upUnitPrice"    column="up_unit_price"    />
+        <result property="genElecQuantity"    column="gen_elec_quantity"    />
+        <result property="useElecQuantity"    column="use_elec_quantity"    />
+        <result property="upElecQuantity"    column="up_elec_quantity"    />
+        <result property="upElecEarn"    column="up_elec_earn"    />
     </resultMap>
 
     <sql id="selectPvSupplyHVo">
-        select id, area_code, facs_code, date, time, time_index, meter_type, meter_unit_price, elec_reading, elec_quantity, elec_earn from adm_ems_pv_supply_h
+        select
+            pv.id, pv.area_code, a.area_name, a.short_name as area_short_name, pv.facs_code, f.facs_name, pv.`date`, pv.`time`, pv.time_index, pv.up_unit_price, pv.gen_elec_quantity, pv.use_elec_quantity, pv.up_elec_quantity, pv.up_elec_earn
+        from adm_ems_pv_supply_h pv
+            LEFT JOIN adm_service_area a ON pv.`area_code` = a.`area_code`
+            LEFT JOIN adm_ems_facs f ON pv.`facs_code` = f.`facs_code`
     </sql>
 
     <select id="selectPvSupplyHList" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
         <include refid="selectPvSupplyHVo"/>
         <where>
-            <if test="areaCode != null  and areaCode != ''"> and area_code = #{areaCode}</if>
-            <if test="facsCode != null  and facsCode != ''"> and facs_code = #{facsCode}</if>
-            <if test="date != null "> and date = #{date}</if>
-            <if test="time != null "> and time = #{time}</if>
-            <if test="timeIndex != null "> and time_index = #{timeIndex}</if>
-            <if test="meterType != null "> and meter_type = #{meterType}</if>
-            <if test="meterUnitPrice != null "> and meter_unit_price = #{meterUnitPrice}</if>
-            <if test="elecReading != null "> and elec_reading = #{elecReading}</if>
-            <if test="elecQuantity != null "> and elec_quantity = #{elecQuantity}</if>
-            <if test="elecEarn != null "> and elec_earn = #{elecEarn}</if>
+            <if test="areaCode != null  and areaCode != ''"> and pv.area_code = #{areaCode}</if>
+            <if test="facsCode != null  and facsCode != ''"> and pv.facs_code = #{facsCode}</if>
+            <if test="date != null "> and pv.`date` = #{date}</if>
+            <if test="time != null "> and pv.`time` = #{time}</if>
+            <if test="timeIndex != null "> and pv.time_index = #{timeIndex}</if>
+            <if test="upUnitPrice != null "> and pv.up_unit_price = #{upUnitPrice}</if>
+            <if test="genElecQuantity != null "> and pv.gen_elec_quantity = #{genElecQuantity}</if>
+            <if test="useElecQuantity != null "> and pv.use_elec_quantity = #{useElecQuantity}</if>
+            <if test="upElecQuantity != null "> and pv.up_elec_quantity = #{upElecQuantity}</if>
+            <if test="upElecEarn != null "> and pv.up_elec_earn = #{upElecEarn}</if>
         </where>
     </select>
+
     <select id="selectAreaSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
-        SELECT area_code, DATE, time_index, SUM( elec_quantity ) elec_quantity
+        SELECT area_code, `date`, time_index,
+               SUM( gen_elec_quantity ) as gen_elec_quantity,
+               SUM( use_elec_quantity ) as use_elec_quantity,
+               SUM( up_elec_quantity ) as up_elec_quantity,
+               SUM( up_elec_earn ) as up_elec_earn
         FROM
             adm_ems_pv_supply_h
         WHERE
@@ -60,14 +72,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="areaCode != null and areaCode != ''">area_code,</if>
             <if test="facsCode != null and facsCode != ''">facs_code,</if>
-            <if test="date != null">date,</if>
-            <if test="time != null">time,</if>
+            <if test="date != null">`date`,</if>
+            <if test="time != null">`time`,</if>
             <if test="timeIndex != null">time_index,</if>
-            <if test="meterType != null">meter_type,</if>
-            <if test="meterUnitPrice != null">meter_unit_price,</if>
-            <if test="elecReading != null">elec_reading,</if>
-            <if test="elecQuantity != null">elec_quantity,</if>
-            <if test="elecEarn != null">elec_earn,</if>
+            <if test="upUnitPrice != null">up_unit_price,</if>
+            <if test="genElecQuantity != null">gen_elec_quantity,</if>
+            <if test="useElecQuantity != null">use_elec_quantity,</if>
+            <if test="upElecQuantity != null">up_elec_quantity,</if>
+            <if test="upElecEarn != null">up_elec_earn,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
@@ -75,11 +87,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="date != null">#{date},</if>
             <if test="time != null">#{time},</if>
             <if test="timeIndex != null">#{timeIndex},</if>
-            <if test="meterType != null">#{meterType},</if>
-            <if test="meterUnitPrice != null">#{meterUnitPrice},</if>
-            <if test="elecReading != null">#{elecReading},</if>
-            <if test="elecQuantity != null">#{elecQuantity},</if>
-            <if test="elecEarn != null">#{elecEarn},</if>
+            <if test="upUnitPrice != null">#{upUnitPrice},</if>
+            <if test="genElecQuantity != null">#{genElecQuantity},</if>
+            <if test="useElecQuantity != null">#{useElecQuantity},</if>
+            <if test="upElecQuantity != null">#{upElecQuantity},</if>
+            <if test="upElecEarn != null">#{upElecEarn},</if>
          </trim>
     </insert>
 
@@ -91,11 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="date != null">date = #{date},</if>
             <if test="time != null">time = #{time},</if>
             <if test="timeIndex != null">time_index = #{timeIndex},</if>
-            <if test="meterType != null">meter_type = #{meterType},</if>
-            <if test="meterUnitPrice != null">meter_unit_price = #{meterUnitPrice},</if>
-            <if test="elecReading != null">elec_reading = #{elecReading},</if>
-            <if test="elecQuantity != null">elec_quantity = #{elecQuantity},</if>
-            <if test="elecEarn != null">elec_earn = #{elecEarn},</if>
+            <if test="upUnitPrice != null">up_unit_price = #{upUnitPrice},</if>
+            <if test="genElecQuantity != null">gen_elec_quantity = #{genElecQuantity},</if>
+            <if test="useElecQuantity != null">use_elec_quantity = #{useElecQuantity},</if>
+            <if test="upElecQuantity != null">up_elec_quantity = #{upElecQuantity},</if>
+            <if test="upElecEarn != null">up_elec_earn = #{upElecEarn},</if>
         </trim>
         where id = #{id}
     </update>

+ 3 - 21
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElecUseHMapper.xml

@@ -11,19 +11,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="areaShortName"    column="area_short_name"    />
         <result property="facsCode"    column="facs_code"    />
         <result property="facsName"    column="facs_name"    />
-        <result property="facsType"    column="facs_type"    />
-        <result property="facsSubtype"    column="facs_subtype"    />
         <result property="date"    column="date"    />
         <result property="time"    column="time"    />
         <result property="timeIndex"    column="time_index"    />
-        <result property="elecReading"    column="elec_reading"    />
         <result property="elecQuantity"    column="elec_quantity"    />
-        <result property="elecCost"    column="elec_cost"    />
     </resultMap>
 
     <sql id="selectElecUseHVo">
         select
-            u.id, u.area_code, a.area_name, a.short_name as area_short_name, u.facs_code, f.facs_name, u.facs_type, u.facs_subtype, u.`date`, u.`time`, u.time_index, u.elec_reading, u.elec_quantity, u.elec_cost
+            u.id, u.area_code, a.area_name, a.short_name as area_short_name, u.facs_code, f.facs_name, f.facs_type, f.facs_subtype, u.`date`, u.`time`, u.time_index, u.elec_quantity
         from adm_ems_facs_use_h u
             LEFT JOIN adm_service_area a ON u.`area_code` = a.`area_code`
             LEFT JOIN adm_ems_facs f ON u.`facs_code` = f.`facs_code`
@@ -34,14 +30,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="areaCode != null  and areaCode != ''"> and u.area_code = #{areaCode}</if>
             <if test="facsCode != null  and facsCode != ''"> and u.facs_code = #{facsCode}</if>
-            <if test="facsType != null  and facsType != ''"> and u.facs_type = #{facsType}</if>
-            <if test="facsSubtype != null  and facsSubtype != ''"> and u.facs_subtype = #{facsSubtype}</if>
+            <if test="facsType != null  and facsType != ''"> and f.facs_type = #{facsType}</if>
+            <if test="facsSubtype != null  and facsSubtype != ''"> and f.facs_subtype = #{facsSubtype}</if>
             <if test="date != null "> and u.`date` = #{date}</if>
             <if test="time != null "> and u.`time` = #{time}</if>
             <if test="timeIndex != null "> and u.time_index = #{timeIndex}</if>
-            <if test="elecReading != null "> and u.elec_reading = #{elecReading}</if>
             <if test="elecQuantity != null "> and u.elec_quantity = #{elecQuantity}</if>
-            <if test="elecCost != null "> and u.elec_cost = #{elecCost}</if>
         </where>
     </select>
     
@@ -55,26 +49,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="areaCode != null and areaCode != ''">area_code,</if>
             <if test="facsCode != null and facsCode != ''">facs_code,</if>
-            <if test="facsType != null and facsType != ''">facs_type,</if>
-            <if test="facsSubtype != null and facsSubtype != ''">facs_subtype,</if>
             <if test="date != null">date,</if>
             <if test="time != null">time,</if>
             <if test="timeIndex != null">time_index,</if>
-            <if test="elecReading != null">elec_reading,</if>
             <if test="elecQuantity != null">elec_quantity,</if>
-            <if test="elecCost != null">elec_cost,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
             <if test="facsCode != null and facsCode != ''">#{facsCode},</if>
-            <if test="facsType != null and facsType != ''">#{facsType},</if>
-            <if test="facsSubtype != null and facsSubtype != ''">#{facsSubtype},</if>
             <if test="date != null">#{date},</if>
             <if test="time != null">#{time},</if>
             <if test="timeIndex != null">#{timeIndex},</if>
-            <if test="elecReading != null">#{elecReading},</if>
             <if test="elecQuantity != null">#{elecQuantity},</if>
-            <if test="elecCost != null">#{elecCost},</if>
          </trim>
     </insert>
 
@@ -83,14 +69,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
             <if test="facsCode != null and facsCode != ''">facs_code = #{facsCode},</if>
-            <if test="facsType != null and facsType != ''">facs_type = #{facsType},</if>
-            <if test="facsSubtype != null and facsSubtype != ''">facs_subtype = #{facsSubtype},</if>
             <if test="date != null">date = #{date},</if>
             <if test="time != null">time = #{time},</if>
             <if test="timeIndex != null">time_index = #{timeIndex},</if>
-            <if test="elecReading != null">elec_reading = #{elecReading},</if>
             <if test="elecQuantity != null">elec_quantity = #{elecQuantity},</if>
-            <if test="elecCost != null">elec_cost = #{elecCost},</if>
         </trim>
         where id = #{id}
     </update>

+ 6 - 14
ems-cloud/sql/ems_server.sql

@@ -978,14 +978,10 @@ create table adm_ems_pg_supply_h (
   `date`               date            not null                     comment '日期 yyyy-MM-dd',
   `time`               time            not null                     comment '时间 HH:mm:ss',
   `time_index`         int             not null                     comment '时间序列',
-  `meter_type`         int             default null                 comment '计量类型 0:不区分 1:峰电计量  2:谷电计量',
+  `meter_type`         int             default null                 comment '计量类型 -1:低谷电 0:平峰电 1:高峰电 2:尖峰电',
   `meter_unit_price`   double          default null                 comment '单位电价(1度电)',
-  `use_elec_reading`   double          default null                 comment '用电读数',
   `use_elec_quantity`  double          default null                 comment '用电量 单位:kW-h(千瓦时)',
   `use_elec_cost`      double          default null                 comment '用电电费 单位: ¥(元)',
-  `up_elec_reading`    double          default null                 comment '上网读数',
-  `up_elec_quantity`   double          default null                 comment '上网电量 单位:kW-h(千瓦时)',
-  `up_elec_earn`       double          default null                 comment '上网收益 单位: ¥(元)',
   primary key (`id`),
   unique key ux_ems_pg_supply_h(`area_code`, `facs_code`, `date`, `time_index`)
 ) engine=innodb auto_increment=1 comment = '电网供应计量表-小时';
@@ -1002,11 +998,11 @@ create table adm_ems_pv_supply_h (
   `date`               date            not null                     comment '日期 yyyy-MM-dd',
   `time`               time            not null                     comment '时间 HH:mm:ss',
   `time_index`         int             not null                     comment '时间序列',
-  `meter_type`         int             default null                 comment '计量类型 1:峰电计量  2:谷电计量',
-  `meter_unit_price`   double          default null                 comment '单位电价(1度电)',
-  `elec_reading`       double          default null                 comment '用电读数',
-  `elec_quantity`      double          default null                 comment '电量 单位:kW-h(千瓦时)',
-  `elec_earn`          double          default null                 comment '发电收益 单位: ¥(元)',
+  `up_unit_price`      double          default null                 comment '单位电价(1度电)',
+  `gen_elec_quantity`  double          default null                 comment '发电量 单位:kW-h(千瓦时)',
+  `use_elec_quantity`  double          default null                 comment '自用电量 单位:kW-h(千瓦时)',
+  `up_elec_quantity`   double          default null                 comment '上网电量 单位:kW-h(千瓦时)',
+  `up_elec_earn`       double          default null                 comment '上网收益 单位: ¥(元)',
   primary key (`id`),
   unique key ux_ems_pg_supply_h(`area_code`, `facs_code`, `date`, `time_index`)
 ) engine=innodb auto_increment=1 comment = '光伏并网计量表光伏并网计量表-小时';
@@ -1020,14 +1016,10 @@ create table adm_ems_facs_use_h (
   `id`                 bigint(20)      not null auto_increment      comment '序号',
   `area_code`          varchar(16)     not null                     comment '园区代码',
   `facs_code`          varchar(16)     not null                     comment '设施代码',
-  `facs_type`          varchar(16)     not null                     comment '设施类型',
-  `facs_subtype`       varchar(16)     not null                     comment '设施子类',
   `date`               date            not null                     comment '日期 yyyy-MM-dd',
   `time`               time            not null                     comment '时间 HH:mm:ss',
   `time_index`         int             not null                     comment '时间序列',
-  `elec_reading`       double          default null                 comment '电表读数',
   `elec_quantity`      double          default null                 comment '用电量 单位:kW-h(千瓦时)',
-  `elec_cost`          double          default null                 comment '电费 单位: ¥(元)',
   primary key (`id`),
   unique key ux_ems_facs_use_h(`area_code`, `facs_code`, `date`, `time_index`)
 ) engine=innodb auto_increment=1 comment = '用能计量表-小时';

+ 1 - 1
ems-cloud/sql/ems_sys.sql

@@ -172,7 +172,7 @@ insert into sys_menu values ('99', '开发工具', '0', '99', 'tool',
 insert into sys_menu values ('100',  '服务区',         '1',   '1',   'hp-view-sa',         'view/servicearea',          '', 1, 0, 'C', '0', '0',   'view:service-area',      'servicearea',    'admin', sysdate(), '', null, '园区能源概览');
 insert into sys_menu values ('101',  '主路光伏',       '1',   '2',   'hp-view-rpv',        'view/road/photovoltaic',    '', 1, 0, 'C', '0', '0',   'view:road-pv',           'photovoltaic',   'admin', sysdate(), '', null, '主路光伏概览');
 
-insert into sys_menu values ('102',  '源网',            '2',    '1',  'strategy-pg',        'mgr/powergrid',             '', 1, 0, 'C', '0', '0',   'power-mgr:pg',           'powergrid',      'admin', sysdate(), '', null, '源网协调');
+    insert into sys_menu values ('102',  '源网',            '2',    '1',  'strategy-pg',        'mgr/powergrid',             '', 1, 0, 'C', '0', '0',   'power-mgr:pg',           'powergrid',      'admin', sysdate(), '', null, '源网协调');
 insert into sys_menu values ('103',  '储能',            '2',    '2',  'strategy-gs',        'mgr/powerstore',            '', 1, 0, 'C', '0', '0',   'power-mgr:gs',           'powerstore',     'admin', sysdate(), '', null, '网储互动');
 insert into sys_menu values ('104',  '负荷',            '2',    '3',  'strategy-use',       'mgr/poweruse',              '', 1, 0, 'C', '0', '0',   'power-mgr:use',          'powerload',      'admin', sysdate(), '', null, '源荷互动');
 insert into sys_menu values ('105',  '配电',            '2',    '4',  'strategy-dist',      'mgr/powerdist',             '', 1, 0, 'C', '0', '0',   'power-mgr:dist',         'powerdist',      'admin', sysdate(), '', null, '配电监控');