Selaa lähdekoodia

Merge branch 'master' of http://git.xt.wenhq.top:8083/hs/zhny_bg

hsshuxian 10 kuukautta sitten
vanhempi
commit
edf031ea0d
22 muutettua tiedostoa jossa 654 lisäystä ja 110 poistoa
  1. 41 16
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/DeviceController.java
  2. 33 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecUseHController.java
  3. 28 14
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsFacsController.java
  4. 11 1
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevice.java
  5. 5 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecPgIndexMapper.java
  6. 8 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElecUseHMapper.java
  7. 11 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsDeviceMapper.java
  8. 13 8
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElecUseHService.java
  9. 5 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsDeviceService.java
  10. 6 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsService.java
  11. 19 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElecUseHServiceImpl.java
  12. 29 15
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsDeviceServiceImpl.java
  13. 7 28
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsServiceImpl.java
  14. 1 1
      ems-cloud/ems-modules/ems-server/src/main/resources/logback.xml
  15. 23 7
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxEqptIndexMapper.xml
  16. 10 5
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxIndexMapper.xml
  17. 19 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecPgIndexMapper.xml
  18. 59 3
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElecUseHMapper.xml
  19. 75 6
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceMapper.xml
  20. 1 2
      ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/DateTimeUtil.java
  21. 246 2
      ems-cloud/sql/ems_init_data.sql
  22. 4 2
      ems-cloud/sql/ems_server.sql

+ 41 - 16
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/DeviceController.java

@@ -1,5 +1,23 @@
 package com.ruoyi.ems.controller;
 
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -15,23 +33,8 @@ import com.ruoyi.ems.domain.vo.QueryDevice;
 import com.ruoyi.ems.service.IAreaBuildingService;
 import com.ruoyi.ems.service.IAreaBuildingZoningService;
 import com.ruoyi.ems.service.IEmsDeviceService;
-import io.swagger.annotations.Api;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-import java.util.stream.Collectors;
+import io.swagger.annotations.Api;
 
 /**
  * 能源设备Controller
@@ -162,4 +165,26 @@ public class DeviceController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(deviceService.deleteEmsDeviceByIds(ids));
     }
+
+    /**
+     * 设备-设备状态统计
+     *
+     * @param areaCode
+     * @return
+     */
+    @GetMapping(value = "/status/cnt")
+    public AjaxResult getDeviceStatusCnt(@RequestParam("areaCode") String areaCode) {
+        return success(deviceService.cntDeviceStatus(areaCode));
+    }
+
+    /**
+     * 设备-类型在线率
+     *
+     * @param areaCode
+     * @return
+     */
+    @GetMapping(value = "/type/online")
+    public AjaxResult getDeviceOnlineSummary(@RequestParam("areaCode") String areaCode) {
+        return success(deviceService.calcDeviceOnlineSummary(areaCode));
+    }
 }

+ 33 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecUseHController.java

@@ -113,4 +113,37 @@ public class ElecUseHController extends BaseController {
     public AjaxResult getAreaMonthUseSupply(@RequestParam("area") String area) {
         return success(elecUseHService.selectElecAndPower(area));
     }
+
+    /**
+     * 荷-近一年用能
+     *
+     * @param area
+     * @return
+     */
+    @GetMapping("/area/month/elec/use")
+    public AjaxResult getAreaMonthElecUse(@RequestParam(value = "area", required = false) String area) {
+        return success(elecUseHService.selectMonthElecUse(area));
+    }
+
+    /**
+     * 荷-当日用能-设备类型占比
+     *
+     * @param area
+     * @return
+     */
+    @GetMapping("/area/thisday/fac/type/elec/use")
+    public AjaxResult getAreaThisDayFacTypeElecUse(@RequestParam(value = "area", required = false) String area) {
+        return success(elecUseHService.selectThisDayFacsTypeElecUse(area));
+    }
+
+    /**
+     * 荷-当日用能
+     *
+     * @param area
+     * @return
+     */
+    @GetMapping("/area/thisday/elec/use")
+    public AjaxResult getAreaThisDayElecUse(@RequestParam(value = "area", required = false) String area) {
+        return success(elecUseHService.selectThisDayAreaElecUse(area));
+    }
 }

+ 28 - 14
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsFacsController.java

@@ -1,16 +1,9 @@
 package com.ruoyi.ems.controller;
 
-import com.ruoyi.common.core.utils.StringUtils;
-import com.ruoyi.common.core.utils.poi.ExcelUtil;
-import com.ruoyi.common.core.web.controller.BaseController;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.common.core.web.page.TableDataInfo;
-import com.ruoyi.common.log.annotation.Log;
-import com.ruoyi.common.log.enums.BusinessType;
-import com.ruoyi.common.security.annotation.RequiresPermissions;
-import com.ruoyi.ems.domain.EmsFacs;
-import com.ruoyi.ems.service.IEmsFacsService;
-import io.swagger.annotations.Api;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,12 +15,22 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.EmsFacs;
+import com.ruoyi.ems.service.IEmsFacsService;
+
+import io.swagger.annotations.Api;
 
 /**
  * 能源设施/系统Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-07-10
  */
@@ -121,4 +124,15 @@ public class EmsFacsController extends BaseController
 
         return success(emsFacsService.selectEmsFacsList(emsFacs));
     }
+
+    /**
+     * 网-服务区日功率指标
+     *
+     * @param areaCode
+     * @return
+     */
+    @GetMapping("/area/day/power/index")
+    public AjaxResult qryAreaDayPowerIndex(@RequestParam("areaCode") String areaCode) {
+        return success(emsFacsService.qryAreaDayPowerIndex(areaCode));
+    }
 }

+ 11 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevice.java

@@ -7,7 +7,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
 
 /**
  * 能源设备对象 adm_ems_device
- * 
+ *
  * @author ruoyi
  * @date 2024-07-10
  */
@@ -37,6 +37,8 @@ public class EmsDevice extends BaseEntity
     @Excel(name = "设备状态")
     private Long deviceStatus;
 
+   private String  areaAncestors;
+
     /** 区域类型 */
     private String areaType;
 
@@ -176,6 +178,14 @@ public class EmsDevice extends BaseEntity
         this.areaPath = areaPath;
     }
 
+    public String getAreaAncestors() {
+        return areaAncestors;
+    }
+
+    public void setAreaAncestors(String areaAncestors) {
+        this.areaAncestors = areaAncestors;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 5 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecPgIndexMapper.java

@@ -66,4 +66,9 @@ public interface AdmEmsElecPgIndexMapper {
 
     @MapKey("facsCode")
     Map<String, Map<String, Object>> qryLatestObjIndex(@Param("set") List<String> set);
+
+    @MapKey("dateIndex")
+    Map<String, Map<String, Object>> qryAreaDayPowerIndex(
+        @Param("areaCode") String areaCode, @Param("date") String date);
+
 }

+ 8 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElecUseHMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.ems.mapper;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 
 import com.ruoyi.ems.domain.ElecUseH;
@@ -64,4 +65,11 @@ public interface ElecUseHMapper
      int deleteElecUseHByIds(Long[] ids);
 
     List<Map<String, Object>> selectElecUseHByMonth(@Param("areaCode") String areaCode, @Param("date") String date);
+
+    @MapKey("areaCode")
+    Map<String, Object> selectThisDayElecUse(@Param("areaCode") String areaCode, @Param("date") String date);
+
+    List<Map<String, Object>> selectMonthElecUse(@Param("areaCode") String areaCode, @Param("date") String date);
+
+    List<Map<String, Object>> selectThisDayFacsTypeElecUse(@Param("areaCode") String areaCode, @Param("date") String date);
 }

