Эх сурвалжийг харах

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

# Conflicts:
#	ems-cloud/sql/ems_init_data.sql
hsshuxian 11 сар өмнө
parent
commit
fb79dda476
46 өөрчлөгдсөн 2817 нэмэгдсэн , 207 устгасан
  1. 99 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmBoxElecEqptController.java
  2. 102 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsElecBoxEqptIndexController.java
  3. 100 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsElecBoxIndexController.java
  4. 57 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ChargingBillController.java
  5. 0 38
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/CoChargingBillController.java
  6. 23 24
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/MeterReadingController.java
  7. 1 2
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/PowerBoxController.java
  8. 177 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmBoxElecEqpt.java
  9. 162 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecBoxEqptIndex.java
  10. 209 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecBoxIndex.java
  11. 84 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ChargingBill.java
  12. 0 28
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/CoChargingBill.java
  13. 1 1
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReading.java
  14. 20 8
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/PowerBoxElecEqpt.java
  15. 16 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/common/MeterObjSubType.java
  16. 87 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/QueryChargingBill.java
  17. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmBoxElecEqptMapper.java
  18. 64 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecBoxEqptIndexMapper.java
  19. 63 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecBoxIndexMapper.java
  20. 5 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterDeviceMapper.java
  21. 7 7
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterReadingMapper.java
  22. 16 7
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/PowerBoxMapper.java
  23. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmBoxElecEqptService.java
  24. 65 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsElecBoxEqptIndexService.java
  25. 65 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsElecBoxIndexService.java
  26. 34 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IChargingBillService.java
  27. 8 8
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterReadingService.java
  28. 93 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmBoxElecEqptServiceImpl.java
  29. 94 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmEmsElecBoxEqptIndexServiceImpl.java
  30. 93 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmEmsElecBoxIndexServiceImpl.java
  31. 12 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmOpAlarmServiceImpl.java
  32. 4 2
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AreaServiceImpl.java
  33. 91 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ChargingBillServiceImpl.java
  34. 0 52
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/MeterReadingManualServiceImpl.java
  35. 52 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/MeterReadingServiceImpl.java
  36. 94 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmBoxElecEqptMapper.xml
  37. 108 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxEqptIndexMapper.xml
  38. 119 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxIndexMapper.xml
  39. 1 1
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsTypeMapper.xml
  40. 5 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterDeviceMapper.xml
  41. 8 8
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterReadingMapper.xml
  42. 13 8
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/PowerBoxElecEqptMapper.xml
  43. 11 6
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/PowerBoxMapper.xml
  44. 55 2
      ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/ObjType.java
  45. 329 0
      ems-cloud/sql/ems_init_data.sql
  46. 48 5
      ems-cloud/sql/ems_server.sql

+ 99 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmBoxElecEqptController.java

@@ -0,0 +1,99 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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.AdmBoxElecEqpt;
+import com.ruoyi.ems.service.IAdmBoxElecEqptService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 动力箱柜电气设备Controller
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@RestController
+@RequestMapping("/eqpt")
+public class AdmBoxElecEqptController extends BaseController
+{
+    @Autowired
+    private IAdmBoxElecEqptService admBoxElecEqptService;
+
+    /**
+     * 查询动力箱柜电气设备列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        startPage();
+        List<AdmBoxElecEqpt> list = admBoxElecEqptService.selectAdmBoxElecEqptList(admBoxElecEqpt);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动力箱柜电气设备列表
+     */
+    @Log(title = "动力箱柜电气设备", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        List<AdmBoxElecEqpt> list = admBoxElecEqptService.selectAdmBoxElecEqptList(admBoxElecEqpt);
+        ExcelUtil<AdmBoxElecEqpt> util = new ExcelUtil<AdmBoxElecEqpt>(AdmBoxElecEqpt.class);
+        util.exportExcel(response, list, "动力箱柜电气设备数据");
+    }
+
+    /**
+     * 获取动力箱柜电气设备详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(admBoxElecEqptService.selectAdmBoxElecEqptById(id));
+    }
+
+    /**
+     * 新增动力箱柜电气设备
+     */
+    @Log(title = "动力箱柜电气设备", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        return toAjax(admBoxElecEqptService.insertAdmBoxElecEqpt(admBoxElecEqpt));
+    }
+
+    /**
+     * 修改动力箱柜电气设备
+     */
+    @Log(title = "动力箱柜电气设备", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        return toAjax(admBoxElecEqptService.updateAdmBoxElecEqpt(admBoxElecEqpt));
+    }
+
+    /**
+     * 删除动力箱柜电气设备
+     */
+    @Log(title = "动力箱柜电气设备", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(admBoxElecEqptService.deleteAdmBoxElecEqptByIds(ids));
+    }
+}

+ 102 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsElecBoxEqptIndexController.java

@@ -0,0 +1,102 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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.AdmEmsElecBoxEqptIndex;
+import com.ruoyi.ems.service.IAdmEmsElecBoxEqptIndexService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 动力箱元器件指标Controller
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@RestController
+@RequestMapping("/elecBoxEqptIndex")
+public class AdmEmsElecBoxEqptIndexController extends BaseController {
+    @Autowired
+    private IAdmEmsElecBoxEqptIndexService admEmsElecBoxEqptIndexService;
+
+    /**
+     * 查询动力箱元器件指标列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        startPage();
+        List<AdmEmsElecBoxEqptIndex> list = admEmsElecBoxEqptIndexService
+            .selectAdmEmsElecBoxEqptIndexList(admEmsElecBoxEqptIndex);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/latest/list")
+    public TableDataInfo latestIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        startPage();
+        List<AdmEmsElecBoxEqptIndex> list = admEmsElecBoxEqptIndexService
+            .selectAdmEmsElecBoxEqptLatestIndex(admEmsElecBoxEqptIndex);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动力箱元器件指标列表
+     */
+    @Log(title = "动力箱元器件指标", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        List<AdmEmsElecBoxEqptIndex> list = admEmsElecBoxEqptIndexService
+            .selectAdmEmsElecBoxEqptIndexList(admEmsElecBoxEqptIndex);
+        ExcelUtil<AdmEmsElecBoxEqptIndex> util = new ExcelUtil<AdmEmsElecBoxEqptIndex>(AdmEmsElecBoxEqptIndex.class);
+        util.exportExcel(response, list, "动力箱元器件指标数据");
+    }
+
+    /**
+     * 获取动力箱元器件指标详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(admEmsElecBoxEqptIndexService.selectAdmEmsElecBoxEqptIndexById(id));
+    }
+
+    /**
+     * 新增动力箱元器件指标
+     */
+    @Log(title = "动力箱元器件指标", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        return toAjax(admEmsElecBoxEqptIndexService.insertAdmEmsElecBoxEqptIndex(admEmsElecBoxEqptIndex));
+    }
+
+    /**
+     * 修改动力箱元器件指标
+     */
+    @Log(title = "动力箱元器件指标", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        return toAjax(admEmsElecBoxEqptIndexService.updateAdmEmsElecBoxEqptIndex(admEmsElecBoxEqptIndex));
+    }
+
+    /**
+     * 删除动力箱元器件指标
+     */
+    @Log(title = "动力箱元器件指标", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(admEmsElecBoxEqptIndexService.deleteAdmEmsElecBoxEqptIndexByIds(ids));
+    }
+}

+ 100 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsElecBoxIndexController.java

