Bladeren bron

+ 汇报缺失页面

chen.cheng 3 maanden geleden
bovenliggende
commit
92156b4565

+ 27 - 50
ems/ems-core/src/main/java/com/ruoyi/ems/domain/CaEmissionForecast.java

@@ -3,6 +3,8 @@ package com.ruoyi.ems.domain;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -10,74 +12,49 @@ import java.util.Date;
 
 /**
  * 碳排放预测对象 adm_ems_ca_emission_forecast
- * 
+ *
  * @author ruoyi
  * @date 2024-08-12
  */
-public class CaEmissionForecast extends BaseEntity
-{
+@EqualsAndHashCode(callSuper = true)
+@Data
+
+public class CaEmissionForecast extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 序号 */
+    /**
+     * 序号
+     */
     private Long id;
 
-    /** 园区代码 */
+    /**
+     * 园区代码
+     */
     @Excel(name = "园区代码")
     private String areaCode;
 
-    /** 日期 */
+    private String areaName;
+
+    /**
+     * 日期
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date date;
 
-    /** (千克) */
+    /**
+     * (千克)
+     */
     @Excel(name = "", readConverterExp = "千=克")
     private Double caEmission;
 
-    public void setId(Long id) 
-    {
-        this.id = id;
-    }
-
-    public Long getId() 
-    {
-        return id;
-    }
-    public void setAreaCode(String areaCode) 
-    {
-        this.areaCode = areaCode;
-    }
-
-    public String getAreaCode() 
-    {
-        return areaCode;
-    }
-    public void setDate(Date date) 
-    {
-        this.date = date;
-    }
-
-    public Date getDate() 
-    {
-        return date;
-    }
-    public void setCaEmission(Double caEmission) 
-    {
-        this.caEmission = caEmission;
-    }
-
-    public Double getCaEmission() 
-    {
-        return caEmission;
-    }
-
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("areaCode", getAreaCode())
-            .append("date", getDate())
-            .append("caEmission", getCaEmission())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("areaCode", getAreaCode())
+                .append("date", getDate())
+                .append("caEmission", getCaEmission())
+                .toString();
     }
 }

+ 37 - 9
ems/ems-core/src/main/java/com/ruoyi/ems/model/QueryMeter.java

@@ -27,31 +27,51 @@ import java.util.Set;
 public class QueryMeter extends BaseEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    /** 服务区代码 */
+    /**
+     * 服务区代码
+     */
     private String areaCode;
 
-    /** 设备编号 */
+    private String areaName;
+
+    /**
+     * 设备编号
+     */
     private String deviceCode;
 
-    /** 设备编号集合*/
+    /**
+     * 设备编号集合
+     */
     private Set<String> deviceCodes;
 
-    /** 对象标签 */
+    /**
+     * 对象标签
+     */
     private Integer objTag;
 
-    /** 对象类型 */
+    /**
+     * 对象类型
+     */
     private Integer objType;
 
-    /** 对象code*/
+    /**
+     * 对象code
+     */
     private String objCode;
 
-    /** 对象名称*/
+    /**
+     * 对象名称
+     */
     private String objName;
 
-    /** 计量介质 */
+    /**
+     * 计量介质
+     */
     private Integer meterCls;
 
-    /** 年份 */
+    /**
+     * 年份
+     */
     private String year;
 
     /**
@@ -177,4 +197,12 @@ public class QueryMeter extends BaseEntity implements Serializable {
     public void setOrderFlag(String orderFlag) {
         this.orderFlag = orderFlag;
     }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
 }

+ 3 - 2
ems/ems-core/src/main/resources/mapper/ems/CaEmissionForecastMapper.xml

@@ -16,9 +16,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectCaEmissionForecastList" parameterType="com.ruoyi.ems.domain.CaEmissionForecast" resultMap="CaEmissionForecastResult">
-        <include refid="selectCaEmissionForecastVo"/>
+        select d.id, d.area_code,area.area_name, date, ca_emission from adm_ems_ca_emission_forecast d
+        inner join adm_area area on area.area_code = d.area_code and area.parent_code = '0'
         <where>
-            <if test="areaCode != null  and areaCode != ''"> and area_code = #{areaCode}</if>
+            <if test="areaName != null  and areaName != ''">and area_name like concat('%', #{areaName}, '%')</if>
             <if test="date != null "> and date = #{date}</if>
             <if test="caEmission != null "> and ca_emission = #{caEmission}</if>
         </where>

+ 18 - 15
ems/ems-core/src/main/resources/mapper/ems/ElecPvSupplyHMapper.xml

@@ -99,23 +99,26 @@
 
     <select id="selectPvSupplyDayList" parameterType="com.ruoyi.ems.model.QueryMeter" resultMap="PvSupplyHResult">
         SELECT
-            <if test="facsSubCategory != null and facsSubCategory !=''">
-              sc.`name` as facs_name,
-            </if>
-            <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
-              pv.area_code,
-            </if>
-            pv.`date`,
-            sum(COALESCE(pv.gen_elec_quantity,0)) gen_elec_quantity,
-            sum(COALESCE(pv.use_elec_quantity,0)) use_elec_quantity,
-            sum(COALESCE(pv.up_elec_quantity,0)) up_elec_quantity,
-            sum(COALESCE(pv.up_elec_earn,0)) up_elec_earn
+        <if test="facsSubCategory != null and facsSubCategory !=''">
+            sc.`name` as facs_name,
+        </if>
+        <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
+            pv.area_code,
+        </if>
+        area.area_name,
+        pv.`date`,
+        sum(COALESCE(pv.gen_elec_quantity,0)) gen_elec_quantity,
+        sum(COALESCE(pv.use_elec_quantity,0)) use_elec_quantity,
+        sum(COALESCE(pv.up_elec_quantity,0)) up_elec_quantity,
+        sum(COALESCE(pv.up_elec_earn,0)) up_elec_earn
         FROM adm_ems_pv_supply_h pv
-            <if test="facsSubCategory != null and facsSubCategory !=''">
-              LEFT JOIN adm_ems_facs f ON pv.`facs_code` = f.`facs_code`
-              LEFT JOIN dim_ems_facs_subcategory sc ON f.facs_subcategory = sc.`code`
-            </if>
+        inner join adm_area area on area.area_code = pv.area_code and area.parent_code = '0'
+        <if test="facsSubCategory != null and facsSubCategory !=''">
+            LEFT JOIN adm_ems_facs f ON pv.`facs_code` = f.`facs_code`
+            LEFT JOIN dim_ems_facs_subcategory sc ON f.facs_subcategory = sc.`code`
+        </if>
         <where>
+            <if test="areaName != null  and areaName != ''">and area.area_name like concat('%', #{areaName}, '%')</if>
             <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
                 and pv.area_code = #{areaCode}
             </if>