فهرست منبع

储能mqtt对接

learshaw 1 هفته پیش
والد
کامیت
9ba7a75782
20فایلهای تغییر یافته به همراه1543 افزوده شده و 628 حذف شده
  1. 0 89
      ems/ems-application/ems-admin/src/main/java/com/ruoyi/web/controller/ems/ElecStoreIndexController.java
  2. 14 0
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/common/TaskClacService.java
  3. 105 0
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/config/GccMqttProperty.java
  4. 13 8
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/controller/GccController.java
  5. 860 0
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/handle/GccHandler.java
  6. 131 0
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/handle/GccSubscriber.java
  7. 103 0
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/model/GccSite.java
  8. 61 0
      ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/model/GccSiteDevice.java
  9. 10 0
      ems/ems-cloud/ems-dev-adapter/src/main/resources/application-local.yml
  10. 11 0
      ems/ems-cloud/ems-dev-adapter/src/main/resources/application-prod-ct.yml
  11. 0 95
      ems/ems-cloud/ems-server/src/main/java/com/ruoyi/ems/controller/ElecStoreIndexController.java
  12. 0 65
      ems/ems-core/src/main/java/com/ruoyi/ems/domain/ElecStoreIndex.java
  13. 0 61
      ems/ems-core/src/main/java/com/ruoyi/ems/mapper/ElecStoreIndexMapper.java
  14. 1 1
      ems/ems-core/src/main/java/com/ruoyi/ems/model/ElecStoreSta.java
  15. 0 61
      ems/ems-core/src/main/java/com/ruoyi/ems/service/IElecStoreIndexService.java
  16. 0 87
      ems/ems-core/src/main/java/com/ruoyi/ems/service/impl/ElecStoreIndexServiceImpl.java
  17. 0 110
      ems/ems-core/src/main/resources/mapper/ems/ElecStoreIndexMapper.xml
  18. 234 26
      ems/sql/ems_init_data_ctfwq.sql
  19. 0 19
      ems/sql/ems_server.sql
  20. 0 6
      ems/sql/ems_sys_data.sql

+ 0 - 89
ems/ems-application/ems-admin/src/main/java/com/ruoyi/web/controller/ems/ElecStoreIndexController.java

@@ -1,89 +0,0 @@
-package com.ruoyi.web.controller.ems;
-
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.page.TableDataInfo;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.enums.BusinessType;
-import org.springframework.security.access.prepost.PreAuthorize;
-import com.ruoyi.ems.domain.ElecStoreIndex;
-import com.ruoyi.ems.service.IElecStoreIndexService;
-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.RestController;
-import com.huashe.common.domain.AjaxResult;
-
-import java.util.List;
-
-/**
- * 储能设施指标Controller
- *
- * @author ruoyi
- * @date 2026-01-28
- */
-@RestController
-@RequestMapping("/ems/elec/store/index")
-public class ElecStoreIndexController extends BaseController {
-    @Autowired
-    private IElecStoreIndexService elecStoreIndexService;
-
-    /**
-     * 查询储能设施指标列表
-     */
-    @PreAuthorize("@ss.hasPermi('ems:ElecStoreIndex:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(ElecStoreIndex elecStoreIndex) {
-        startPage();
-        List<ElecStoreIndex> list = elecStoreIndexService.selectElecStoreIndexList(elecStoreIndex);
-        return getDataTable(list);
-    }
-
-    @PreAuthorize("@ss.hasPermi('ems:ElecStoreIndex:list')")
-    @GetMapping("/latest")
-    public AjaxResult latest(ElecStoreIndex elecStoreIndex) {
-        List<ElecStoreIndex> list = elecStoreIndexService.selectLatestByDevice(elecStoreIndex);
-        return success(list);
-    }
-
-    @PreAuthorize("@ss.hasPermi('ems:ElecStoreIndex:list')")
-    @GetMapping("/listAll")
-    public AjaxResult listAll(ElecStoreIndex elecStoreIndex) {
-        List<ElecStoreIndex> list = elecStoreIndexService.selectElecStoreIndexList(elecStoreIndex);
-        return success(list);
-    }
-
-    /**
-     * 新增储能设施指标
-     */
-    @PreAuthorize("@ss.hasPermi('ems:ElecStoreIndex:add')")
-    @Log(title = "储能设施指标", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody ElecStoreIndex elecStoreIndex) {
-        return toAjax(elecStoreIndexService.insertElecStoreIndex(elecStoreIndex));
-    }
-
-    /**
-     * 修改储能设施指标
-     */
-    @PreAuthorize("@ss.hasPermi('ems:ElecStoreIndex:edit')")
-    @Log(title = "储能设施指标", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody ElecStoreIndex elecStoreIndex) {
-        return toAjax(elecStoreIndexService.updateElecStoreIndex(elecStoreIndex));
-    }
-
-    /**
-     * 删除储能设施指标
-     */
-    @PreAuthorize("@ss.hasPermi('ems:ElecStoreIndex:remove')")
-    @Log(title = "储能设施指标", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(elecStoreIndexService.deleteElecStoreIndexByIds(ids));
-    }
-}

+ 14 - 0
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/common/TaskClacService.java

@@ -14,6 +14,7 @@ import com.ruoyi.ems.common.config.AnalysisConfig;
 import com.ruoyi.ems.domain.Area;
 import com.ruoyi.ems.domain.EmsFacs;
 import com.ruoyi.ems.ba.handle.BaCtlHandler;
+import com.ruoyi.ems.gcc.handle.GccHandler;
 import com.ruoyi.ems.model.QueryMeter;
 import com.ruoyi.ems.service.IAreaService;
 import com.ruoyi.ems.service.IEmsFacsService;