@@ -0,0 +1,100 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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.AdmEmsElecBoxIndex;
+import com.ruoyi.ems.service.IAdmEmsElecBoxIndexService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 动力箱指标Controller
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@RestController
+@RequestMapping("/powerBoxIndex")
+public class AdmEmsElecBoxIndexController extends BaseController {
+    @Autowired
+    private IAdmEmsElecBoxIndexService admEmsElecBoxIndexService;
+
+    /**
+     * 查询动力箱指标列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        startPage();
+        List<AdmEmsElecBoxIndex> list = admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动力箱指标列表
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        List<AdmEmsElecBoxIndex> list = admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
+        ExcelUtil<AdmEmsElecBoxIndex> util = new ExcelUtil<AdmEmsElecBoxIndex>(AdmEmsElecBoxIndex.class);
+        util.exportExcel(response, list, "动力箱指标数据");
+    }
+
+    /**
+     * 获取动力箱指标详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexById(id));
+    }
+
+    /**
+     * 获取动力箱指标详细信息
+     */
+    @GetMapping(value = "/latest/{boxCode}")
+    public AjaxResult getLatestIndexByBoxCode(@PathVariable("boxCode") String boxCode) {
+        return success(admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexByBoxCode(boxCode));
+    }
+
+    /**
+     * 新增动力箱指标
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return toAjax(admEmsElecBoxIndexService.insertAdmEmsElecBoxIndex(admEmsElecBoxIndex));
+    }
+
+    /**
+     * 修改动力箱指标
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return toAjax(admEmsElecBoxIndexService.updateAdmEmsElecBoxIndex(admEmsElecBoxIndex));
+    }
+
+    /**
+     * 删除动力箱指标
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(admEmsElecBoxIndexService.deleteAdmEmsElecBoxIndexByIds(ids));
+    }
+}

+ 57 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ChargingBillController.java

@@ -0,0 +1,57 @@
+/*
+ * 文 件 名:  CoBillController
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/8/30
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.controller;
+
+/**
+ * 商户账单接口
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/8/30]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.ems.domain.vo.QueryChargingBill;
+import com.ruoyi.ems.service.IChargingBillService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 商户能源账单配置Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-26
+ */
+@RestController
+@RequestMapping("/basecfg/bill/charging")
+@Api(value = "CoChargingBillController", description = "计费账单服务")
+public class ChargingBillController extends BaseController {
+    @Autowired
+    private IChargingBillService chargingBillService;
+
+    /**
+     * 商户计费
+     * @param queryParam 查询参数
+     * @return
+     */
+    @GetMapping(value = "/co/bill")
+    public AjaxResult getCoBill(QueryChargingBill queryParam) {
+        return success(chargingBillService.selectChargingBillList(queryParam));
+    }
+}

+ 0 - 38
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/CoChargingBillController.java

@@ -1,38 +0,0 @@
-/*
- * 文 件 名:  CoBillController
- * 版    权:  浩鲸云计算科技股份有限公司
- * 描    述:  <描述>
- * 修 改 人:  lvwenbin
- * 修改时间:  2024/8/30
- * 跟踪单号:  <跟踪单号>
- * 修改单号:  <修改单号>
- * 修改内容:  <修改内容>
- */
-package com.ruoyi.ems.controller;
-
-/**
- * 商户账单接口
- * <功能详细描述>
- *
- * @author lvwenbin
- * @version [版本号, 2024/8/30]
- * @see [相关类/方法]
- * @since [产品/模块版本]
- */
-
-import io.swagger.annotations.Api;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 商户能源账单配置Controller
- *
- * @author ruoyi
- * @date 2024-08-26
- */
-@RestController
-@RequestMapping("/basecfg/bill/coCharging")
-@Api(value = "CoChargingBillController", description = "商户计费账单服务")
-public class CoChargingBillController {
-
-}

+ 23 - 24
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/MeterReadingManualController.java → ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/MeterReadingController.java

@@ -6,10 +6,10 @@ 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.MeterDevice;
-import com.ruoyi.ems.domain.MeterReadingManual;
+import com.ruoyi.ems.domain.MeterReading;
 import com.ruoyi.ems.domain.vo.QueryMeterReading;
 import com.ruoyi.ems.service.IMeterDeviceService;
-import com.ruoyi.ems.service.IMeterReadingManualService;
+import com.ruoyi.ems.service.IMeterReadingService;
 import com.ruoyi.ems.util.DateUtils;
 import com.ruoyi.ems.util.exception.Assert;
 import com.ruoyi.ems.util.exception.BusinessException;
@@ -25,32 +25,31 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.time.Year;
 import java.util.Date;
 import java.util.List;
 
 /**
- * 手动抄记录Controller
+ * 抄记录Controller
  *
  * @author ruoyi
  * @date 2024-08-28
  */
 @RestController
 @RequestMapping("/meterReading")
-@Api(value = "MeterReadingManualController", description = "手动抄表管理")
-public class MeterReadingManualController extends BaseController {
+@Api(value = "MeterReadingManualController", description = "抄表管理")
+public class MeterReadingController extends BaseController {
     @Autowired
-    private IMeterReadingManualService meterReadingManualService;
+    private IMeterReadingService meterReadingService;
 
     @Autowired
     private IMeterDeviceService meterDeviceService;
 
     /**
-     * 查询手动抄记录列表
+     * 查询抄记录列表
      */
     @GetMapping("/listByParam")
     public AjaxResult listByParam(QueryMeterReading queryMeterReading) {
-        List<MeterReadingManual> list = meterReadingManualService.selectList(queryMeterReading);
+        List<MeterReading> list = meterReadingService.selectList(queryMeterReading);
         return success(list);
     }
 
@@ -60,19 +59,19 @@ public class MeterReadingManualController extends BaseController {
     @GetMapping(value = "/getLastRecord")
     public AjaxResult getLastRecord(@RequestParam(name = "areaCode") String areaCode,
         @RequestParam(name = "deviceCode") String deviceCode) {
-        return success(meterReadingManualService.selectLastItem(areaCode, deviceCode));
+        return success(meterReadingService.selectLastItem(areaCode, deviceCode));
     }
 
     /**
-     * 新增手动抄记录
+     * 新增抄记录
      */
     @RequiresPermissions("ems:meterReading:add")
-    @Log(title = "手动抄记录", businessType = BusinessType.INSERT)
+    @Log(title = "抄记录", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody MeterReadingManual meterRec) {
+    public AjaxResult add(@RequestBody MeterReading meterRec) {
         try {
             fillData(meterRec);
-            int count = meterReadingManualService.insert(meterRec);
+            int count = meterReadingService.insert(meterRec);
             return toAjax(count);
         }
         catch (BusinessException e) {
@@ -81,19 +80,19 @@ public class MeterReadingManualController extends BaseController {
     }
 
     /**
-     * 修改手动抄记录
+     * 修改抄记录
      */
     @RequiresPermissions("ems:meterReading:edit")
-    @Log(title = "手动抄记录", businessType = BusinessType.UPDATE)
+    @Log(title = "抄记录", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody MeterReadingManual meterRec) {
+    public AjaxResult edit(@RequestBody MeterReading meterRec) {
         try {
-            MeterReadingManual dbItem = meterReadingManualService.selectById(meterRec.getId());
+            MeterReading dbItem = meterReadingService.selectById(meterRec.getId());
             Assert.notNull(dbItem, -1, "该记录不存在");
-            meterReadingManualService.deleteById(meterRec.getId());
+            meterReadingService.deleteById(meterRec.getId());
             dbItem.setMeterReading(meterRec.getMeterReading());
             fillData(meterRec);
-            int count = meterReadingManualService.insert(meterRec);
+            int count = meterReadingService.insert(meterRec);
             return toAjax(count);
         }
         catch (BusinessException e) {
@@ -105,14 +104,14 @@ public class MeterReadingManualController extends BaseController {
      * 删除动力箱柜
      */
     @RequiresPermissions("ems:meterReading:remove")
-    @Log(title = "手动抄记录", businessType = BusinessType.DELETE)
+    @Log(title = "抄记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{id}")
     public AjaxResult remove(@PathVariable Long id) {
-        return toAjax(meterReadingManualService.deleteById(id));
+        return toAjax(meterReadingService.deleteById(id));
     }
 
-    private void fillData(MeterReadingManual meterRec) {
-        MeterReadingManual lastItem = meterReadingManualService.selectLastItem(meterRec.getAreaCode(),
+    private void fillData(MeterReading meterRec) {
+        MeterReading lastItem = meterReadingService.selectLastItem(meterRec.getAreaCode(),
             meterRec.getDeviceCode());
         MeterDevice meterDevice = meterDeviceService.selectMeterDeviceByCode(meterRec.getAreaCode(),
             meterRec.getDeviceCode());

+ 1 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/PowerBoxController.java

@@ -25,7 +25,7 @@ import java.util.List;
 
 /**
  * 动力箱柜Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-08-20
  */
@@ -40,7 +40,6 @@ public class PowerBoxController extends BaseController
     /**
      * 查询动力箱柜列表
      */
-    @RequiresPermissions("ems:powerBox:list")
     @GetMapping("/list")
     public TableDataInfo list(PowerBox powerBox)
     {

+ 177 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmBoxElecEqpt.java

@@ -0,0 +1,177 @@
+package com.ruoyi.ems.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 动力箱柜电气设备对象 adm_box_elec_eqpt
+ * 
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public class AdmBoxElecEqpt extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 箱柜代码 */
+    @Excel(name = "箱柜代码")
+    private String boxCode;
+
+    /** 电气编码 */
+    @Excel(name = "电气编码")
+    private String eqptCode;
+
+    /** 外部系统编码 */
+    @Excel(name = "外部系统编码")
+    private String extEqptCode;
+
+    /** 电气符号代码 */
+    @Excel(name = "电气符号代码")
+    private String eqptType;
+
+    /** 电气型号 */
+    @Excel(name = "电气型号")
+    private String eqptSpec;
+
+    /** 额定电压 */
+    @Excel(name = "额定电压")
+    private Integer ratedVoltage;
+
+    /** 额定电流 */
+    @Excel(name = "额定电流")
+    private Integer ratedCurrent;
+
+    /** 祖籍列表 */
+    @Excel(name = "祖籍列表")
+    private String ancestors;
+
+    /** 上级电气件 */
+    @Excel(name = "上级电气件")
+    private String parentEqpt;
+
+    /** 下级支路 */
+    @Excel(name = "下级支路")
+    private String subCircuit;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setBoxCode(String boxCode) 
+    {
+        this.boxCode = boxCode;
+    }
+
+    public String getBoxCode() 
+    {
+        return boxCode;
+    }
+    public void setEqptCode(String eqptCode) 
+    {
+        this.eqptCode = eqptCode;
+    }
+
+    public String getEqptCode() 
+    {
+        return eqptCode;
+    }
+    public void setExtEqptCode(String extEqptCode) 
+    {
+        this.extEqptCode = extEqptCode;
+    }
+
+    public String getExtEqptCode() 
+    {
+        return extEqptCode;
+    }
+    public void setEqptType(String eqptType) 
+    {
+        this.eqptType = eqptType;
+    }
+
+    public String getEqptType() 
+    {
+        return eqptType;
+    }
+    public void setEqptSpec(String eqptSpec) 
+    {
+        this.eqptSpec = eqptSpec;
+    }
+
+    public String getEqptSpec() 
+    {
+        return eqptSpec;
+    }
+    public void setRatedVoltage(Integer ratedVoltage) 
+    {
+        this.ratedVoltage = ratedVoltage;
+    }
+
+    public Integer getRatedVoltage() 
+    {
+        return ratedVoltage;
+    }
+    public void setRatedCurrent(Integer ratedCurrent) 
+    {
+        this.ratedCurrent = ratedCurrent;
+    }
+
+    public Integer getRatedCurrent() 
+    {
+        return ratedCurrent;
+    }
+    public void setAncestors(String ancestors) 
+    {
+        this.ancestors = ancestors;
+    }
+
+    public String getAncestors() 
+    {
+        return ancestors;
+    }
+    public void setParentEqpt(String parentEqpt) 
+    {
+        this.parentEqpt = parentEqpt;
+    }
+
+    public String getParentEqpt() 
+    {
+        return parentEqpt;
+    }
+    public void setSubCircuit(String subCircuit) 
+    {
+        this.subCircuit = subCircuit;
+    }
+
+    public String getSubCircuit() 
+    {
+        return subCircuit;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("boxCode", getBoxCode())
+            .append("eqptCode", getEqptCode())
+            .append("extEqptCode", getExtEqptCode())
+            .append("eqptType", getEqptType())
+            .append("eqptSpec", getEqptSpec())
+            .append("ratedVoltage", getRatedVoltage())
+            .append("ratedCurrent", getRatedCurrent())
+            .append("ancestors", getAncestors())
+            .append("parentEqpt", getParentEqpt())
+            .append("subCircuit", getSubCircuit())
+            .toString();
+    }
+}

+ 162 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecBoxEqptIndex.java

@@ -0,0 +1,162 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 动力箱元器件指标对象 adm_ems_elec_box_eqpt_index
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public class AdmEmsElecBoxEqptIndex extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 序号
+     */
+    private Long id;
+
+    /**
+     * 箱体代码
+     */
+    @Excel(name = "箱体代码")
+    private String boxCode;
+
+    /**
+     * 元件代码
+     */
+    @Excel(name = "元件代码")
+    private String eqptCode;
+
+    /**
+     * 服务区代码
+     */
+    @Excel(name = "服务区代码")
+    private String areaCode;
+
+    /**
+     * 日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date date;
+
+    /**
+     * 时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date time;
+
+    /**
+     * 电压(伏)
+     */
+    @Excel(name = "电压", readConverterExp = "伏=")
+    private Double voltage;
+
+    /**
+     * 电流(安培)
+     */
+    @Excel(name = "电流", readConverterExp = "安=培")
+    private Double current;
+
+    /**
+     * 功率(千瓦)
+     */
+    @Excel(name = "功率", readConverterExp = "千=瓦")
+    private Double power;
+
+    private String eqptSpec;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setBoxCode(String boxCode) {
+        this.boxCode = boxCode;
+    }
+
+    public String getBoxCode() {
+        return boxCode;
+    }
+
+    public void setEqptCode(String eqptCode) {
+        this.eqptCode = eqptCode;
+    }
+
+    public String getEqptCode() {
+        return eqptCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+    public Date getDate() {
+        return date;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    public void setVoltage(Double voltage) {
+        this.voltage = voltage;
+    }
+
+    public Double getVoltage() {
+        return voltage;
+    }
+
+    public void setCurrent(Double current) {
+        this.current = current;
+    }
+
+    public Double getCurrent() {
+        return current;
+    }
+
+    public void setPower(Double power) {
+        this.power = power;
+    }
+
+    public Double getPower() {
+        return power;
+    }
+
+    public String getEqptSpec() {
+        return eqptSpec;
+    }
+
+    public void setEqptSpec(String eqptSpec) {
+        this.eqptSpec = eqptSpec;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("boxCode", getBoxCode()).append("eqptCode", getEqptCode()).append("areaCode", getAreaCode()).append("date", getDate()).append("time", getTime()).append("voltage", getVoltage()).append("current", getCurrent()).append("power", getPower()).toString();
+    }
+}

+ 209 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecBoxIndex.java

@@ -0,0 +1,209 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 动力箱指标对象 adm_ems_elec_box_index
+ * 
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public class AdmEmsElecBoxIndex extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 箱体代码 */
+    @Excel(name = "箱体代码")
+    private String boxCode;
+
+    /** 箱体类型 */
+    @Excel(name = "箱体类型")
+    private Integer boxType;
+
+    /** 服务区代码 */
+    @Excel(name = "服务区代码")
+    private String areaCode;
+
+    /** 日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date date;
+
+    /** 时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date time;
+
+    /** 电压(A相,伏) */
+    @Excel(name = "电压(A相,伏)")
+    private Double voltageA;
+
+    /** 电压(B相,伏) */
+    @Excel(name = "电压(B相,伏)")
+    private Double voltageB;
+
+    /** 电压(C相,伏) */
+    @Excel(name = "电压(C相,伏)")
+    private Double voltageC;
+
+    /** 电流(A相,安培) */
+    @Excel(name = "电流(A相,安培)")
+    private Double electricityA;
+
+    /** 电流(B相,安培) */
+    @Excel(name = "电流(B相,安培)")
+    private Double electricityB;
+
+    /** 电流(C相,安培) */
+    @Excel(name = "电流(C相,安培)")
+    private Double electricityC;
+
+    /** 功率(千瓦) */
+    @Excel(name = "功率", readConverterExp = "千=瓦")
+    private Double power;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setBoxCode(String boxCode) 
+    {
+        this.boxCode = boxCode;
+    }
+
+    public String getBoxCode() 
+    {
+        return boxCode;
+    }
+    public void setBoxType(Integer boxType) 
+    {
+        this.boxType = boxType;
+    }
+
+    public Integer getBoxType() 
+    {
+        return boxType;
+    }
+    public void setAreaCode(String areaCode) 
+    {
+        this.areaCode = areaCode;
+    }
+
+    public String getAreaCode() 
+    {
+        return areaCode;
+    }
+    public void setDate(Date date) 
+    {
+        this.date = date;
+    }
+
+    public Date getDate() 
+    {
+        return date;
+    }
+    public void setTime(Date time) 
+    {
+        this.time = time;
+    }
+
+    public Date getTime() 
+    {
+        return time;
+    }
+    public void setVoltageA(Double voltageA) 
+    {
+        this.voltageA = voltageA;
+    }
+
+    public Double getVoltageA() 
+    {
+        return voltageA;
+    }
+    public void setVoltageB(Double voltageB) 
+    {
+        this.voltageB = voltageB;
+    }
+
+    public Double getVoltageB() 
+    {
+        return voltageB;
+    }
+    public void setVoltageC(Double voltageC) 
+    {
+        this.voltageC = voltageC;
+    }
+
+    public Double getVoltageC() 
+    {
+        return voltageC;
+    }
+    public void setElectricityA(Double electricityA) 
+    {
+        this.electricityA = electricityA;
+    }
+
+    public Double getElectricityA() 
+    {
+        return electricityA;
+    }
+    public void setElectricityB(Double electricityB) 
+    {
+        this.electricityB = electricityB;
+    }
+
+    public Double getElectricityB() 
+    {
+        return electricityB;
+    }
+    public void setElectricityC(Double electricityC) 
+    {
+        this.electricityC = electricityC;
+    }
+
+    public Double getElectricityC() 
+    {
+        return electricityC;
+    }
+    public void setPower(Double power) 
+    {
+        this.power = power;
+    }
+
+    public Double getPower() 
+    {
+        return power;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("boxCode", getBoxCode())
+            .append("boxType", getBoxType())
+            .append("areaCode", getAreaCode())
+            .append("date", getDate())
+            .append("time", getTime())
+            .append("voltageA", getVoltageA())
+            .append("voltageB", getVoltageB())
+            .append("voltageC", getVoltageC())
+            .append("electricityA", getElectricityA())
+            .append("electricityB", getElectricityB())
+            .append("electricityC", getElectricityC())
+            .append("power", getPower())
+            .toString();
+    }
+}

+ 84 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ChargingBill.java

@@ -0,0 +1,84 @@
+/*
+ * 文 件 名:  ChargingBill
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/9/2
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.domain;
+
+/**
+ * 采购项目
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/9/2]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public class ChargingBill {
+    private int objType;
+
+    /**
+     * 账单项目名称
+     */
+    private String itemName;
+
+    /**
+     * 计量时间
+     */
+    private String meteredTime;
+
+    /**
+     * 计量值
+     */
+    private Double meteredValue;
+
+    /**
+     * 计量金额
+     */
+    private Double meteredPrice;
+
+    public int getObjType() {
+        return objType;
+    }
+
+    public void setObjType(int objType) {
+        this.objType = objType;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getMeteredTime() {
+        return meteredTime;
+    }
+
+    public void setMeteredTime(String meteredTime) {
+        this.meteredTime = meteredTime;
+    }
+
+    public Double getMeteredValue() {
+        return meteredValue;
+    }
+
+    public void setMeteredValue(Double meteredValue) {
+        this.meteredValue = meteredValue;
+    }
+
+    public Double getMeteredPrice() {
+        return meteredPrice;
+    }
+
+    public void setMeteredPrice(Double meteredPrice) {
+        this.meteredPrice = meteredPrice;
+    }
+}

+ 0 - 28
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/CoChargingBill.java

@@ -1,28 +0,0 @@
-/*
- * 文 件 名:  CoChargingBill
- * 版    权:  浩鲸云计算科技股份有限公司
- * 描    述:  <描述>
- * 修 改 人:  lvwenbin
- * 修改时间:  2024/8/30
- * 跟踪单号:  <跟踪单号>
- * 修改单号:  <修改单号>
- * 修改内容:  <修改内容>
- */
-package com.ruoyi.ems.domain;
-
-/**
- * 商户计费账单
- * <功能详细描述>
- *
- * @author lvwenbin
- * @version [版本号, 2024/8/30]
- * @see [相关类/方法]
- * @since [产品/模块版本]
- */
-public class CoChargingBill {
-    private String objCode;
-
-    private String objName;
-
-
-}

+ 1 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReadingManual.java → ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReading.java

@@ -14,7 +14,7 @@ import java.util.Date;
  * @author ruoyi
  * @date 2024-08-28
  */
-public class MeterReadingManual extends BaseEntity
+public class MeterReading extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 

+ 20 - 8
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/PowerBoxElecEqpt.java

@@ -47,13 +47,16 @@ public class PowerBoxElecEqpt extends BaseEntity
     @Excel(name = "额定电流")
     private Long ratedCurrent;
 
+    /** 祖籍列表 */
+    private String ancestors;
+
     /** 上级电气件 */
     @Excel(name = "上级电气件")
     private String parentEqpt;
 
-    /** 计量设备 */
-    @Excel(name = "计量设备")
-    private String meterDevice;
+    /** 下级支路 */
+    @Excel(name = "下级支路")
+    private String subCircuit;
 
     public Long getId() {
         return id;
@@ -135,12 +138,20 @@ public class PowerBoxElecEqpt extends BaseEntity
         this.parentEqpt = parentEqpt;
     }
 
-    public String getMeterDevice() {
-        return meterDevice;
+    public String getAncestors() {
+        return ancestors;
+    }
+
+    public void setAncestors(String ancestors) {
+        this.ancestors = ancestors;
+    }
+
+    public String getSubCircuit() {
+        return subCircuit;
     }
 
-    public void setMeterDevice(String meterDevice) {
-        this.meterDevice = meterDevice;
+    public void setSubCircuit(String subCircuit) {
+        this.subCircuit = subCircuit;
     }
 
     @Override
@@ -155,7 +166,8 @@ public class PowerBoxElecEqpt extends BaseEntity
             .append("ratedVoltage", getRatedVoltage())
             .append("ratedCurrent", getRatedCurrent())
             .append("parentEqpt", getParentEqpt())
-            .append("meterDevice", getMeterDevice())
+            .append("ancestors", getAncestors())
+            .append("subCircuit", getSubCircuit())
             .toString();
     }
 }

+ 16 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/common/MeterObjSubType.java

@@ -10,6 +10,8 @@
  */
 package com.ruoyi.ems.domain.common;
 
+import org.apache.commons.lang3.StringUtils;
+
 /**
  * 计量对象子
  * <功能详细描述>
@@ -43,4 +45,18 @@ public enum MeterObjSubType {
     public void setType(int type) {
         this.type = type;
     }
+
+    public static MeterObjSubType getByTier(String tier) {
+        if (StringUtils.equals(tier, AreaTier.Area.name())) {
+            return METER_AREA;
+        }
+        else if (StringUtils.equals(tier, AreaTier.Building.name())) {
+            return METER_BUILDING;
+        }
+        else if (StringUtils.equals(tier, AreaTier.Zoning.name())) {
+            return METER_ZONING;
+        }
+
+        return null;
+    }
 }

+ 87 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/QueryChargingBill.java

@@ -0,0 +1,87 @@
+/*
+ * 文 件 名:  QueryChargingBill
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/9/2
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.domain.vo;
+
+/**
+ * 查询账单请求
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/9/2]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public class QueryChargingBill {
+    /**
+     * 区域编码
+     */
+    private String areaCode;
+
+    /**
+     * 区域层级
+     */
+    private String tier;
+
+    /**
+     * 计量类型 45:电,70:水
+     */
+    private Integer meterCls;
+
+    /**
+     * 开始时间
+     */
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    private String endTime;
+
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
+    public String getTier() {
+        return tier;
+    }
+
+    public void setTier(String tier) {
+        this.tier = tier;
+    }
+
+    public Integer getMeterCls() {
+        return meterCls;
+    }
+
+    public void setMeterCls(Integer meterCls) {
+        this.meterCls = meterCls;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmBoxElecEqptMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmBoxElecEqpt;
+
+/**
+ * 动力箱柜电气设备Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface AdmBoxElecEqptMapper 
+{
+    /**
+     * 查询动力箱柜电气设备
+     * 
+     * @param id 动力箱柜电气设备主键
+     * @return 动力箱柜电气设备
+     */
+    public AdmBoxElecEqpt selectAdmBoxElecEqptById(Long id);
+
+    /**
+     * 查询动力箱柜电气设备列表
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 动力箱柜电气设备集合
+     */
+    public List<AdmBoxElecEqpt> selectAdmBoxElecEqptList(AdmBoxElecEqpt admBoxElecEqpt);
+
+    /**
+     * 新增动力箱柜电气设备
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 结果
+     */
+    public int insertAdmBoxElecEqpt(AdmBoxElecEqpt admBoxElecEqpt);
+
+    /**
+     * 修改动力箱柜电气设备
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 结果
+     */
+    public int updateAdmBoxElecEqpt(AdmBoxElecEqpt admBoxElecEqpt);
+
+    /**
+     * 删除动力箱柜电气设备
+     * 
+     * @param id 动力箱柜电气设备主键
+     * @return 结果
+     */
+    public int deleteAdmBoxElecEqptById(Long id);
+
+    /**
+     * 批量删除动力箱柜电气设备
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmBoxElecEqptByIds(Long[] ids);
+}

+ 64 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecBoxEqptIndexMapper.java

@@ -0,0 +1,64 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex;
+
+/**
+ * 动力箱元器件指标Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface AdmEmsElecBoxEqptIndexMapper
+{
+    /**
+     * 查询动力箱元器件指标
+     *
+     * @param id 动力箱元器件指标主键
+     * @return 动力箱元器件指标
+     */
+    public AdmEmsElecBoxEqptIndex selectAdmEmsElecBoxEqptIndexById(Long id);
+
+    /**
+     * 查询动力箱元器件指标列表
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 动力箱元器件指标集合
+     */
+    public List<AdmEmsElecBoxEqptIndex> selectAdmEmsElecBoxEqptIndexList(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+
+    List<AdmEmsElecBoxEqptIndex> selectAdmEmsElecBoxEqptLatestIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    /**
+     * 新增动力箱元器件指标
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecBoxEqptIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    /**
+     * 修改动力箱元器件指标
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecBoxEqptIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    /**
+     * 删除动力箱元器件指标
+     *
+     * @param id 动力箱元器件指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxEqptIndexById(Long id);
+
+    /**
+     * 批量删除动力箱元器件指标
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxEqptIndexByIds(Long[] ids);
+}

+ 63 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecBoxIndexMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
+
+/**
+ * 动力箱指标Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface AdmEmsElecBoxIndexMapper {
+    /**
+     * 查询动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 动力箱指标
+     */
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id);
+
+    AdmEmsElecBoxIndex selectElecBoxLatestIndexByBoxCode(String boxCode);
+
+    /**
+     * 查询动力箱指标列表
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 动力箱指标集合
+     */
+    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 新增动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 修改动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 删除动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexById(Long id);
+
+    /**
+     * 批量删除动力箱指标
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids);
+}

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

@@ -29,6 +29,11 @@ public interface MeterDeviceMapper {
      */
     MeterDevice selectMeterDeviceByCode(@Param("areaCode") String areaCode, @Param("deviceCode") String deviceCode);
 
+    MeterDevice selectMeterDeviceByObj(@Param("objType") int objType,
+        @Param("objSubType") int objSubType,
+        @Param("objCode") String objCode,
+        @Param("meterCls") int meterCls);
+
     /**
      * 查询计量设备列表
      *

+ 7 - 7
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterReadingManualMapper.java → ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterReadingMapper.java

@@ -2,7 +2,7 @@ package com.ruoyi.ems.mapper;
 
 import java.util.List;
 
-import com.ruoyi.ems.domain.MeterReadingManual;
+import com.ruoyi.ems.domain.MeterReading;
 import com.ruoyi.ems.domain.vo.QueryMeterReading;
 import org.apache.ibatis.annotations.Param;
 
@@ -12,14 +12,14 @@ import org.apache.ibatis.annotations.Param;
  * @author ruoyi
  * @date 2024-08-28
  */
-public interface MeterReadingManualMapper {
+public interface MeterReadingMapper {
     /**
      * 查询手动抄记录列表
      *
      * @param id   区域编码
      * @return 手动抄记录集合
      */
-    MeterReadingManual selectById(@Param("id") Long id);
+    MeterReading selectById(@Param("id") Long id);
 
     /**
      * 查询手动抄记录列表
@@ -28,7 +28,7 @@ public interface MeterReadingManualMapper {
      * @param deviceCode 设备编码
      * @return 手动抄记录集合
      */
-    MeterReadingManual selectLastItem(@Param("areaCode") String areaCode, @Param("deviceCode") String deviceCode);
+    MeterReading selectLastItem(@Param("areaCode") String areaCode, @Param("deviceCode") String deviceCode);
 
     /**
      * 查询手动抄记录列表
@@ -36,7 +36,7 @@ public interface MeterReadingManualMapper {
      * @param queryMeterReading 参数
      * @return 手动抄记录集合
      */
-    List<MeterReadingManual> selectList(QueryMeterReading queryMeterReading);
+    List<MeterReading> selectList(QueryMeterReading queryMeterReading);
 
     /**
      * 新增手动抄记录
@@ -44,7 +44,7 @@ public interface MeterReadingManualMapper {
      * @param meterReadingManual 手动抄记录
      * @return 结果
      */
-    int insert(MeterReadingManual meterReadingManual);
+    int insert(MeterReading meterReadingManual);
 
     /**
      * 修改手动抄记录
@@ -52,7 +52,7 @@ public interface MeterReadingManualMapper {
      * @param meterReadingManual 手动抄记录
      * @return 结果
      */
-    int update(MeterReadingManual meterReadingManual);
+    int update(MeterReading meterReadingManual);
 
     /**
      * 删除手动抄记录

+ 16 - 7
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/PowerBoxMapper.java

@@ -5,7 +5,7 @@ import com.ruoyi.ems.domain.PowerBox;
 
 /**
  * 动力箱柜Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2024-08-20
  */
@@ -13,7 +13,7 @@ public interface PowerBoxMapper
 {
     /**
      * 查询动力箱柜
-     * 
+     *
      * @param id 动力箱柜主键
      * @return 动力箱柜
      */
@@ -21,15 +21,24 @@ public interface PowerBoxMapper
 
     /**
      * 查询动力箱柜列表
-     * 
+     *
      * @param powerBox 动力箱柜
      * @return 动力箱柜集合
      */
      List<PowerBox> selectPowerBoxList(PowerBox powerBox);
 
     /**
+     * Select power box by code power box.
+     *
+     * @param boxCode the box code
+     * @return the power box
+     * @author chen.cheng
+     */
+    PowerBox selectPowerBoxByCode(String boxCode);
+
+    /**
      * 新增动力箱柜
-     * 
+     *
      * @param powerBox 动力箱柜
      * @return 结果
      */
@@ -37,7 +46,7 @@ public interface PowerBoxMapper
 
     /**
      * 修改动力箱柜
-     * 
+     *
      * @param powerBox 动力箱柜
      * @return 结果
      */
@@ -45,7 +54,7 @@ public interface PowerBoxMapper
 
     /**
      * 删除动力箱柜
-     * 
+     *
      * @param id 动力箱柜主键
      * @return 结果
      */
@@ -53,7 +62,7 @@ public interface PowerBoxMapper
 
     /**
      * 批量删除动力箱柜
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmBoxElecEqptService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmBoxElecEqpt;
+
+/**
+ * 动力箱柜电气设备Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface IAdmBoxElecEqptService 
+{
+    /**
+     * 查询动力箱柜电气设备
+     * 
+     * @param id 动力箱柜电气设备主键
+     * @return 动力箱柜电气设备
+     */
+    public AdmBoxElecEqpt selectAdmBoxElecEqptById(Long id);
+
+    /**
+     * 查询动力箱柜电气设备列表
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 动力箱柜电气设备集合
+     */
+    public List<AdmBoxElecEqpt> selectAdmBoxElecEqptList(AdmBoxElecEqpt admBoxElecEqpt);
+
+    /**
+     * 新增动力箱柜电气设备
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 结果
+     */
+    public int insertAdmBoxElecEqpt(AdmBoxElecEqpt admBoxElecEqpt);
+
+    /**
+     * 修改动力箱柜电气设备
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 结果
+     */
+    public int updateAdmBoxElecEqpt(AdmBoxElecEqpt admBoxElecEqpt);
+
+    /**
+     * 批量删除动力箱柜电气设备
+     * 
+     * @param ids 需要删除的动力箱柜电气设备主键集合
+     * @return 结果
+     */
+    public int deleteAdmBoxElecEqptByIds(Long[] ids);
+
+    /**
+     * 删除动力箱柜电气设备信息
+     * 
+     * @param id 动力箱柜电气设备主键
+     * @return 结果
+     */
+    public int deleteAdmBoxElecEqptById(Long id);
+}

+ 65 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsElecBoxEqptIndexService.java

@@ -0,0 +1,65 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex;
+
+/**
+ * 动力箱元器件指标Service接口
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface IAdmEmsElecBoxEqptIndexService
+{
+    /**
+     * 查询动力箱元器件指标
+     *
+     * @param id 动力箱元器件指标主键
+     * @return 动力箱元器件指标
+     */
+    public AdmEmsElecBoxEqptIndex selectAdmEmsElecBoxEqptIndexById(Long id);
+
+    /**
+     * 查询动力箱元器件指标列表
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 动力箱元器件指标集合
+     */
+    public List<AdmEmsElecBoxEqptIndex> selectAdmEmsElecBoxEqptIndexList(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    List<AdmEmsElecBoxEqptIndex> selectAdmEmsElecBoxEqptLatestIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    /**
+     * 新增动力箱元器件指标
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecBoxEqptIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    /**
+     * 修改动力箱元器件指标
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecBoxEqptIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex);
+
+    /**
+     * 批量删除动力箱元器件指标
+     *
+     * @param ids 需要删除的动力箱元器件指标主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxEqptIndexByIds(Long[] ids);
+
+    /**
+     * 删除动力箱元器件指标信息
+     *
+     * @param id 动力箱元器件指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxEqptIndexById(Long id);
+
+
+}

+ 65 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsElecBoxIndexService.java

@@ -0,0 +1,65 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
+
+/**
+ * 动力箱指标Service接口
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface IAdmEmsElecBoxIndexService {
+    /**
+     * 查询动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 动力箱指标
+     */
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id);
+
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexByBoxCode(String boxCode);
+
+    /**
+     * 查询动力箱指标列表
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 动力箱指标集合
+     */
+    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 新增动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 修改动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 批量删除动力箱指标
+     *
+     * @param ids 需要删除的动力箱指标主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids);
+
+    /**
+     * 删除动力箱指标信息
+     *
+     * @param id 动力箱指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexById(Long id);
+
+
+}

+ 34 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IChargingBillService.java

@@ -0,0 +1,34 @@
+/*
+ * 文 件 名:  IChargingBillService
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/9/2
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.service;
+
+import com.ruoyi.ems.domain.ChargingBill;
+import com.ruoyi.ems.domain.vo.QueryChargingBill;
+
+import java.util.List;
+
+/**
+ * 计费账单服务
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/9/2]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public interface IChargingBillService {
+    /**
+     * 查询计费账单列表
+     * @param queryParam 查询参数
+     * @return 返回列表
+     */
+    List<ChargingBill> selectChargingBillList(QueryChargingBill queryParam);
+}

+ 8 - 8
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterReadingManualService.java → ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterReadingService.java

@@ -1,19 +1,19 @@
 package com.ruoyi.ems.service;
 
-import com.ruoyi.ems.domain.MeterReadingManual;
+import com.ruoyi.ems.domain.MeterReading;
 import com.ruoyi.ems.domain.vo.QueryMeterReading;
 
 import java.util.List;
 
 /**
- * 手动抄记录Service接口
+ * 抄记录Service接口
  * 
  * @author ruoyi
  * @date 2024-08-28
  */
-public interface IMeterReadingManualService
+public interface IMeterReadingService
 {
-    MeterReadingManual selectById(Long id);
+    MeterReading selectById(Long id);
 
     /**
      * 查询手动抄记录列表
@@ -22,7 +22,7 @@ public interface IMeterReadingManualService
      * @param deviceCode 设备编码
      * @return 手动抄记录集合
      */
-    MeterReadingManual selectLastItem(String areaCode, String deviceCode);
+    MeterReading selectLastItem(String areaCode, String deviceCode);
 
     /**
      * 查询手动抄记录列表
@@ -30,7 +30,7 @@ public interface IMeterReadingManualService
      * @param queryMeterReading 查询条件参数
      * @return 手动抄记录集合
      */
-    List<MeterReadingManual> selectList(QueryMeterReading queryMeterReading);
+    List<MeterReading> selectList(QueryMeterReading queryMeterReading);
 
     /**
      * 新增手动抄记录
@@ -38,7 +38,7 @@ public interface IMeterReadingManualService
      * @param meterReadingManual 手动抄记录
      * @return 结果
      */
-    int insert(MeterReadingManual meterReadingManual);
+    int insert(MeterReading meterReadingManual);
 
     /**
      * 修改手动抄记录
@@ -46,7 +46,7 @@ public interface IMeterReadingManualService
      * @param meterReadingManual 手动抄记录
      * @return 结果
      */
-    int update(MeterReadingManual meterReadingManual);
+    int update(MeterReading meterReadingManual);
 
     /**
      * 删除手动抄记录

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

@@ -0,0 +1,93 @@
+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.AdmBoxElecEqptMapper;
+import com.ruoyi.ems.domain.AdmBoxElecEqpt;
+import com.ruoyi.ems.service.IAdmBoxElecEqptService;
+
+/**
+ * 动力箱柜电气设备Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@Service
+public class AdmBoxElecEqptServiceImpl implements IAdmBoxElecEqptService 
+{
+    @Autowired
+    private AdmBoxElecEqptMapper admBoxElecEqptMapper;
+
+    /**
+     * 查询动力箱柜电气设备
+     * 
+     * @param id 动力箱柜电气设备主键
+     * @return 动力箱柜电气设备
+     */
+    @Override
+    public AdmBoxElecEqpt selectAdmBoxElecEqptById(Long id)
+    {
+        return admBoxElecEqptMapper.selectAdmBoxElecEqptById(id);
+    }
+
+    /**
+     * 查询动力箱柜电气设备列表
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 动力箱柜电气设备
+     */
+    @Override
+    public List<AdmBoxElecEqpt> selectAdmBoxElecEqptList(AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        return admBoxElecEqptMapper.selectAdmBoxElecEqptList(admBoxElecEqpt);
+    }
+
+    /**
+     * 新增动力箱柜电气设备
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 结果
+     */
+    @Override
+    public int insertAdmBoxElecEqpt(AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        return admBoxElecEqptMapper.insertAdmBoxElecEqpt(admBoxElecEqpt);
+    }
+
+    /**
+     * 修改动力箱柜电气设备
+     * 
+     * @param admBoxElecEqpt 动力箱柜电气设备
+     * @return 结果
+     */
+    @Override
+    public int updateAdmBoxElecEqpt(AdmBoxElecEqpt admBoxElecEqpt)
+    {
+        return admBoxElecEqptMapper.updateAdmBoxElecEqpt(admBoxElecEqpt);
+    }
+
+    /**
+     * 批量删除动力箱柜电气设备
+     * 
+     * @param ids 需要删除的动力箱柜电气设备主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmBoxElecEqptByIds(Long[] ids)
+    {
+        return admBoxElecEqptMapper.deleteAdmBoxElecEqptByIds(ids);
+    }
+
+    /**
+     * 删除动力箱柜电气设备信息
+     * 
+     * @param id 动力箱柜电气设备主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmBoxElecEqptById(Long id)
+    {
+        return admBoxElecEqptMapper.deleteAdmBoxElecEqptById(id);
+    }
+}

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

@@ -0,0 +1,94 @@
+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.domain.AdmEmsElecBoxEqptIndex;
+import com.ruoyi.ems.mapper.AdmEmsElecBoxEqptIndexMapper;
+import com.ruoyi.ems.service.IAdmEmsElecBoxEqptIndexService;
+
+/**
+ * 动力箱元器件指标Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@Service
+public class AdmEmsElecBoxEqptIndexServiceImpl implements IAdmEmsElecBoxEqptIndexService {
+    @Autowired
+    private AdmEmsElecBoxEqptIndexMapper admEmsElecBoxEqptIndexMapper;
+
+    /**
+     * 查询动力箱元器件指标
+     *
+     * @param id 动力箱元器件指标主键
+     * @return 动力箱元器件指标
+     */
+    @Override
+    public AdmEmsElecBoxEqptIndex selectAdmEmsElecBoxEqptIndexById(Long id) {
+        return admEmsElecBoxEqptIndexMapper.selectAdmEmsElecBoxEqptIndexById(id);
+    }
+
+    /**
+     * 查询动力箱元器件指标列表
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 动力箱元器件指标
+     */
+    @Override
+    public List<AdmEmsElecBoxEqptIndex> selectAdmEmsElecBoxEqptIndexList(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        return admEmsElecBoxEqptIndexMapper.selectAdmEmsElecBoxEqptIndexList(admEmsElecBoxEqptIndex);
+    }
+
+
+    @Override
+    public List<AdmEmsElecBoxEqptIndex> selectAdmEmsElecBoxEqptLatestIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        return admEmsElecBoxEqptIndexMapper.selectAdmEmsElecBoxEqptLatestIndex(admEmsElecBoxEqptIndex);
+    }
+
+    /**
+     * 新增动力箱元器件指标
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 结果
+     */
+    @Override
+    public int insertAdmEmsElecBoxEqptIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        return admEmsElecBoxEqptIndexMapper.insertAdmEmsElecBoxEqptIndex(admEmsElecBoxEqptIndex);
+    }
+
+    /**
+     * 修改动力箱元器件指标
+     *
+     * @param admEmsElecBoxEqptIndex 动力箱元器件指标
+     * @return 结果
+     */
+    @Override
+    public int updateAdmEmsElecBoxEqptIndex(AdmEmsElecBoxEqptIndex admEmsElecBoxEqptIndex) {
+        return admEmsElecBoxEqptIndexMapper.updateAdmEmsElecBoxEqptIndex(admEmsElecBoxEqptIndex);
+    }
+
+    /**
+     * 批量删除动力箱元器件指标
+     *
+     * @param ids 需要删除的动力箱元器件指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecBoxEqptIndexByIds(Long[] ids) {
+        return admEmsElecBoxEqptIndexMapper.deleteAdmEmsElecBoxEqptIndexByIds(ids);
+    }
+
+    /**
+     * 删除动力箱元器件指标信息
+     *
+     * @param id 动力箱元器件指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecBoxEqptIndexById(Long id) {
+        return admEmsElecBoxEqptIndexMapper.deleteAdmEmsElecBoxEqptIndexById(id);
+    }
+}

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

@@ -0,0 +1,93 @@
+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.domain.AdmEmsElecBoxIndex;
+import com.ruoyi.ems.mapper.AdmEmsElecBoxIndexMapper;
+import com.ruoyi.ems.service.IAdmEmsElecBoxIndexService;
+
+/**
+ * 动力箱指标Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@Service
+public class AdmEmsElecBoxIndexServiceImpl implements IAdmEmsElecBoxIndexService {
+    @Autowired
+    private AdmEmsElecBoxIndexMapper admEmsElecBoxIndexMapper;
+
+    /**
+     * 查询动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 动力箱指标
+     */
+    @Override
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id) {
+        return admEmsElecBoxIndexMapper.selectAdmEmsElecBoxIndexById(id);
+    }
+
+    @Override
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexByBoxCode(String boxCode) {
+        return admEmsElecBoxIndexMapper.selectElecBoxLatestIndexByBoxCode(boxCode);
+    }
+
+    /**
+     * 查询动力箱指标列表
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 动力箱指标
+     */
+    @Override
+    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return admEmsElecBoxIndexMapper.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
+    }
+
+    /**
+     * 新增动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    @Override
+    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return admEmsElecBoxIndexMapper.insertAdmEmsElecBoxIndex(admEmsElecBoxIndex);
+    }
+
+    /**
+     * 修改动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    @Override
+    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return admEmsElecBoxIndexMapper.updateAdmEmsElecBoxIndex(admEmsElecBoxIndex);
+    }
+
+    /**
+     * 批量删除动力箱指标
+     *
+     * @param ids 需要删除的动力箱指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids) {
+        return admEmsElecBoxIndexMapper.deleteAdmEmsElecBoxIndexByIds(ids);
+    }
+
+    /**
+     * 删除动力箱指标信息
+     *
+     * @param id 动力箱指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecBoxIndexById(Long id) {
+        return admEmsElecBoxIndexMapper.deleteAdmEmsElecBoxIndexById(id);
+    }
+}

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

@@ -15,11 +15,13 @@ import com.ruoyi.ems.domain.Area;
 import com.ruoyi.ems.domain.AreaBuildingZoning;
 import com.ruoyi.ems.domain.EmsDevice;
 import com.ruoyi.ems.domain.EmsFacs;
+import com.ruoyi.ems.domain.PowerBox;
 import com.ruoyi.ems.mapper.AdmOpAlarmMapper;
 import com.ruoyi.ems.mapper.AreaBuildingZoningMapper;
 import com.ruoyi.ems.mapper.AreaMapper;
 import com.ruoyi.ems.mapper.EmsDeviceMapper;
 import com.ruoyi.ems.mapper.EmsFacsMapper;
+import com.ruoyi.ems.mapper.PowerBoxMapper;
 import com.ruoyi.ems.service.IAdmOpAlarmService;
 
 /**
@@ -45,6 +47,9 @@ public class AdmOpAlarmServiceImpl implements IAdmOpAlarmService {
     @Autowired
     private EmsDeviceMapper emsDeviceMapper;
 
+    @Autowired
+    private PowerBoxMapper powerBoxMapper;
+
     /**
      * 查询能源设施告警
      *
@@ -183,6 +188,13 @@ public class AdmOpAlarmServiceImpl implements IAdmOpAlarmService {
             }
             return emsDevice.getDeviceName();
         }
+        if (ObjType.POWER_BOX.getCode().equals(objType)) {
+            PowerBox powerBox = powerBoxMapper.selectPowerBoxByCode(objCode);
+            if (ObjectUtils.isEmpty(powerBox)) {
+                return StringUtils.EMPTY;
+            }
+            return String.format("%s(%s)", powerBox.getLocation(), powerBox.getAreaName());
+        }
         return StringUtils.EMPTY;
     }
 }

+ 4 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AreaServiceImpl.java

@@ -204,8 +204,10 @@ public class AreaServiceImpl implements IAreaService {
                     }
                 }
 
-                area.setChildren(buildings);
-                retList.add(area);
+                if (CollectionUtils.isNotEmpty(buildings)) {
+                    area.setChildren(buildings);
+                    retList.add(area);
+                }
             }
         }
 

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

@@ -0,0 +1,91 @@
+/*
+ * 文 件 名:  ChargingBillServiceImpl
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/9/2
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.service.impl;
+
+import com.ruoyi.ems.domain.ChargingBill;
+import com.ruoyi.ems.domain.MeterDevice;
+import com.ruoyi.ems.domain.MeterReading;
+import com.ruoyi.ems.domain.common.MeterObjSubType;
+import com.ruoyi.ems.domain.common.MeterObjType;
+import com.ruoyi.ems.domain.vo.QueryChargingBill;
+import com.ruoyi.ems.domain.vo.QueryMeterReading;
+import com.ruoyi.ems.mapper.MeterDeviceMapper;
+import com.ruoyi.ems.mapper.MeterReadingMapper;
+import com.ruoyi.ems.service.IChargingBillService;
+import com.ruoyi.ems.util.exception.BusinessException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 账单服务接口
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/9/2]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Service
+public class ChargingBillServiceImpl implements IChargingBillService {
+
+    @Autowired
+    private MeterReadingMapper meterReadingMapper;
+
+    @Autowired
+    private MeterDeviceMapper meterDeviceMapper;
+
+    @Override
+    public List<ChargingBill> selectChargingBillList(QueryChargingBill queryParam) {
+        List<ChargingBill> retList = new ArrayList<>();
+
+        try {
+            // 查询计量设备
+            int objType = MeterObjType.METER_ABZ.getType();
+            int objSubType = MeterObjSubType.getByTier(queryParam.getTier()).getType();
+            MeterDevice meterDevice = meterDeviceMapper.selectMeterDeviceByObj(objType, objSubType,
+                queryParam.getAreaCode(), queryParam.getMeterCls());
+
+            if (null != meterDevice) {
+                QueryMeterReading recParam = new QueryMeterReading();
+                recParam.setAreaCode(meterDevice.getAreaCode());
+                recParam.setDeviceCode(meterDevice.getDeviceCode());
+                recParam.setStartMonth(queryParam.getStartTime());
+                recParam.setEndMonth(queryParam.getEndTime());
+
+                List<MeterReading> recList = meterReadingMapper.selectList(recParam);
+                retList = convertToChargingBill(recList);
+            }
+        }
+        catch (BusinessException e) {
+            throw e;
+        }
+        catch (Exception e) {
+            throw new BusinessException(-1, "查询账单失败", e);
+        }
+
+        return retList;
+    }
+
+    private List<ChargingBill> convertToChargingBill(List<MeterReading> recList) {
+        List<ChargingBill> retList = new ArrayList<>();
+
+        for (MeterReading rec : recList) {
+            ChargingBill bill = new ChargingBill();
+
+            retList.add(bill);
+        }
+
+        return retList;
+    }
+}

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

@@ -1,52 +0,0 @@
-package com.ruoyi.ems.service.impl;
-
-import com.ruoyi.ems.domain.MeterReadingManual;
-import com.ruoyi.ems.domain.vo.QueryMeterReading;
-import com.ruoyi.ems.mapper.MeterReadingManualMapper;
-import com.ruoyi.ems.service.IMeterReadingManualService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 手动抄记录Service业务层处理
- *
- * @author ruoyi
- * @date 2024-08-28
- */
-@Service
-public class MeterReadingManualServiceImpl implements IMeterReadingManualService {
-    @Autowired
-    private MeterReadingManualMapper meterReadingManualMapper;
-
-    @Override
-    public MeterReadingManual selectById(Long id) {
-        return meterReadingManualMapper.selectById(id);
-    }
-
-    @Override
-    public MeterReadingManual selectLastItem(String areaCode, String deviceCode) {
-        return meterReadingManualMapper.selectLastItem(areaCode, deviceCode);
-    }
-
-    @Override
-    public List<MeterReadingManual> selectList(QueryMeterReading queryMeterReading) {
-        return meterReadingManualMapper.selectList(queryMeterReading);
-    }
-
-    @Override
-    public int insert(MeterReadingManual meterReadingManual) {
-        return meterReadingManualMapper.insert(meterReadingManual);
-    }
-
-    @Override
-    public int update(MeterReadingManual meterReadingManual) {
-        return meterReadingManualMapper.update(meterReadingManual);
-    }
-
-    @Override
-    public int deleteById(Long id) {
-        return meterReadingManualMapper.deleteById(id);
-    }
-}

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

@@ -0,0 +1,52 @@
+package com.ruoyi.ems.service.impl;
+
+import com.ruoyi.ems.domain.MeterReading;
+import com.ruoyi.ems.domain.vo.QueryMeterReading;
+import com.ruoyi.ems.mapper.MeterReadingMapper;
+import com.ruoyi.ems.service.IMeterReadingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 手动抄记录Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-08-28
+ */
+@Service
+public class MeterReadingServiceImpl implements IMeterReadingService {
+    @Autowired
+    private MeterReadingMapper meterReadingMapper;
+
+    @Override
+    public MeterReading selectById(Long id) {
+        return meterReadingMapper.selectById(id);
+    }
+
+    @Override
+    public MeterReading selectLastItem(String areaCode, String deviceCode) {
+        return meterReadingMapper.selectLastItem(areaCode, deviceCode);
+    }
+
+    @Override
+    public List<MeterReading> selectList(QueryMeterReading queryMeterReading) {
+        return meterReadingMapper.selectList(queryMeterReading);
+    }
+
+    @Override
+    public int insert(MeterReading meterReadingManual) {
+        return meterReadingMapper.insert(meterReadingManual);
+    }
+
+    @Override
+    public int update(MeterReading meterReadingManual) {
+        return meterReadingMapper.update(meterReadingManual);
+    }
+
+    @Override
+    public int deleteById(Long id) {
+        return meterReadingMapper.deleteById(id);
+    }
+}

+ 94 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmBoxElecEqptMapper.xml

@@ -0,0 +1,94 @@
+<?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.AdmBoxElecEqptMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmBoxElecEqpt" id="AdmBoxElecEqptResult">
+        <result property="id"    column="id"    />
+        <result property="boxCode"    column="box_code"    />
+        <result property="eqptCode"    column="eqpt_code"    />
+        <result property="extEqptCode"    column="ext_eqpt_code"    />
+        <result property="eqptType"    column="eqpt_type"    />
+        <result property="eqptSpec"    column="eqpt_spec"    />
+        <result property="ratedVoltage"    column="rated_voltage"    />
+        <result property="ratedCurrent"    column="rated_current"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="parentEqpt"    column="parent_eqpt"    />
+        <result property="subCircuit"    column="sub_circuit"    />
+    </resultMap>
+
+    <sql id="selectAdmBoxElecEqptVo">
+        select id, box_code, eqpt_code, ext_eqpt_code, eqpt_type, eqpt_spec, rated_voltage, rated_current, ancestors, parent_eqpt, sub_circuit from adm_box_elec_eqpt
+    </sql>
+
+    <select id="selectAdmBoxElecEqptList" parameterType="com.ruoyi.ems.domain.AdmBoxElecEqpt" resultMap="AdmBoxElecEqptResult">
+        <include refid="selectAdmBoxElecEqptVo"/>
+        <where>
+            <if test="boxCode != null  and boxCode != ''"> and box_code = #{boxCode}</if>
+            <if test="eqptCode != null  and eqptCode != ''"> and eqpt_code = #{eqptCode}</if>
+        </where>
+    </select>
+
+
+    <select id="selectAdmBoxElecEqptById" parameterType="Long" resultMap="AdmBoxElecEqptResult">
+        <include refid="selectAdmBoxElecEqptVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmBoxElecEqpt" parameterType="com.ruoyi.ems.domain.AdmBoxElecEqpt" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_box_elec_eqpt
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code,</if>
+            <if test="eqptCode != null and eqptCode != ''">eqpt_code,</if>
+            <if test="extEqptCode != null">ext_eqpt_code,</if>
+            <if test="eqptType != null">eqpt_type,</if>
+            <if test="eqptSpec != null">eqpt_spec,</if>
+            <if test="ratedVoltage != null">rated_voltage,</if>
+            <if test="ratedCurrent != null">rated_current,</if>
+            <if test="ancestors != null">ancestors,</if>
+            <if test="parentEqpt != null">parent_eqpt,</if>
+            <if test="subCircuit != null">sub_circuit,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">#{boxCode},</if>
+            <if test="eqptCode != null and eqptCode != ''">#{eqptCode},</if>
+            <if test="extEqptCode != null">#{extEqptCode},</if>
+            <if test="eqptType != null">#{eqptType},</if>
+            <if test="eqptSpec != null">#{eqptSpec},</if>
+            <if test="ratedVoltage != null">#{ratedVoltage},</if>
+            <if test="ratedCurrent != null">#{ratedCurrent},</if>
+            <if test="ancestors != null">#{ancestors},</if>
+            <if test="parentEqpt != null">#{parentEqpt},</if>
+            <if test="subCircuit != null">#{subCircuit},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAdmBoxElecEqpt" parameterType="com.ruoyi.ems.domain.AdmBoxElecEqpt">
+        update adm_box_elec_eqpt
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code = #{boxCode},</if>
+            <if test="eqptCode != null and eqptCode != ''">eqpt_code = #{eqptCode},</if>
+            <if test="extEqptCode != null">ext_eqpt_code = #{extEqptCode},</if>
+            <if test="eqptType != null">eqpt_type = #{eqptType},</if>
+            <if test="eqptSpec != null">eqpt_spec = #{eqptSpec},</if>
+            <if test="ratedVoltage != null">rated_voltage = #{ratedVoltage},</if>
+            <if test="ratedCurrent != null">rated_current = #{ratedCurrent},</if>
+            <if test="ancestors != null">ancestors = #{ancestors},</if>
+            <if test="parentEqpt != null">parent_eqpt = #{parentEqpt},</if>
+            <if test="subCircuit != null">sub_circuit = #{subCircuit},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmBoxElecEqptById" parameterType="Long">
+        delete from adm_box_elec_eqpt where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmBoxElecEqptByIds" parameterType="String">
+        delete from adm_box_elec_eqpt where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 108 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxEqptIndexMapper.xml

@@ -0,0 +1,108 @@
+<?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.AdmEmsElecBoxEqptIndexMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex" id="AdmEmsElecBoxEqptIndexResult">
+        <result property="id" column="id"/>
+        <result property="boxCode" column="box_code"/>
+        <result property="eqptCode" column="eqpt_code"/>
+        <result property="areaCode" column="area_code"/>
+        <result property="date" column="date"/>
+        <result property="time" column="time"/>
+        <result property="voltage" column="voltage"/>
+        <result property="current" column="current"/>
+        <result property="power" column="power"/>
+        <result property="eqptSpec" column="eqpt_spec"/>
+    </resultMap>
+
+    <select id="selectAdmEmsElecBoxEqptLatestIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex"
+            resultMap="AdmEmsElecBoxEqptIndexResult">
+        WITH rowIndex AS (SELECT *, ROW_NUMBER() over ( PARTITION BY eqpt_code ORDER BY TIME DESC ) AS rowNum
+                          FROM `adm_ems_elec_box_eqpt_index`
+                          WHERE box_code = #{boxCode})
+        SELECT
+            latestIndex.*,
+            elecEqpt.eqpt_spec
+        FROM
+            rowIndex latestIndex
+                INNER JOIN adm_box_elec_eqpt elecEqpt ON latestIndex.eqpt_code = elecEqpt.eqpt_code
+        WHERE
+            rowNum =1
+    </select>
+
+
+    <select id="selectAdmEmsElecBoxEqptIndexList" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex"
+            resultMap="AdmEmsElecBoxEqptIndexResult">
+        <include refid="selectAdmEmsElecBoxEqptIndexVo"/>
+        <where>
+            <if test="boxCode != null  and boxCode != ''">and box_code = #{boxCode}</if>
+            <if test="eqptCode != null  and eqptCode != ''">and eqpt_code = #{eqptCode}</if>
+            <if test="areaCode != null  and areaCode != ''">and area_code = #{areaCode}</if>
+        </where>
+    </select>
+
+    <sql id="selectAdmEmsElecBoxEqptIndexVo">
+        select id, box_code, eqpt_code, area_code, date, time, voltage, current, power
+        from adm_ems_elec_box_eqpt_index
+    </sql>
+
+    <select id="selectAdmEmsElecBoxEqptIndexById" parameterType="Long" resultMap="AdmEmsElecBoxEqptIndexResult">
+        <include refid="selectAdmEmsElecBoxEqptIndexVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmEmsElecBoxEqptIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into adm_ems_elec_box_eqpt_index
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code,</if>
+            <if test="eqptCode != null and eqptCode != ''">eqpt_code,</if>
+            <if test="areaCode != null and areaCode != ''">area_code,</if>
+            <if test="date != null">date,</if>
+            <if test="time != null">time,</if>
+            <if test="voltage != null">voltage,</if>
+            <if test="current != null">current,</if>
+            <if test="power != null">power,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">#{boxCode},</if>
+            <if test="eqptCode != null and eqptCode != ''">#{eqptCode},</if>
+            <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
+            <if test="date != null">#{date},</if>
+            <if test="time != null">#{time},</if>
+            <if test="voltage != null">#{voltage},</if>
+            <if test="current != null">#{current},</if>
+            <if test="power != null">#{power},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmEmsElecBoxEqptIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxEqptIndex">
+        update adm_ems_elec_box_eqpt_index
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code = #{boxCode},</if>
+            <if test="eqptCode != null and eqptCode != ''">eqpt_code = #{eqptCode},</if>
+            <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
+            <if test="date != null">date = #{date},</if>
+            <if test="time != null">time = #{time},</if>
+            <if test="voltage != null">voltage = #{voltage},</if>
+            <if test="current != null">current = #{current},</if>
+            <if test="power != null">power = #{power},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmEmsElecBoxEqptIndexById" parameterType="Long">
+        delete
+        from adm_ems_elec_box_eqpt_index
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmEmsElecBoxEqptIndexByIds" parameterType="String">
+        delete from adm_ems_elec_box_eqpt_index where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 119 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxIndexMapper.xml

@@ -0,0 +1,119 @@
+<?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.AdmEmsElecBoxIndexMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmEmsElecBoxIndex" id="AdmEmsElecBoxIndexResult">
+        <result property="id" column="id"/>
+        <result property="boxCode" column="box_code"/>
+        <result property="boxType" column="box_type"/>
+        <result property="areaCode" column="area_code"/>
+        <result property="date" column="date"/>
+        <result property="time" column="time"/>
+        <result property="voltageA" column="voltage_a"/>
+        <result property="voltageB" column="voltage_b"/>
+        <result property="voltageC" column="voltage_c"/>
+        <result property="electricityA" column="electricity_a"/>
+        <result property="electricityB" column="electricity_b"/>
+        <result property="electricityC" column="electricity_c"/>
+        <result property="power" column="power"/>
+    </resultMap>
+
+    <sql id="selectAdmEmsElecBoxIndexVo">
+        select id,
+               box_code,
+               box_type,
+               area_code, date, time, voltage_a, voltage_b, voltage_c, electricity_a, electricity_b, electricity_c, power
+        from adm_ems_elec_box_index
+    </sql>
+
+    <select id="selectAdmEmsElecBoxIndexList" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex"
+            resultMap="AdmEmsElecBoxIndexResult">
+        <include refid="selectAdmEmsElecBoxIndexVo"/>
+        <where>
+            <if test="boxCode != null  and boxCode != ''">and box_code = #{boxCode}</if>
+            <if test="boxType != null ">and box_type = #{boxType}</if>
+            <if test="areaCode != null  and areaCode != ''">and area_code = #{areaCode}</if>
+        </where>
+    </select>
+
+    <select id="selectAdmEmsElecBoxIndexById" parameterType="Long" resultMap="AdmEmsElecBoxIndexResult">
+        <include refid="selectAdmEmsElecBoxIndexVo"/>
+        where id = #{id}
+    </select>
+    <select id="selectElecBoxLatestIndexByBoxCode" parameterType="String"
+            resultType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex">
+        WITH rowIndex AS (SELECT *, ROW_NUMBER() over ( PARTITION BY box_code ORDER BY TIME DESC ) AS rowNum
+                          FROM adm_ems_elec_box_index
+                          WHERE box_code = #{boxCode})
+        SELECT *
+        FROM rowIndex latestIndex
+        WHERE rowNum = 1
+    </select>
+
+    <insert id="insertAdmEmsElecBoxIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into adm_ems_elec_box_index
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code,</if>
+            <if test="boxType != null">box_type,</if>
+            <if test="areaCode != null and areaCode != ''">area_code,</if>
+            <if test="date != null">date,</if>
+            <if test="time != null">time,</if>
+            <if test="voltageA != null">voltage_a,</if>
+            <if test="voltageB != null">voltage_b,</if>
+            <if test="voltageC != null">voltage_c,</if>
+            <if test="electricityA != null">electricity_a,</if>
+            <if test="electricityB != null">electricity_b,</if>
+            <if test="electricityC != null">electricity_c,</if>
+            <if test="power != null">power,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">#{boxCode},</if>
+            <if test="boxType != null">#{boxType},</if>
+            <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
+            <if test="date != null">#{date},</if>
+            <if test="time != null">#{time},</if>
+            <if test="voltageA != null">#{voltageA},</if>
+            <if test="voltageB != null">#{voltageB},</if>
+            <if test="voltageC != null">#{voltageC},</if>
+            <if test="electricityA != null">#{electricityA},</if>
+            <if test="electricityB != null">#{electricityB},</if>
+            <if test="electricityC != null">#{electricityC},</if>
+            <if test="power != null">#{power},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmEmsElecBoxIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex">
+        update adm_ems_elec_box_index
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code = #{boxCode},</if>
+            <if test="boxType != null">box_type = #{boxType},</if>
+            <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
+            <if test="date != null">date = #{date},</if>
+            <if test="time != null">time = #{time},</if>
+            <if test="voltageA != null">voltage_a = #{voltageA},</if>
+            <if test="voltageB != null">voltage_b = #{voltageB},</if>
+            <if test="voltageC != null">voltage_c = #{voltageC},</if>
+            <if test="electricityA != null">electricity_a = #{electricityA},</if>
+            <if test="electricityB != null">electricity_b = #{electricityB},</if>
+            <if test="electricityC != null">electricity_c = #{electricityC},</if>
+            <if test="power != null">power = #{power},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmEmsElecBoxIndexById" parameterType="Long">
+        delete
+        from adm_ems_elec_box_index
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmEmsElecBoxIndexByIds" parameterType="String">
+        delete from adm_ems_elec_box_index where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

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

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="code != null and code != ''">code,</if>
             <if test="name != null and name != ''">name,</if>
-            <if test="desc != null">desc,</if>
+            <if test="desc != null">`desc`,</if>
             <if test="version != null">version,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">

+ 5 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterDeviceMapper.xml

@@ -49,6 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectMeterDeviceVo"/>
         where area_code = #{areaCode} and device_code = #{deviceCode}
     </select>
+
+    <select id="selectMeterDeviceByObj"  resultMap="meterDeviceResult">
+        <include refid="selectMeterDeviceVo"/>
+        where obj_type = #{objType} and obj_sub_type = #{objSubType} and obj_code = #{objCode} and meter_cls = #{meterCls}
+    </select>
         
     <insert id="insertMeterDevice" parameterType="com.ruoyi.ems.domain.MeterDevice" useGeneratedKeys="true" keyProperty="id">
         insert into adm_meter_device

+ 8 - 8
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterReadingManualMapper.xml → ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterReadingMapper.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.ems.mapper.MeterReadingManualMapper">
+<mapper namespace="com.ruoyi.ems.mapper.MeterReadingMapper">
     
-    <resultMap type="com.ruoyi.ems.domain.MeterReadingManual" id="MeterReadingManualResult">
+    <resultMap type="com.ruoyi.ems.domain.MeterReading" id="MeterReadingManualResult">
         <result property="id"    column="id"    />
         <result property="deviceCode"    column="device_code"    />
         <result property="areaCode"    column="area_code"    />
@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMeterReadingManualVo">
-        select id, device_code, area_code, `year`, meter_month, last_reading, last_time, meter_reading, meter_time, increase, create_time, update_time from adm_meter_reading_manual
+        select id, device_code, area_code, `year`, meter_month, last_reading, last_time, meter_reading, meter_time, increase, create_time, update_time from adm_meter_reading
     </sql>
 
     <select id="selectById"  parameterType="Long" resultMap="MeterReadingManualResult">
@@ -48,8 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY meter_month ${orderFlag}
     </select>
 
-    <insert id="insert" parameterType="com.ruoyi.ems.domain.MeterReadingManual" useGeneratedKeys="true" keyProperty="id">
-        insert into adm_meter_reading_manual
+    <insert id="insert" parameterType="com.ruoyi.ems.domain.MeterReading" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_meter_reading
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="deviceCode != null and deviceCode != ''">device_code,</if>
             <if test="areaCode != null and areaCode != ''">area_code,</if>
@@ -78,8 +78,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
     </insert>
 
-    <update id="update" parameterType="com.ruoyi.ems.domain.MeterReadingManual">
-        update adm_meter_reading_manual
+    <update id="update" parameterType="com.ruoyi.ems.domain.MeterReading">
+        update adm_meter_reading
         <trim prefix="SET" suffixOverrides=",">
             <if test="meterReading != null">meter_reading = #{meterReading},</if>
             <if test="meterTime != null">meter_time = #{meterTime},</if>
@@ -89,6 +89,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteById" parameterType="Long">
-        delete from adm_meter_reading_manual where id = #{id}
+        delete from adm_meter_reading where id = #{id}
     </delete>
 </mapper>

+ 13 - 8
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/PowerBoxElecEqptMapper.xml

@@ -15,13 +15,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="eqptSpec"     column="eqpt_spec"    />
         <result property="ratedVoltage" column="rated_voltage"    />
         <result property="ratedCurrent" column="rated_current"    />
+        <result property="ancestors"     column="ancestors"    />
         <result property="parentEqpt"   column="parent_eqpt"    />
-        <result property="meterDevice"  column="meter_device"    />
+        <result property="subCircuit"  column="sub_circuit"    />
     </resultMap>
 
     <sql id="selectBoxElecEqptVo">
         select
-            bee.id, bee.box_code, bee.eqpt_code, bee.ext_eqpt_code, bee.eqpt_type, bet.type_name as eqpt_name, bee.eqpt_spec, bee.rated_voltage, bee.rated_current, bee.parent_eqpt, bee.meter_device
+            bee.id, bee.box_code, bee.eqpt_code, bee.ext_eqpt_code, bee.eqpt_type, bet.type_name as eqpt_name, bee.eqpt_spec, bee.rated_voltage, bee.rated_current, bee.ancestors, bee.parent_eqpt, bee.sub_circuit
         from adm_box_elec_eqpt bee
             LEFT JOIN dim_box_eleceqpt_type bet ON bee.eqpt_type = bet.type_code
     </sql>
@@ -36,8 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="eqptSpec != null  and eqptSpec != ''"> and bee.eqpt_spec = #{eqptSpec}</if>
             <if test="ratedVoltage != null "> and bee.rated_voltage = #{ratedVoltage}</if>
             <if test="ratedCurrent != null "> and bee.rated_current = #{ratedCurrent}</if>
+            <if test="ancestors != null and ancestors != ''"> and bee.ancestors = #{ancestors}</if>
             <if test="parentEqpt != null  and parentEqpt != ''"> and bee.parent_eqpt = #{parentEqpt}</if>
-            <if test="meterDevice != null  and meterDevice != ''"> and bee.meter_device = #{meterDevice}</if>
+            <if test="subCircuit != null  and subCircuit != ''"> and bee.sub_circuit = #{subCircuit}</if>
         </where>
     </select>
 
@@ -61,8 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="eqptSpec != null">eqpt_spec,</if>
             <if test="ratedVoltage != null">rated_voltage,</if>
             <if test="ratedCurrent != null">rated_current,</if>
+            <if test="ancestors != null ">ancestors</if>
             <if test="parentEqpt != null">parent_eqpt,</if>
-            <if test="meterDevice != null">meter_device,</if>
+            <if test="subCircuit != null">sub_circuit,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="boxCode != null and boxCode != ''">#{boxCode},</if>
@@ -72,16 +75,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="eqptSpec != null">#{eqptSpec},</if>
             <if test="ratedVoltage != null">#{ratedVoltage},</if>
             <if test="ratedCurrent != null">#{ratedCurrent},</if>
+            <if test="ancestors != null ">#{ancestors},</if>
             <if test="parentEqpt != null">#{parentEqpt},</if>
-            <if test="meterDevice != null">#{meterDevice},</if>
+            <if test="subCircuit != null">#{subCircuit},</if>
          </trim>
     </insert>
 
     <insert id="insertBatch" parameterType="java.util.List" >
-        insert into adm_box_elec_eqpt (box_code, eqpt_code, ext_eqpt_code, eqpt_type, eqpt_spec, rated_voltage, rated_current, parent_eqpt, meter_device)
+        insert into adm_box_elec_eqpt (box_code, eqpt_code, ext_eqpt_code, eqpt_type, eqpt_spec, rated_voltage, rated_current, ancestors, parent_eqpt, sub_circuit)
         values
         <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.boxCode}, #{item.eqptCode}, #{item.extEqptCode}, #{item.eqptType}, #{item.eqptSpec}, #{item.ratedVoltage}, #{item.ratedCurrent}, #{item.parentEqpt}, #{item.meterDevice})
+            (#{item.boxCode}, #{item.eqptCode}, #{item.extEqptCode}, #{item.eqptType}, #{item.eqptSpec}, #{item.ratedVoltage}, #{item.ratedCurrent}, #{item.ancestors}, #{item.parentEqpt}, #{item.subCircuit})
         </foreach>
     </insert>
 
@@ -95,8 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="eqptSpec != null">eqpt_spec = #{eqptSpec},</if>
             <if test="ratedVoltage != null">rated_voltage = #{ratedVoltage},</if>
             <if test="ratedCurrent != null">rated_current = #{ratedCurrent},</if>
+            <if test="ancestors != null ">ancestors = #{ancestors}</if>
             <if test="parentEqpt != null">parent_eqpt = #{parentEqpt},</if>
-            <if test="meterDevice != null">meter_device = #{meterDevice},</if>
+            <if test="subCircuit != null">sub_circuit = #{subCircuit},</if>
         </trim>
         where id = #{id}
     </update>

+ 11 - 6
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/PowerBoxMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ems.mapper.PowerBoxMapper">
-    
+
     <resultMap type="com.ruoyi.ems.domain.PowerBox" id="powerBoxResult">
         <result property="id"    column="id"    />
         <result property="boxCode"    column="box_code"    />
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectPowerBoxList" parameterType="com.ruoyi.ems.domain.PowerBox" resultMap="powerBoxResult">
         <include refid="selectPowerBoxVo"/>
-        <where>  
+        <where>
             <if test="boxCode != null  and boxCode != ''"> and pb.box_code = #{boxCode}</if>
             <if test="boxType != null "> and pb.box_type = #{boxType}</if>
             <if test="areaCode != null  and areaCode != ''"> and pb.area_code = #{areaCode}</if>
@@ -36,12 +36,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="gatewayPort != null "> and pb.gateway_port = #{gatewayPort}</if>
         </where>
     </select>
-    
+
     <select id="selectPowerBoxById" parameterType="Long" resultMap="powerBoxResult">
         <include refid="selectPowerBoxVo"/>
         where pb.id = #{id}
     </select>
-        
+
+    <select id="selectPowerBoxByCode" parameterType="String" resultMap="powerBoxResult">
+        <include refid="selectPowerBoxVo"/>
+        where pb.box_code = #{boxCode}
+    </select>
+
     <insert id="insertPowerBox" parameterType="com.ruoyi.ems.domain.PowerBox" useGeneratedKeys="true" keyProperty="id">
         insert into adm_power_box
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -83,9 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deletePowerBoxByIds" parameterType="String">
-        delete from adm_power_box where id in 
+        delete from adm_power_box where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>

+ 55 - 2
ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/ObjType.java

@@ -7,23 +7,76 @@ package com.ruoyi.common.core.enums;
  */
 public enum ObjType {
     /**
-     * 0:园区,1:区块,2:设施,3:设备
+     * 0:园区,1:区块,2:设施,3:设备,4:配电柜
      */
-    AREA(0, "园区"), ZONE(1, "区块"), FACS(2, "设施"), DEVICE(3, "设备");
+    AREA(0, "园区"),
+    /**
+     * Zone obj type.
+     *
+     * @author chen.cheng
+     */
+    ZONE(1, "区块"),
+    /**
+     * Facs obj type.
+     *
+     * @author chen.cheng
+     */
+    FACS(2, "设施"),
+    /**
+     * Device obj type.
+     *
+     * @author chen.cheng
+     */
+    DEVICE(3, "设备"),
+    /**
+     * Power box obj type.
+     *
+     * @author chen.cheng
+     */
+    POWER_BOX(4, "配电柜");
 
+    /**
+     * The Code.
+     *
+     * @author chen.cheng
+     */
     private final Integer code;
 
+    /**
+     * The Info.
+     *
+     * @author chen.cheng
+     */
     private final String info;
 
+    /**
+     * Instantiates a new Obj type.
+     *
+     * @param code the code
+     * @param info the info
+     * @author chen.cheng
+     */
     ObjType(Integer code, String info) {
         this.code = code;
         this.info = info;
     }
 
+    /**
+     * Gets code.
+     *
+     * @return the code
+     * @author chen.cheng
+     */
     public Integer getCode() {
         return code;
     }
 
+    /**
+     * Gets info.
+     *
+     * @return the info
+     * @author chen.cheng
+     */
     public String getInfo() {
         return info;
     }

+ 329 - 0
ems-cloud/sql/ems_init_data.sql

@@ -0,0 +1,329 @@
+-- 服务区初始数据
+INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3001', '常泰高速服务区(北区)', '北区', 4, '泰州', 'S30如常高速', '常州方向', '江苏省泰州市泰兴市虹桥镇常泰高速常州方向', null, null, '2025-01-01', '72.5', '6000', '120.050937', '32.071956');
+INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3002', '常泰高速服务区(南区)', '南区', 4, '泰州', 'S30如常高速', '泰兴方向', '江苏省泰州市泰兴市虹桥镇常泰高速泰州方向', null, null, '2025-01-01', '72.5', '6000', '120.052389', '32.070408');
+
+-- 建筑初始数据
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300101', '综合楼', '北区中部', 2, 1, 13.7, 4700, '一层提供商业、餐饮、卫生间、开水服务,二层为办公区、会议区', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300102', '配电泵房', '北区西北角', 1, 0, null, 300, '配电设施,水泵设施工作区', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300103', '维修间&货车之家', '北区东侧', 2, 0, null, 300, '提供车辆维修服务', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300104', '加油站', '北区西南角', 1, 0, null, 200, '提供加油服务', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300105', '警务站', '北区东北角', 1, 0, null, 50000, '警务办公场地', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300106', '停车场', '北区广场', 1, 0, null, 50000, '车位', '321283124S3001');
+
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300201', '综合楼', '南区中部', 2, 1, 14.2, 4788.2, '一层提供商业、餐饮、卫生间、开水服务,二层为员工餐厅、展厅', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300202', '配电泵房', '南区东南角', 1, 0, null, 300, '配电设施,水泵设施工作区', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300203', '维修间&货车之家', '南区西侧', 2, 0, null, 300, '提供车辆维修服务', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300204', '加油站', '南区东北角', 1, 0, null, 200, '提供加油服务', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300205', '宿舍楼', '南区西南角', 2, 0, null, 920, '提供员工住宿服务', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300206', '停车场', '南区广场', 1, 0, null, 50000, '车位', '321283124S3002');
+
+
+-- 建筑初始数据
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-101', '开水泡面间', 1, '101', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-102', '超市', 1, '102', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-103', '中式糕点', 1, '103', 150, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-104', '特色产品市集', 1, '104', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-105', '奶茶&咖啡', 1, '105', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-106', '中式套餐', 1, '106', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-107', '特色小吃', 1, '107', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-108', '串串&卤味', 1, '108', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-109', '糖葫芦&水果', 1, '109', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-110', '美食广场', 1, '110', 300, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-111', '男卫', 1, '111', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-112', '男盥洗室', 1, '112', 150, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-113', '女卫', 1, '113', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-114', '女盥洗室', 1, '114', 150, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-115', '工具间1', 1, '115', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-116', '工具间2', 1, '116', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-117', '工具间3', 1, '117', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-118', '工具间4', 1, '118', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-119', '货车服务空间', 1, '119', 50, '使用中');
+
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-XK', '小客停车位', 1, 'CW-XK', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-CD', '充电车位', 1, 'CW-CD', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-WZA', '无障碍车位', 1, 'CW-WZA', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-DKC', '大客车停车位', 1, 'CW-DKC', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-HC', '货车车位', 1, 'CW-HC', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-WXP', '危险品车位', 1, 'CW-WXP', 100, '使用中');
+
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-101', '开水泡面间', 1, '101', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-102', '超市', 1, '102', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-103', '中式糕点', 1, '103', 150, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-104', '特色产品市集', 1, '104', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-105', '奶茶&咖啡', 1, '105', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-106', '中式套餐', 1, '106', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-107', '特色小吃', 1, '107', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-108', '串串&卤味', 1, '108', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-109', '糖葫芦&水果', 1, '109', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-110', '美食广场', 1, '110', 300, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-111', '男卫', 1, '111', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-112', '男盥洗室', 1, '112', 150, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-113', '女卫', 1, '113', 200, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-114', '女盥洗室', 1, '114', 150, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-115', '工具间1', 1, '115', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-116', '工具间2', 1, '116', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-117', '工具间3', 1, '117', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-118', '工具间4', 1, '118', 50, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-119', '货车服务空间', 1, '119', 50, '使用中');
+
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-XK', '小客停车位', 1, 'CW-XK', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-CD', '充电车位', 1, 'CW-XK', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-WZA', '无障碍车位', 1, 'CW-XK', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-DKC', '大客车停车位', 1, 'CW-XK', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-HC', '货车车位', 1, 'CW-XK', 100, '使用中');
+INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-WXP','危险品车位', 1, 'CW-XK', 100, '使用中');
+
+-- 能源设施初始数据
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('W201', '北区-供电网', 'W', 'W2', 1, '321283124S3001');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('W202', '南区-供电网', 'W', 'W2', 1, '321283124S3002');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('E501', '北区-光伏', 'E', 'E5', 1, '321283124S3001');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('E502', '南区-光伏', 'E', 'E5', 1, '321283124S3002');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z101', '北区-室内照明', 'Z', 'Z001', 1, '321283124S3001');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z102', '北区-室外照明', 'Z', 'Z002', 1, '321283124S3001');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z110', '北区-公共设施', 'Z', 'Z010', 1, '321283124S3001');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z120', '北区-空调设施', 'Z', 'Z020', 1, '321283124S3001');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z201', '南区-室内照明', 'Z', 'Z001', 1, '321283124S3002');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z202', '南区-室外照明', 'Z', 'Z002', 1, '321283124S3002');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z210', '南区-公共设施', 'Z', 'Z010', 1, '321283124S3002');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z220', '南区-空调设施', 'Z', 'Z020', 1, '321283124S3002');
+
+
+-- 设施属性DEMO数据
+INSERT INTO `adm_ems_facs_attr` (`facs_code`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('W201', 'input_load', '进线负荷', '293.55', 'kw/h');
+INSERT INTO `adm_ems_facs_attr` (`facs_code`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('E501', 'installed_capacity', '装机容量', '2000', 'MW');
+
+-- 设施属性DEMO数据
+INSERT INTO `adm_ems_facs_ability` (`facs_code`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('Z020', '开启', '开启空调', '{\"enable\":1}');
+INSERT INTO `adm_ems_facs_ability` (`facs_code`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('Z020', '关闭', '关闭空调', '{\"enable\":0}');
+
+-- 设施事件DEMO数据
+INSERT INTO `adm_ems_facs_event` (`facs_code`, `event_name`, `event_type`, `event_desc`, `event_code`, `ext_event_code`) VALUES ('Z101', '电压告警', '2', '电压过低告警', 'LOW_V',  '10001001');
+
+
+-- 能源设施能流关系DEMO数据
+INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('W201_Z101', 'W201', 'Z101', '45', 1, '4501');
+INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_W201', 'E501', 'W201', '45', 1, '4502');
+INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_Z101', 'E501', 'Z101', '45', 1, '4505');
+
+-- 配电柜DEMO数据
+INSERT INTO adm_power_box (`box_code`, `box_type`, `area_code`, `location`, `box_size`, `gateway_addr`, `gateway_port`) VALUES ('D-B-1001', 1, '321283124S3001', '综合楼配电间', '100*200', '0.0.0.0', 9999);
+INSERT INTO adm_power_box (`box_code`, `box_type`, `area_code`, `location`, `box_size`, `gateway_addr`, `gateway_port`) VALUES ('D-B-1002', 1, '321283124S3001', '广场配电柜', '100*200', '0.0.0.0', 9999);
+INSERT INTO adm_power_box (`box_code`, `box_type`, `area_code`, `location`, `box_size`, `gateway_addr`, `gateway_port`) VALUES ('D-N-1001', 1, '321283124S3002', '综合楼配电间', '100*200', '0.0.0.0', 9999);
+INSERT INTO adm_power_box (`box_code`, `box_type`, `area_code`, `location`, `box_size`, `gateway_addr`, `gateway_port`) VALUES ('D-N-1002', 1, '321283124S3002', '广场配电柜', '100*200', '0.0.0.0', 9999);
+
+-- 动力箱柜电气设备表
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1001', 'D-B-1001-10000', '0x0001', 'RCD', '总开(漏保)', 380, 200, '', '-1', '分开');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1001', 'D-B-1001-10011', '0x0002', 'QF', '分开(空开)', 380, 60, '-1,D-B-1001-10000', 'D-B-1001-10000', '照明');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1001', 'D-B-1001-11012', '0x0003', 'QF', '分开(空开)', 380, 60, '-1,D-B-1001-10000', 'D-B-1001-10000', 'LED');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1001', 'D-B-1001-11013', '0x0003', 'QF', '分开(空开)', 380, 60, '-1,D-B-1001-10000', 'D-B-1001-10000', '空调');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1001', 'D-B-1001-11014', '0x0004', 'QF', '分开(空开)', 380, 60, '-1,D-B-1001-10000', 'D-B-1001-10000', '水泵');
+
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1002', 'D-B-1002-10000', '0x0011', 'RCD', '总开(漏保)', 380, 200, '', '-1', '分开');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1002', 'D-B-1002-10011', '0x0012', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '照明');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1002', 'D-B-1002-11012', '0x0013', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '照明');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1002', 'D-B-1002-11013', '0x0013', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '照明');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-B-1002', 'D-B-1002-11014', '0x0014', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '照明');
+
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1001', 'D-N-1001-10000', '0x0101', 'RCD', '总开(漏保)', 380, 200, '', '-1', '分开');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1001', 'D-N-1001-10011', '0x0102', 'QF', '分开(空开)', 380, 60, '-1,D-N-1001-10000', 'D-N-1001-10000', '空调');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1001', 'D-N-1001-11012', '0x0103', 'QF', '分开(空开)', 380, 60, '-1,D-N-1001-10000', 'D-N-1001-10000', '空调');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1001', 'D-N-1001-11013', '0x0103', 'QF', '分开(空开)', 380, 60, '-1,D-N-1001-10000', 'D-N-1001-10000', '空调');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1001', 'D-N-1001-11014', '0x0104', 'QF', '分开(空开)', 380, 60, '-1,D-N-1001-10000', 'D-N-1001-10000', '空调');
+
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1002', 'D-B-1002-10000', '0x0201', 'RCD', '总开(漏保)', 380, 200, '', '-1', '分开');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1002', 'D-B-1002-10011', '0x0202', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '水泵');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1002', 'D-B-1002-11012', '0x0203', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '水泵');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1002', 'D-B-1002-11013', '0x0203', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '水泵');
+INSERT INTO adm_box_elec_eqpt (`box_code`, `eqpt_code`, `ext_eqpt_code`, `eqpt_type`, `eqpt_spec`, `rated_voltage`, `rated_current`, `ancestors`, `parent_eqpt`, `sub_circuit`) VALUES ('D-N-1002', 'D-B-1002-11014', '0x0204', 'QF', '分开(空开)', 380, 60, '-1,D-B-1002-10000', 'D-B-1002-10000', '水泵');
+
+-- 区域&标签关系表
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-101','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-102','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-103','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-104','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-105','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-106','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-107','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-108','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-109','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-110','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-111','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-112','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-113','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-114','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-115','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-116','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-117','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-118','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-119','Area_00');
+
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-CD','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-DKC','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-HC','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-WXP','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-WZA','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-XK','Area_00');
+
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-101','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-102','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-103','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-104','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-105','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-106','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-107','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-108','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-109','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-110','Area_01');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-111','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-112','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-113','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-114','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-115','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-116','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-117','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-118','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-119','Area_00');
+
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-CD','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-DKC','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-HC','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-WXP','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-WZA','Area_00');
+insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-XK','Area_00');
+
+-- 服务区用电属性数据
+INSERT INTO adm_area_elec_attr (`area_code`, `price_code`, `req_capacity_flag`, `trans_capacity`, `req_quantity`) VALUES ('321283124S3001', '4001', 1, 630, NULL);
+INSERT INTO adm_area_elec_attr (`area_code`, `price_code`, `req_capacity_flag`, `trans_capacity`, `req_quantity`) VALUES ('321283124S3002', '4001', 1, 630, NULL);
+
+-- 国网电价数据
+-- 单一制初始电价数据
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('3001', 3, '不满1千伏', 0.7624, 1.5296, 1.2747, 0.7624, 0.3445, NULL, NULL);
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('3002', 3, '1-10(20)千伏', 0.7364, 1.4774, 1.2312, 0.7364, 0.3327, NULL, NULL);
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('3003', 3, '35千伏', 0.7114, 1.4273, 1.1894, 0.7114, 0.3214, NULL, NULL);
+
+-- 两部制初始电价数据
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4001', 4, '1-10(20)千伏', 0.6587, 1.3592, 1.1327, 0.6587, 0.2757, 51.2, 32);
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4002', 4, '35千伏', 0.6337, 1.3076, 1.0897, 0.6337, 0.2652, 48, 30);
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4003', 4, '110千伏', 0.6087, 1.256, 1.0467, 0.6087, 0.2547, 44.8, 28);
+INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4004', 4, '220千伏及以上', 0.5827, 1.2024, 1.002, 0.5827, 0.2439, 41.6, 26);
+
+
+-- 峰谷电价策略数据
+-- 默认策略
+INSERT INTO adm_elecprice_strategy (`strategy_code`, `strategy_name`, `strategy_desc`, `repeat_type`, `repeat_param`, `priority`, `edit_flag`) VALUES ('-1', '默认策略', '0:00-24:00 执行平峰电价', 2, null, 0, 0);
+INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('-1', '00:00:00', '23:59:59', 0);
+
+-- 默认策略
+INSERT INTO adm_elecprice_strategy (`strategy_code`, `strategy_name`, `strategy_desc`, `repeat_type`, `repeat_param`, `priority`, `edit_flag`) VALUES ('1001', '100千伏安', '100千伏安以上峰谷电价', 2, null, 1, 1);
+INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('1001', '00:00:00', '08:00:00', -1);
+INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('1001', '08:00:00', '10:00:00', 1);
+INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('1001', '11:00:00', '17:00:00', 0);
+INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('1001', '17:00:00', '22:00:00', 1);
+INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('1001', '22:00:00', '23:59:59', 0);
+
+-- 商户能源计费策略
+INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_compute_type`, `elec_compute_desc`, `water_unit_price`, `water_gt_compute_type`, `water_compute_desc`) VALUES ('321283124S3001', 0.6068, 1, '1.按户数均摊\n公摊电费每户收费 = 公摊电费 / 户数\n2、按面积分摊\n单户公摊电费 = 公摊电费 * (单户面积 / 总面积)', 3.04, 0, NULL);
+INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_compute_type`, `elec_compute_desc`, `water_unit_price`, `water_gt_compute_type`, `water_compute_desc`) VALUES ('321283124S3002', 0.6068, 1, '1.按户数均摊\n公摊电费每户收费 = 公摊电费 / 户数\n2、按面积分摊\n单户公摊电费 = 公摊电费 * (单户面积 / 总面积)', 3.04, 0, NULL);
+
+-- 能源计量设备DEMO数据
+-- 电表
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-102', '321283124S3001', 45, 1, 3, 'B-102', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-103', '321283124S3001', 45, 1, 3, 'B-103', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-104', '321283124S3001', 45, 1, 3, 'B-104', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-105', '321283124S3001', 45, 1, 3, 'B-105', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-106', '321283124S3001', 45, 1, 3, 'B-106', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-107', '321283124S3001', 45, 1, 3, 'B-107', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-108', '321283124S3001', 45, 1, 3, 'B-108', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-109', '321283124S3001', 45, 1, 3, 'B-109', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-110', '321283124S3001', 45, 1, 3, 'B-110', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-Z120', '321283124S3001', 45, 2, 1, 'Z120', 0, 4, 1, 20, '互感器表');
+
+-- 水表
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-01', '321283124S3001', 70, 1, 2, '321283124S300101', 0, 4, 1, 1, '直采表');
+
+
+-- 抄表demo数据
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202402', 100, '2024-02-29', 238, '2024-02-28', 138, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202403', 238, '2024-02-29', 365, '2024-03-31', 127, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202404', 365, '2024-03-31', 537, '2024-04-30', 172, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202405', 537, '2024-04-30', 686, '2024-05-31', 149, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202406', 686, '2024-05-31', 921, '2024-06-30', 235, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202407', 921, '2024-06-30', 1189, '2024-07-31', 268, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202408', 1189, '2024-07-31', 1464, '2024-08-31', 275, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202402', 100, '2024-02-29', 250, '2024-02-28', 150, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202403', 250, '2024-02-29', 360, '2024-03-31', 160, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202404', 360, '2024-03-31', 500, '2024-04-30', 140, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202405', 500, '2024-04-30', 600, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202406', 600, '2024-05-31', 720, '2024-06-30', 120, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202407', 720, '2024-06-30', 800, '2024-07-31', 80, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202408', 800, '2024-07-31', 860, '2024-08-31', 160, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+
+
+

+ 48 - 5
ems-cloud/sql/ems_server.sql

@@ -617,8 +617,9 @@ create table adm_box_elec_eqpt  (
   `eqpt_spec`       varchar(64)     default null                 comment '电气型号',
   `rated_voltage`   int             default null                 comment '额定电压',
   `rated_current`   int             default null                 comment '额定电流',
+  `ancestors`       varchar(256)    default null                 comment '祖籍列表',
   `parent_eqpt`     varchar(32)     default null                 comment '上级电气件',
-  `meter_device`    varchar(16)     default null                 comment '计量设备',
+  `sub_circuit`     varchar(64)     default null                 comment '下级支路',
   primary key (`id`),
   unique key ux_box_elec_eqpt(`box_code`,`eqpt_code`)
 ) engine=innodb auto_increment=1 comment = '动力箱柜电气设备表';
@@ -820,10 +821,10 @@ create table adm_obj_tag_rel (
 
 
 -- ----------------------------
--- 手动抄表记录表
+-- 抄表记录表
 -- ----------------------------
-drop table if exists adm_meter_reading_manual;
-create table adm_meter_reading_manual (
+drop table if exists adm_meter_reading;
+create table adm_meter_reading (
   `id`               bigint(20)      not null auto_increment      comment '序号',
   `device_code`      varchar(16)     not null                     comment '计量设备code',
   `area_code`        varchar(16)     not null                     comment '服务区代码',
@@ -838,7 +839,7 @@ create table adm_meter_reading_manual (
   `update_time`      datetime        default null                 comment '更新时间',
   primary key (`id`),
   key meter_reading_manual(`device_code`)
-) engine=innodb auto_increment=1 comment = '手动抄表记录表';
+) engine=innodb auto_increment=1 comment = '抄表记录表';
 
 
 -- ----------------------------
@@ -1175,6 +1176,48 @@ create table adm_ems_elec_load_index (
 
 
 -- ----------------------------
+-- 动力箱指标表
+-- ----------------------------
+drop table if exists adm_ems_elec_box_index;
+create table adm_ems_elec_box_index (
+  `id`                        bigint(20)      not null auto_increment      comment '序号',
+  `box_code`                  varchar(32)     not null                     comment '箱体代码',
+  `box_type`                  int             not null                     comment '箱体类型',
+  `area_code`                 varchar(16)     not null                     comment '服务区代码',
+  `date`                      date            not null                     comment '日期 yyyy-MM-dd',
+  `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
+  `voltage_a`                 double          default null                 comment '电压(A相) 单位:V(伏)',
+  `voltage_b`                 double          default null                 comment '电压(B相) 单位:V(伏)',
+  `voltage_c`                 double          default null                 comment '电压(C相) 单位:V(伏)',
+  `electricity_a`             double          default null                 comment '电流(A相) 单位:A(安培)',
+  `electricity_b`             double          default null                 comment '电流(B相) 单位:A(安培)',
+  `electricity_c`             double          default null                 comment '电流(C相) 单位:A(安培)',
+  `power`                     double          default null                 comment '功率 单位:kW(千瓦)',
+  primary key (`id`),
+  unique key ux_elec_box_index(`box_code`, `time`)
+) engine=innodb auto_increment=1 comment = '动力箱指标表';
+
+
+-- ----------------------------
+-- 动力箱元器件指标表
+-- ----------------------------
+drop table if exists adm_ems_elec_box_eqpt_index;
+create table adm_ems_elec_box_eqpt_index (
+  `id`                        bigint(20)      not null auto_increment      comment '序号',
+  `box_code`                  varchar(32)     not null                     comment '箱体代码',
+  `eqpt_code`                 varchar(32)     not null                     comment '元件代码',
+  `area_code`                 varchar(16)     not null                     comment '服务区代码',
+  `date`                      date            not null                     comment '日期 yyyy-MM-dd',
+  `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
+  `voltage`                   double          default null                 comment '电压 单位:V(伏)',
+  `current`                   double          default null                 comment '电流 单位:A(安培)',
+  `power`                     double          default null                 comment '功率 单位:kW(千瓦)',
+  primary key (`id`),
+  unique key ux_elec_box_eqpt_index(`box_code`, `eqpt_code`, `time`)
+) engine=innodb auto_increment=1 comment = '动力箱元器件指标表';
+
+
+-- ----------------------------
 -- 电力产能预测表
 -- ----------------------------
 drop table if exists adm_ems_elec_prod_forecast;