+ 11 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsDeviceMapper.java

@@ -1,6 +1,9 @@
 package com.ruoyi.ems.mapper;
 
 import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Param;
 
 import com.ruoyi.ems.domain.EmsDevice;
 import com.ruoyi.ems.domain.vo.QueryDevice;
@@ -22,6 +25,7 @@ public interface EmsDeviceMapper {
 
     /**
      * 查询能源设备
+     *
      * @param code 能源设备编码
      * @return 能源设备
      */
@@ -37,6 +41,7 @@ public interface EmsDeviceMapper {
 
     /**
      * 根据区域树递归查询设备
+     *
      * @param queryDevice 条件
      * @return 设备列表
      */
@@ -73,4 +78,10 @@ public interface EmsDeviceMapper {
      * @return 结果
      */
     int deleteEmsDeviceByIds(Long[] ids);
+
+    String selectDevicePath(@Param("areaType") String areaType, @Param("refArea") String refArea);
+
+    List<Map<String, Object>> cntDeviceStatus(@Param("areaCode") String areaCode);
+
+    List<Map<String, Object>> calcDeviceOnlineSummary(@Param("areaCode") String areaCode);
 }

+ 13 - 8
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElecUseHService.java

@@ -11,15 +11,14 @@ import com.ruoyi.ems.domain.ElecUseH;
  * @author ruoyi
  * @date 2024-08-15
  */
-public interface IElecUseHService
-{
+public interface IElecUseHService {
     /**
      * 查询用能计量-小时
      *
      * @param id 用能计量-小时主键
      * @return 用能计量-小时
      */
-     ElecUseH selectElecUseHById(Long id);
+    ElecUseH selectElecUseHById(Long id);
 
     /**
      * 查询用能计量-小时列表
@@ -27,7 +26,7 @@ public interface IElecUseHService
      * @param elecUseH 用能计量-小时
      * @return 用能计量-小时集合
      */
-     List<ElecUseH> selectElecUseHList(ElecUseH elecUseH);
+    List<ElecUseH> selectElecUseHList(ElecUseH elecUseH);
 
     /**
      * 新增用能计量-小时
@@ -35,7 +34,7 @@ public interface IElecUseHService
      * @param elecUseH 用能计量-小时
      * @return 结果
      */
-     int insertElecUseH(ElecUseH elecUseH);
+    int insertElecUseH(ElecUseH elecUseH);
 
     /**
      * 修改用能计量-小时
@@ -43,7 +42,7 @@ public interface IElecUseHService
      * @param elecUseH 用能计量-小时
      * @return 结果
      */
-     int updateElecUseH(ElecUseH elecUseH);
+    int updateElecUseH(ElecUseH elecUseH);
 
     /**
      * 批量删除用能计量-小时
@@ -51,7 +50,7 @@ public interface IElecUseHService
      * @param ids 需要删除的用能计量-小时主键集合
      * @return 结果
      */
-     int deleteElecUseHByIds(Long[] ids);
+    int deleteElecUseHByIds(Long[] ids);
 
     /**
      * 删除用能计量-小时信息
@@ -59,10 +58,16 @@ public interface IElecUseHService
      * @param id 用能计量-小时主键
      * @return 结果
      */
-     int deleteElecUseHById(Long id);
+    int deleteElecUseHById(Long id);
 
     /**
      * 查询用能和发电量
      */
     List<Map> selectElecAndPower(String areaCode);
+
+    Map<String, List<Map<String, Object>>> selectMonthElecUse(String areaCode);
+
+    List<Map<String, Object>> selectThisDayFacsTypeElecUse(String areaCode);
+
+    Map<String, Object> selectThisDayAreaElecUse(String areaCode);
 }

+ 5 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsDeviceService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.ems.service;
 
 import java.util.List;
+import java.util.Map;
 
 import com.ruoyi.ems.domain.EmsDevice;
 import com.ruoyi.ems.domain.vo.QueryDevice;
@@ -82,4 +83,8 @@ public interface IEmsDeviceService {
      * @return 结果
      */
     int deleteEmsDeviceById(Long id);
+
+    List<Map<String, Object>> cntDeviceStatus(String areaCode);
+
+    List<Map<String, Object>> calcDeviceOnlineSummary(String areaCode);
 }

+ 6 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.ems.service;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.ems.domain.EmsFacs;
 
 /**
@@ -72,4 +74,8 @@ public interface IEmsFacsService {
      * @return 结果
      */
     int deleteEmsFacsById(Long id);
+
+    List<String> inspectFacIndex();
+
+    Map<String, Map<String, Object>> qryAreaDayPowerIndex(String areaCode);
 }

+ 19 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElecUseHServiceImpl.java

@@ -122,4 +122,23 @@ public class ElecUseHServiceImpl implements IElecUseHService {
         }
         return result;
     }
+
+    @Override
+    public Map<String, List<Map<String, Object>>> selectMonthElecUse(String areaCode) {
+        String date = DateTimeUtil.getFirstDayOfRecentYear();
+        List<Map<String, Object>> areaData = elecUseHMapper.selectMonthElecUse(areaCode, date);
+        return StreamUtils.groupByKey(areaData, map -> MapUtil.getStr(map, "areaCode"));
+    }
+
+    @Override
+    public List<Map<String, Object>> selectThisDayFacsTypeElecUse(String areaCode) {
+        String date = DateTimeUtil.currentDateTime(DateTimeUtil.DateFormatter.yyyy_MM_dd);
+        return elecUseHMapper.selectThisDayFacsTypeElecUse(areaCode, date);
+    }
+
+    @Override
+    public Map<String, Object> selectThisDayAreaElecUse(String areaCode) {
+        String date = DateTimeUtil.currentDateTime(DateTimeUtil.DateFormatter.yyyy_MM_dd);
+        return elecUseHMapper.selectThisDayElecUse(areaCode, date);
+    }
 }

+ 29 - 15
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsDeviceServiceImpl.java

@@ -1,5 +1,16 @@
 package com.ruoyi.ems.service.impl;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.ems.domain.Area;
 import com.ruoyi.ems.domain.AreaBuilding;