@@ -75,6 +76,10 @@ public class TaskClacService {
     @Resource
     private BaCtlHandler baCtlHandler;
 
+    @Qualifier("gccHandler")
+    @Resource
+    private GccHandler gccHandler;
+
     /**
      * 节能分析
      */
@@ -242,6 +247,15 @@ public class TaskClacService {
         log.debug("产出室内能耗设备计量数据: {} 条", cnt);
     }
 
+    /**
+     * 每小时产出储能计量数据(充电/放电小时增量)
+     */
+    @Scheduled(cron = "0 5 0/1 * * ?")
+    public void gccStoreMeterHourProd() {
+        int cnt = gccHandler.meterHourProd();
+        log.debug("产出储能计量数据: {} 条", cnt);
+    }
+
     private void areaElecConsumeForecast(String rootArea, LocalDate today) {
         List<Area> areas = areaService.selectAreaTree(rootArea, true);
         areaElecConsumeForecastSub(rootArea, areas, today);

+ 105 - 0
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/config/GccMqttProperty.java

@@ -0,0 +1,105 @@
+/*
+ * 文 件 名:  GccMqttProperty
+ * 版    权:  华设设计集团股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2026/8/21
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.gcc.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 储能(城市动力)MQTT对接配置
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2026/8/21]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Configuration
+@ConfigurationProperties(prefix = "gcc.mqtt")
+public class GccMqttProperty {
+    /**
+     * 是否启用储能mqtt链路
+     */
+    private boolean enabled = false;
+
+    /**
+     * mqtt服务地址 如:tcp://124.70.80.248:1883
+     */
+    private String host;
+
+    /**
+     * 客户端ID
+     */
+    private String clientId;
+
+    /**
+     * 用户名
+     */
+    private String userName;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 属性值落库周期(秒)
+     */
+    private int saveIntervalSeconds = 10;
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public int getSaveIntervalSeconds() {
+        return saveIntervalSeconds;
+    }
+
+    public void setSaveIntervalSeconds(int saveIntervalSeconds) {
+        this.saveIntervalSeconds = saveIntervalSeconds;
+    }
+}

+ 13 - 8
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/common/mock/MockGccController.java → ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/controller/GccController.java

@@ -1,5 +1,5 @@
 /*
- * 文 件 名:  MockGccController
+ * 文 件 名:  GccController
  * 版    权:  华设设计集团股份有限公司
  * 描    述:  <描述>
  * 修 改 人:  lvwenbin
@@ -8,8 +8,9 @@
  * 修改单号:  <修改单号>
  * 修改内容:  <修改内容>
  */
-package com.ruoyi.ems.common.mock;
+package com.ruoyi.ems.gcc.controller;
 
+import com.ruoyi.ems.gcc.handle.GccHandler;
 import com.ruoyi.ems.model.AbilityPayload;
 import com.ruoyi.ems.model.CallResponse;
 import io.swagger.annotations.Api;
@@ -18,6 +19,7 @@ import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -25,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
- * Mock 光储充
+ * 储能(光储充)控制
  * <功能详细描述>
  *
  * @author lvwenbin
@@ -36,9 +38,12 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @CrossOrigin(allowedHeaders = "*", allowCredentials = "false")
 @RequestMapping("/gcc")
-@Api(value = "MockGccController", description = "光储冲柔控制Api")
-public class MockGccController {
-    private static final Logger log = LoggerFactory.getLogger(MockGccController.class);
+@Api(value = "GccController", description = "光储充控制Api")
+public class GccController {
+    private static final Logger log = LoggerFactory.getLogger(GccController.class);
+
+    @Autowired
+    private GccHandler gccHandler;
 
     /**
      * 采集器能力调用
@@ -54,7 +59,7 @@ public class MockGccController {
         CallResponse<Void> res = null;
 
         try {
-            res = new CallResponse<>(0, "成功");
+            res = gccHandler.call(abilityPayload);
         }
         catch (Exception e) {
             log.error("call fail!", e);
@@ -63,4 +68,4 @@ public class MockGccController {
 
         return res;
     }
-}
+}

+ 860 - 0
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/handle/GccHandler.java

@@ -0,0 +1,860 @@
+/*
+ * 文 件 名:  GccHandler
+ * 版    权:  华设设计集团股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2026/8/21
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.gcc.handle;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.huashe.common.utils.DateUtils;
+import com.ruoyi.ems.common.handle.BaseDevHandler;
+import com.ruoyi.ems.common.mqtt.MqttMessageHandler;
+import com.ruoyi.ems.domain.ElecStoreH;
+import com.ruoyi.ems.domain.EmsDevice;
+import com.ruoyi.ems.domain.EmsObjAttrValue;
+import com.ruoyi.ems.enums.DevOnlineStatus;
+import com.ruoyi.ems.gcc.model.GccSite;
+import com.ruoyi.ems.gcc.model.GccSiteDevice;
+import com.ruoyi.ems.model.AbilityPayload;
+import com.ruoyi.ems.model.CallResponse;
+import com.ruoyi.ems.model.QueryDevice;
+import com.ruoyi.ems.service.IElecStoreService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.nio.charset.StandardCharsets;
+import java.sql.Time;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 储能(城市动力)MQTT消息处理
+ * <p>
+ * 订阅厂家MQTT,按serviceCode路由解析:
+ * energy_meter-储能电表 / pcs、bms、fault-储能一体机,
+ * 解析结果写入 adm_ems_obj_attr_value,站点-设备关系自动回写 projectList
+ *
+ * @author lvwenbin
+ * @version [版本号, 2026/8/21]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Component("gccHandler")
+public class GccHandler extends BaseDevHandler implements MqttMessageHandler {
+    private static final Logger log = LoggerFactory.getLogger(GccHandler.class);
+
+    public static final String SUBSYSTEM_CODE = "SYS_GCC";
+    public static final String SYS_MODEL_CODE = "M_W4_SYS_GCC";
+    public static final String MODEL_DB = "M_W4_DEV_GCC_DB";
+    public static final String MODEL_YTJ = "M_W4_DEV_GCC_YTJ";
+
+    private static final String SERVICE_ENERGY_METER = "energy_meter";
+    private static final String SERVICE_PCS = "pcs";
+    private static final String SERVICE_BMS = "bms";
+    private static final String SERVICE_FAULT = "fault";
+
+    private static final String ATTR_PROJECT_LIST = "projectList";
+    private static final String DEV_CODE_PREFIX_YTJ = "GCC-YTJ-";
+    private static final String DEV_CODE_PREFIX_DB = "GCC-DB-";
+
+    /**
+     * 储能电表累计抄表缓存字段(redis hash field)
+     */
+    private static final String READING_FWD = "GCC_STORE_READING_FWD";
+    private static final String READING_REV = "GCC_STORE_READING_REV";
+
+    private static final Pattern SUFFIX_PATTERN = Pattern.compile("(\\d+)$");
+
+    /**
+     * 字段类型:U-电压 I-电流 P-功率 E-电能(需乘PT/CT),F-固定倍率,R-原值
+     */
+    private static final int KIND_U = 1;
+    private static final int KIND_I = 2;
+    private static final int KIND_P = 3;
+    private static final int KIND_E = 4;
+    private static final int KIND_F = 5;
+    private static final int KIND_R = 6;
+
+    /**
+     * 储能电表字段映射 info_n -> [attrKey, kind, 固定倍率]
+     */
+    private static final Map<Integer, FieldDef> EM_FIELDS = new HashMap<>();
+
+    /**
+     * 储能一体机PCS字段映射
+     */
+    private static final Map<Integer, FieldDef> PCS_FIELDS = new HashMap<>();
+
+    /**
+     * 储能一体机BMS字段映射
+     */
+    private static final Map<Integer, FieldDef> BMS_FIELDS = new HashMap<>();
+
+    /**
+     * 储能一体机故障字段映射
+     */
+    private static final Map<String, FieldDef> FAULT_FIELDS = new HashMap<>();
+
+    static {
+        // 储能电表(U=data*PT*0.1 / I=data*CT*0.01 / P=data*PT*CT*0.001 / E=data*PT*CT*0.01)
+        EM_FIELDS.put(1, new FieldDef("emAbVoltage", KIND_U, 0.1));
+        EM_FIELDS.put(2, new FieldDef("emBcVoltage", KIND_U, 0.1));
+        EM_FIELDS.put(3, new FieldDef("emCaVoltage", KIND_U, 0.1));
+        EM_FIELDS.put(4, new FieldDef("emACurrent", KIND_I, 0.01));
+        EM_FIELDS.put(5, new FieldDef("emBCurrent", KIND_I, 0.01));
+        EM_FIELDS.put(6, new FieldDef("emCCurrent", KIND_I, 0.01));
+        EM_FIELDS.put(7, new FieldDef("emFrequency", KIND_F, 0.01));
+        EM_FIELDS.put(8, new FieldDef("emAActivePower", KIND_P, 0.001));
+        EM_FIELDS.put(9, new FieldDef("emBActivePower", KIND_P, 0.001));
+        EM_FIELDS.put(10, new FieldDef("emCActivePower", KIND_P, 0.001));
+        EM_FIELDS.put(11, new FieldDef("emActivePower", KIND_P, 0.001));
+        EM_FIELDS.put(12, new FieldDef("emAReactivePower", KIND_P, 0.001));
+        EM_FIELDS.put(13, new FieldDef("emBReactivePower", KIND_P, 0.001));
+        EM_FIELDS.put(14, new FieldDef("emCReactivePower", KIND_P, 0.001));
+        EM_FIELDS.put(15, new FieldDef("emReactivePower", KIND_P, 0.001));
+        EM_FIELDS.put(16, new FieldDef("emAApparentPower", KIND_P, 0.001));
+        EM_FIELDS.put(17, new FieldDef("emBApparentPower", KIND_P, 0.001));
+        EM_FIELDS.put(18, new FieldDef("emCApparentPower", KIND_P, 0.001));
+        EM_FIELDS.put(19, new FieldDef("emApparentPower", KIND_P, 0.001));
+        EM_FIELDS.put(20, new FieldDef("emAPowerFactor", KIND_F, 0.001));
+        EM_FIELDS.put(21, new FieldDef("emBPowerFactor", KIND_F, 0.001));
+        EM_FIELDS.put(22, new FieldDef("emCPowerFactor", KIND_F, 0.001));
+        EM_FIELDS.put(23, new FieldDef("emPowerFactor", KIND_F, 0.001));
+        EM_FIELDS.put(24, new FieldDef("emActiveEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(25, new FieldDef("emSharpEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(26, new FieldDef("emPeakEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(27, new FieldDef("emFlatEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(28, new FieldDef("emValleyEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(29, new FieldDef("emFwdActiveEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(30, new FieldDef("emFwdSharpEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(31, new FieldDef("emFwdPeakEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(32, new FieldDef("emFwdFlatEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(33, new FieldDef("emFwdValleyEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(34, new FieldDef("emRevActiveEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(35, new FieldDef("emRevSharpEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(36, new FieldDef("emRevPeakEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(37, new FieldDef("emRevFlatEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(38, new FieldDef("emRevValleyEnergy", KIND_E, 0.01));
+        EM_FIELDS.put(39, new FieldDef("emPtRatio", KIND_R, 1));
+        EM_FIELDS.put(40, new FieldDef("emCtRatio", KIND_R, 1));
+
+        // 一体机PCS
+        PCS_FIELDS.put(1, new FieldDef("pcsDcVoltage", KIND_F, 0.1));
+        PCS_FIELDS.put(2, new FieldDef("pcsDcCurrent", KIND_F, 0.1));
+        PCS_FIELDS.put(3, new FieldDef("pcsDcPower", KIND_F, 0.1));
+        PCS_FIELDS.put(4, new FieldDef("pcsAbVoltage", KIND_F, 0.1));
+        PCS_FIELDS.put(5, new FieldDef("pcsBcVoltage", KIND_F, 0.1));
+        PCS_FIELDS.put(6, new FieldDef("pcsCaVoltage", KIND_F, 0.1));
+        PCS_FIELDS.put(7, new FieldDef("pcsACurrent", KIND_F, 0.1));
+        PCS_FIELDS.put(8, new FieldDef("pcsBCurrent", KIND_F, 0.1));
+        PCS_FIELDS.put(9, new FieldDef("pcsCCurrent", KIND_F, 0.1));
+        PCS_FIELDS.put(10, new FieldDef("pcsActivePower", KIND_F, 0.1));
+        PCS_FIELDS.put(11, new FieldDef("pcsReactivePower", KIND_F, 0.1));
+        PCS_FIELDS.put(12, new FieldDef("pcsApparentPower", KIND_F, 0.1));
+        PCS_FIELDS.put(13, new FieldDef("pcsFrequency", KIND_F, 0.01));
+        PCS_FIELDS.put(14, new FieldDef("pcsPowerFactor", KIND_F, 0.001));
+        PCS_FIELDS.put(15, new FieldDef("pcsWorkMode", KIND_R, 1));
+        PCS_FIELDS.put(16, new FieldDef("pcsRunStatus", KIND_R, 1));
+        PCS_FIELDS.put(17, new FieldDef("pcsChargeStatus", KIND_R, 1));
+        PCS_FIELDS.put(18, new FieldDef("pcsMaxTemp", KIND_F, 0.1));
+        PCS_FIELDS.put(19, new FieldDef("pcsMinTemp", KIND_F, 0.1));
+        PCS_FIELDS.put(20, new FieldDef("pcsDayChargeKwh", KIND_F, 0.1));
+        PCS_FIELDS.put(21, new FieldDef("pcsDayDischargeKwh", KIND_F, 0.1));
+        PCS_FIELDS.put(24, new FieldDef("pcsIoFeedback", KIND_R, 1));
+
+        // 一体机BMS
+        BMS_FIELDS.put(1, new FieldDef("bmsMaxChargePower", KIND_R, 1));
+        BMS_FIELDS.put(2, new FieldDef("bmsMaxDischargePower", KIND_R, 1));
+        BMS_FIELDS.put(3, new FieldDef("bmsTotalVoltage", KIND_R, 1));
+        BMS_FIELDS.put(4, new FieldDef("bmsTotalCurrent", KIND_R, 1));
+        BMS_FIELDS.put(5, new FieldDef("bmsSysRequire", KIND_R, 1));
+        BMS_FIELDS.put(6, new FieldDef("bmsDiStatus", KIND_R, 1));
+        BMS_FIELDS.put(7, new FieldDef("bmsCumChargeKwh", KIND_F, 0.1));
+        BMS_FIELDS.put(8, new FieldDef("bmsCumDischargeKwh", KIND_F, 0.1));
+        BMS_FIELDS.put(9, new FieldDef("bmsOnceChargeKwh", KIND_F, 0.1));
+        BMS_FIELDS.put(10, new FieldDef("bmsOnceDischargeKwh", KIND_F, 0.1));
+        BMS_FIELDS.put(11, new FieldDef("bmsSoc", KIND_R, 1));
+        BMS_FIELDS.put(12, new FieldDef("bmsSoh", KIND_R, 1));
+        BMS_FIELDS.put(13, new FieldDef("bmsTempPointNum", KIND_R, 1));
+        BMS_FIELDS.put(14, new FieldDef("bmsMaxTemp", KIND_R, 1));
+        BMS_FIELDS.put(15, new FieldDef("bmsMaxTempModule", KIND_R, 1));
+        BMS_FIELDS.put(16, new FieldDef("bmsMaxTempPoint", KIND_R, 1));
+        BMS_FIELDS.put(17, new FieldDef("bmsMinTemp", KIND_R, 1));
+        BMS_FIELDS.put(18, new FieldDef("bmsMinTempModule", KIND_R, 1));
+        BMS_FIELDS.put(19, new FieldDef("bmsMinTempPoint", KIND_R, 1));
+        BMS_FIELDS.put(20, new FieldDef("bmsAvgTemp", KIND_R, 1));
+        BMS_FIELDS.put(21, new FieldDef("bmsCellCount", KIND_R, 1));
+        BMS_FIELDS.put(22, new FieldDef("bmsAvgCellV", KIND_F, 0.001));
+        BMS_FIELDS.put(23, new FieldDef("bmsMaxCellV", KIND_F, 0.001));
+        BMS_FIELDS.put(24, new FieldDef("bmsMaxCellVModule", KIND_R, 1));
+        BMS_FIELDS.put(25, new FieldDef("bmsMaxCellVIndex", KIND_R, 1));
+        BMS_FIELDS.put(26, new FieldDef("bmsMinCellV", KIND_F, 0.001));
+        BMS_FIELDS.put(27, new FieldDef("bmsMinCellVModule", KIND_R, 1));
+        BMS_FIELDS.put(28, new FieldDef("bmsMinCellVIndex", KIND_R, 1));
+
+        // 一体机故障字
+        for (int i = 1; i <= 8; i++) {
+            FAULT_FIELDS.put("info_" + i, new FieldDef("faultPcs" + i, KIND_R, 1));
+        }
+        for (int i = 9; i <= 16; i++) {
+            FAULT_FIELDS.put("info_" + i, new FieldDef("faultBms" + (i - 8), KIND_R, 1));
+        }
+        FAULT_FIELDS.put("pcs_type", new FieldDef("pcsType", KIND_R, 1));
+        FAULT_FIELDS.put("bms_type", new FieldDef("bmsType", KIND_R, 1));
+    }
+
+    /**
+     * 站点列表(来自projectList)
+     */
+    private volatile List<GccSite> sites = new ArrayList<>();
+
+    /**
+     * topic -> 站点
+     */
+    private final Map<String, GccSite> siteByTopic = new ConcurrentHashMap<>();
+
+    /**
+     * deviceId -> 站点
+     */
+    private final Map<String, GccSite> siteByDeviceId = new ConcurrentHashMap<>();
+
+    /**
+     * 设备缓存 deviceCode -> device
+     */
+    private final Map<String, EmsDevice> deviceCache = new ConcurrentHashMap<>();
+
+    /**
+     * 待落库属性值 key=modelCode:objCode
+     */
+    private final Map<String, Map<String, String>> pendingAttrs = new ConcurrentHashMap<>();
+
+    @Autowired
+    private IElecStoreService elecStoreService;
+
+    /**
+     * 注册站点配置(启动时由订阅器加载projectList后调用)
+     *
+     * @param siteList 站点列表
+     */
+    public void registerSites(List<GccSite> siteList) {
+        this.sites = siteList;
+        siteByTopic.clear();
+        siteByDeviceId.clear();
+
+        for (GccSite site : siteList) {
+            if (StringUtils.isNotEmpty(site.getTopic())) {
+                siteByTopic.put(site.getTopic(), site);
+            }
+
+            if (StringUtils.isNotEmpty(site.getDeviceId())) {
+                siteByDeviceId.put(site.getDeviceId(), site);
+            }
+        }
+    }
+
+    @Override
+    public void handle(String topic, byte[] payload) {
+        try {
+            JSONObject root = JSON.parseObject(new String(payload, StandardCharsets.UTF_8));
+            JSONObject device = root.getJSONObject("device");
+            if (null == device) {
+                return;
+            }
+
+            String deviceId = device.getString("deviceId");
+            JSONObject service = device.getJSONObject("service");
+            if (null == service) {
+                return;
+            }
+
+            String serviceCode = service.getString("serviceCode");
+            JSONObject data = service.getJSONObject("data");
+            if (StringUtils.isEmpty(serviceCode) || null == data) {
+                return;
+            }
+
+            GccSite site = siteByTopic.get(topic);
+            if (null == site) {
+                site = siteByDeviceId.get(deviceId);
+            }
+
+            if (null == site) {
+                log.warn("储能消息未匹配到站点配置, topic[{}], deviceId[{}]", topic, deviceId);
+                return;
+            }
+
+            if (StringUtils.equals(SERVICE_ENERGY_METER, serviceCode)) {
+                handleEnergyMeter(site, data);
+            }
+            else if (StringUtils.equalsAny(serviceCode, SERVICE_PCS, SERVICE_BMS, SERVICE_FAULT)) {
+                handleCabinet(site, serviceCode, data);
+            }
+            else {
+                log.debug("储能消息忽略未对接的serviceCode[{}], site[{}]", serviceCode, site.getDeviceId());
+            }
+        }
+        catch (Exception e) {
+            log.error("储能消息解析异常, topic[{}]", topic, e);
+        }
+    }
+
+    /**
+     * 储能电表消息处理
+     *
+     * @param site 站点
+     * @param data 数据体
+     */
+    private void handleEnergyMeter(GccSite site, JSONObject data) {
+        String dataCode = data.getString("code");
+        if (StringUtils.isEmpty(dataCode)) {
+            return;
+        }
+
+        GccSiteDevice siteDevice = resolveSiteDevice(site, MODEL_DB, dataCode);
+        if (null == siteDevice) {
+            siteDevice = registerDevice(site, MODEL_DB, dataCode);
+        }
+
+        // 变比 PT/CT
+        double pt = getRatio(data, 39);
+        double ct = getRatio(data, 40);
+
+        Map<String, String> attrs = new HashMap<>();
+        for (Map.Entry<Integer, FieldDef> entry : EM_FIELDS.entrySet()) {
+            String value = convert(data, "info_" + entry.getKey(), entry.getValue(), pt, ct);
+            if (null != value) {
+                attrs.put(entry.getValue().attrKey, value);
+            }
+        }
+
+        cacheAttrs(MODEL_DB, siteDevice.getDeviceCode(), attrs);
+        cacheStoreReading(siteDevice.getDeviceCode(), data);
+        refreshDeviceStatus(siteDevice.getDeviceCode());
+    }
+
+    /**
+     * 储能一体机消息处理(pcs/bms/fault共用柜子维度)
+     *
+     * @param site        站点
+     * @param serviceCode 服务编码
+     * @param data        数据体
+     */
+    private void handleCabinet(GccSite site, String serviceCode, JSONObject data) {
+        String dataCode = data.getString("code");
+        if (StringUtils.isEmpty(dataCode)) {
+            return;
+        }
+
+        GccSiteDevice siteDevice = resolveSiteDevice(site, MODEL_YTJ, dataCode);
+        if (null == siteDevice) {
+            siteDevice = registerDevice(site, MODEL_YTJ, dataCode);
+        }
+
+        Map<String, String> attrs = new HashMap<>();
+        Map<Integer, FieldDef> indexFields = StringUtils.equals(SERVICE_PCS, serviceCode) ? PCS_FIELDS : BMS_FIELDS;
+
+        if (StringUtils.equals(SERVICE_FAULT, serviceCode)) {
+            for (Map.Entry<String, FieldDef> entry : FAULT_FIELDS.entrySet()) {
+                String value = convert(data, entry.getKey(), entry.getValue(), 1, 1);
+                if (null != value) {
+                    attrs.put(entry.getValue().attrKey, value);
+                }
+            }
+        }
+        else {
+            for (Map.Entry<Integer, FieldDef> entry : indexFields.entrySet()) {
+                String value = convert(data, "info_" + entry.getKey(), entry.getValue(), 1, 1);
+                if (null != value) {
+                    attrs.put(entry.getValue().attrKey, value);
+                }
+            }
+        }
+
+        cacheAttrs(MODEL_YTJ, siteDevice.getDeviceCode(), attrs);
+        refreshDeviceStatus(siteDevice.getDeviceCode());
+    }
+
+    /**
+     * 站点内按模型与数据编码定位设备(一体机支持按编号后缀匹配pcs/bms/fault)
+     *
+     * @param site     站点
+     * @param model    设备模型
+     * @param dataCode 数据编码
+     * @return 站点设备关系
+     */
+    private GccSiteDevice resolveSiteDevice(GccSite site, String model, String dataCode) {
+        for (GccSiteDevice item : site.getDevices()) {
+            if (StringUtils.equals(model, item.getModel()) && StringUtils.equals(dataCode, item.getCode())) {
+                return item;
+            }
+        }
+
+        if (StringUtils.equals(MODEL_YTJ, model)) {
+            String suffix = suffixOf(dataCode);
+
+            for (GccSiteDevice item : site.getDevices()) {
+                if (StringUtils.equals(model, item.getModel()) && StringUtils.equals(suffix, suffixOf(item.getCode()))) {
+                    return item;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 自动注册新设备并回写projectList站点-设备关系
+     *
+     * @param site     站点
+     * @param model    设备模型
+     * @param dataCode 数据编码
+     * @return 站点设备关系
+     */
+    private synchronized GccSiteDevice registerDevice(GccSite site, String model, String dataCode) {
+        // 双重检查
+        GccSiteDevice exist = resolveSiteDevice(site, model, dataCode);
+        if (null != exist) {
+            return exist;
+        }
+
+        boolean isYtj = StringUtils.equals(MODEL_YTJ, model);
+        String prefix = isYtj ? DEV_CODE_PREFIX_YTJ : DEV_CODE_PREFIX_DB;
+
+        int maxNo = 0;
+        for (EmsDevice device : getDeviceListByModel(model)) {
+            Matcher matcher = SUFFIX_PATTERN.matcher(device.getDeviceCode());
+            if (matcher.find()) {
+                maxNo = Math.max(maxNo, Integer.parseInt(matcher.group(1)));
+            }
+        }
+
+        String deviceCode = prefix + String.format("%02d", maxNo + 1);
+        String deviceName = String.format("%s%s", site.getSiteName(), isYtj ? "储能柜" + suffixOf(dataCode) : "储能电表");
+
+        EmsDevice device = new EmsDevice();
+        device.setDeviceCode(deviceCode);
+        device.setDeviceName(deviceName);
+        device.setDeviceBrand("城市动力");
+        device.setDeviceSpec("-");
+        device.setDeviceStatus(1);
+        device.setLocation(isYtj ? ("321283124S3001".equals(site.getAreaCode()) ? "北区广场" : "南区广场") : null);
+        device.setAreaCode(site.getAreaCode());
+        device.setDeviceModel(model);
+        device.setRefFacs(site.getFacsCode());
+        device.setSubsystemCode(SUBSYSTEM_CODE);
+        deviceService.insertEmsDevice(device);
+
+        // 站点归属属性
+        objAttrValueService.mergeObjAttrValue(new EmsObjAttrValue(deviceCode, model, "siteId", site.getDeviceId()));
+        if (isYtj) {
+            objAttrValueService.mergeObjAttrValue(new EmsObjAttrValue(deviceCode, model, "dataSuffix", suffixOf(dataCode)));
+        }
+        else {
+            objAttrValueService.mergeObjAttrValue(new EmsObjAttrValue(deviceCode, model, "dataCode", dataCode));
+        }
+
+        // 回写projectList
+        GccSiteDevice siteDevice = new GccSiteDevice();
+        siteDevice.setDeviceCode(deviceCode);
+        siteDevice.setModel(model);
+        siteDevice.setCode(dataCode);
+        site.getDevices().add(siteDevice);
+        persistProjectList();
+
+        log.info("储能设备自动注册: site[{}] model[{}] dataCode[{}] -> deviceCode[{}]", site.getDeviceId(), model,
+            dataCode, deviceCode);
+        return siteDevice;
+    }
+
+    /**
+     * 回写projectList到属性值表
+     */
+    private void persistProjectList() {
+        try {
+            objAttrValueService.updateObjAttrValue(SYS_MODEL_CODE, SUBSYSTEM_CODE, ATTR_PROJECT_LIST,
+                JSON.toJSONString(sites));
+        }
+        catch (Exception e) {
+            log.error("回写projectList失败!", e);
+        }
+    }
+
+    /**
+     * 缓存待落库属性值
+     *
+     * @param modelCode 模型
+     * @param objCode   对象代码
+     * @param attrs     属性值集合
+     */
+    private void cacheAttrs(String modelCode, String objCode, Map<String, String> attrs) {
+        if (attrs.isEmpty()) {
+            return;
+        }
+
+        pendingAttrs.computeIfAbsent(modelCode + ":" + objCode, k -> new ConcurrentHashMap<>()).putAll(attrs);
+    }
+
+    /**
+     * 缓存储能电表累计抄表值(正向=充电 反向=放电),供小时增量计算
+     *
+     * @param deviceCode 设备代码
+     * @param data       数据体
+     */
+    private void cacheStoreReading(String deviceCode, JSONObject data) {
+        try {
+            BigDecimal fwd = data.getBigDecimal("info_29");
+            BigDecimal rev = data.getBigDecimal("info_34");
+
+            if (null != fwd) {
+                updateCacheAfterSuccess(deviceCode, READING_FWD, fwd.toPlainString());
+            }
+
+            if (null != rev) {
+                updateCacheAfterSuccess(deviceCode, READING_REV, rev.toPlainString());
+            }
+        }
+        catch (Exception e) {
+            log.error("缓存储能电表抄表值失败 device[{}]", deviceCode, e);
+        }
+    }
+
+    /**
+     * 储能计量小时产出:按电表累计抄表值计算上一小时充放电增量,按设施汇总写入 adm_ems_elec_store_h
+     *
+     * @return 产出条数
+     */
+    public int meterHourProd() {
+        int cnt = 0;
+
+        try {
+            List<EmsDevice> meters = getDeviceListByModel(MODEL_DB);
+            if (CollectionUtils.isEmpty(meters)) {
+                return 0;
+            }
+
+            // 上一小时整点(如当前19:05 -> 18:00:00)
+            Calendar hourCal = Calendar.getInstance();
+            hourCal.setTime(DateUtils.adjustHour(new Date(), -1));
+            hourCal.set(Calendar.MINUTE, 0);
+            hourCal.set(Calendar.SECOND, 0);
+            hourCal.set(Calendar.MILLISECOND, 0);
+            Date recordTime = hourCal.getTime();
+            Map<String, double[]> facsDeltaMap = new HashMap<>();
+            Map<String, EmsDevice> facsFirstDevice = new HashMap<>();
+
+            for (EmsDevice meter : meters) {
+                String deviceCode = meter.getDeviceCode();
+
+                Double chargeDelta = calcReadingDelta(deviceCode, READING_FWD);
+                Double dischargeDelta = calcReadingDelta(deviceCode, READING_REV);
+                if (null == chargeDelta && null == dischargeDelta) {
+                    continue;
+                }
+
+                String facsCode = StringUtils.defaultIfEmpty(meter.getRefFacs(), "C101");
+                double[] delta = facsDeltaMap.computeIfAbsent(facsCode, k -> new double[2]);
+                delta[0] += null == chargeDelta ? 0 : chargeDelta;
+                delta[1] += null == dischargeDelta ? 0 : dischargeDelta;
+                facsFirstDevice.putIfAbsent(facsCode, meter);
+            }
+
+            for (Map.Entry<String, double[]> entry : facsDeltaMap.entrySet()) {
+                String facsCode = entry.getKey();
+                double[] delta = entry.getValue();
+                EmsDevice firstDevice = facsFirstDevice.get(facsCode);
+
+                saveStoreHour(firstDevice, facsCode, recordTime, delta[0], delta[1]);
+                cnt++;
+            }
+        }
+        catch (Exception e) {
+            log.error("储能计量小时产出异常", e);
+        }
+
+        return cnt;
+    }
+
+    /**
+     * 计算抄表增量:本次读数 - 上次读数;首次抄表或表计复位(差值为负)不产出,仅刷新基准
+     *
+     * @param deviceCode 设备代码
+     * @param field      缓存字段
+     * @return 增量值
+     */
+    private Double calcReadingDelta(String deviceCode, String field) {
+        String newValue = redisService.getCacheMapValue(deviceCode, field);
+        if (StringUtils.isEmpty(newValue)) {
+            return null;
+        }
+
+        String lastValue = redisService.getCacheMapValue(deviceCode, field + "_LAST");
+        // 刷新基准,供下一小时计算
+        updateCacheAfterSuccess(deviceCode, field + "_LAST", newValue);
+
+        if (StringUtils.isEmpty(lastValue)) {
+            return null;
+        }
+
+        try {
+            double delta = Double.parseDouble(newValue) - Double.parseDouble(lastValue);
+
+            if (delta < 0) {
+                log.warn("储能电表累计值回退,跳过本小时增量 device[{}] field[{}] last[{}] new[{}]", deviceCode, field,
+                    lastValue, newValue);
+                return null;
+            }
+
+            return BigDecimal.valueOf(delta).setScale(2, RoundingMode.HALF_UP).doubleValue();
+        }
+        catch (NumberFormatException e) {
+            log.warn("储能电表抄表值解析失败 device[{}] field[{}]", deviceCode, field);
+            return null;
+        }
+    }
+
+    /**
+     * 保存储能计量小时记录(存在则更新,保证任务可重跑)
+     *
+     * @param device    设施下任一电表设备(取区域)
+     * @param facsCode  设施代码
+     * @param hourStart 小时起始时间
+     * @param charge    充电增量
+     * @param discharge 放电增量
+     */
+    private void saveStoreHour(EmsDevice device, String facsCode, Date hourStart, double charge, double discharge) {
+        ElecStoreH query = new ElecStoreH();
+        query.setAreaCode(device.getAreaCode());
+        query.setFacsCode(facsCode);
+
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(hourStart);
+        query.setStartRecTime(DateUtils.dateToString(hourStart, DateUtils.YYYY_MM_DD_HH_MM_SS));
+        cal.add(Calendar.HOUR_OF_DAY, 1);
+        // 开区间右界减1秒,避免命中下一小时记录
+        cal.add(Calendar.SECOND, -1);
+        query.setEndRecTime(DateUtils.dateToString(cal.getTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
+
+        List<ElecStoreH> existList = elecStoreService.selectHourList(query);
+
+        ElecStoreH storeH;
+        if (CollectionUtils.isNotEmpty(existList)) {
+            storeH = existList.get(0);
+        }
+        else {
+            storeH = new ElecStoreH();
+            storeH.setAreaCode(device.getAreaCode());
+            storeH.setFacsCode(facsCode);
+            storeH.setRecordTime(hourStart);
+            storeH.setDate(hourStart);
+            storeH.setTime(new Time(hourStart.getTime()));
+            storeH.setTimeIndex(hourStart.getHours() + 1);
+        }
+
+        storeH.setChargeElecQuantity(charge);
+        storeH.setDischargeElecQuantity(discharge);
+
+        if (null != storeH.getId()) {
+            elecStoreService.updateHour(storeH);
+        }
+        else {
+            elecStoreService.insertHour(storeH);
+        }
+    }
+
+    /**
+     * 周期落库属性值
+     */
+    @Scheduled(fixedDelayString = "${gcc.mqtt.save-interval-seconds:10}000")
+    public void flushPending() {
+        if (pendingAttrs.isEmpty()) {
+            return;
+        }
+
+        Map<String, Map<String, String>> snapshot = new HashMap<>(pendingAttrs);
+        pendingAttrs.clear();
+
+        for (Map.Entry<String, Map<String, String>> entry : snapshot.entrySet()) {
+            String[] keys = entry.getKey().split(":");
+            String modelCode = keys[0];
+            String objCode = keys[1];
+
+            for (Map.Entry<String, String> attr : entry.getValue().entrySet()) {
+                try {
+                    objAttrValueService.mergeObjAttrValue(
+                        new EmsObjAttrValue(objCode, modelCode, attr.getKey(), attr.getValue()));
+                }
+                catch (Exception e) {
+                    log.error("储能属性值落库失败 obj[{}] key[{}]", objCode, attr.getKey(), e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 刷新设备在线状态与最后消息时间
+     *
+     * @param deviceCode 设备代码
+     */
+    private void refreshDeviceStatus(String deviceCode) {
+        try {
+            EmsDevice device = deviceCache.computeIfAbsent(deviceCode, deviceService::selectByCode);
+            if (null != device) {
+                refreshStatus(device, DevOnlineStatus.ONLINE);
+                updateMsgTime(device, new Date());
+            }
+        }
+        catch (Exception e) {
+            log.error("刷新设备状态失败 device[{}]", deviceCode, e);
+        }
+    }
+
+    /**
+     * 按模型查询设备列表
+     *
+     * @param model 设备模型
+     * @return 设备列表
+     */
+    private List<EmsDevice> getDeviceListByModel(String model) {
+        QueryDevice queryDevice = new QueryDevice();
+        queryDevice.setDeviceModel(model);
+        return deviceService.selectList(queryDevice);
+    }
+
+    /**
+     * 字段值换算
+     *
+     * @param data    数据体
+     * @param field   字段标识 info_n
+     * @param def     字段定义
+     * @param pt      电压变比
+     * @param ct      电流变比
+     * @return 换算后的属性值
+     */
+    private String convert(JSONObject data, String field, FieldDef def, double pt, double ct) {
+        if (!data.containsKey(field)) {
+            return null;
+        }
+
+        BigDecimal raw;
+        try {
+            raw = data.getBigDecimal(field);
+        }
+        catch (Exception e) {
+            return null;
+        }
+
+        if (null == raw) {
+            return null;
+        }
+
+        BigDecimal result;
+        switch (def.kind) {
+            case KIND_U:
+                result = raw.multiply(BigDecimal.valueOf(def.multiplier)).multiply(BigDecimal.valueOf(pt));
+                return result.setScale(2, RoundingMode.HALF_UP).toPlainString();
+            case KIND_I:
+                result = raw.multiply(BigDecimal.valueOf(def.multiplier)).multiply(BigDecimal.valueOf(ct));
+                return result.setScale(2, RoundingMode.HALF_UP).toPlainString();
+            case KIND_P:
+                result = raw.multiply(BigDecimal.valueOf(def.multiplier)).multiply(BigDecimal.valueOf(pt))
+                    .multiply(BigDecimal.valueOf(ct));
+                return result.setScale(3, RoundingMode.HALF_UP).toPlainString();
+            case KIND_E:
+                result = raw.multiply(BigDecimal.valueOf(def.multiplier)).multiply(BigDecimal.valueOf(pt))
+                    .multiply(BigDecimal.valueOf(ct));
+                return result.setScale(2, RoundingMode.HALF_UP).toPlainString();
+            case KIND_F:
+                result = raw.multiply(BigDecimal.valueOf(def.multiplier));
+                int scale = def.multiplier <= 0.001 ? 3 : 2;
+                return result.setScale(scale, RoundingMode.HALF_UP).toPlainString();
+            default:
+                return raw.setScale(0, RoundingMode.HALF_UP).toPlainString();
+        }
+    }
+
+    /**
+     * 获取变比值,缺省为1
+     *
+     * @param data  数据体
+     * @param index info序号
+     * @return 变比
+     */
+    private double getRatio(JSONObject data, int index) {
+        Double value = data.getDouble("info_" + index);
+        return (null == value || value <= 0) ? 1 : value;
+    }
+
+    /**
+     * 提取数据编码尾部编号 如:pcs02 -> 02
+     *
+     * @param dataCode 数据编码
+     * @return 编号后缀
+     */
+    private String suffixOf(String dataCode) {
+        Matcher matcher = SUFFIX_PATTERN.matcher(dataCode);
+        return matcher.find() ? matcher.group(1) : dataCode;
+    }
+
+    @Override
+    public CallResponse<Void> call(AbilityPayload abilityParam) {
+        return new CallResponse<>(-1, "储能系统为订阅采集模式,暂不支持能力下发");
+    }
+
+    @Override
+    public List<EmsDevice> getDeviceList() {
+        QueryDevice queryDevice = new QueryDevice();
+        queryDevice.setSubsystemCode(SUBSYSTEM_CODE);
+        return deviceService.selectList(queryDevice);
+    }
+
+    @Override
+    public void refreshOnline() {
+        // mqtt订阅模式,在线状态由消息到达驱动
+    }
+
+    /**
+     * 协议字段定义
+     */
+    private static class FieldDef {
+        /**
+         * 属性标识
+         */
+        private final String attrKey;
+
+        /**
+         * 换算类型
+         */
+        private final int kind;
+
+        /**
+         * 固定倍率
+         */
+        private final double multiplier;
+
+        FieldDef(String attrKey, int kind, double multiplier) {
+            this.attrKey = attrKey;
+            this.kind = kind;
+            this.multiplier = multiplier;
+        }
+    }
+}

+ 131 - 0
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/handle/GccSubscriber.java

@@ -0,0 +1,131 @@
+/*
+ * 文 件 名:  GccSubscriber
+ * 版    权:  华设设计集团股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2026/8/21
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.gcc.handle;
+
+import com.alibaba.fastjson2.JSON;
+import com.ruoyi.ems.common.mqtt.MqttTemplate;
+import com.ruoyi.ems.domain.EmsObjAttrValue;
+import com.ruoyi.ems.gcc.config.GccMqttProperty;
+import com.ruoyi.ems.gcc.model.GccSite;
+import com.ruoyi.ems.service.IEmsObjAttrValueService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 储能MQTT订阅器
+ * <p>
+ * 启动后查询光储充系统projectList属性,得到各站点topic并订阅监听
+ *
+ * @author lvwenbin
+ * @version [版本号, 2026/8/21]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Component
+@Order(100)
+public class GccSubscriber implements ApplicationRunner {
+    private static final Logger log = LoggerFactory.getLogger(GccSubscriber.class);
+
+    /**
+     * 订阅重试间隔(毫秒)
+     */
+    private static final long RETRY_INTERVAL = 60_000L;
+
+    @Autowired
+    private GccMqttProperty property;
+
+    @Autowired
+    private IEmsObjAttrValueService objAttrValueService;
+
+    @Autowired
+    private GccHandler gccHandler;
+
+    @Override
+    public void run(ApplicationArguments args) {
+        if (!property.isEnabled()) {
+            log.info("储能mqtt链路未启用(gcc.mqtt.enabled=false)");
+            return;
+        }
+
+        Thread thread = new Thread(this::subscribeWithRetry, "gcc-mqtt-subscriber");
+        thread.setDaemon(true);
+        thread.start();
+    }
+
+    /**
+     * 订阅(失败重试)
+     */
+    private void subscribeWithRetry() {
+        while (true) {
+            try {
+                subscribe();
+                return;
+            }
+            catch (Exception e) {
+                log.error("储能mqtt订阅失败,{}ms后重试!", RETRY_INTERVAL, e);
+
+                try {
+                    Thread.sleep(RETRY_INTERVAL);
+                }
+                catch (InterruptedException ex) {
+                    Thread.currentThread().interrupt();
+                    return;
+                }
+            }
+        }
+    }
+
+    /**
+     * 加载projectList并订阅站点topic
+     *
+     * @throws Exception 连接或订阅异常
+     */
+    private void subscribe() throws Exception {
+        // 1. 查询站点列表配置
+        EmsObjAttrValue attrValue = objAttrValueService.selectObjAttrValue(GccHandler.SYS_MODEL_CODE,
+            GccHandler.SUBSYSTEM_CODE, "projectList");
+        if (null == attrValue || StringUtils.isBlank(attrValue.getAttrValue())) {
+            throw new IllegalStateException("光储充系统projectList未配置");
+        }
+
+        List<GccSite> sites = JSON.parseArray(attrValue.getAttrValue(), GccSite.class);
+        if (CollectionUtils.isEmpty(sites)) {
+            throw new IllegalStateException("光储充系统projectList为空");
+        }
+
+        // 2. 注册站点路由
+        gccHandler.registerSites(sites);
+
+        // 3. 连接并订阅
+        MqttTemplate template = new MqttTemplate(property.getHost(), property.getClientId(), property.getUserName(),
+            property.getPassword());
+
+        for (GccSite site : sites) {
+            if (StringUtils.isEmpty(site.getTopic())) {
+                continue;
+            }
+
+            template.subscribe(site.getTopic(), 0, gccHandler);
+            log.info("储能站点订阅成功: {} -> {}", site.getSiteName(), site.getTopic());
+        }
+
+        log.info("储能mqtt订阅完成, 共{}个站点", sites.size());
+    }
+}

+ 103 - 0
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/model/GccSite.java

@@ -0,0 +1,103 @@
+/*
+ * 文 件 名:  GccSite
+ * 版    权:  华设设计集团股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2026/8/21
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.gcc.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 储能接入站点(projectList 元素)
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2026/8/21]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public class GccSite {
+    /**
+     * 站点接入点ID(=消息体deviceId) 如:ems_changtaidq_01
+     */
+    private String deviceId;
+
+    /**
+     * 站点名称 如:南区1号点
+     */
+    private String siteName;
+
+    /**
+     * 订阅主题 如:/v1/devices/ems_changtaidq_01/datas
+     */
+    private String topic;
+
+    /**
+     * 归属区域代码
+     */
+    private String areaCode;
+
+    /**
+     * 归属设施代码
+     */
+    private String facsCode;
+
+    /**
+     * 站点关联设备列表(冗余存储站点-设备关系)
+     */
+    private List<GccSiteDevice> devices = new ArrayList<>();
+
+    public String getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(String deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public String getSiteName() {
+        return siteName;
+    }
+
+    public void setSiteName(String siteName) {
+        this.siteName = siteName;
+    }
+
+    public String getTopic() {
+        return topic;
+    }
+
+    public void setTopic(String topic) {
+        this.topic = topic;
+    }
+
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
+    public String getFacsCode() {
+        return facsCode;
+    }
+
+    public void setFacsCode(String facsCode) {
+        this.facsCode = facsCode;
+    }
+
+    public List<GccSiteDevice> getDevices() {
+        return devices;
+    }
+
+    public void setDevices(List<GccSiteDevice> devices) {
+        this.devices = devices;
+    }
+}

+ 61 - 0
ems/ems-cloud/ems-dev-adapter/src/main/java/com/ruoyi/ems/gcc/model/GccSiteDevice.java

@@ -0,0 +1,61 @@
+/*
+ * 文 件 名:  GccSiteDevice
+ * 版    权:  华设设计集团股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2026/8/21
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.gcc.model;
+
+/**
+ * 站点关联设备(projectList.devices 元素)
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2026/8/21]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public class GccSiteDevice {
+    /**
+     * 平台设备代码
+     */
+    private String deviceCode;
+
+    /**
+     * 设备模型
+     */
+    private String model;
+
+    /**
+     * 协议数据编码 如:pcs01 / energy_meter01
+     */
+    private String code;
+
+    public String getDeviceCode() {
+        return deviceCode;
+    }
+
+    public void setDeviceCode(String deviceCode) {
+        this.deviceCode = deviceCode;
+    }
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+}

+ 10 - 0
ems/ems-cloud/ems-dev-adapter/src/main/resources/application-local.yml

@@ -64,6 +64,16 @@ mqtt:
       queueCapacity: 2000
       namePrefix: 'mqttHandle-'
 
+# 储能(城市动力)MQTT对接
+gcc:
+  mqtt:
+    enabled: false
+    host: tcp://124.70.80.248:1883
+    client_id: ems_changtai_forward
+    user_name: changtaiforward
+    password: 12345678
+    save-interval-seconds: 10
+
 general-data:
   api-key: 4988803c28e1461b999054255a0b311fga37G3RPI1Bc2uR1
   server: 101.133.108.113:9000

+ 11 - 0
ems/ems-cloud/ems-dev-adapter/src/main/resources/application-prod-ct.yml

@@ -62,6 +62,17 @@ mqtt:
       queueCapacity: 2000
       namePrefix: 'mqttHandle-'
 
+# 储能(城市动力)MQTT对接
+gcc:
+  mqtt:
+    enabled: true
+    host: tcp://124.70.80.248:1883
+    client_id: ems_changtai_forward
+    user_name: changtaiforward
+    password: 12345678
+    save-interval-seconds: 10
+
+
 general-data:
   api-key: 4988803c28e1461b999054255a0b311fga37G3RPI1Bc2uR1
   server: 101.133.108.113:9000

+ 0 - 95
ems/ems-cloud/ems-server/src/main/java/com/ruoyi/ems/controller/ElecStoreIndexController.java

@@ -1,95 +0,0 @@
-package com.ruoyi.ems.controller;
-
-import com.ruoyi.common.core.web.controller.BaseController;
-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.ElecStoreIndex;
-import com.ruoyi.ems.service.IElecStoreIndexService;
-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.RestController;
-import com.huashe.common.domain.AjaxResult;
-import java.util.List;
-
-/**
- * 储能设施指标Controller
- * 
- * @author ruoyi
- * @date 2026-01-28
- */
-@RestController
-@RequestMapping("/elec/store/index")
-public class ElecStoreIndexController extends BaseController
-{
-    @Autowired
-    private IElecStoreIndexService elecStoreIndexService;
-
-    /**
-     * 查询储能设施指标列表
-     */
-    @RequiresPermissions("ems:ElecStoreIndex:list")
-    @GetMapping("/list")
-    public TableDataInfo list(ElecStoreIndex elecStoreIndex)
-    {
-        startPage();
-        List<ElecStoreIndex> list = elecStoreIndexService.selectElecStoreIndexList(elecStoreIndex);
-        return getDataTable(list);
-    }
-
-    @RequiresPermissions("ems:ElecStoreIndex:list")
-    @GetMapping("/latest")
-    public AjaxResult latest(ElecStoreIndex elecStoreIndex)
-    {
-        List<ElecStoreIndex> list = elecStoreIndexService.selectLatestByDevice(elecStoreIndex);
-        return success(list);
-    }
-
-    @RequiresPermissions("ems:ElecStoreIndex:list")
-    @GetMapping("/listAll")
-    public AjaxResult listAll(ElecStoreIndex elecStoreIndex)
-    {
-        List<ElecStoreIndex> list = elecStoreIndexService.selectElecStoreIndexList(elecStoreIndex);
-        return success(list);
-    }
-
-    /**
-     * 新增储能设施指标
-     */
-    @RequiresPermissions("ems:ElecStoreIndex:add")
-    @Log(title = "储能设施指标", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody ElecStoreIndex elecStoreIndex)
-    {
-        return toAjax(elecStoreIndexService.insertElecStoreIndex(elecStoreIndex));
-    }
-
-    /**
-     * 修改储能设施指标
-     */
-    @RequiresPermissions("ems:ElecStoreIndex:edit")
-    @Log(title = "储能设施指标", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody ElecStoreIndex elecStoreIndex)
-    {
-        return toAjax(elecStoreIndexService.updateElecStoreIndex(elecStoreIndex));
-    }
-
-    /**
-     * 删除储能设施指标
-     */
-    @RequiresPermissions("ems:ElecStoreIndex:remove")
-    @Log(title = "储能设施指标", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
-        return toAjax(elecStoreIndexService.deleteElecStoreIndexByIds(ids));
-    }
-}

+ 0 - 65
ems/ems-core/src/main/java/com/ruoyi/ems/domain/ElecStoreIndex.java

@@ -1,65 +0,0 @@
-package com.ruoyi.ems.domain;
-
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.huashe.common.domain.BaseEntity;
-import lombok.Data;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
-
-/**
- * 储能设施指标对象 adm_ems_elec_store_index
- * 
- * @author ruoyi
- * @date 2026-01-28
- */
-@Data
-public class ElecStoreIndex extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 序号 */
-    private Long id;
-
-    /** 园区代码 */
-    private String areaCode;
-
-    /** 设施代码 */
-    private String facsCode;
-
-    /** 设备代码 */
-    private String deviceCode;
-
-    /** 日期 yyyy-MM-dd */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    private Date date;
-
-    /** 时间 yyyy-MM-dd HH:mm:ss */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date time;
-
-    /** 充电功率 */
-    private Double chargeVoltage;
-
-    /** 放电功率 */
-    private Double dischargePower;
-
-    /** 当前容量 单位:kW-h(千瓦·时) */
-    private Double currentCapacity;
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("areaCode", getAreaCode())
-            .append("facsCode", getFacsCode())
-            .append("deviceCode", getDeviceCode())
-            .append("date", getDate())
-            .append("time", getTime())
-            .append("chargeVoltage", getChargeVoltage())
-            .append("dischargePower", getDischargePower())
-            .append("currentCapacity", getCurrentCapacity())
-            .toString();
-    }
-}

+ 0 - 61
ems/ems-core/src/main/java/com/ruoyi/ems/mapper/ElecStoreIndexMapper.java

@@ -1,61 +0,0 @@
-package com.ruoyi.ems.mapper;
-
-import java.util.List;
-import com.ruoyi.ems.domain.ElecStoreIndex;
-
-/**
- * 储能设施指标Mapper接口
- * 
- * @author ruoyi
- * @date 2026-01-28
- */
-public interface ElecStoreIndexMapper 
-{
-    /**
-     * 查询储能设施指标列表
-     * 
-     * @param elecStoreIndex 储能设施指标
-     * @return 储能设施指标集合
-     */
-    List<ElecStoreIndex> selectElecStoreIndexList(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 查询每个设备最新一条记录
-     *
-     * @param elecStoreIndex 查询条件(可按areaCode、facsCode筛选)
-     * @return 每个设备的最新记录列表
-     */
-    List<ElecStoreIndex> selectLatestByDevice(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 新增储能设施指标
-     * 
-     * @param elecStoreIndex 储能设施指标
-     * @return 结果
-     */
-    int insertElecStoreIndex(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 修改储能设施指标
-     * 
-     * @param elecStoreIndex 储能设施指标
-     * @return 结果
-     */
-    int updateElecStoreIndex(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 删除储能设施指标
-     * 
-     * @param id 储能设施指标主键
-     * @return 结果
-     */
-    int deleteElecStoreIndexById(Long id);
-
-    /**
-     * 批量删除储能设施指标
-     * 
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    int deleteElecStoreIndexByIds(Long[] ids);
-}

+ 1 - 1
ems/ems-core/src/main/java/com/ruoyi/ems/model/ElecStoreSta.java

@@ -1,5 +1,5 @@
 /*
- * 文 件 名:  ElecStoreIndex
+ * 文 件 名:  ElecStoreSta
  * 版    权:  浩鲸云计算科技股份有限公司
  * 描    述:  <描述>
  * 修 改 人:  lvwenbin

+ 0 - 61
ems/ems-core/src/main/java/com/ruoyi/ems/service/IElecStoreIndexService.java

@@ -1,61 +0,0 @@
-package com.ruoyi.ems.service;
-
-import java.util.List;
-
-import com.ruoyi.ems.domain.ElecStoreIndex;
-
-/**
- * 储能设施指标Service接口
- *
- * @author ruoyi
- * @date 2026-01-28
- */
-public interface IElecStoreIndexService {
-    /**
-     * 查询储能设施指标列表
-     *
-     * @param elecStoreIndex 储能设施指标
-     * @return 储能设施指标集合
-     */
-    List<ElecStoreIndex> selectElecStoreIndexList(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 查询每个设备最新一条记录
-     *
-     * @param elecStoreIndex 查询条件
-     * @return 每个设备的最新记录列表
-     */
-    List<ElecStoreIndex> selectLatestByDevice(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 新增储能设施指标
-     *
-     * @param elecStoreIndex 储能设施指标
-     * @return 结果
-     */
-    int insertElecStoreIndex(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 修改储能设施指标
-     *
-     * @param elecStoreIndex 储能设施指标
-     * @return 结果
-     */
-    int updateElecStoreIndex(ElecStoreIndex elecStoreIndex);
-
-    /**
-     * 批量删除储能设施指标
-     *
-     * @param ids 需要删除的储能设施指标主键集合
-     * @return 结果
-     */
-    int deleteElecStoreIndexByIds(Long[] ids);
-
-    /**
-     * 删除储能设施指标信息
-     *
-     * @param id 储能设施指标主键
-     * @return 结果
-     */
-    int deleteElecStoreIndexById(Long id);
-}

+ 0 - 87
ems/ems-core/src/main/java/com/ruoyi/ems/service/impl/ElecStoreIndexServiceImpl.java

@@ -1,87 +0,0 @@
-package com.ruoyi.ems.service.impl;
-
-import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ruoyi.ems.mapper.ElecStoreIndexMapper;
-import com.ruoyi.ems.domain.ElecStoreIndex;
-import com.ruoyi.ems.service.IElecStoreIndexService;
-
-/**
- * 储能设施指标Service业务层处理
- * 
- * @author ruoyi
- * @date 2026-01-28
- */
-@Service
-public class ElecStoreIndexServiceImpl implements IElecStoreIndexService 
-{
-    @Autowired
-    private ElecStoreIndexMapper elecStoreIndexMapper;
-
-    /**
-     * 查询储能设施指标列表
-     * 
-     * @param elecStoreIndex 储能设施指标
-     * @return 储能设施指标
-     */
-    @Override
-    public List<ElecStoreIndex> selectElecStoreIndexList(ElecStoreIndex elecStoreIndex)
-    {
-        return elecStoreIndexMapper.selectElecStoreIndexList(elecStoreIndex);
-    }
-
-    @Override
-    public List<ElecStoreIndex> selectLatestByDevice(ElecStoreIndex elecStoreIndex)
-    {
-        return elecStoreIndexMapper.selectLatestByDevice(elecStoreIndex);
-    }
-
-    /**
-     * 新增储能设施指标
-     * 
-     * @param elecStoreIndex 储能设施指标
-     * @return 结果
-     */
-    @Override
-    public int insertElecStoreIndex(ElecStoreIndex elecStoreIndex)
-    {
-        return elecStoreIndexMapper.insertElecStoreIndex(elecStoreIndex);
-    }
-
-    /**
-     * 修改储能设施指标
-     * 
-     * @param elecStoreIndex 储能设施指标
-     * @return 结果
-     */
-    @Override
-    public int updateElecStoreIndex(ElecStoreIndex elecStoreIndex)
-    {
-        return elecStoreIndexMapper.updateElecStoreIndex(elecStoreIndex);
-    }
-
-    /**
-     * 批量删除储能设施指标
-     * 
-     * @param ids 需要删除的储能设施指标主键
-     * @return 结果
-     */
-    @Override
-    public int deleteElecStoreIndexByIds(Long[] ids)
-    {
-        return elecStoreIndexMapper.deleteElecStoreIndexByIds(ids);
-    }
-
-    /**
-     * 删除储能设施指标信息
-     * 
-     * @param id 储能设施指标主键
-     * @return 结果
-     */
-    @Override
-    public int deleteElecStoreIndexById(Long id)
-    {
-        return elecStoreIndexMapper.deleteElecStoreIndexById(id);
-    }
-}

+ 0 - 110
ems/ems-core/src/main/resources/mapper/ems/ElecStoreIndexMapper.xml

@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.ems.mapper.ElecStoreIndexMapper">
-    
-    <resultMap type="com.ruoyi.ems.domain.ElecStoreIndex" id="ElecStoreIndexResult">
-        <result property="id"    column="id"    />
-        <result property="areaCode"    column="area_code"    />
-        <result property="facsCode"    column="facs_code"    />
-        <result property="deviceCode"    column="device_code"    />
-        <result property="date"    column="date"    />
-        <result property="time"    column="time"    />
-        <result property="chargeVoltage"    column="charge_voltage"    />
-        <result property="dischargePower"    column="discharge_power"    />
-        <result property="currentCapacity"    column="current_capacity"    />
-    </resultMap>
-
-    <sql id="selectElecStoreIndexVo">
-        select id, area_code, facs_code, device_code, date, time, charge_voltage, discharge_power, current_capacity from adm_ems_elec_store_index
-    </sql>
-
-    <select id="selectElecStoreIndexList" parameterType="com.ruoyi.ems.domain.ElecStoreIndex" resultMap="ElecStoreIndexResult">
-        <include refid="selectElecStoreIndexVo"/>
-        <where>  
-            <if test="areaCode != null  and areaCode != ''"> and area_code = #{areaCode}</if>
-            <if test="facsCode != null  and facsCode != ''"> and facs_code = #{facsCode}</if>
-            <if test="deviceCode != null  and deviceCode != ''"> and device_code = #{deviceCode}</if>
-            <if test="date != null "> and `date` = #{date}</if>
-            <if test="time != null "> and `time` = #{time}</if>
-            <if test="startRecTime != null and startRecTime != ''">
-                AND `time` &gt;= #{startRecTime}
-            </if>
-            <if test="endRecTime != null and endRecTime != ''">
-                AND `time` &lt;= #{endRecTime}
-            </if>
-        </where>
-    </select>
-
-    <select id="selectLatestByDevice" parameterType="com.ruoyi.ems.domain.ElecStoreIndex" resultMap="ElecStoreIndexResult">
-        SELECT t1.id, t1.area_code, t1.facs_code, t1.device_code, t1.date, t1.time,
-        t1.charge_voltage, t1.discharge_power, t1.current_capacity
-        FROM adm_ems_elec_store_index t1
-        INNER JOIN (
-        SELECT device_code, MAX(`time`) AS max_time
-        FROM adm_ems_elec_store_index
-        <where>
-            <if test="areaCode != null and areaCode != ''">AND area_code = #{areaCode}</if>
-            <if test="facsCode != null and facsCode != ''">AND facs_code = #{facsCode}</if>
-        </where>
-        GROUP BY device_code
-        ) t2 ON t1.device_code = t2.device_code AND t1.`time` = t2.max_time
-        <where>
-            <if test="areaCode != null and areaCode != ''">AND t1.area_code = #{areaCode}</if>
-            <if test="facsCode != null and facsCode != ''">AND t1.facs_code = #{facsCode}</if>
-        </where>
-        ORDER BY t1.area_code, t1.facs_code, t1.device_code
-    </select>
-
-        
-    <insert id="insertElecStoreIndex" parameterType="com.ruoyi.ems.domain.ElecStoreIndex" useGeneratedKeys="true" keyProperty="id">
-        insert into adm_ems_elec_store_index
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="areaCode != null and areaCode != ''">area_code,</if>
-            <if test="facsCode != null and facsCode != ''">facs_code,</if>
-            <if test="deviceCode != null and deviceCode != ''">device_code,</if>
-            <if test="date != null">`date`,</if>
-            <if test="time != null">`time`,</if>
-            <if test="chargeVoltage != null">charge_voltage,</if>
-            <if test="dischargePower != null">discharge_power,</if>
-            <if test="currentCapacity != null">current_capacity,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
-            <if test="facsCode != null and facsCode != ''">#{facsCode},</if>
-            <if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
-            <if test="date != null">#{date},</if>
-            <if test="time != null">#{time},</if>
-            <if test="chargeVoltage != null">#{chargeVoltage},</if>
-            <if test="dischargePower != null">#{dischargePower},</if>
-            <if test="currentCapacity != null">#{currentCapacity},</if>
-         </trim>
-    </insert>
-
-    <update id="updateElecStoreIndex" parameterType="com.ruoyi.ems.domain.ElecStoreIndex">
-        update adm_ems_elec_store_index
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
-            <if test="facsCode != null and facsCode != ''">facs_code = #{facsCode},</if>
-            <if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
-            <if test="date != null">`date` = #{date},</if>
-            <if test="time != null">`time` = #{time},</if>
-            <if test="chargeVoltage != null">charge_voltage = #{chargeVoltage},</if>
-            <if test="dischargePower != null">discharge_power = #{dischargePower},</if>
-            <if test="currentCapacity != null">current_capacity = #{currentCapacity},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteElecStoreIndexById" parameterType="Long">
-        delete from adm_ems_elec_store_index where id = #{id}
-    </delete>
-
-    <delete id="deleteElecStoreIndexByIds" parameterType="String">
-        delete from adm_ems_elec_store_index where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 234 - 26
ems/sql/ems_init_data_ctfwq.sql

@@ -418,6 +418,10 @@ INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `abilit
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W2_DEV_CHARGING_HOST', '充电主机', 2, 'http://172.17.60.27:9203/ems-dev-adapter/charging/ct/abilityCall', NULL);
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W2_DEV_CHARGING_PILE', '充电枪', 2, 'http://172.17.60.27:9203/ems-dev-adapter/charging/ct/abilityCall', NULL);
 
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W4_SYS_GCC', '储能系统', 3, 'http://172.17.60.27:9203/ems-dev-adapter/gcc/ct/abilityCall', NULL);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W4_DEV_GCC_DB', '储能电表', 2, 'http://172.17.60.27:9203/ems-dev-adapter/gcc/ct/abilityCall', NULL);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W4_DEV_GCC_YTJ', '储能一体机', 2, 'http://172.17.60.27:9203/ems-dev-adapter/gcc/ct/abilityCall', NULL);
+
 
 -- 对象属性数据
 -- 能耗监测属性
@@ -506,6 +510,8 @@ INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_na
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'State', 'interfaceStatus', '通道状态', NULL, 'Enum');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'Base', 'projectList', '项目列表', NULL, 'Table');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'Base', 'projectSubsetList', '分组列表', NULL, 'Table');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'Protocol', 'firmwareVer', '固件版本', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'Protocol', 'softwareVer', '软件版本', NULL, 'String');
 
 -- 灯杆属性
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LAMP_POST', 'Base', 'subDev', '灯组列表', NULL, 'String');
@@ -520,8 +526,6 @@ INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_na
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LIGHT', 'Base', 'imageUrl', '图片', NULL, 'WebPic');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LIGHT', 'Base', 'deviceStatus', '设备状态', NULL, 'Enum');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LIGHT', 'Base', 'csq', '信号强度', NULL, 'Value');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'Protocol', 'firmwareVer', '固件版本', NULL, 'String');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_SQUARE_LIGHT', 'Protocol', 'softwareVer', '软件版本', NULL, 'String');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LIGHT', 'State', 'cct', '色温', NULL, 'Value');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LIGHT', 'State', 'Switch', '开关', NULL, 'Enum');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_DEV_SQUARE_LIGHT', 'Measure', 'current', '电流', 'A', 'Value');
@@ -728,7 +732,155 @@ INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_na
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W2_DEV_CHARGING_PILE', 'Measure', 'chargedAmount', '已充金额', NULL, 'Value');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W2_DEV_CHARGING_PILE', 'Measure', 'hardwareFault', '硬件故障', NULL, 'String');
 
-
+-- 储能属性
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'interfaceType', '协议类型', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'addr', '服务地址', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'clientId', '客户端ID', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'userName', '用户名', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'password', '密码', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'projectList', '站点列表', NULL, 'Table');
+-- ---------------------------- 储能电表模型属性(serviceCode=energy_meter) ----------------------------
+-- 说明:倍率按规约换算 U=data*PT*0.1 / I=data*CT*0.01 / P=data*PT*CT*0.001 / E=data*PT*CT*0.01,adapter 解析时应用
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Base', 'siteId', '所属接入点', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Base', 'dataCode', '数据编码', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emAbVoltage', 'AB线电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emBcVoltage', 'BC线电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCaVoltage', 'CA线电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emACurrent', 'A相电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emBCurrent', 'B相电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCCurrent', 'C相电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFrequency', '频率', 'Hz', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emAActivePower', 'A相有功功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emBActivePower', 'B相有功功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCActivePower', 'C相有功功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emActivePower', '总有功功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emAReactivePower', 'A相无功功率', 'kVar', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emBReactivePower', 'B相无功功率', 'kVar', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCReactivePower', 'C相无功功率', 'kVar', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emReactivePower', '总无功功率', 'kVar', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emAApparentPower', 'A相视在功率', 'kVA', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emBApparentPower', 'B相视在功率', 'kVA', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCApparentPower', 'C相视在功率', 'kVA', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emApparentPower', '总视在功率', 'kVA', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emAPowerFactor', 'A相功率因数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emBPowerFactor', 'B相功率因数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCPowerFactor', 'C相功率因数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emPowerFactor', '总功率因数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emActiveEnergy', '有功总电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emSharpEnergy', '有功尖电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emPeakEnergy', '有功峰电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFlatEnergy', '有功平电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emValleyEnergy', '有功谷电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFwdActiveEnergy', '正向有功总电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFwdSharpEnergy', '正向有功尖电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFwdPeakEnergy', '正向有功峰电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFwdFlatEnergy', '正向有功平电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emFwdValleyEnergy', '正向有功谷电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emRevActiveEnergy', '反向有功总电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emRevSharpEnergy', '反向有功尖电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emRevPeakEnergy', '反向有功峰电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emRevFlatEnergy', '反向有功平电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emRevValleyEnergy', '反向有功谷电能', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emPtRatio', '电压变比', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_DB', 'Measure', 'emCtRatio', '电流变比', NULL, 'Value');
+
+-- ---------------------------- 储能一体机模型属性-PCS(serviceCode=pcs) ----------------------------
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Base', 'siteId', '所属接入点', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Base', 'dataSuffix', '数据编码后缀', NULL, 'String');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Base', 'ratedCapacity', '额定容量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsDcVoltage', '直流电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsDcCurrent', '直流电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsDcPower', '直流功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsAbVoltage', 'AB线电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsBcVoltage', 'BC线电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsCaVoltage', 'CA线电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsACurrent', 'A相电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsBCurrent', 'B相电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsCCurrent', 'C相电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsActivePower', '有功功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsReactivePower', '无功功率', 'kVar', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsApparentPower', '视在功率', 'kVA', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsFrequency', '电网频率', 'Hz', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsPowerFactor', '功率因数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsWorkMode', '工作模式', NULL, 'Enum');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsRunStatus', '运行状态', NULL, 'Enum');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsChargeStatus', '充放电状态', NULL, 'Enum');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsMaxTemp', 'PCS最高温度', '℃', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsMinTemp', 'PCS最低温度', '℃', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsDayChargeKwh', '日充电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsDayDischargeKwh', '日放电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'PCS', 'pcsIoFeedback', 'IO反馈', NULL, 'Value');
+
+-- ---------------------------- 储能一体机模型属性-BMS(serviceCode=bms) ----------------------------
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxChargePower', '最大允许充电功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxDischargePower', '最大允许放电功率', 'kW', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsTotalVoltage', '电池总电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsTotalCurrent', '电池总电流', 'A', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsSysRequire', '系统需求', NULL, 'Enum');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsDiStatus', 'DI检测状态', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsCumChargeKwh', '累计充电电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsCumDischargeKwh', '累计放电电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsOnceChargeKwh', '单次充电电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsOnceDischargeKwh', '单次放电电量', 'kWh', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsSoc', '系统电池SOC', '%', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsSoh', '系统电池SOH', '%', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsTempPointNum', '实际温度采集点数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxTemp', '电池最高温度', '℃', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxTempModule', '电池最高温度所在模块号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxTempPoint', '电池最高温度采集点号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMinTemp', '电池最低温度', '℃', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMinTempModule', '电池最低温度所在模块号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMinTempPoint', '电池最低温度采集点号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsAvgTemp', '电池平均温度', '℃', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsCellCount', '电池组电池总节数', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsAvgCellV', '单体平均电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxCellV', '最高单体电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxCellVModule', '最高单体电压所在模块号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMaxCellVIndex', '最高单体电压节号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMinCellV', '最低单体电压', 'V', 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMinCellVModule', '最低单体电压所在模块号', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'BMS', 'bmsMinCellVIndex', '最低单体电压节号', NULL, 'Value');
+
+-- ---------------------------- 储能一体机模型属性-故障(serviceCode=fault) ----------------------------
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs1', 'PCS故障字1', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs2', 'PCS故障字2', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs3', 'PCS故障字3', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs4', 'PCS故障字4', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs5', 'PCS故障字5', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs6', 'PCS故障字6', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs7', 'PCS故障字7', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultPcs8', 'PCS故障字8', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms1', 'BMS故障代码1', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms2', 'BMS故障代码2', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms3', 'BMS故障代码3', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms4', 'BMS故障代码4', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms5', 'BMS故障代码5', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms6', 'BMS故障代码6', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms7', 'BMS故障代码7(水冷/空调故障字)', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'faultBms8', 'BMS故障代码8', NULL, 'Value');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'pcsType', 'PCS类型', NULL, 'Enum');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_DEV_GCC_YTJ', 'Fault', 'bmsType', 'BMS类型', NULL, 'Enum');
+
+-- ---------------------------- 属性枚举 ----------------------------
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsWorkMode', '85', '并网模式');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsWorkMode', '170', '离网模式');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsRunStatus', '85', '运行');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsRunStatus', '170', '停机');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsRunStatus', '153', '故障');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsChargeStatus', '85', '待机');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsChargeStatus', '170', '充电');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsChargeStatus', '153', '放电');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsSysRequire', '0', '禁充禁放');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsSysRequire', '1', '只能充电');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsSysRequire', '2', '只能放电');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsSysRequire', '3', '可充可放');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsType', '0', '华储PCS');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsType', '1', '新艾PCS');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'pcsType', '2', '英博PCS');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsType', '0', '优旦BMS');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsType', '1', '华塑BMS');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsType', '2', '科工BMS');
+INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_DEV_GCC_YTJ', 'bmsType', '3', '高特BMS');
 
 INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_SYS_BA', 'interfaceStatus', '1', '正常');
 INSERT INTO `adm_ems_obj_attr_enum` (`model_code`, `attr_key`, `attr_value`, `attr_value_name`) VALUES ('M_W4_SYS_BA', 'interfaceStatus', '0', '断开');
@@ -1666,6 +1818,81 @@ INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `att
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`) VALUES ('3212830006000207', 'M_W2_DEV_CHARGING_PILE', 'pileCode', '32128300060002');
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`) VALUES ('3212830006000207', 'M_W2_DEV_CHARGING_PILE', 'gunNo', '07');
 
+-- 储能属性值
+-- ---------------------------- 系统属性值 ----------------------------
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'interfaceType', 'mqtt', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'addr', '124.70.80.248:1883', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'clientId', 'ems_changtai_forward', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'userName', 'changtaiforward', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'password', '12345678', NULL);
+-- 站点列表:站点静态信息 + 站点-设备关系(冗余),adapter 启动读取并订阅,运行时回写
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'projectList',
+                                                                                                                 '[{"deviceId":"ems_changtaidq_01","siteName":"南区1号点","topic":"/v1/devices/ems_changtaidq_01/datas","areaCode":"321283124S3002","facsCode":"C102","devices":[{"deviceCode":"GCC-YTJ-01","model":"M_W4_DEV_GCC_YTJ","code":"pcs01"},{"deviceCode":"GCC-YTJ-02","model":"M_W4_DEV_GCC_YTJ","code":"pcs02"},{"deviceCode":"GCC-DB-01","model":"M_W4_DEV_GCC_DB","code":"energy_meter01"}]},
+                                                                                                                 {"deviceId":"ems_changtaidq_02","siteName":"南区2号点","topic":"/v1/devices/ems_changtaidq_02/datas","areaCode":"321283124S3002","facsCode":"C102","devices":[{"deviceCode":"GCC-YTJ-03","model":"M_W4_DEV_GCC_YTJ","code":"pcs01"},{"deviceCode":"GCC-DB-02","model":"M_W4_DEV_GCC_DB","code":"energy_meter01"}]},
+                                                                                                                 {"deviceId":"ems_changtaidq_06","siteName":"南区3号点","topic":"/v1/devices/ems_changtaidq_06/datas","areaCode":"321283124S3002","facsCode":"C102","devices":[{"deviceCode":"GCC-YTJ-04","model":"M_W4_DEV_GCC_YTJ","code":"pcs01"},{"deviceCode":"GCC-DB-03","model":"M_W4_DEV_GCC_DB","code":"energy_meter01"}]},
+                                                                                                                 {"deviceId":"ems_changtaidq_03","siteName":"北区1号点","topic":"/v1/devices/ems_changtaidq_03/datas","areaCode":"321283124S3001","facsCode":"C101","devices":[{"deviceCode":"GCC-YTJ-05","model":"M_W4_DEV_GCC_YTJ","code":"pcs01"},{"deviceCode":"GCC-YTJ-06","model":"M_W4_DEV_GCC_YTJ","code":"pcs02"},{"deviceCode":"GCC-DB-04","model":"M_W4_DEV_GCC_DB","code":"energy_meter01"}]},
+                                                                                                                 {"deviceId":"ems_changtaidq_04","siteName":"北区2号点","topic":"/v1/devices/ems_changtaidq_04/datas","areaCode":"321283124S3001","facsCode":"C101","devices":[{"deviceCode":"GCC-YTJ-07","model":"M_W4_DEV_GCC_YTJ","code":"pcs01"},{"deviceCode":"GCC-DB-05","model":"M_W4_DEV_GCC_DB","code":"energy_meter01"}]},
+                                                                                                                 {"deviceId":"ems_changtaidq_05","siteName":"北区3号点","topic":"/v1/devices/ems_changtaidq_05/datas","areaCode":"321283124S3001","facsCode":"C101","devices":[{"deviceCode":"GCC-YTJ-08","model":"M_W4_DEV_GCC_YTJ","code":"pcs01"},{"deviceCode":"GCC-DB-06","model":"M_W4_DEV_GCC_DB","code":"energy_meter01"}]}]', NULL);
+
+-- ---------------------------- 设备:储能一体机 x8(南区4+北区4) ----------------------------
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-01', '南区1号储能柜1', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_YTJ', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-02', '南区1号储能柜2', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_YTJ', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-03', '南区2号储能柜', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_YTJ', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-04', '南区3号储能柜', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_YTJ', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-05', '北区1号储能柜1', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_YTJ', 'C101', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-06', '北区1号储能柜2', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_YTJ', 'C101', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-07', '北区2号储能柜', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_YTJ', 'C101', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-YTJ-08', '北区3号储能柜', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_YTJ', 'C101', NULL, 'SYS_GCC');
+
+-- ---------------------------- 设备:储能电表 x6(每个接入点1块) ----------------------------
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-DB-01', '南区1号储能电表', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_DB', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-DB-02', '南区2号储能电表', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_DB', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-DB-03', '南区3号储能电表', '城市动力', '-', 1, '南区广场', '321283124S300204', '321283124S3002', 'M_W4_DEV_GCC_DB', 'C102', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-DB-04', '北区1号储能电表', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_DB', 'C101', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-DB-05', '北区2号储能电表', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_DB', 'C101', NULL, 'SYS_GCC');
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCC-DB-06', '北区3号储能电表', '城市动力', '-', 1, '北区广场', '321283124S300104', '321283124S3001', 'M_W4_DEV_GCC_DB', 'C101', NULL, 'SYS_GCC');
+
+-- ---------------------------- 设备静态属性值 ----------------------------
+-- 储能一体机:额定容量261kWh + 站点归属
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-01', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-01', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-01', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-02', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-02', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-02', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '02', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-03', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-03', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_02', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-03', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-04', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-04', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_06', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-04', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-05', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-05', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_03', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-05', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-06', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-06', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_03', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-06', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '02', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-07', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-07', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_04', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-07', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-08', 'M_W4_DEV_GCC_YTJ', 'ratedCapacity', '261', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-08', 'M_W4_DEV_GCC_YTJ', 'siteId', 'ems_changtaidq_05', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-YTJ-08', 'M_W4_DEV_GCC_YTJ', 'dataSuffix', '01', NULL);
+
+-- 储能电表:站点归属 + 数据编码
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-01', 'M_W4_DEV_GCC_DB', 'siteId', 'ems_changtaidq_01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-01', 'M_W4_DEV_GCC_DB', 'dataCode', 'energy_meter01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-02', 'M_W4_DEV_GCC_DB', 'siteId', 'ems_changtaidq_02', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-02', 'M_W4_DEV_GCC_DB', 'dataCode', 'energy_meter01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-03', 'M_W4_DEV_GCC_DB', 'siteId', 'ems_changtaidq_06', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-03', 'M_W4_DEV_GCC_DB', 'dataCode', 'energy_meter01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-04', 'M_W4_DEV_GCC_DB', 'siteId', 'ems_changtaidq_03', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-04', 'M_W4_DEV_GCC_DB', 'dataCode', 'energy_meter01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-05', 'M_W4_DEV_GCC_DB', 'siteId', 'ems_changtaidq_04', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-05', 'M_W4_DEV_GCC_DB', 'dataCode', 'energy_meter01', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-06', 'M_W4_DEV_GCC_DB', 'siteId', 'ems_changtaidq_05', NULL);
+INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('GCC-DB-06', 'M_W4_DEV_GCC_DB', 'dataCode', 'energy_meter01', NULL);
+
 -- 对象能力数据
 INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `param_definition`, `hidden_flag`) VALUES ('M_W4_SYS_BA', 'MeterReadingTotal', '全量抄报-网关', '网关-测点批量抄报', null, 1);
 INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `param_definition`, `hidden_flag`) VALUES ('M_Z010_SYS_BA', 'SyncXfDevAttr', '采集同步-新风设备', '新风-采集同步', null, 1);
@@ -2272,7 +2499,7 @@ INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `mo
 INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_DLJK', '电力监控系统', '电力监控', 'M_W4_SYS_ELEC_MONITOR', '安科瑞', 'gzl', '1212121121', 'gzl', '1212221111', NULL);
 INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_GF', '光伏系统', '光伏', 'M_E5_SYS_PHOTOVOLTAIC', '古瑞瓦特', '张', '1380000', '李工', '123123', NULL);
 INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_CD', '充电桩系统', '充电桩', 'M_W2_SYS_CHARGING', '科士达', NULL, NULL, NULL, NULL, NULL);
-
+INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_GCC', '光储充系统', '光储充', 'M_W4_SYS_GCC', '城市动力', '安磊', '-', '安磊', '-', NULL);
 
 -- 告警策略
 -- 通用设备离线规则
@@ -2742,14 +2969,12 @@ INSERT INTO `adm_report_template` (`template_code`, `template_name`, `template_d
 -- ================== Mock 设备 =========================
 
 -- mock 设备数据
-INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_GCC', '光储充系统', '光储充', 'M_W4_SYS_GCC', '光储充厂商', '张三', '1212121121', '刘工', '1212221111', NULL);
 INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_GCZR', '光储直柔系统', '光储直柔', 'M_W4_SYS_GCZR', '光储直柔厂商', '张三', '1212121121', '刘工', '1212221111', NULL);
 INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_ZHHM', '智慧海绵系统', '智慧海绵', 'M_Z010_SYS_HM', '智慧海绵厂商', '张三', '1212121121', '刘工', '1212221111', NULL);
 INSERT INTO `adm_ems_subsystem` (`system_code`, `system_name`, `short_name`, `model_code`, `man_facturer`, `contact_person`, `contact_number`, `maintainer_person`, `maintainer_number`, `descr`) VALUES ('SYS_LG', '垃圾厨余系统', '垃圾厨余', 'M_Z010_SYS_LJCY', '垃圾厨余厂商', '张三', '1212121121', '刘工', '1212221111', NULL);
 
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_TEST', '测试', 3, NULL, NULL);
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W4_SYS_GCZR', '光储直柔系统', 3, 'http://172.17.60.27:9203/ems-dev-adapter/gczr/ct/abilityCall', NULL);
-INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W4_SYS_GCC', '光储充系统', 3, 'http://172.17.60.27:9203/ems-dev-adapter/gcc/ct/abilityCall', NULL);
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_W4_DEV_CN', '储能设备', 2, 'http://172.17.60.27:9203/ems-dev-adapter/gcc/ct/abilityCall', NULL);
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_Z010_SYS_HM', '海绵系统', 3, 'http://172.17.60.27:9203/ems-dev-adapter/hm/ct/abilityCall', NULL);
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`, `ability_handler`, `event_handler`) VALUES ('M_Z010_DEV_HM', '海绵设备', 2, 'http://172.17.60.27:9203/ems-dev-adapter/hm/ct/abilityCall', NULL);
@@ -2761,10 +2986,6 @@ INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_na
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCZR', 'Base', 'url', '服务地址', NULL, 'String');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCZR', 'Base', 'token', '接口令牌', NULL, 'String');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCZR', 'Base', 'plantList', '站点信息', NULL, 'String');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'interfaceType', '协议类型', NULL, 'String');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'url', '服务地址', NULL, 'String');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'token', '接口令牌', NULL, 'String');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_W4_SYS_GCC', 'Base', 'plantList', '站点信息', NULL, 'String');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_HM', 'Base', 'interfaceType', '协议类型', NULL, 'String');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_HM', 'Base', 'url', '服务地址', NULL, 'String');
 INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_group`, `attr_key`, `attr_name`, `attr_unit`, `attr_value_type`) VALUES ('M_Z010_SYS_HM', 'Base', 'token', '接口令牌', NULL, 'String');
@@ -2789,10 +3010,6 @@ INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `att
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCZR', 'M_W4_SYS_GCZR', 'url', 'https://openapi-cn.growatt.com', NULL);
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCZR', 'M_W4_SYS_GCZR', 'token', '3g7gdk3264xfw94jn1f7oox76fln8o3q', NULL);
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCZR', 'M_W4_SYS_GCZR', 'plantList', '北岸(926492)', NULL);
-INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'interfaceType', 'http', NULL);
-INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'url', 'https://0.0.0.0', NULL);
-INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'token', '12345678', NULL);
-INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_GCC', 'M_W4_SYS_GCC', 'plantList', '0000', NULL);
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_ZHHM', 'M_Z010_SYS_HM', 'interfaceType', 'http', NULL);
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_ZHHM', 'M_Z010_SYS_HM', 'url', 'https://0.0.0.0', NULL);
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `attr_value`, `update_time`) VALUES ('SYS_ZHHM', 'M_Z010_SYS_HM', 'token', '12345678', NULL);
@@ -2852,18 +3069,9 @@ INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `model_code`, `attr_key`, `att
 INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `param_definition`, `hidden_flag`) VALUES ('SYS_GCZR', 'SyncDevInverter', '同步逆变器设备', '从Growatt API同步逆变器设备列表和基础属性', null, 1);
 
 INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `param_definition`, `hidden_flag`) VALUES ('M_W4_SYS_GCZR', 'setLoadRatio', '设置负荷比', '设置负荷比', '{"type":"Slider", "min":0, "max":100}', 1);
-INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `param_definition`, `hidden_flag`) VALUES ('M_W4_SYS_GCC', 'setCharging', '充电开启', '充电开启', NULL, 1);
-INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `param_definition`, `hidden_flag`) VALUES ('M_W4_SYS_GCC', 'setDisCharging', '放电开启', '放电开启', NULL, 1);
-
-
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-001', '光储设备1',    'xxx', 'xxx', 1, '北区广场', '321283124S300104', '321283124S3001',  'M_W4_DEV_CN', 'C101', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-002', '光储设备2',    'xxx', 'xxx', 1, '北区广场', '321283124S300104', '321283124S3001',  'M_W4_DEV_CN', 'C101', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-003', '光储设备3',    'xxx', 'xxx', 1, '北区广场', '321283124S300104', '321283124S3001',  'M_W4_DEV_CN', 'C101', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-004', '光储设备4',    'xxx', 'xxx', 1, '北区广场', '321283124S300104', '321283124S3001',  'M_W4_DEV_CN', 'C101', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-005', '光储设备5',    'xxx', 'xxx', 1, '南区广场', '321283124S300204', '321283124S3002',  'M_W4_DEV_CN', 'C102', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-006', '光储设备6',    'xxx', 'xxx', 1, '南区广场', '321283124S300204', '321283124S3002',  'M_W4_DEV_CN', 'C102', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-007', '光储设备7',    'xxx', 'xxx', 1, '南区广场', '321283124S300204', '321283124S3002',  'M_W4_DEV_CN', 'C102', NULL, 'SYS_GCC');
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('GCZR-008', '光储设备8',    'xxx', 'xxx', 1, '南区广场', '321283124S300204', '321283124S3002',  'M_W4_DEV_CN', 'C102', NULL, 'SYS_GCC');
+
+
+
 INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('ZHHM-01', '海绵设备1',    'xxx', 'xxx', 1, '北区广场', '321283124S300104', '321283124S3001',  'test', 'Z-QT-01', NULL, 'SYS_ZHHM');
 INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('ZHHM-02', '海绵设备2',    'xxx', 'xxx', 1, '南区广场', '321283124S300204', '321283124S3002',  'test', 'Z-QT-02', NULL, 'SYS_ZHHM');
 INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_brand`, `device_spec`, `device_status`, `location`, `location_ref`, `area_code`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('LGCY-01', '厨余垃圾设备1',    'xxx', 'xxx', 1, '北区广场', '321283124S300104', '321283124S3001',  'test', 'Z-QT-01', NULL, 'SYS_LG');

+ 0 - 19
ems/sql/ems_server.sql

@@ -1783,25 +1783,6 @@ create table adm_ems_ca_meter_d (
   unique key ux_ems_elec_meter_d(`area_code`, `date`)
 ) engine=innodb auto_increment=1 comment = '碳计量日表';
 
-
--- ----------------------------
--- 储能设施指标表
--- ----------------------------
-drop table if exists adm_ems_elec_store_index;
-create table adm_ems_elec_store_index (
-  `id`                        bigint(20)      not null auto_increment      comment '序号',
-  `area_code`                 varchar(32)     not null                     comment '园区代码',
-  `facs_code`                 varchar(16)     not null                     comment '设施代码',
-  `device_code`               varchar(64)     not null                     comment '设备代码',
-  `date`                      date            not null                     comment '日期 yyyy-MM-dd',
-  `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
-  `charge_voltage`            double          default null                 comment '充电功率 单位:W(瓦)',
-  `discharge_power`           double          default null                 comment '放电功率 单位:W(瓦)',
-  `current_capacity`          double          default null                 comment '当前容量 单位:kW-h(千瓦·时)',
-  primary key (`id`),
-  unique key ux_ems_elec_store_index(`device_code`, `time`)
-) engine=innodb auto_increment=1 comment = '储能设施指标表';
-
 -- ----------------------------
 -- 充电交易记录主表
 -- ----------------------------

+ 0 - 6
ems/sql/ems_sys_data.sql

@@ -326,12 +326,6 @@ INSERT INTO sys_menu VALUES (16310, '列表查询', 1631, 1, '', NULL, NULL, 1,
 INSERT INTO sys_menu VALUES (16311, '新增', 1631, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:meterBoundary:add', '#', 'admin', sysdate(), '', NULL, '');
 INSERT INTO sys_menu VALUES (16312, '删除', 1631, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:meterBoundary:remove', '#', 'admin', sysdate(), '', NULL, '');
 
--- 储能设施指标按钮
-INSERT INTO sys_menu VALUES (12701, '列表查询', 127, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:ElecStoreIndex:list', '#', 'admin', sysdate(), '', NULL, '');
-INSERT INTO sys_menu VALUES (12702, '新增', 127, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:ElecStoreIndex:add', '#', 'admin', sysdate(), '', NULL, '');
-INSERT INTO sys_menu VALUES (12703, '修改', 127, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:ElecStoreIndex:edit', '#', 'admin', sysdate(), '', NULL, '');
-INSERT INTO sys_menu VALUES (12704, '删除', 127, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:ElecStoreIndex:remove', '#', 'admin', sysdate(), '', NULL, '');
-
 -- 碳排计量
 INSERT INTO `sys_menu` VALUES (12311,'列表查询',1231, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:list', '#', 'admin', sysdate(), '', NULL, '');
 INSERT INTO `sys_menu` VALUES (12312,'导出',1231, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:export', '#', 'admin', sysdate(), '', NULL, '');