@@ -15,16 +26,6 @@ import com.ruoyi.ems.service.IAreaBuildingZoningService;
 import com.ruoyi.ems.service.IAreaService;
 import com.ruoyi.ems.service.IEmsDeviceService;
 import com.ruoyi.ems.service.IEmsFacsService;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
 
 /**
  * 能源设备Service业务层处理
@@ -189,13 +190,12 @@ public class EmsDeviceServiceImpl implements IEmsDeviceService {
                 else if (StringUtils.equals(AreaTier.Zoning.name(), device.getAreaType())) {
                     AreaBuildingZoning zoning = zoningMap.get(device.getRefArea());
                     AreaBuilding building = zoning != null ? buildingMap.get(zoning.getBldgCode()) : null;
-                    namePrefix = (building != null ? building.getBldgName() : "") + "/" + (zoning != null ?
-                        zoning.getZoningName() : "");
+                    namePrefix = (building != null ? building.getBldgName() : "") + "/"
+                        + (zoning != null ? zoning.getZoningName() : "");
                 }
 
-                String label = StringUtils.isNotBlank(namePrefix) ?
-                    namePrefix + " - " + device.getDeviceName() :
-                    device.getDeviceName();
+                String label = StringUtils.isNotBlank(namePrefix) ? namePrefix + " - " + device.getDeviceName()
+                    : device.getDeviceName();
 
                 TreeEntity entity = new TreeEntity();
                 entity.setId(device.getDeviceCode());
@@ -227,6 +227,8 @@ public class EmsDeviceServiceImpl implements IEmsDeviceService {
     @Override
     public int insertEmsDevice(EmsDevice emsDevice) {
         emsDevice.setCreateTime(DateUtils.getNowDate());
+        String codePath = emsDeviceMapper.selectDevicePath(emsDevice.getAreaType(), emsDevice.getRefArea());
+        emsDevice.setAreaAncestors(codePath);
         return emsDeviceMapper.insertEmsDevice(emsDevice);
     }
 
@@ -239,6 +241,8 @@ public class EmsDeviceServiceImpl implements IEmsDeviceService {
     @Override
     public int updateEmsDevice(EmsDevice emsDevice) {
         emsDevice.setUpdateTime(DateUtils.getNowDate());
+        String codePath = emsDeviceMapper.selectDevicePath(emsDevice.getAreaType(), emsDevice.getRefArea());
+        emsDevice.setAreaAncestors(codePath);
         return emsDeviceMapper.updateEmsDevice(emsDevice);
     }
 
@@ -310,4 +314,14 @@ public class EmsDeviceServiceImpl implements IEmsDeviceService {
             }
         }
     }
+
+    @Override
+    public List<Map<String, Object>> cntDeviceStatus(String areaCode) {
+        return emsDeviceMapper.cntDeviceStatus(areaCode);
+    }
+
+    @Override
+    public List<Map<String, Object>> calcDeviceOnlineSummary(String areaCode) {
+        return emsDeviceMapper.calcDeviceOnlineSummary(areaCode);
+    }
 }

+ 7 - 28
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsServiceImpl.java

@@ -14,11 +14,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.ruoyi.common.core.enums.FacTypes;
+import com.ruoyi.common.core.utils.DateTimeUtil;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.ExpressUtil;
 import com.ruoyi.common.core.utils.StreamUtils;
-import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
-import com.ruoyi.ems.domain.AdmEmsIndexRange;
 import com.ruoyi.ems.domain.EmsFacs;
 import com.ruoyi.ems.domain.EmsFacsAbility;
 import com.ruoyi.ems.domain.EmsFacsAttr;
@@ -32,7 +31,6 @@ import com.ruoyi.ems.service.IEmsFacsAttrService;
 import com.ruoyi.ems.service.IEmsFacsEventService;
 import com.ruoyi.ems.service.IEmsFacsService;
 
-import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.map.MapUtil;
@@ -211,6 +209,7 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
         return emsFacsMapper.deleteEmsFacsById(id);
     }
 
+    @Override
     public List<String> inspectFacIndex() {
         List<Map<String, Object>> admEmsIndexRanges = admEmsIndexRangeMapper.selectAdmEmsIndexRange();
         Map<String, List<Map<String, Object>>> facTypeRangeMap = StreamUtils.groupByKey(admEmsIndexRanges,
@@ -234,6 +233,11 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
         return errorReport;
     }
 
+    @Override
+    public Map<String, Map<String, Object>> qryAreaDayPowerIndex(String areaCode) {
+        String firstDayOfRecentMonth = DateTimeUtil.getFirstDayOfRecentMonth();
+        return admEmsElecPgIndexMapper.qryAreaDayPowerIndex(areaCode, firstDayOfRecentMonth);
+    }
     private void pgIndexInspection(List<String> errorReport,
         Map.Entry<String, List<Map<String, Object>>> facTypeRange) {
         Map<String, List<Map<String, Object>>> objCodeRangeMap = StreamUtils.groupByKey(facTypeRange.getValue(),
@@ -267,31 +271,6 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
         }
     }
 
-    public static void main(String[] args) {
-        List<Map<String, Object>> admEmsIndexRanges = new ArrayList<>();
-        admEmsIndexRanges.add(BeanUtil.beanToMap(new AdmEmsIndexRange() {
-            {
-                setFacsType(FacTypes.PRODUCT.getCode());
-                setIndexName("voltage");
-                setIndexUpperLimit(225.0D);
-                setIndexLowerLimit(220.1D);
-            }
-        }, "facsType", "indexName", "indexUpperLimit", "indexLowerLimit"));
-        admEmsIndexRanges.add(BeanUtil.beanToMap(new AdmEmsIndexRange() {
-            {
-                setFacsType(FacTypes.PRODUCT.getCode());
-                setIndexName("electricity");
-                setIndexUpperLimit(225.0D);
-                setIndexLowerLimit(220.1D);
-            }
-        }, "facsType", "indexName", "indexUpperLimit", "indexLowerLimit"));
-        System.out.println(ExpressUtil.hitExpress(new AdmEmsElecPgIndex() {
-            {
-                setVoltage(220.1D);
-                setElectricity(1.1D);
-            }
-        }, admEmsIndexRanges));
-    }
 
     private List<EmsFacsAttr> getFacsAttrs(EmsFacs emsFacs) {
         EmsFacsAttr param = new EmsFacsAttr(emsFacs.getFacsCode());

+ 1 - 1
ems-cloud/ems-modules/ems-server/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="60 seconds" debug="false">
     <!-- 日志存放路径 -->
-	<property name="log.path" value="logs/ruoyi-system" />
+	<property name="log.path" value="logs/ems-server" />
    <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 

+ 23 - 7
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxEqptIndexMapper.xml

@@ -19,18 +19,34 @@
 
     <select id="selectAdmEmsElecBoxEqptLatestIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex"
             resultMap="AdmEmsElecBoxEqptIndexResult">
-        WITH rowIndex AS (SELECT *, ROW_NUMBER() over ( PARTITION BY eqpt_code ORDER BY TIME DESC ) AS rowNum
-                          FROM `adm_ems_elec_box_eqpt_index`
-                          WHERE box_code = #{boxCode})
         SELECT
             latestIndex.*,
             elecEqpt.eqpt_spec,
             elecEqpt.rated_current
         FROM
-            rowIndex latestIndex
-                INNER JOIN adm_box_elec_eqpt elecEqpt ON latestIndex.eqpt_code = elecEqpt.eqpt_code
-        WHERE
-            rowNum =1
+            (SELECT
+                 a.*
+             FROM
+                 `adm_ems_elec_box_eqpt_index` a
+                     JOIN
+                 (SELECT
+                      eqpt_code,
+                      MAX(id) AS id
+                  FROM
+                      `adm_ems_elec_box_eqpt_index`
+                  WHERE
+                      box_code = #{boxCode}
+                  GROUP BY
+                      eqpt_code) latestTime
+                 ON
+                     a.eqpt_code = latestTime.eqpt_code AND a.id = latestTime.id
+             WHERE
+                 a.box_code = #{boxCode}
+            ) latestIndex
+                JOIN
+            adm_box_elec_eqpt elecEqpt
+            ON
+                latestIndex.eqpt_code = elecEqpt.eqpt_code
     </select>
 
 

+ 10 - 5
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxIndexMapper.xml

@@ -44,12 +44,17 @@
     </select>
     <select id="selectElecBoxLatestIndexByBoxCode" parameterType="String"
             resultType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex">
-        WITH rowIndex AS (SELECT *, ROW_NUMBER() over ( PARTITION BY box_code ORDER BY TIME DESC ) AS rowNum
-                          FROM adm_ems_elec_box_index
-                          WHERE box_code = #{boxCode})
         SELECT *
-        FROM rowIndex latestIndex
-        WHERE rowNum = 1
+        FROM (SELECT a.*
+              FROM adm_ems_elec_box_index a
+                       JOIN (SELECT box_code,
+                                    MAX(id) AS max_id
+                             FROM adm_ems_elec_box_index
+                             WHERE box_code = #{boxCode}
+                             GROUP BY box_code) latestId
+                            ON
+                                a.box_code = latestId.box_code AND a.id = latestId.max_id
+              WHERE a.box_code = #{boxCode}) latestIndex;
     </select>
 
     <insert id="insertAdmEmsElecBoxIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex"

+ 19 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecPgIndexMapper.xml

@@ -103,4 +103,23 @@
         f.num =1
     </select>
 
+    <select id="qryAreaDayPowerIndex" resultType="Map">
+        SELECT avgIndex.area_code areaCode,
+               DATE_FORMAT(avgIndex.DATE, '%Y-%m-%d') AS dateIndex,
+               sum(power)                                power
+        FROM (SELECT pgIndex.area_code,
+                     pgIndex.DATE,
+                     pgIndex.facs_code,
+                     AVG(power) power
+              FROM adm_ems_elec_pg_index pgIndex
+              WHERE area_code = #{areaCode}
+                AND pgIndex.DATE >= #{date}
+                AND power > 0
+              GROUP BY pgIndex.area_code,
+                       pgIndex.DATE,
+                       pgIndex.facs_code) avgIndex
+        GROUP BY avgIndex.area_code,
+                 dateIndex
+    </select>
+
 </mapper>

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

@@ -101,12 +101,68 @@
     </delete>
 
     <select id="selectElecUseHByMonth" resultType="Map">
-        SELECT area_code,
+        SELECT area_code areaCode,
+        DATE_FORMAT(date, '%Y-%m') AS dateIndex,
+        SUM(elec_quantity) as elecQuantity
+        FROM adm_ems_facs_use_h
+        <where>
+            <if test="areaCode != null and areaCode != ''">
+                and area_code = #{areaCode}
+            </if>
+            <if test="date != null and date != ''">
+                and DATE >= #{date}
+            </if>
+        </where>
+        GROUP BY
+        area_code,
+        dateIndex
+    </select>
+
+    <select id="selectThisDayElecUse" resultType="Map">
+        SELECT area_code areaCode,
+        DATE_FORMAT(date, '%Y-%m-%d') AS dateIndex,
+        SUM(elec_quantity) as elecQuantity
+        FROM adm_ems_facs_use_h
+        <where>
+            <if test="areaCode != null and areaCode != ''">
+                and area_code = #{areaCode}
+            </if>
+            <if test="date != null and date != ''">
+                and DATE >= #{date}
+            </if>
+        </where>
+        GROUP BY
+        area_code,
+        dateIndex
+    </select>
+
+    <select id="selectThisDayFacsTypeElecUse" resultType="Map">
+        SELECT subtype.`name`,
+        DATE_FORMAT(DATE, '%Y-%m-%d') AS dateIndex,
+        SUM(elec_quantity) AS elecQuantity
+        FROM adm_ems_facs_use_h facUse
+        inner JOIN adm_ems_facs facs ON facUse.facs_code = facs.facs_code
+        <if test="areaCode != null and areaCode != ''">
+            and facUse.area_code = #{areaCode}
+        </if>
+        LEFT JOIN dim_ems_facs_subtype subtype ON facs.facs_subtype = subtype.`code`
+        AND subtype.parent_code = 'Z'
+        WHERE
+        DATE >= #{date}
+        GROUP BY
+        subtype.`name`,
+        dateIndex
+    </select>
+
+    <select id="selectMonthElecUse" resultType="Map">
+        SELECT area_code                     areaCode,
                DATE_FORMAT(date, '%Y-%m') AS dateIndex,
                SUM(elec_quantity)         as elecQuantity
         FROM adm_ems_facs_use_h
-        WHERE area_code = #{areaCode}
-          AND DATE >= #{date}
+        WHERE DATE >= #{date}
+        <if test="areaCode != null and areaCode != ''">
+            and area_code = #{areaCode}
+        </if>
         GROUP BY
             area_code,
             dateIndex

+ 75 - 6
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ems.mapper.EmsDeviceMapper">
-    
+
     <resultMap type="com.ruoyi.ems.domain.EmsDevice" id="EmsDeviceResult">
         <result property="id"    column="id"    />
         <result property="deviceCode"        column="device_code"    />
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectEmsDeviceList" parameterType="com.ruoyi.ems.domain.EmsDevice" resultMap="EmsDeviceResult">
         <include refid="selectEmsDeviceVo"/>
-        <where>  
+        <where>
             <if test="deviceCode != null  and deviceCode != ''"> and d.`device_code` = #{deviceCode}</if>
             <if test="deviceName != null  and deviceName != ''"> and d.`device_name` like concat('%', #{deviceName}, '%')</if>
             <if test="deviceType != null "> and d.`device_type` = #{deviceType}</if>
@@ -83,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         ORDER BY d.`area_type`, d.`ref_area`
     </select>
-    
+
     <select id="selectEmsDeviceById" parameterType="Long" resultMap="EmsDeviceResult">
         <include refid="selectEmsDeviceVo"/>
         where d.`id` = #{id}
@@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectEmsDeviceVo"/>
         where d.`device_code` = #{code}
     </select>
-        
+
     <insert id="insertEmsDevice" parameterType="com.ruoyi.ems.domain.EmsDevice" useGeneratedKeys="true" keyProperty="id">
         insert into adm_ems_device
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -107,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="subsystemCode != null">subsystem_code,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="areaAncestors !=null">area_ancestors,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
@@ -119,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="subsystemCode != null">#{subsystemCode},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="areaAncestors !=null">#{areaAncestors},</if>
          </trim>
     </insert>
 
@@ -135,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="subsystemCode != null">subsystem_code = #{subsystemCode},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="areaAncestors !=null">area_ancestors = #{areaAncestors},</if>
         </trim>
         where id = #{id}
     </update>
@@ -144,9 +147,75 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteEmsDeviceByIds" parameterType="String">
-        delete from adm_ems_device where id in 
+        delete from adm_ems_device where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+
+    <select id="selectDevicePath" resultType="String">
+        SELECT
+        <if test="areaType == 'Area'">
+            area.area_code path
+        </if>
+        <if test="areaType == 'Building'">
+            CONCAT( area.area_code, ',', building.bldg_code) path
+        </if>
+        <if test="areaType == 'Zoning'">
+            CONCAT( area.area_code, ',', building.bldg_code, ',', zone.zoning_code ) path
+        </if>
+        FROM
+        adm_service_area area
+        <if test="areaType == 'Building' or areaType == 'Zoning'">
+            INNER JOIN adm_area_building building ON area.area_code = building.area_code
+        </if>
+        <if test="areaType == 'Zoning'">
+            INNER JOIN adm_area_building_zoning zone ON building.bldg_code = zone.bldg_code
+        </if>
+        <where>
+            <if test="areaType == 'Area'">
+                area.area_code = #{refArea}
+            </if>
+            <if test="areaType == 'Building'">
+                building.bldg_code = #{refArea}
+            </if>
+            <if test="areaType == 'Zoning'">
+                zone.zoning_code = #{refArea}
+            </if>
+        </where>
+        limit 1
+    </select>
+    <select id="cntDeviceStatus">
+        SELECT
+        device_status deviceStatus,
+        count( id ) cnt
+        FROM
+        adm_ems_device
+        <where>
+            <if test="areaCode !=null and areaCode!=''">
+                area_ancestors like CONCAT('%',#{areaCode},'%')
+            </if>
+        </where>
+        GROUP BY
+        device_status
+    </select>
+
+    <select id="calcDeviceOnlineSummary">
+        SELECT
+            device_status  deviceStatus,
+            devcType.type_name typeName,
+            count( devc.id ) total,
+            SUM( CASE WHEN device_status = '0' THEN 1 ELSE 0 END ) AS onlineCount
+        FROM
+            adm_ems_device devc
+                INNER JOIN dim_devc_type devcType ON devc.device_type = devcType.type_code
+        <where>
+            <if test="areaCode !=null and areaCode!=''">
+                area_ancestors like CONCAT('%',#{areaCode},'%')
+            </if>
+        </where>
+        GROUP BY
+            device_type
+    </select>
+
+</mapper>

+ 1 - 2
ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/DateTimeUtil.java

@@ -536,7 +536,6 @@ public class DateTimeUtil {
         // 计算近一年的年份
         int recentYear = today.getYear() - 1;
 
-        // 使用 TemporalAdjusters 来找到近一年的第一天
         LocalDate localDate = LocalDate.of(recentYear, today.getMonth(), 1);
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat);
         return localDate.format(formatter);
@@ -563,7 +562,7 @@ public class DateTimeUtil {
         // 获取当前日期
         LocalDate today = LocalDate.now();
         // 使用 TemporalAdjusters 来找到近一个月的第一天
-        LocalDate with = today.minusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
+        LocalDate with = today.minusMonths(1);
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat);
         return with.format(formatter);
     }

+ 246 - 2
ems-cloud/sql/ems_init_data.sql

@@ -1,6 +1,7 @@
 -- 服务区初始数据
 INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3001', '常泰高速服务区(北区)', '北区', 4, '泰州', 'S30如常高速', '常州方向', '江苏省泰州市泰兴市虹桥镇常泰高速常州方向', null, null, '2025-01-01', '72.5', '6000', '120.050937', '32.071956');
 INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3002', '常泰高速服务区(南区)', '南区', 4, '泰州', 'S30如常高速', '泰兴方向', '江苏省泰州市泰兴市虹桥镇常泰高速泰州方向', null, null, '2025-01-01', '72.5', '6000', '120.052389', '32.070408');
+INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3003', '主路沿线光伏', '主路', 4, '泰州', 'S30如常高速', null, '江苏省泰州市泰兴市虹桥镇常泰高速泰州方向', null, null, '2025-01-01', '72.5', '6000', '120.052389', '32.070408');
 
 -- 建筑初始数据
 INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300101', '综合楼', '北区中部', 2, 1, 13.7, 4700, '一层提供商业、餐饮、卫生间、开水服务,二层为办公区、会议区', '321283124S3001');
@@ -38,7 +39,19 @@ INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`,
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-117', '工具间3', 1, '117', 50, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-118', '工具间4', 1, '118', 50, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-119', '货车服务空间', 1, '119', 50, '使用中');
-
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300102', 'B-120', '配电间', 1, '120', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300102', 'B-121', '水泵间', 1, '121', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300102', 'B-122', '控制间', 1, '122', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300103', 'B-123', '维修车间', 1, '123', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300103', 'B-124', '办公室', 1, '124', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300104', 'B-125', '加油站区', 1, '125', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300104', 'B-126', '油罐区', 1, '126', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300104', 'B-127', '营业区', 1, '127', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300104', 'B-128', '辅助区', 1, '128', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300105', 'B-129', '接待区', 1, '129', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300105', 'B-130', '指挥室', 1, '130', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300105', 'B-131', '调解室', 1, '131', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300105', 'B-132', '便民服务区', 1, '132', 50, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-XK', '小客停车位', 1, 'CW-XK', 100, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-CD', '充电车位', 1, 'CW-CD', 100, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-WZA', '无障碍车位', 1, 'CW-WZA', 100, '使用中');
@@ -65,6 +78,19 @@ INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`,
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-117', '工具间3', 1, '117', 50, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-118', '工具间4', 1, '118', 50, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-119', '货车服务空间', 1, '119', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300202', 'N-120', '消防设备', 1, '120', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300202', 'N-121', '照明设备', 1, '121', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300202', 'N-122', '信号设备', 1, '122', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300203', 'N-123', '备件管理', 1, '123', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300203', 'N-124', '集装箱', 1, '124', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300204', 'N-125', '加油站区', 1, '125', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300204', 'N-126', '油罐区', 1, '126', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300204', 'N-127', '营业区', 1, '127', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300204', 'N-128', '辅助区', 1, '128', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300205', 'N-129', '接待区', 1, '129', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300205', 'N-130', '指挥中心', 1, '130', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300205', 'N-131', '调解室', 1, '131', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300205', 'N-132', '便民服务区', 1, '132', 50, '使用中');
 
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-XK', '小客停车位', 1, 'CW-XK', 100, '使用中');
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-CD', '充电车位', 1, 'CW-XK', 100, '使用中');
@@ -105,6 +131,109 @@ INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_cod
 INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_W201', 'E501', 'W201', '45', 1, '4502');
 INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_Z101', 'E501', 'Z101', '45', 1, '4505');
 
+-- 能源设备
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R102-002', '超市照明灯',       '1', '2', 'Zoning', 'B-102', '321283124S3001,321283124S300101,B-102', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R102-003', '超市监控和防盗设备', '1', '2', 'Zoning', 'B-102', '321283124S3001,321283124S300101,B-102', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R103-001', '空调',             '2', '1', 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', 'Z120', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R103-002', '烤箱', '2', '2', 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R103-003', '搅拌机', '2','2' , 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R104-001', 'LED节能灯', '2', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R104-002', '智能电表', '2', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R104-003', '智慧路灯', '2', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R105-001', '电源管理器', '2', '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R105-002', '充电站', '1', '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R105-003', '调光系统', '1', '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R106-001', '吊灯', '2', '1', 'Zoning', 'B-106', '321283124S3001,321283124S300101,B-106', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R107-001', '橱窗照明','2', '1', 'Zoning', 'B-107', '321283124S3001,321283124S300101,B-107', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R107-002', 'UPS(不间断电源)系统', '1', '1', 'Zoning', 'B-107', '321283124S3001,321283124S300101,B-107', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R108-001', '吊灯', '2', '1', 'Zoning', 'B-108', '321283124S3001,321283124S300101,B-108', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R109-001', '指示灯', '2', '1', 'Zoning', 'B-109', '321283124S3001,321283124S300101,B-109', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R110-001', '应急照明', '2', '1', 'Zoning', 'B-110', '321283124S3001,321283124S300101,B-110', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R112-001', '自动感应灯', '2', '2', 'Zoning', 'B-112', '321283124S3001,321283124S300101,B-112', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R112-002', '电路保护装置', '1', '2', 'Zoning', 'B-112', '321283124S3001,321283124S300101,B-112', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R114-001', '自动感应灯', '2', '2', 'Zoning', 'B-114', '321283124S3001,321283124S300101,B-114', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R114-002', '电路保护装置', '1', '2', 'Zoning', 'B-114', '321283124S3001,321283124S300101,B-114', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R115-001', '工作灯', '1', '2', 'Zoning', 'B-115', '321283124S3001,321283124S300101,B-115', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R16-001',  '防水灯具', '1', '2', 'Zoning', 'B-116', '321283124S3001,321283124S300101,B-116', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R117-001', '防水灯具', '1', '2', 'Zoning', 'B-117', '321283124S3001,321283124S300101,B-117', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R118-001', '灯具', '1', '2', 'Zoning', 'B-118', '321283124S3001,321283124S300101,B-118', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R119-001', '防水灯具', '1', '2', 'Zoning', 'B-119', '321283124S3001,321283124S300101,B-119', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R120-001', '控制面板', '1', '1', 'Zoning', 'B-120', '321283124S3001,321283124S300102,B-120', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R121-001', '配电柜', '2', '1', 'Zoning', 'B-121', '321283124S3001,321283124S300102,B-121', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R122-001', '断路器', '1', '1', 'Zoning', 'B-122', '321283124S3001,321283124S300102,B-122', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R123-001', '电源插座', '1', '1', 'Zoning', 'B-123', '321283124S3001,321283124S300103,B-123', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R124-001', '加热器', '1', '1', 'Zoning', 'B-124', '321283124S3001,321283124S300103,B-124', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R125-001', '空调', '1', '1', 'Zoning', 'B-125', '321283124S3001,321283124S300104,B-125', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R126-001', '空调', '1', '1', 'Zoning', 'B-126', '321283124S3001,321283124S300104,B-126', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R127-001', '空调', '1', '1', 'Zoning', 'B-127', '321283124S3001,321283124S300104,B-127', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R128-001', '空调', '1', '1', 'Zoning', 'B-128', '321283124S3001,321283124S300104,B-128', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R129-001', '空调', '1', '1', 'Zoning', 'B-129', '321283124S3001,321283124S300105,B-129', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R130-001', '空调', '1', '1', 'Zoning', 'B-130', '321283124S3001,321283124S300105,B-130', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R131-001', '空调', '1', '1', 'Zoning', 'B-131', '321283124S3001,321283124S300105,B-131', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R132-001', '空调', '1', '1', 'Zoning', 'B-132', '321283124S3001,321283124S300105,B-132', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-001', '照明灯', '1', '1', 'Zoning', '321283124S3001_CW-XK', '321283124S3001,321283124S300106,321283124S3001_CW-XK', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-002', '智能监控系统', '1', NULL, 'Zoning', '321283124S3001_CW-CD', '321283124S3001,321283124S300106,321283124S3001_CW-CD', 'Z110','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-003', '照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-WZA', '321283124S3001,321283124S300106,321283124S3001_CW-WZA', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-004', '照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-DKC', '321283124S3001,321283124S300106,321283124S3001_CW-DKC', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-005', '照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-HC', '321283124S3001,321283124S300106,321283124S3001_CW-HC', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-006', '停车场照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-WXP', '321283124S3001,321283124S300106,321283124S3001_CW-WXP', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-007', '智能监控系统', '1', NULL, 'Zoning', '321283124S3001_CW-WXP', '321283124S3001,321283124S300106,321283124S3001_CW-WXP', 'Z110','SYS_BA');
+
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R101-101', '开水炉', '1', '2', 'Zoning', 'N-101', '321283124S3002,321283124S300201,N-101', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R102-101', '超市区空调', '2', '1', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', 'Z120', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R102-102', '超市照明灯', '1', '2', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R102-103', '超市监控和防盗设备', '1', '2', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R103-101', '空调', '2', NULL, 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', 'Z120', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R103-102', '烤箱', '2', '2', 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R103-103', '搅拌机', '2','2' , 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R104-101', 'LED节能灯', '2', '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R104-102', '智能电表', '2', '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R104-103', '智慧路灯', '2', '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R105-101', '电源管理器', '2', '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R105-102', '充电站', '1', '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R105-103', '调光系统', '1', '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R106-101', '吊灯', '2', '1', 'Zoning', 'N-106', '321283124S3002,321283124S300201,N-106', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R107-101', '橱窗照明','2', '1', 'Zoning', 'N-107', '321283124S3002,321283124S300201,N-107', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R107-102', 'UPS(不间断电源)系统', '1', '1', 'Zoning', 'N-107', '321283124S3002,321283124S300201,N-107', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R108-101', '吊灯', '2', '1', 'Zoning', 'N-108', '321283124S3002,321283124S300201,N-108', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R109-101', '指示灯', '2', '1', 'Zoning', 'N-109', '321283124S3002,321283124S300201,N-109', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R110-101', '应急照明', '2', '1', 'Zoning', 'N-110', '321283124S3002,321283124S300201,N-110', 'Z101', 'SYS_BA');
+
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R112-101', '自动感应灯', '2', '2', 'Zoning', 'N-112', '321283124S3002,321283124S300201,N-112', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R112-102', '电路保护装置', '1', '2', 'Zoning', 'N-112', '321283124S3002,321283124S300201,N-112', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R114-101', '自动感应灯', '2', '2', 'Zoning', 'N-114', '321283124S3002,321283124S300201,N-114', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R114-102', '电路保护装置', '1', '2', 'Zoning', 'N-114', '321283124S3002,321283124S300201,N-114', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R115-101', '工作灯', '1', '2', 'Zoning', 'N-115', '321283124S3002,321283124S300201,N-115', 'Z101', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R16-101', '防水灯具', '1', '2', 'Zoning', 'N-116', '321283124S3002,321283124S300201,N-115', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R117-101', '防水灯具', '1', '2', 'Zoning', 'N-117', '321283124S3002,321283124S300201,N-117', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R118-101', '防水灯具', '1', '1', 'Zoning', 'N-118', '321283124S3002,321283124S300201,N-118', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R119-101', '防水灯具', '1', '1', 'Zoning', 'N-119', '321283124S3002,321283124S300201,N-119', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R120-101', '控制面板', '1', '1', 'Zoning', 'N-120', '321283124S3002,321283124S300202,N-120', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R121-101', '配电柜', '2', '1', 'Zoning', 'N-121', '321283124S3002,321283124S300202,N-121', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R122-101', '断路器', '1', '1', 'Zoning', 'N-122', '321283124S3002,321283124S300202,N-122', 'W201', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R123-101', '电源插座', '1', '1', 'Zoning', 'N-123', '321283124S3002,321283124S300203,N-123', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R124-101', '加热器', '1', '1', 'Zoning', 'N-124', '321283124S3002,321283124S300203,N-124', 'Z102', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R125-101', '空调', '1', '1', 'Zoning', 'N-125', '321283124S3002,321283124S300204,N-125', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R126-101', '空调', '1', '1', 'Zoning', 'N-126', '321283124S3002,321283124S300204,N-126', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R127-101', '空调', '1', '1', 'Zoning', 'N-127', '321283124S3002,321283124S300204,N-127', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R128-101', '空调', '1', '1', 'Zoning', 'N-128', '321283124S3002,321283124S300204,N-128', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R129-101', '空调', '1', '1', 'Zoning', 'N-129', '321283124S3002,321283124S300205,N-129', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R130-101', '空调', '1', '1', 'Zoning', 'N-130', '321283124S3002,321283124S300205,N-130', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R131-101', '空调', '1', '1', 'Zoning', 'N-131', '321283124S3002,321283124S300205,N-131', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Z010-R132-101', '空调', '1', '1', 'Zoning', 'N-132', '321283124S3002,321283124S300205,N-132', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-101', '照明灯', '1', '1', 'Zoning', '321283124S3002_CW-XK', '321283124S3002,321283124S300206,321283124S3002_CW-XK', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-102', '智能监控系统', '1', NULL, 'Zoning', '321283124S3002_CW-CD', '321283124S3002,321283124S300206,321283124S3002_CW-CD', 'Z110','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-103', '照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-WZA', '321283124S3002,321283124S300206,321283124S3002_CW-WZA', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-104', '照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-DKC', '321283124S3002,321283124S300206,321283124S3002_CW-DKC', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-105', '照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-HC', '321283124S3002,321283124S300206,321283124S3002_CW-HC', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-106', '停车场照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-WXP', '321283124S3002,321283124S300206,321283124S3002_CW-WXP', 'Z102','SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `subsystem_code`) VALUES ( 'Car-107', '智能监控系统', '1', NULL, 'Zoning', '321283124S3002_CW-WXP', '321283124S3002,321283124S300206,321283124S3002_CW-WXP', 'Z110','SYS_BA');
+
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `ref_facs`, `subsystem_code`) VALUES ( 'Road_001', '主板1', '2', '1', 'Area', '321283124S3003', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `ref_facs`, `subsystem_code`) VALUES ( 'Road_002', '主板2', '2', '1', 'Area', '321283124S3003', 'Z110', 'SYS_BA');
+INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `ref_facs`, `subsystem_code`) VALUES ( 'Road_003', '主板3', '2', '1', 'Area', '321283124S3003', 'Z110', 'SYS_BA');
+
+
 -- 配电柜DEMO数据
 INSERT INTO adm_power_box (`box_code`, `box_type`, `area_code`, `location`, `box_size`, `gateway_addr`, `gateway_port`) VALUES ('D-B-1001', 1, '321283124S3001', '综合楼配电间', '100*200', '0.0.0.0', 9999);
 INSERT INTO adm_power_box (`box_code`, `box_type`, `area_code`, `location`, `box_size`, `gateway_addr`, `gateway_port`) VALUES ('D-B-1002', 1, '321283124S3001', '广场配电柜', '100*200', '0.0.0.0', 9999);
@@ -239,10 +368,21 @@ INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_ty
 INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-Z101', '321283124S3001', 45, 2, 1, 'Z101', 0, 4, 1, 1, '直采表');
 INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-Z120', '321283124S3001', 45, 2, 1, 'Z120', 0, 4, 1, 50, '互感器表');
 
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-101', '321283124S3002', 45, 1, 3, 'N-101', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-102', '321283124S3002', 45, 1, 3, 'N-103', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-103', '321283124S3002', 45, 1, 3, 'N-105', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-104', '321283124S3002', 45, 1, 3, 'N-107', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-105', '321283124S3002', 45, 1, 3, 'N-109', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-106', '321283124S3002', 45, 1, 3, 'N-110', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-107', '321283124S3002', 45, 1, 3, 'N-112', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-108', '321283124S3002', 45, 1, 3, 'N-113', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-109', '321283124S3002', 45, 1, 3, 'N-114', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-N-110', '321283124S3002', 45, 1, 3, 'N-115', 0, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-Z010-R105-101', '321283124S3002', 45, 2, 2, 'Z010-R105-101', 0, 4, 1, 20, '互感器表');
+
 -- 水表
 INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-01', '321283124S3001', 70, 1, 2, '321283124S300101', 0, 4, 1, 1, '直采表');
 
-
 -- 抄表demo数据
 INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
 INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202402', 100, '2024-02-29', 238, '2024-02-28', 138, NULL, NULL);
@@ -343,3 +483,107 @@ INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`
 INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-Z120', '321283124S3001', '2024', '202407', 293, '2024-06-30', 387, '2024-07-31', 4700, NULL, NULL);
 INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-Z120', '321283124S3001', '2024', '202408', 387, '2024-07-31', 465, '2024-08-31', 3900, NULL, NULL);
 
+-- 电网计量指标数据
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '00:00:00', 1, 0, 0.75, 70, 52.5);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '01:00:00', 2, 0, 0.75, 65, 48.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '02:00:00', 3, 0, 0.75, 60, 45);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '03:00:00', 4, 0, 0.75, 68, 51);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '04:00:00', 5, 0, 0.75, 77, 57.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '05:00:00', 6, 0, 0.75, 86, 63);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '06:00:00', 7, 0, 0.75, 97, 72.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '07:00:00', 8, 0, 0.75, 127, 96);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '08:00:00', 9, 0, 0.75, 133, 99.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '09:00:00', 10, 0, 0.75, 150, 112.2);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '10:00:00', 11, 0, 0.75, 120, 90);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '11:00:00', 12, 0, 0.75, 158, 118.5);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '12:00:00', 13, 0, 0.75, 164, 112.2);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '13:00:00', 14, 0, 0.75, 147, 110.25);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '14:00:00', 15, 0, 0.75, 184, 138);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '15:00:00', 16, 0, 0.75, 135, 101.25);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '16:00:00', 17, 0, 0.75, 120, 90);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '17:00:00', 18, 0, 0.75, 117, 112.2);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '18:00:00', 19, 0, 0.75, 110, 87.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '19:00:00', 20, 0, 0.75, 98, 73.5);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '20:00:00', 21, 0, 0.75, 87, 65.25);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '21:00:00', 22, 0, 0.75, 77, 57.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '22:00:00', 23, 0, 0.75, 84, 63);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3001', 'W201', '2024-09-01', '23:00:00', 24, 0, 0.75, 62, 46.5);
+
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '01:00:00', 1, 0, 0.75, 164, 112.2);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '02:00:00', 2, 0, 0.75, 147, 110.25);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '03:00:00', 3, 0, 0.75, 184, 138);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '04:00:00', 4, 0, 0.75, 135, 101.25);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '05:00:00', 5, 0, 0.75, 120, 90);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '06:00:00', 6, 0, 0.75, 117, 112.2);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '07:00:00', 7, 0, 0.75, 110, 87.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '08:00:00', 8, 0, 0.75, 98, 73.5);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '09:00:00', 9, 0, 0.75, 87, 65.25);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '10:00:00', 10, 0, 0.75, 77, 57.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '11:00:00', 11, 0, 0.75, 84, 63);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '12:00:00', 12, 0, 0.75, 62, 46.5);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '13:00:00', 13, 0, 0.75, 70, 52.5);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '14:00:00', 14, 0, 0.75, 65, 48.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '15:00:00', 15, 0, 0.75, 60, 45);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '16:00:00', 16, 0, 0.75, 68, 51);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '17:00:00', 17, 0, 0.75, 77, 57.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '18:00:00', 18, 0, 0.75, 86, 63);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '19:00:00', 19, 0, 0.75, 97, 72.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '20:00:00', 20, 0, 0.75, 127, 96);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '21:00:00', 21, 0, 0.75, 133, 99.75);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '22:00:00', 22, 0, 0.75, 150, 112.2);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '23:00:00', 23, 0, 0.75, 120, 90);
+INSERT INTO `adm_ems_pg_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `meter_type`, `meter_unit_price`, `use_elec_quantity`, `use_elec_cost`) VALUES ('321283124S3002', 'W202', '2024-09-01', '24:00:00', 24, 0, 0.75, 158, 118.5);
+
+-- 光伏指标数据
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '00:00:00', 1, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '01:00:00', 2, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '02:00:00', 3, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '03:00:00', 4, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '04:00:00', 5, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '05:00:00', 6, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '06:00:00', 7, 0.45, 10, 10, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '07:00:00', 8, 0.45, 17, 12, 5, 2.25);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '08:00:00', 9, 0.45, 28, 15, 13, 5.85);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '09:00:00', 10, 0.45, 40, 25, 25, 11.25);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '10:00:00', 11, 0.45, 67, 30, 37, 16.65);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '11:00:00', 12, 0.45, 88, 50, 38, 17.1);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '12:00:00', 13, 0.45, 96, 72, 24, 10.8);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '13:00:00', 14, 0.45, 112, 80, 32, 14.4);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '14:00:00', 15, 0.45, 128, 97, 31, 13.95);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '15:00:00', 16, 0.45, 108, 60, 48, 21.6);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '16:00:00', 17, 0.45, 68, 38, 30, 13.5);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '17:00:00', 18, 0.45, 37, 20, 17, 7.65);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '18:00:00', 19, 0.45, 23, 10, 13, 5.85);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '19:00:00', 20, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '20:00:00', 21, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '21:00:00', 22, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '22:00:00', 23, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3001', 'E501', '2024-09-01', '23:00:00', 24, 0.45, 0, 0, 0, 0);
+
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '00:00:00', 1, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '01:00:00', 2, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '02:00:00', 3, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '03:00:00', 4, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '04:00:00', 5, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '05:00:00', 6, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '06:00:00', 7, 0.45, 10, 10, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '07:00:00', 8, 0.45, 17, 12, 5, 2.25);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '08:00:00', 9, 0.45, 28, 15, 13, 5.85);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '09:00:00', 10, 0.45, 40, 25, 25, 11.25);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '10:00:00', 11, 0.45, 67, 30, 37, 16.65);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '11:00:00', 12, 0.45, 88, 50, 38, 17.1);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '12:00:00', 13, 0.45, 96, 72, 24, 10.8);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '13:00:00', 14, 0.45, 112, 80, 32, 14.4);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '14:00:00', 15, 0.45, 128, 97, 31, 13.95);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '15:00:00', 16, 0.45, 108, 60, 48, 21.6);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '16:00:00', 17, 0.45, 68, 38, 30, 13.5);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '17:00:00', 18, 0.45, 37, 20, 17, 7.65);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '18:00:00', 19, 0.45, 23, 10, 13, 5.85);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '19:00:00', 20, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '20:00:00', 21, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '21:00:00', 22, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '22:00:00', 23, 0.45, 0, 0, 0, 0);
+INSERT INTO `adm_ems_pv_supply_h` (`area_code`, `facs_code`, `date`, `time`, `time_index`, `up_unit_price`, `gen_elec_quantity`, `use_elec_quantity`, `up_elec_quantity`, `up_elec_earn`) VALUES ('321283124S3002', 'E502', '2024-09-01', '23:00:00', 24, 0.45, 0, 0, 0, 0);
+
+
+

+ 4 - 2
ems-cloud/sql/ems_server.sql

@@ -555,6 +555,7 @@ create table adm_ems_device  (
   `device_status`   int             default null                 comment '设备状态',
   `area_type`       varchar(32)     default null                 comment '设备类型',
   `ref_area`        varchar(64)     default null                 comment '归属区域代码',
+  `area_ancestors`  varchar(200)     default null                comment '区域祖级代码',
   `ref_facs`        varchar(64)     default null                 comment '归属设施代码',
   `subsystem_code`  varchar(16)     default null                 comment '子系统名称',
   `create_time`     datetime        default CURRENT_TIMESTAMP    comment '创建时间',
@@ -738,6 +739,7 @@ create table adm_op_alarm  (
   `system_code`         varchar(16)     default null                 comment '子系统代码',
   `obj_type`            int             not null                     comment '对象类型 0:园区,1:区块,2:设施,3:设备',
   `obj_code`            varchar(32)     not null                     comment '对象代码',
+  `obj_name`            varchar(128)    default null                 comment '对象名称',
   `alarm_date`          date            default null                 comment '告警日期',
   `alarm_time`          datetime        default null                 comment '告警时间',
   `alarm_code`          varchar(64)     default null                 comment '告警代码',
@@ -988,7 +990,7 @@ create table adm_ems_pg_supply_h (
   `use_elec_quantity`  double          default null                 comment '用电量 单位:kW-h(千瓦时)',
   `use_elec_cost`      double          default null                 comment '用电电费 单位: ¥(元)',
   primary key (`id`),
-  unique key ux_ems_pg_supply_h(`area_code`, `facs_code`, `date`, `time_index`)
+  unique key ux_ems_pg_supply_h(`area_code`, `facs_code`, `date`, `time`)
 ) engine=innodb auto_increment=1 comment = '电网供应计量表-小时';
 
 
@@ -1009,7 +1011,7 @@ create table adm_ems_pv_supply_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`)
+  unique key ux_ems_pg_supply_h(`area_code`, `facs_code`, `date`, `time`)
 ) engine=innodb auto_increment=1 comment = '光伏并网计量表光伏并网计量表-小时';