Przeglądaj źródła

物模型接口开发

lv.wenbin 10 miesięcy temu
rodzic
commit
7fbcefd7ac
33 zmienionych plików z 2009 dodań i 777 usunięć
  1. 113 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/DeviceComponentController.java
  2. 33 20
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjAbilityController.java
  3. 30 27
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjAttrController.java
  4. 44 43
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjEventController.java
  5. 100 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjModelController.java
  6. 115 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevProcess.java
  7. 140 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDeviceComponent.java
  8. 42 58
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAbility.java
  9. 40 69
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAttr.java
  10. 69 92
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjEvent.java
  11. 107 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjModel.java
  12. 70 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsDeviceComponentMapper.java
  13. 46 37
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjAbilityMapper.java
  14. 39 29
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjAttrMapper.java
  15. 41 31
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjEventMapper.java
  16. 62 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjModelMapper.java
  17. 69 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsDeviceComponentService.java
  18. 37 31
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjAbilityService.java
  19. 38 29
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjAttrService.java
  20. 46 36
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjEventService.java
  21. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjModelService.java
  22. 98 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsDeviceComponentServiceImpl.java
  23. 56 52
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjAbilityServiceImpl.java
  24. 55 58
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjAttrServiceImpl.java
  25. 56 47
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjEventServiceImpl.java
  26. 125 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjModelServiceImpl.java
  27. 93 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceComponentMapper.xml
  28. 36 33
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAbilityMapper.xml
  29. 38 39
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAttrMapper.xml
  30. 43 38
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjEventMapper.xml
  31. 66 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjModelMapper.xml
  32. 0 7
      ems-cloud/sql/ems_init_data.sql
  33. 1 1
      ems-cloud/sql/ems_server.sql

+ 113 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/DeviceComponentController.java

@@ -0,0 +1,113 @@
+package com.ruoyi.ems.controller;
+
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.EmsDeviceComponent;
+import com.ruoyi.ems.service.IEmsDeviceComponentService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 能源设备部件Controller
+ *
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+@RestController
+@RequestMapping("/device/component")
+@Api(value = "DeviceController", description = "设备部件管理")
+public class DeviceComponentController extends BaseController {
+    @Autowired
+    private IEmsDeviceComponentService deviceComponentService;
+
+    /**
+     * 查询能源设备部件列表
+     */
+    @RequiresPermissions("ems:device:list")
+    @GetMapping("/list")
+    public TableDataInfo list(EmsDeviceComponent deviceComponent) {
+        startPage();
+        List<EmsDeviceComponent> list = deviceComponentService.selectDeviceComponentList(deviceComponent);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询能源设备部件列表
+     *
+     * @param deviceCode 设备编号
+     * @return AjaxResult
+     */
+    @GetMapping("/listByDevice")
+    public AjaxResult list(@RequestParam(name = "deviceCode") String deviceCode) {
+        List<EmsDeviceComponent> list = deviceComponentService.selectByDeviceCode(deviceCode);
+        return success(list);
+    }
+
+    /**
+     * 导出能源设备部件列表
+     */
+    @RequiresPermissions("ems:device:export")
+    @Log(title = "能源设备部件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmsDeviceComponent deviceComponent) {
+        List<EmsDeviceComponent> list = deviceComponentService.selectDeviceComponentList(deviceComponent);
+        ExcelUtil<EmsDeviceComponent> util = new ExcelUtil<>(EmsDeviceComponent.class);
+        util.exportExcel(response, list, "能源设备部件数据");
+    }
+
+    /**
+     * 获取能源设备部件详细信息
+     */
+    @RequiresPermissions("ems:device:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(deviceComponentService.selectDeviceComponentById(id));
+    }
+
+    /**
+     * 新增能源设备部件
+     */
+    @RequiresPermissions("ems:device:add")
+    @Log(title = "能源设备部件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EmsDeviceComponent deviceComponent) {
+        return toAjax(deviceComponentService.insertDeviceComponent(deviceComponent));
+    }
+
+    /**
+     * 修改能源设备部件
+     */
+    @RequiresPermissions("ems:device:edit")
+    @Log(title = "能源设备部件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody EmsDeviceComponent deviceComponent) {
+        return toAjax(deviceComponentService.updateDeviceComponent(deviceComponent));
+    }
+
+    /**
+     * 删除能源设备部件
+     */
+    @RequiresPermissions("ems:device:remove")
+    @Log(title = "能源设备部件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(deviceComponentService.deleteDeviceComponentByIds(ids));
+    }
+}

+ 33 - 20
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjAbilityController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ems.controller;
 
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -18,70 +19,82 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
- * 能源设施能力Controller
+ * 能源对象能力Controller
  * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 @RestController
-@RequestMapping("/basecfg/ems/ability")
-@Api(value = "EmsObjAbilityController", description = "能源对象能力特性管理")
+@RequestMapping("/object/ability")
+@Api(value = "EmsObjAbilityController", description = "能源对象能力管理")
 public class EmsObjAbilityController extends BaseController
 {
     @Autowired
     private IEmsObjAbilityService abilityService;
 
     /**
-     * 查询能源设施能力列表
+     * 查询能源对象能力列表
      */
     @GetMapping("/list")
-    public TableDataInfo list(EmsObjAbility ability)
+    public TableDataInfo list(EmsObjAbility objAbility)
     {
         startPage();
-        List<EmsObjAbility> list = abilityService.selectAbilityList(ability);
+        List<EmsObjAbility> list = abilityService.selectObjAbilityList(objAbility);
         return getDataTable(list);
     }
 
+    /**
+     * 导出能源对象能力列表
+     */
+    @Log(title = "能源对象能力", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmsObjAbility objAbility)
+    {
+        List<EmsObjAbility> list = abilityService.selectObjAbilityList(objAbility);
+        ExcelUtil<EmsObjAbility> util = new ExcelUtil<>(EmsObjAbility.class);
+        util.exportExcel(response, list, "能源对象能力数据");
+    }
 
     /**
-     * 获取能源设施能力详细信息
+     * 获取能源对象能力详细信息
      */
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
-        return success(abilityService.selectAbilityById(id));
+        return success(abilityService.selectObjAbilityById(id));
     }
 
     /**
-     * 新增能源设施能力
+     * 新增能源对象能力
      */
-    @Log(title = "能源设施能力", businessType = BusinessType.INSERT)
+    @Log(title = "能源对象能力", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody EmsObjAbility ability)
+    public AjaxResult add(@RequestBody EmsObjAbility objAbility)
     {
-        return toAjax(abilityService.insertAbility(ability));
+        return toAjax(abilityService.insertObjAbility(objAbility));
     }
 
     /**
-     * 修改能源设施能力
+     * 修改能源对象能力
      */
-    @Log(title = "能源设施能力", businessType = BusinessType.UPDATE)
+    @Log(title = "能源对象能力", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody EmsObjAbility ability)
+    public AjaxResult edit(@RequestBody EmsObjAbility objAbility)
     {
-        return toAjax(abilityService.updateAbility(ability));
+        return toAjax(abilityService.updateObjAbility(objAbility));
     }
 
     /**
-     * 删除能源设施能力
+     * 删除能源对象能力
      */
-    @Log(title = "能源设施能力", businessType = BusinessType.DELETE)
+    @Log(title = "能源对象能力", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
-        return toAjax(abilityService.deleteAbilityByIds(ids));
+        return toAjax(abilityService.deleteObjAbilityByIds(ids));
     }
 }

+ 30 - 27
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjAttrController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ems.controller;
 
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -18,80 +19,82 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
- * 能源设施属性Controller
+ * 能源对象属性Controller
  * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 @RestController
-@RequestMapping("/basecfg/ems/attr")
+@RequestMapping("/obj/attr")
 @Api(value = "EmsObjAttrController", description = "能源对象属性管理")
 public class EmsObjAttrController extends BaseController
 {
     @Autowired
-    private IEmsObjAttrService objAttrService;
+    private IEmsObjAttrService attrService;
 
     /**
-     * 查询能源设施属性列表
+     * 查询能源对象属性列表
      */
     @GetMapping("/list")
     public TableDataInfo list(EmsObjAttr objAttr)
     {
         startPage();
-        List<EmsObjAttr> list = objAttrService.selectAttrList(objAttr);
+        List<EmsObjAttr> list = attrService.selectObjAttrList(objAttr);
         return getDataTable(list);
     }
 
-
     /**
-     * 获取能源设施属性详细信息
+     * 导出能源对象属性列表
      */
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
+    @Log(title = "能源对象属性", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmsObjAttr objAttr)
     {
-        return success(objAttrService.selectAttrById(id));
+        List<EmsObjAttr> list = attrService.selectObjAttrList(objAttr);
+        ExcelUtil<EmsObjAttr> util = new ExcelUtil<>(EmsObjAttr.class);
+        util.exportExcel(response, list, "能源对象属性数据");
     }
 
     /**
-     * 新增能源设施属性
+     * 获取能源对象属性详细信息
      */
-    @Log(title = "能源设施属性", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody EmsObjAttr objAttr)
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
     {
-        return toAjax(objAttrService.insertAttr(objAttr));
+        return success(attrService.selectObjAttrById(id));
     }
 
     /**
-     * 新增能源设施属性
+     * 新增能源对象属性
      */
-    @Log(title = "能源设施属性", businessType = BusinessType.INSERT)
-    @PostMapping("/batch")
-    public AjaxResult addBatch(@RequestBody List<EmsObjAttr> objAttrs)
+    @Log(title = "能源对象属性", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EmsObjAttr objAttr)
     {
-        return toAjax(objAttrService.insertAttrBatch(objAttrs));
+        return toAjax(attrService.insertObjAttr(objAttr));
     }
 
     /**
-     * 修改能源设施属性
+     * 修改能源对象属性
      */
-    @Log(title = "能源设施属性", businessType = BusinessType.UPDATE)
+    @Log(title = "能源对象属性", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody EmsObjAttr objAttr)
     {
-        return toAjax(objAttrService.updateAttr(objAttr));
+        return toAjax(attrService.updateObjAttr(objAttr));
     }
 
     /**
-     * 删除能源设施属性
+     * 删除能源对象属性
      */
-    @Log(title = "能源设施属性", businessType = BusinessType.DELETE)
+    @Log(title = "能源对象属性", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
-        return toAjax(objAttrService.deleteAttrByIds(ids));
+        return toAjax(attrService.deleteObjAttrByIds(ids));
     }
 }

+ 44 - 43
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsObjEventController.java

@@ -1,99 +1,100 @@
 package com.ruoyi.ems.controller;
 
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.ems.domain.EmsObjEvent;
+import com.ruoyi.ems.service.IEmsObjEventService;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.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.EmsObjEvent;
-import com.ruoyi.ems.service.IEmsObjEventService;
-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;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
- * 能源设施事件Controller
+ * 能源对象事件Controller
  * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 @RestController
-@RequestMapping("/basecfg/ems/event")
-@Api(value = "EmsObjEventController", description = "能源对象事件特性管理")
+@RequestMapping("/object/event")
+@Api(value = "EmsObjEventController", description = "能源对象性管理")
 public class EmsObjEventController extends BaseController
 {
     @Autowired
-    private IEmsObjEventService eventService;
+    private IEmsObjEventService objEventService;
 
     /**
-     * 查询能源设施事件列表
+     * 查询能源对象事件列表
      */
     @GetMapping("/list")
-    public TableDataInfo list(EmsObjEvent event)
+    public TableDataInfo list(EmsObjEvent admEmsObjEvent)
     {
         startPage();
-        List<EmsObjEvent> list = eventService.selectEventList(event);
+        List<EmsObjEvent> list = objEventService.selectObjEventList(admEmsObjEvent);
         return getDataTable(list);
     }
 
     /**
-     * 获取能源设施事件详细信息
+     * 导出能源对象事件列表
      */
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
+    @Log(title = "能源对象事件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmsObjEvent admEmsObjEvent)
     {
-        return success(eventService.selectEventById(id));
+        List<EmsObjEvent> list = objEventService.selectObjEventList(admEmsObjEvent);
+        ExcelUtil<EmsObjEvent> util = new ExcelUtil<>(EmsObjEvent.class);
+        util.exportExcel(response, list, "能源对象事件数据");
     }
 
     /**
-     * 新增能源设施事件
+     * 获取能源对象事件详细信息
      */
-    @Log(title = "能源设施事件", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody EmsObjEvent event)
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
     {
-        return toAjax(eventService.insertEvent(event));
+        return success(objEventService.selectObjEventById(id));
     }
 
     /**
-     * 新增能源设施事件
+     * 新增能源对象事件
      */
-    @Log(title = "能源设施事件", businessType = BusinessType.INSERT)
-    @PostMapping(value = "/batch")
-    public AjaxResult addBatch(@RequestBody List<EmsObjEvent> events)
+    @Log(title = "能源对象事件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EmsObjEvent admEmsObjEvent)
     {
-        return toAjax(eventService.insertEventBatch(events));
+        return toAjax(objEventService.insertObjEvent(admEmsObjEvent));
     }
 
     /**
-     * 修改能源设施事件
+     * 修改能源对象事件
      */
-    @Log(title = "能源设施事件", businessType = BusinessType.UPDATE)
+    @Log(title = "能源对象事件", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody EmsObjEvent event)
+    public AjaxResult edit(@RequestBody EmsObjEvent admEmsObjEvent)
     {
-        return toAjax(eventService.updateEvent(event));
+        return toAjax(objEventService.updateObjEvent(admEmsObjEvent));
     }
 
     /**
-     * 删除能源设施事件
+     * 删除能源对象事件
      */
-    @Log(title = "能源设施事件", businessType = BusinessType.DELETE)
+    @Log(title = "能源对象事件", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
-        return toAjax(eventService.deleteEventByIds(ids));
+        return toAjax(objEventService.deleteObjEventByIds(ids));
     }
 }

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

@@ -0,0 +1,100 @@
+package com.ruoyi.ems.controller;
+
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.ems.domain.EmsObjModel;
+import com.ruoyi.ems.service.IEmsObjModelService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 能源对象属性Controller
+ * 
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+@RestController
+@RequestMapping("/object/model")
+@Api(value = "EmsObjModelController", description = "能源对象模型管理")
+public class EmsObjModelController extends BaseController
+{
+    @Autowired
+    private IEmsObjModelService objModelService;
+
+    /**
+     * 查询能源对象属性列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(EmsObjModel objModel)
+    {
+        startPage();
+        List<EmsObjModel> list = objModelService.selectObjModelList(objModel);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出能源对象属性列表
+     */
+    @Log(title = "能源对象属性", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmsObjModel objModel)
+    {
+        List<EmsObjModel> list = objModelService.selectObjModelList(objModel);
+        ExcelUtil<EmsObjModel> util = new ExcelUtil<>(EmsObjModel.class);
+        util.exportExcel(response, list, "能源对象属性数据");
+    }
+
+    /**
+     * 获取能源对象属性详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(objModelService.selectObjModelById(id));
+    }
+
+    /**
+     * 新增能源对象属性
+     */
+    @Log(title = "能源对象属性", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EmsObjModel objModel)
+    {
+        return toAjax(objModelService.insertObjModel(objModel));
+    }
+
+    /**
+     * 修改能源对象属性
+     */
+    @Log(title = "能源对象属性", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody EmsObjModel objModel)
+    {
+        return toAjax(objModelService.updateObjModel(objModel));
+    }
+
+    /**
+     * 删除能源对象属性
+     */
+    @Log(title = "能源对象属性", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(objModelService.deleteObjModelByIds(ids));
+    }
+}

+ 115 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevProcess.java

@@ -0,0 +1,115 @@
+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;
+
+/**
+ * 能源设施工艺系统维对象 dim_ems_dev_process
+ * 
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public class EmsDevProcess extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 工艺代码 */
+    private String psCode;
+
+    /** 工艺名称 */
+    private String psName;
+
+    /** 工艺系统说明 */
+    private String desc;
+
+    /** 设施分类代码 */
+    private String categoryCode;
+
+    /** 设施子类代码 */
+    private String subcategoryCode;
+
+    /** 数据版本 */
+    private String version;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPsCode(String psCode) 
+    {
+        this.psCode = psCode;
+    }
+
+    public String getPsCode() 
+    {
+        return psCode;
+    }
+    public void setPsName(String psName) 
+    {
+        this.psName = psName;
+    }
+
+    public String getPsName() 
+    {
+        return psName;
+    }
+    public void setDesc(String desc) 
+    {
+        this.desc = desc;
+    }
+
+    public String getDesc() 
+    {
+        return desc;
+    }
+    public void setCategoryCode(String categoryCode) 
+    {
+        this.categoryCode = categoryCode;
+    }
+
+    public String getCategoryCode() 
+    {
+        return categoryCode;
+    }
+    public void setSubcategoryCode(String subcategoryCode) 
+    {
+        this.subcategoryCode = subcategoryCode;
+    }
+
+    public String getSubcategoryCode() 
+    {
+        return subcategoryCode;
+    }
+    public void setVersion(String version) 
+    {
+        this.version = version;
+    }
+
+    public String getVersion() 
+    {
+        return version;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("psCode", getPsCode())
+            .append("psName", getPsName())
+            .append("desc", getDesc())
+            .append("categoryCode", getCategoryCode())
+            .append("subcategoryCode", getSubcategoryCode())
+            .append("version", getVersion())
+            .toString();
+    }
+}

+ 140 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDeviceComponent.java

@@ -0,0 +1,140 @@
+package com.ruoyi.ems.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 能源设备部件对象 adm_ems_device_component
+ * 
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public class EmsDeviceComponent extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 设备编码 */
+    private String deviceCode;
+
+    /** 部件编码 */
+    private String compoCode;
+
+    /** 外部系统编码 */
+    private String extCompoCode;
+
+    /** 部件模型 */
+    private String compoModel;
+
+    /** 部件品牌 */
+    private String compoBrand;
+
+    /** 部件型号 */
+    private String compoSpec;
+
+    /** 祖籍列表 */
+    private String ancestors;
+
+    /** 上级部件 */
+    private String parentCompo;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setDeviceCode(String deviceCode) 
+    {
+        this.deviceCode = deviceCode;
+    }
+
+    public String getDeviceCode() 
+    {
+        return deviceCode;
+    }
+    public void setCompoCode(String compoCode) 
+    {
+        this.compoCode = compoCode;
+    }
+
+    public String getCompoCode() 
+    {
+        return compoCode;
+    }
+    public void setExtCompoCode(String extCompoCode) 
+    {
+        this.extCompoCode = extCompoCode;
+    }
+
+    public String getExtCompoCode() 
+    {
+        return extCompoCode;
+    }
+    public void setCompoModel(String compoModel) 
+    {
+        this.compoModel = compoModel;
+    }
+
+    public String getCompoModel() 
+    {
+        return compoModel;
+    }
+    public void setCompoBrand(String compoBrand) 
+    {
+        this.compoBrand = compoBrand;
+    }
+
+    public String getCompoBrand() 
+    {
+        return compoBrand;
+    }
+    public void setCompoSpec(String compoSpec) 
+    {
+        this.compoSpec = compoSpec;
+    }
+
+    public String getCompoSpec() 
+    {
+        return compoSpec;
+    }
+    public void setAncestors(String ancestors) 
+    {
+        this.ancestors = ancestors;
+    }
+
+    public String getAncestors() 
+    {
+        return ancestors;
+    }
+    public void setParentCompo(String parentCompo) 
+    {
+        this.parentCompo = parentCompo;
+    }
+
+    public String getParentCompo() 
+    {
+        return parentCompo;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("deviceCode", getDeviceCode())
+            .append("compoCode", getCompoCode())
+            .append("extCompoCode", getExtCompoCode())
+            .append("compoModel", getCompoModel())
+            .append("compoBrand", getCompoBrand())
+            .append("compoSpec", getCompoSpec())
+            .append("ancestors", getAncestors())
+            .append("parentCompo", getParentCompo())
+            .toString();
+    }
+}

+ 42 - 58
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAbility.java

@@ -1,15 +1,14 @@
 package com.ruoyi.ems.domain;
 
+import com.ruoyi.common.core.web.domain.BaseEntity;
 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_obj_ability
+ * 能源对象能力对象 adm_ems_obj_ability
  * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 public class EmsObjAbility extends BaseEntity
 {
@@ -18,14 +17,11 @@ public class EmsObjAbility extends BaseEntity
     /** 序号 */
     private Long id;
 
-    /** 能力分组代码 */
-    private String groupCode;
-
-    /** 能力分组名称 */
-    private String groupName;
+    /** 模型code */
+    private String modelCode;
 
-    /** 对象类型 */
-    private Integer objType;
+    /** 能力键 */
+    private String abilityKey;
 
     /** 能力名称 */
     private String abilityName;
@@ -33,82 +29,70 @@ public class EmsObjAbility extends BaseEntity
     /** 能力描述 */
     private String abilityDesc;
 
-    /** 属性值 */
+    /** 能力参数 */
     private String abilityParam;
 
-    public EmsObjAbility() {
-        super();
-    }
-
-    public EmsObjAbility(String groupCode, int objType){
-        super();
-        this.groupCode = groupCode;
-        this.objType = objType;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
+    public void setId(Long id) 
+    {
         this.id = id;
     }
 
-    public String getGroupCode() {
-        return groupCode;
+    public Long getId() 
+    {
+        return id;
     }
-
-    public void setGroupCode(String groupCode) {
-        this.groupCode = groupCode;
+    public void setModelCode(String modelCode) 
+    {
+        this.modelCode = modelCode;
     }
 
-    public String getGroupName() {
-        return groupName;
+    public String getModelCode() 
+    {
+        return modelCode;
     }
-
-    public void setGroupName(String groupName) {
-        this.groupName = groupName;
+    public void setAbilityKey(String abilityKey) 
+    {
+        this.abilityKey = abilityKey;
     }
 
-    public Integer getObjType() {
-        return objType;
+    public String getAbilityKey() 
+    {
+        return abilityKey;
     }
-
-    public void setObjType(Integer objType) {
-        this.objType = objType;
+    public void setAbilityName(String abilityName) 
+    {
+        this.abilityName = abilityName;
     }
 
-    public String getAbilityName() {
+    public String getAbilityName() 
+    {
         return abilityName;
     }
-
-    public void setAbilityName(String abilityName) {
-        this.abilityName = abilityName;
+    public void setAbilityDesc(String abilityDesc) 
+    {
+        this.abilityDesc = abilityDesc;
     }
 
-    public String getAbilityDesc() {
+    public String getAbilityDesc() 
+    {
         return abilityDesc;
     }
-
-    public void setAbilityDesc(String abilityDesc) {
-        this.abilityDesc = abilityDesc;
+    public void setAbilityParam(String abilityParam) 
+    {
+        this.abilityParam = abilityParam;
     }
 
-    public String getAbilityParam() {
+    public String getAbilityParam() 
+    {
         return abilityParam;
     }
 
-    public void setAbilityParam(String abilityParam) {
-        this.abilityParam = abilityParam;
-    }
-
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("groupCode", getGroupCode())
-            .append("groupName", getGroupName())
-            .append("objType", getObjType())
+            .append("modelCode", getModelCode())
+            .append("abilityKey", getAbilityKey())
             .append("abilityName", getAbilityName())
             .append("abilityDesc", getAbilityDesc())
             .append("abilityParam", getAbilityParam())

+ 40 - 69
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAttr.java

@@ -6,126 +6,97 @@ import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.web.domain.BaseEntity;
 
 /**
- * 能源设施/系统属性对象 adm_ems_obj_attr
+ * 能源对象属性对象 adm_ems_obj_attr
  * 
  * @author ruoyi
- * @date 2024-07-10
+ * @date 2024-09-23
  */
 public class EmsObjAttr extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    public EmsObjAttr(){
-        super();
-    }
-
-    public EmsObjAttr(String groupCode, int objType){
-        super();
-        this.groupCode = groupCode;
-        this.objType = objType;
-    }
-
     /** 序号 */
     private Long id;
 
-    /** 分组code */
-    private String groupCode;
+    /** 模型code */
+    private String modelCode;
 
-    /** 分组名称 */
-    private String groupName;
-
-    /** 对象类型 */
-    private Integer objType;
+    /** 属性标识 */
+    private String attrKey;
 
     /** 属性名称 */
     private String attrName;
 
-    /** 属性描述 */
-    private String attrDesc;
-
     /** 属性值 */
     private String attrValue;
 
     /** 属性单位 */
     private String attrUnit;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
+    public void setId(Long id) 
+    {
         this.id = id;
     }
 
-    public String getGroupCode() {
-        return groupCode;
-    }
-
-    public void setGroupCode(String groupCode) {
-        this.groupCode = groupCode;
+    public Long getId() 
+    {
+        return id;
     }
-
-    public String getGroupName() {
-        return groupName;
+    public void setModelCode(String modelCode) 
+    {
+        this.modelCode = modelCode;
     }
 
-    public void setGroupName(String groupName) {
-        this.groupName = groupName;
+    public String getModelCode() 
+    {
+        return modelCode;
     }
-
-    public Integer getObjType() {
-        return objType;
+    public void setAttrKey(String attrKey) 
+    {
+        this.attrKey = attrKey;
     }
 
-    public void setObjType(Integer objType) {
-        this.objType = objType;
+    public String getAttrKey() 
+    {
+        return attrKey;
     }
-
-    public String getAttrName() {
-        return attrName;
-    }
-
-    public void setAttrName(String attrName) {
+    public void setAttrName(String attrName) 
+    {
         this.attrName = attrName;
     }
 
-    public String getAttrDesc() {
-        return attrDesc;
+    public String getAttrName() 
+    {
+        return attrName;
     }
-
-    public void setAttrDesc(String attrDesc) {
-        this.attrDesc = attrDesc;
+    public void setAttrValue(String attrValue) 
+    {
+        this.attrValue = attrValue;
     }
 
-    public String getAttrValue() {
+    public String getAttrValue() 
+    {
         return attrValue;
     }
-
-    public void setAttrValue(String attrValue) {
-        this.attrValue = attrValue;
+    public void setAttrUnit(String attrUnit) 
+    {
+        this.attrUnit = attrUnit;
     }
 
-    public String getAttrUnit() {
+    public String getAttrUnit() 
+    {
         return attrUnit;
     }
 
-    public void setAttrUnit(String attrUnit) {
-        this.attrUnit = attrUnit;
-    }
-
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("groupCode", getGroupCode())
-            .append("groupName", getGroupName())
-            .append("objType", getObjType())
+            .append("modelCode", getModelCode())
+            .append("attrKey", getAttrKey())
             .append("attrName", getAttrName())
-            .append("attrDesc", getAttrDesc())
             .append("attrValue", getAttrValue())
             .append("attrUnit", getAttrUnit())
-            .append("createTime", getCreateTime())
-            .append("updateTime", getUpdateTime())
             .toString();
     }
 }

+ 69 - 92
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjEvent.java

@@ -6,146 +6,123 @@ import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.web.domain.BaseEntity;
 
 /**
- * 能源设施事件对象 adm_ems_facs_event
- *
+ * 能源对象事件对象 adm_ems_obj_event
+ * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
-public class EmsObjEvent extends BaseEntity {
+public class EmsObjEvent extends BaseEntity
+{
     private static final long serialVersionUID = 1L;
 
-    /**
-     * 序号
-     */
+    /** 序号 */
     private Long id;
 
-    /**
-     * 分组代码
-     */
-    private String groupCode;
+    /** 模型code */
+    private String modelCode;
 
-    /**
-     * 分组名称
-     */
-    private String groupName;
+    /** 事件名称 */
+    private String eventKey;
 
-    /**
-     * 对象类型
-     */
-    private Integer objType;
+    /** 事件类型 */
+    private Long eventType;
 
-    /**
-     * 事件名称
-     */
+    /** 事件名称 */
     private String eventName;
 
-    /**
-     * 事件类型
-     */
-    private Long eventType;
-
-    /**
-     * 事件描述
-     */
+    /** 事件名称 */
     private String eventDesc;
 
-    /**
-     * 事件代码
-     */
+    /** 事件代码 */
     private String eventCode;
 
-    /**
-     * 外系统事件代码
-     */
+    /** 外系统事件代码 */
     private String extEventCode;
 
-    public EmsObjEvent() {
-        super();
-    }
-
-    public EmsObjEvent(String groupCode, int objType) {
-        super();
-        this.groupCode = groupCode;
-        this.objType = objType;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
+    public void setId(Long id) 
+    {
         this.id = id;
     }
 
-    public String getGroupCode() {
-        return groupCode;
+    public Long getId() 
+    {
+        return id;
     }
-
-    public void setGroupCode(String groupCode) {
-        this.groupCode = groupCode;
+    public void setModelCode(String modelCode) 
+    {
+        this.modelCode = modelCode;
     }
 
-    public String getGroupName() {
-        return groupName;
+    public String getModelCode() 
+    {
+        return modelCode;
     }
-
-    public void setGroupName(String groupName) {
-        this.groupName = groupName;
+    public void setEventKey(String eventKey) 
+    {
+        this.eventKey = eventKey;
     }
 
-    public Integer getObjType() {
-        return objType;
+    public String getEventKey() 
+    {
+        return eventKey;
     }
-
-    public void setObjType(Integer objType) {
-        this.objType = objType;
+    public void setEventType(Long eventType) 
+    {
+        this.eventType = eventType;
     }
 
-    public String getEventName() {
-        return eventName;
+    public Long getEventType() 
+    {
+        return eventType;
     }
-
-    public void setEventName(String eventName) {
+    public void setEventName(String eventName) 
+    {
         this.eventName = eventName;
     }
 
-    public Long getEventType() {
-        return eventType;
+    public String getEventName() 
+    {
+        return eventName;
     }
-
-    public void setEventType(Long eventType) {
-        this.eventType = eventType;
+    public void setEventDesc(String eventDesc) 
+    {
+        this.eventDesc = eventDesc;
     }
 
-    public String getEventDesc() {
+    public String getEventDesc() 
+    {
         return eventDesc;
     }
-
-    public void setEventDesc(String eventDesc) {
-        this.eventDesc = eventDesc;
+    public void setEventCode(String eventCode) 
+    {
+        this.eventCode = eventCode;
     }
 
-    public String getEventCode() {
+    public String getEventCode() 
+    {
         return eventCode;
     }
-
-    public void setEventCode(String eventCode) {
-        this.eventCode = eventCode;
+    public void setExtEventCode(String extEventCode) 
+    {
+        this.extEventCode = extEventCode;
     }
 
-    public String getExtEventCode() {
+    public String getExtEventCode() 
+    {
         return extEventCode;
     }
 
-    public void setExtEventCode(String extEventCode) {
-        this.extEventCode = extEventCode;
-    }
-
     @Override
     public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
-            .append("groupCode", getGroupCode()).append("groupName", getGroupName()).append("objType", getObjType())
-            .append("eventName", getEventName()).append("eventType", getEventType()).append("eventDesc", getEventDesc())
-            .append("eventCode", getEventCode()).append("extEventCode", getExtEventCode()).toString();
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("modelCode", getModelCode())
+            .append("eventKey", getEventKey())
+            .append("eventType", getEventType())
+            .append("eventName", getEventName())
+            .append("eventDesc", getEventDesc())
+            .append("eventCode", getEventCode())
+            .append("extEventCode", getExtEventCode())
+            .toString();
     }
 }

+ 107 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjModel.java

@@ -0,0 +1,107 @@
+package com.ruoyi.ems.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.List;
+
+/**
+ * 能源对象属性对象 adm_ems_obj_model
+ * 
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public class EmsObjModel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 模型code */
+    private String modelCode;
+
+    /** 模型名称 */
+    private String modelName;
+
+    /** 对象类型 */
+    private Long objType;
+
+    private List<EmsObjAttr> attrList;
+
+    private List<EmsObjAbility> abilityList;
+
+    private List<EmsObjEvent> eventList;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setModelCode(String modelCode) 
+    {
+        this.modelCode = modelCode;
+    }
+
+    public String getModelCode() 
+    {
+        return modelCode;
+    }
+    public void setModelName(String modelName) 
+    {
+        this.modelName = modelName;
+    }
+
+    public String getModelName() 
+    {
+        return modelName;
+    }
+    public void setObjType(Long objType) 
+    {
+        this.objType = objType;
+    }
+
+    public Long getObjType() 
+    {
+        return objType;
+    }
+
+    public List<EmsObjAttr> getAttrList() {
+        return attrList;
+    }
+
+    public void setAttrList(List<EmsObjAttr> attrList) {
+        this.attrList = attrList;
+    }
+
+    public List<EmsObjAbility> getAbilityList() {
+        return abilityList;
+    }
+
+    public void setAbilityList(List<EmsObjAbility> abilityList) {
+        this.abilityList = abilityList;
+    }
+
+    public List<EmsObjEvent> getEventList() {
+        return eventList;
+    }
+
+    public void setEventList(List<EmsObjEvent> eventList) {
+        this.eventList = eventList;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("modelCode", getModelCode())
+            .append("modelName", getModelName())
+            .append("objType", getObjType())
+            .toString();
+    }
+}

+ 70 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsDeviceComponentMapper.java

@@ -0,0 +1,70 @@
+package com.ruoyi.ems.mapper;
+
+import com.ruoyi.ems.domain.EmsDeviceComponent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 能源设备部件Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public interface EmsDeviceComponentMapper {
+    /**
+     * 查询能源设备部件
+     *
+     * @param id 能源设备部件主键
+     * @return 能源设备部件
+     */
+    EmsDeviceComponent selectDeviceComponentById(Long id);
+
+    /**
+     * 查询能源设备部件列表
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 能源设备部件集合
+     */
+    List<EmsDeviceComponent> selectDeviceComponentList(EmsDeviceComponent deviceComponent);
+
+    /**
+     * 查询能源设备部件列表
+     *
+     * @param deviceCode 设备代码
+     * @return 能源设备部件集合
+     */
+    List<EmsDeviceComponent> selectByDeviceCode(@Param("deviceCode") String deviceCode);
+
+    /**
+     * 新增能源设备部件
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 结果
+     */
+    int insertDeviceComponent(EmsDeviceComponent deviceComponent);
+
+    /**
+     * 修改能源设备部件
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 结果
+     */
+    int updateDeviceComponent(EmsDeviceComponent deviceComponent);
+
+    /**
+     * 删除能源设备部件
+     *
+     * @param id 能源设备部件主键
+     * @return 结果
+     */
+    int deleteDeviceComponentById(Long id);
+
+    /**
+     * 批量删除能源设备部件
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteDeviceComponentByIds(Long[] ids);
+}

+ 46 - 37
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjAbilityMapper.java

@@ -1,77 +1,86 @@
 package com.ruoyi.ems.mapper;
 
 import java.util.List;
+
 import com.ruoyi.ems.domain.EmsObjAbility;
+import org.apache.ibatis.annotations.Param;
 
 /**
- * 能源设施能力Mapper接口
- * 
+ * 能源对象能力Mapper接口
+ *
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
-public interface EmsObjAbilityMapper
-{
+public interface EmsObjAbilityMapper {
     /**
-     * 查询能源设施能力
-     * 
-     * @param id 能源设施能力主键
-     * @return 能源设施能力
+     * 查询能源对象能力
+     *
+     * @param id 能源对象能力主键
+     * @return 能源对象能力
      */
-     EmsObjAbility selectAbilityById(Long id);
+    EmsObjAbility selectObjAbilityById(Long id);
 
     /**
-     * 查询能源设施能力列表
-     * 
-     * @param ability 能源设施能力
-     * @return 能源设施能力集合
+     * 查询能源对象能力列表
+     *
+     * @param ObjAbility 能源对象能力
+     * @return 能源对象能力集合
+     */
+    List<EmsObjAbility> selectObjAbilityList(EmsObjAbility ObjAbility);
+
+    /**
+     * 根据modelCode查询能源对象能力列表
+     *
+     * @param modelCode 设备模型代码
+     * @return 能源对象能力集合
      */
-     List<EmsObjAbility> selectAbilityList(EmsObjAbility ability);
+    List<EmsObjAbility> selectByModelCode(@Param("modelCode") String modelCode);
 
     /**
-     * 新增能源设施能力
-     * 
-     * @param ability 能源设施能力
+     * 新增能源对象能力
+     *
+     * @param ObjAbility 能源对象能力
      * @return 结果
      */
-     int insertAbility(EmsObjAbility ability);
+    int insertObjAbility(EmsObjAbility ObjAbility);
 
     /**
-     * 新增能源设施能力
+     * 批量新增能源对象能力
      *
-     * @param list 能源设施能力list
+     * @param list 能源对象能力
      * @return 结果
      */
-    int insertAbilityBatch(List<EmsObjAbility> list);
+    int insertBatch(List<EmsObjAbility> list);
 
     /**
-     * 修改能源设施能力
-     * 
-     * @param ability 能源设施能力
+     * 修改能源对象能力
+     *
+     * @param ObjAbility 能源对象能力
      * @return 结果
      */
-     int updateAbility(EmsObjAbility ability);
+    int updateObjAbility(EmsObjAbility ObjAbility);
 
     /**
-     * 删除能源设施能力
-     * 
-     * @param id 能源设施能力主键
+     * 删除能源对象能力
+     *
+     * @param id 能源对象能力主键
      * @return 结果
      */
-     int deleteAbilityById(Long id);
+    int deleteObjAbilityById(Long id);
 
     /**
-     * 批量删除能源设施能力
-     * 
-     * @param ids 需要删除的数据主键集合
+     * 根据modelCode删除能源对象能力
+     *
+     * @param modelCode 设备模型代码
      * @return 结果
      */
-     int deleteAbilityByIds(Long[] ids);
+    int deleteByModelCode(@Param("modelCode") String modelCode);
 
     /**
-     * 根据设施code删除
+     * 批量删除能源对象能力
      *
-     * @param groupCode 设施编码
+     * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    int deleteAbilityGroupCode(String groupCode);
+    int deleteObjAbilityByIds(Long[] ids);
 }

+ 39 - 29
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjAttrMapper.java

@@ -1,76 +1,86 @@
 package com.ruoyi.ems.mapper;
 
-import java.util.List;
 import com.ruoyi.ems.domain.EmsObjAttr;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
- * 能源设施/系统属性Mapper接口
+ * 能源对象属性Mapper接口
  *
  * @author ruoyi
- * @date 2024-07-10
+ * @date 2024-09-23
  */
 public interface EmsObjAttrMapper {
     /**
-     * 查询能源设施/系统属性
+     * 查询能源对象属性
      *
-     * @param id 能源设施/系统属性主键
-     * @return 能源设施/系统属性
+     * @param id 能源对象属性主键
+     * @return 能源对象属性
      */
-    EmsObjAttr selectAttrById(Long id);
+    EmsObjAttr selectObjAttrById(Long id);
 
     /**
-     * 查询能源设施/系统属性列表
+     * 查询能源对象属性列表
      *
-     * @param Attr 能源设施/系统属性
-     * @return 能源设施/系统属性集合
+     * @param objAttr 能源对象属性
+     * @return 能源对象属性集合
      */
-    List<EmsObjAttr> selectAttrList(EmsObjAttr Attr);
+    List<EmsObjAttr> selectObjAttrList(EmsObjAttr objAttr);
 
     /**
-     * 新增能源设施/系统属性
+     * 根据modelCode查询能源对象属性列表
      *
-     * @param Attr 能源设施/系统属性
+     * @param modelCode 设备模型代码
+     * @return 能源对象能力集合
+     */
+    List<EmsObjAttr> selectByModelCode(@Param("modelCode") String modelCode);
+
+    /**
+     * 新增能源对象属性
+     *
+     * @param objAttr 能源对象属性
      * @return 结果
      */
-    int insertAttr(EmsObjAttr Attr);
+    int insertObjAttr(EmsObjAttr objAttr);
 
     /**
-     * 批量新增能源设施/系统属性
+     * 批量新增能源对象属性
      *
-     * @param list 能源设施/系统属性
+     * @param list 能源对象能力
      * @return 结果
      */
-    int insertAttrBatch(List<EmsObjAttr> list);
+    int insertBatch(List<EmsObjAttr> list);
 
     /**
-     * 修改能源设施/系统属性
+     * 修改能源对象属性
      *
-     * @param Attr 能源设施/系统属性
+     * @param objAttr 能源对象属性
      * @return 结果
      */
-    int updateAttr(EmsObjAttr Attr);
+    int updateObjAttr(EmsObjAttr objAttr);
 
     /**
-     * 删除能源设施/系统属性
+     * 删除能源对象属性
      *
-     * @param id 能源设施/系统属性主键
+     * @param id 能源对象属性主键
      * @return 结果
      */
-    int deleteAttrById(Long id);
+    int deleteObjAttrById(Long id);
 
     /**
-     * 批量删除能源设施/系统属性
+     * 根据modelCode删除能源对象属性
      *
-     * @param ids 需要删除的数据主键集合
+     * @param modelCode 设备模型代码
      * @return 结果
      */
-    int deleteAttrByIds(Long[] ids);
+    int deleteByModelCode(@Param("modelCode") String modelCode);
 
     /**
-     * 批量删除能源设施/系统属性
+     * 批量删除能源对象属性
      *
-     * @param groupCode 分组编码
+     * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    int deleteAttrByGroupCode(String groupCode);
+    int deleteObjAttrByIds(Long[] ids);
 }

+ 41 - 31
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjEventMapper.java

@@ -1,77 +1,87 @@
 package com.ruoyi.ems.mapper;
 
-import java.util.List;
 import com.ruoyi.ems.domain.EmsObjEvent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
- * 能源设施事件Mapper接口
+ * 能源对象事件Mapper接口
  * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 public interface EmsObjEventMapper
 {
     /**
-     * 查询能源设施事件
+     * 查询能源对象事件
      * 
-     * @param id 能源设施事件主键
-     * @return 能源设施事件
+     * @param id 能源对象事件主键
+     * @return 能源对象事件
      */
-     EmsObjEvent selectEventById(Long id);
+     EmsObjEvent selectObjEventById(Long id);
 
     /**
-     * 查询能源设施事件列表
+     * 查询能源对象事件列表
      * 
-     * @param event 能源设施事件
-     * @return 能源设施事件集合
+     * @param objEvent 能源对象事件
+     * @return 能源对象事件集合
+     */
+     List<EmsObjEvent> selectObjEventList(EmsObjEvent objEvent);
+
+    /**
+     * 根据modelCode查询能源对象事件列表
+     *
+     * @param modelCode 设备模型代码
+     * @return 能源对象能力集合
      */
-     List<EmsObjEvent> selectEventList(EmsObjEvent event);
+    List<EmsObjEvent> selectByModelCode(@Param("modelCode") String modelCode);
 
     /**
-     * 新增能源设施事件
+     * 新增能源对象事件
      * 
-     * @param event 能源设施事件
+     * @param objEvent 能源对象事件
      * @return 结果
      */
-     int insertEvent(EmsObjEvent event);
+     int insertObjEvent(EmsObjEvent objEvent);
 
     /**
-     * 批量新增能源设施事件
+     * 批量新增能源对象事件
      *
-     * @param list 能源设施事件
+     * @param list 能源对象事件
      * @return 结果
      */
-    int insertEventBatch(List<EmsObjEvent> list);
+    int insertBatch(List<EmsObjEvent> list);
 
     /**
-     * 修改能源设施事件
+     * 修改能源对象事件
      * 
-     * @param event 能源设施事件
+     * @param objEvent 能源对象事件
      * @return 结果
      */
-     int updateEvent(EmsObjEvent event);
+     int updateObjEvent(EmsObjEvent objEvent);
 
     /**
-     * 删除能源设施事件
+     * 删除能源对象事件
      * 
-     * @param id 能源设施事件主键
+     * @param id 能源对象事件主键
      * @return 结果
      */
-     int deleteEventById(Long id);
+     int deleteObjEventById(Long id);
 
     /**
-     * 批量删除能源设施事件
-     * 
-     * @param ids 需要删除的数据主键集合
+     * 根据modelCode删除能源对象事件
+     *
+     * @param modelCode 设备模型代码
      * @return 结果
      */
-     int deleteEventByIds(Long[] ids);
+    int deleteByModelCode(@Param("modelCode") String modelCode);
 
     /**
-     * 根据设施code删除
-     *
-     * @param groupCode 设施编码
+     * 批量删除能源对象事件
+     * 
+     * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    int deleteEventByGroupCode(String groupCode);
+     int deleteObjEventByIds(Long[] ids);
 }

+ 62 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjModelMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.ems.mapper;
+
+import com.ruoyi.ems.domain.EmsObjModel;
+
+import java.util.List;
+
+/**
+ * 能源对象属性Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public interface EmsObjModelMapper
+{
+    /**
+     * 查询能源对象属性
+     * 
+     * @param id 能源对象属性主键
+     * @return 能源对象属性
+     */
+     EmsObjModel selectObjModelById(Long id);
+
+    /**
+     * 查询能源对象属性列表
+     * 
+     * @param emsObjModel 能源对象属性
+     * @return 能源对象属性集合
+     */
+     List<EmsObjModel> selectObjModelList(EmsObjModel emsObjModel);
+
+    /**
+     * 新增能源对象属性
+     * 
+     * @param emsObjModel 能源对象属性
+     * @return 结果
+     */
+     int insertObjModel(EmsObjModel emsObjModel);
+
+    /**
+     * 修改能源对象属性
+     * 
+     * @param emsObjModel 能源对象属性
+     * @return 结果
+     */
+     int updateObjModel(EmsObjModel emsObjModel);
+
+    /**
+     * 删除能源对象属性
+     * 
+     * @param id 能源对象属性主键
+     * @return 结果
+     */
+     int deleteObjModelById(Long id);
+
+    /**
+     * 批量删除能源对象属性
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+     int deleteObjModelByIds(Long[] ids);
+}

+ 69 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsDeviceComponentService.java

@@ -0,0 +1,69 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.EmsDeviceComponent;
+
+/**
+ * 能源设备部件Service接口
+ *
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public interface IEmsDeviceComponentService {
+    /**
+     * 查询能源设备部件
+     *
+     * @param id 能源设备部件主键
+     * @return 能源设备部件
+     */
+    EmsDeviceComponent selectDeviceComponentById(Long id);
+
+    /**
+     * 查询能源设备部件列表
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 能源设备部件集合
+     */
+    List<EmsDeviceComponent> selectDeviceComponentList(EmsDeviceComponent deviceComponent);
+
+    /**
+     * 查询能源设备部件列表
+     *
+     * @param deviceCode 设备编号
+     * @return 能源设备部件集合
+     */
+    List<EmsDeviceComponent> selectByDeviceCode(String deviceCode);
+
+    /**
+     * 新增能源设备部件
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 结果
+     */
+    int insertDeviceComponent(EmsDeviceComponent deviceComponent);
+
+    /**
+     * 修改能源设备部件
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 结果
+     */
+    int updateDeviceComponent(EmsDeviceComponent deviceComponent);
+
+    /**
+     * 批量删除能源设备部件
+     *
+     * @param ids 需要删除的能源设备部件主键集合
+     * @return 结果
+     */
+    int deleteDeviceComponentByIds(Long[] ids);
+
+    /**
+     * 删除能源设备部件信息
+     *
+     * @param id 能源设备部件主键
+     * @return 结果
+     */
+    int deleteDeviceComponentById(Long id);
+}

+ 37 - 31
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjAbilityService.java

@@ -1,77 +1,83 @@
 package com.ruoyi.ems.service;
 
-import java.util.List;
 import com.ruoyi.ems.domain.EmsObjAbility;
 
+import java.util.List;
+
 /**
- * 能源设施能力Service接口
+ * 能源对象能力Service接口
  * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 public interface IEmsObjAbilityService
 {
     /**
-     * 查询能源设施能力
+     * 查询能源对象能力
      * 
-     * @param id 能源设施能力主键
-     * @return 能源设施能力
+     * @param id 能源对象能力主键
+     * @return 能源对象能力
      */
-     EmsObjAbility selectAbilityById(Long id);
+     EmsObjAbility selectObjAbilityById(Long id);
 
     /**
-     * 查询能源设施能力列表
+     * 查询能源对象能力列表
      * 
-     * @param ability 能源设施能力
-     * @return 能源设施能力集合
+     * @param objAbility 能源对象能力
+     * @return 能源对象能力集合
+     */
+     List<EmsObjAbility> selectObjAbilityList(EmsObjAbility objAbility);
+
+    /**
+     * 查询能源对象能力列表
+     * @param modelCode 模型编号
+     * @return 能源对象能力集合
      */
-     List<EmsObjAbility> selectAbilityList(EmsObjAbility ability);
+     List<EmsObjAbility> selectByModelCode(String modelCode);
 
     /**
-     * 新增能源设施能力
+     * 新增能源对象能力
      * 
-     * @param ability 能源设施能力
+     * @param objAbility 能源对象能力
      * @return 结果
      */
-     int insertAbility(EmsObjAbility ability);
+     int insertObjAbility(EmsObjAbility objAbility);
 
     /**
-     * 批量新增能源设施能力
-     *
-     * @param abilitys 能源设施能力列表
+     * 批量新增能源对象能力
+     * @param list 能源对象能力
      * @return 结果
      */
-    int insertAbilityBatch(List<EmsObjAbility> abilitys);
+     int insertBatch(List<EmsObjAbility> list);
 
     /**
-     * 修改能源设施能力
+     * 修改能源对象能力
      * 
-     * @param ability 能源设施能力
+     * @param objAbility 能源对象能力
      * @return 结果
      */
-     int updateAbility(EmsObjAbility ability);
+     int updateObjAbility(EmsObjAbility objAbility);
 
     /**
-     * 批量删除能源设施能力
+     * 批量删除能源对象能力
      * 
-     * @param ids 需要删除的能源设施能力主键集合
+     * @param ids 需要删除的能源对象能力主键集合
      * @return 结果
      */
-     int deleteAbilityByIds(Long[] ids);
+     int deleteObjAbilityByIds(Long[] ids);
 
     /**
-     * 删除能源设施能力信息
+     * 删除能源对象能力信息
      * 
-     * @param id 能源设施能力主键
+     * @param id 能源对象能力主键
      * @return 结果
      */
-     int deleteAbilityById(Long id);
+     int deleteObjAbilityById(Long id);
 
     /**
-     * 删除能源设施能力信息
-     *
-     * @param groupCode 设施编码
+     * 根据模型编号删除
+     * @param modelCode  模型编号
      * @return 结果
      */
-    int deleteAbilityByGroupCode(String groupCode);
+     int deleteByModelCode(String modelCode);
 }

+ 38 - 29
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjAttrService.java

@@ -1,76 +1,85 @@
 package com.ruoyi.ems.service;
 
-import java.util.List;
 import com.ruoyi.ems.domain.EmsObjAttr;
 
+import java.util.List;
+
 /**
- * 能源设施/系统属性Service接口
+ * 能源对象属性Service接口
  *
  * @author ruoyi
- * @date 2024-07-10
+ * @date 2024-09-23
  */
 public interface IEmsObjAttrService {
     /**
-     * 查询能源设施/系统属性
+     * 查询能源对象属性
+     *
+     * @param id 能源对象属性主键
+     * @return 能源对象属性
+     */
+    EmsObjAttr selectObjAttrById(Long id);
+
+    /**
+     * 查询能源对象属性列表
      *
-     * @param id 能源设施/系统属性主键
-     * @return 能源设施/系统属性
+     * @param objAttr 能源对象属性
+     * @return 能源对象属性集合
      */
-    EmsObjAttr selectAttrById(Long id);
+    List<EmsObjAttr> selectObjAttrList(EmsObjAttr objAttr);
 
     /**
-     * 查询能源设施/系统属性列表
+     * 查询能源对象属性列表
      *
-     * @param attr 能源设施/系统属性
-     * @return 能源设施/系统属性集合
+     * @param modelCode 模型编号
+     * @return 能源对象属性集合
      */
-    List<EmsObjAttr> selectAttrList(EmsObjAttr attr);
+    List<EmsObjAttr> selectByModelCode(String modelCode);
 
     /**
-     * 新增能源设施/系统属性
+     * 新增能源对象属性
      *
-     * @param attr 能源设施/系统属性
+     * @param objAttr 能源对象属性
      * @return 结果
      */
-    int insertAttr(EmsObjAttr attr);
+    int insertObjAttr(EmsObjAttr objAttr);
 
     /**
-     * 批量新增能源设施/系统属性
+     * 批量新增能源对象属性
      *
-     * @param attrs 能源设施/系统属性
+     * @param list 能源对象能力
      * @return 结果
      */
-    int insertAttrBatch(List<EmsObjAttr> attrs);
+    int insertBatch(List<EmsObjAttr> list);
 
     /**
-     * 修改能源设施/系统属性
+     * 修改能源对象属性
      *
-     * @param attr 能源设施/系统属性
+     * @param objAttr 能源对象属性
      * @return 结果
      */
-    int updateAttr(EmsObjAttr attr);
+    int updateObjAttr(EmsObjAttr objAttr);
 
     /**
-     * 批量删除能源设施/系统属性
+     * 批量删除能源对象属性
      *
-     * @param ids 需要删除的能源设施/系统属性主键集合
+     * @param ids 需要删除的能源对象属性主键集合
      * @return 结果
      */
-    int deleteAttrByIds(Long[] ids);
+    int deleteObjAttrByIds(Long[] ids);
 
     /**
-     * 删除能源设施/系统属性信息
+     * 删除能源对象属性信息
      *
-     * @param id 能源设施/系统属性主键
+     * @param id 能源对象属性主键
      * @return 结果
      */
-    int deleteAttrById(Long id);
+    int deleteObjAttrById(Long id);
 
     /**
-     * 删除能源设施/系统属性信息
+     * 根据模型编号删除
      *
-     * @param groupCode 设施编码
+     * @param modelCode 模型编号
      * @return 结果
      */
-    int deleteAttrByGroupCode(String groupCode);
+    int deleteByModelCode(String modelCode);
 }

+ 46 - 36
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjEventService.java

@@ -1,76 +1,86 @@
 package com.ruoyi.ems.service;
 
-import java.util.List;
 import com.ruoyi.ems.domain.EmsObjEvent;
 
+import java.util.List;
+
 /**
- * 能源设施事件Service接口
- *
+ * 能源对象事件Service接口
+ * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
-public interface IEmsObjEventService {
+public interface IEmsObjEventService
+{
     /**
-     * 查询能源设施事件
-     *
-     * @param id 能源设施事件主键
-     * @return 能源设施事件
+     * 查询能源对象事件
+     * 
+     * @param id 能源对象事件主键
+     * @return 能源对象事件
      */
-    EmsObjEvent selectEventById(Long id);
+     EmsObjEvent selectObjEventById(Long id);
 
     /**
-     * 查询能源设施事件列表
-     *
-     * @param event 能源设施事件
-     * @return 能源设施事件集合
+     * 查询能源对象事件列表
+     * 
+     * @param objEvent 能源对象事件
+     * @return 能源对象事件集合
      */
-    List<EmsObjEvent> selectEventList(EmsObjEvent event);
+     List<EmsObjEvent> selectObjEventList(EmsObjEvent objEvent);
 
     /**
-     * 新增能源设施事件
+     * 查询能源对象事件列表
      *
-     * @param event 能源设施事件
+     * @param modelCode 模型编号
+     * @return 能源对象事件集合
+     */
+    List<EmsObjEvent> selectByModelCode(String modelCode);
+
+    /**
+     * 新增能源对象事件
+     * 
+     * @param objEvent 能源对象事件
      * @return 结果
      */
-    int insertEvent(EmsObjEvent event);
+     int insertObjEvent(EmsObjEvent objEvent);
 
     /**
-     * 批量新增能源设施事件
+     * 批量新增能源对象属性
      *
-     * @param events 能源设施事件列表
+     * @param list 能源对象能力
      * @return 结果
      */
-    int insertEventBatch(List<EmsObjEvent> events);
+    int insertBatch(List<EmsObjEvent> list);
 
     /**
-     * 修改能源设施事件
-     *
-     * @param Event 能源设施事件
+     * 修改能源对象事件
+     * 
+     * @param objEvent 能源对象事件
      * @return 结果
      */
-    int updateEvent(EmsObjEvent Event);
+     int updateObjEvent(EmsObjEvent objEvent);
 
     /**
-     * 批量删除能源设施事件
-     *
-     * @param ids 需要删除的能源设施事件主键集合
+     * 批量删除能源对象事件
+     * 
+     * @param ids 需要删除的能源对象事件主键集合
      * @return 结果
      */
-    int deleteEventByIds(Long[] ids);
+     int deleteObjEventByIds(Long[] ids);
 
     /**
-     * 删除能源设施事件信息
-     *
-     * @param id 能源设施事件主键
+     * 删除能源对象事件信息
+     * 
+     * @param id 能源对象事件主键
      * @return 结果
      */
-    int deleteEventById(Long id);
+     int deleteObjEventById(Long id);
 
     /**
-     * 删除能源设施事件信息
+     * 根据模型编号删除
      *
-     * @param groupCode 设施编码
+     * @param modelCode 模型编号
      * @return 结果
      */
-    int deleteEventByGroupCode(String groupCode);
+    int deleteByModelCode(String modelCode);
 }

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

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import com.ruoyi.ems.domain.EmsObjModel;
+
+import java.util.List;
+
+/**
+ * 能源对象属性Service接口
+ *
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+public interface IEmsObjModelService {
+    /**
+     * 查询能源对象属性
+     *
+     * @param id 能源对象属性主键
+     * @return 能源对象属性
+     */
+    EmsObjModel selectObjModelById(Long id);
+
+    /**
+     * 查询能源对象属性列表
+     *
+     * @param objModel 能源对象属性
+     * @return 能源对象属性集合
+     */
+    List<EmsObjModel> selectObjModelList(EmsObjModel objModel);
+
+    /**
+     * 新增能源对象属性
+     *
+     * @param objModel 能源对象属性
+     * @return 结果
+     */
+    int insertObjModel(EmsObjModel objModel);
+
+    /**
+     * 修改能源对象属性
+     *
+     * @param objModel 能源对象属性
+     * @return 结果
+     */
+    int updateObjModel(EmsObjModel objModel);
+
+    /**
+     * 批量删除能源对象属性
+     *
+     * @param ids 需要删除的能源对象属性主键集合
+     * @return 结果
+     */
+    int deleteObjModelByIds(Long[] ids);
+
+    /**
+     * 删除能源对象属性信息
+     *
+     * @param id 能源对象属性主键
+     * @return 结果
+     */
+    int deleteObjModelById(Long id);
+}

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

@@ -0,0 +1,98 @@
+package com.ruoyi.ems.service.impl;
+
+import com.ruoyi.ems.domain.EmsDeviceComponent;
+import com.ruoyi.ems.mapper.EmsDeviceComponentMapper;
+import com.ruoyi.ems.service.IEmsDeviceComponentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 能源设备部件Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+@Service
+public class EmsDeviceComponentServiceImpl implements IEmsDeviceComponentService {
+    @Autowired
+    private EmsDeviceComponentMapper deviceComponentMapper;
+
+    /**
+     * 查询能源设备部件
+     *
+     * @param id 能源设备部件主键
+     * @return 能源设备部件
+     */
+    @Override
+    public EmsDeviceComponent selectDeviceComponentById(Long id) {
+        return deviceComponentMapper.selectDeviceComponentById(id);
+    }
+
+    /**
+     * 查询能源设备部件列表
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 能源设备部件
+     */
+    @Override
+    public List<EmsDeviceComponent> selectDeviceComponentList(EmsDeviceComponent deviceComponent) {
+        return deviceComponentMapper.selectDeviceComponentList(deviceComponent);
+    }
+
+    /**
+     * 根据设备编号查询能源设备部件
+     *
+     * @param deviceCode 设备编号
+     * @return 能源设备部件
+     */
+    @Override
+    public List<EmsDeviceComponent> selectByDeviceCode(String deviceCode) {
+        return deviceComponentMapper.selectByDeviceCode(deviceCode);
+    }
+
+    /**
+     * 新增能源设备部件
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 结果
+     */
+    @Override
+    public int insertDeviceComponent(EmsDeviceComponent deviceComponent) {
+        return deviceComponentMapper.insertDeviceComponent(deviceComponent);
+    }
+
+    /**
+     * 修改能源设备部件
+     *
+     * @param deviceComponent 能源设备部件
+     * @return 结果
+     */
+    @Override
+    public int updateDeviceComponent(EmsDeviceComponent deviceComponent) {
+        return deviceComponentMapper.updateDeviceComponent(deviceComponent);
+    }
+
+    /**
+     * 批量删除能源设备部件
+     *
+     * @param ids 需要删除的能源设备部件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDeviceComponentByIds(Long[] ids) {
+        return deviceComponentMapper.deleteDeviceComponentByIds(ids);
+    }
+
+    /**
+     * 删除能源设备部件信息
+     *
+     * @param id 能源设备部件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDeviceComponentById(Long id) {
+        return deviceComponentMapper.deleteDeviceComponentById(id);
+    }
+}

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

@@ -1,106 +1,110 @@
 package com.ruoyi.ems.service.impl;
 
-import java.util.List;
 
 import com.ruoyi.ems.domain.EmsObjAbility;
+import com.ruoyi.ems.mapper.EmsObjAbilityMapper;
 import com.ruoyi.ems.service.IEmsObjAbilityService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.ems.mapper.EmsObjAbilityMapper;
+
+import java.util.List;
 
 /**
- * 能源设施能力Service业务层处理
- *
+ * 能源对象能力Service业务层处理
+ * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 @Service
-public class EmsObjAbilityServiceImpl implements IEmsObjAbilityService {
+public class EmsObjAbilityServiceImpl implements IEmsObjAbilityService
+{
     @Autowired
-    private EmsObjAbilityMapper abilityMapper;
+    private EmsObjAbilityMapper objAbilityMapper;
 
     /**
-     * 查询能源设施能力
-     *
-     * @param id 能源设施能力主键
-     * @return 能源设施能力
+     * 查询能源对象能力
+     * 
+     * @param id 能源对象能力主键
+     * @return 能源对象能力
      */
     @Override
-    public EmsObjAbility selectAbilityById(Long id) {
-        return abilityMapper.selectAbilityById(id);
+    public EmsObjAbility selectObjAbilityById(Long id)
+    {
+        return objAbilityMapper.selectObjAbilityById(id);
     }
 
     /**
-     * 查询能源设施能力列表
-     *
-     * @param Ability 能源设施能力
-     * @return 能源设施能力
+     * 查询能源对象能力列表
+     * 
+     * @param objAbility 能源对象能力
+     * @return 能源对象能力
      */
     @Override
-    public List<EmsObjAbility> selectAbilityList(EmsObjAbility Ability) {
-        return abilityMapper.selectAbilityList(Ability);
+    public List<EmsObjAbility> selectObjAbilityList(EmsObjAbility objAbility)
+    {
+        return objAbilityMapper.selectObjAbilityList(objAbility);
     }
 
-    /**
-     * 新增能源设施能力
-     *
-     * @param Ability 能源设施能力
-     * @return 结果
-     */
     @Override
-    public int insertAbility(EmsObjAbility Ability) {
-        return abilityMapper.insertAbility(Ability);
+    public List<EmsObjAbility> selectByModelCode(String modelCode) {
+        return objAbilityMapper.selectByModelCode(modelCode);
     }
 
     /**
-     * 批量-新增能源设施能力
-     *
-     * @param Abilitys 能源设施能力list
+     * 新增能源对象能力
+     * 
+     * @param objAbility 能源对象能力
      * @return 结果
      */
     @Override
-    public int insertAbilityBatch(List<EmsObjAbility> Abilitys) {
-        return abilityMapper.insertAbilityBatch(Abilitys);
+    public int insertObjAbility(EmsObjAbility objAbility)
+    {
+        return objAbilityMapper.insertObjAbility(objAbility);
+    }
+
+    @Override
+    public int insertBatch(List<EmsObjAbility> list) {
+        return objAbilityMapper.insertBatch(list);
     }
 
     /**
-     * 修改能源设施能力
-     *
-     * @param Ability 能源设施能力
+     * 修改能源对象能力
+     * 
+     * @param objAbility 能源对象能力
      * @return 结果
      */
     @Override
-    public int updateAbility(EmsObjAbility Ability) {
-        return abilityMapper.updateAbility(Ability);
+    public int updateObjAbility(EmsObjAbility objAbility)
+    {
+        return objAbilityMapper.updateObjAbility(objAbility);
     }
 
     /**
-     * 批量删除能源设施能力
-     *
-     * @param ids 需要删除的能源设施能力主键
+     * 批量删除能源对象能力
+     * 
+     * @param ids 需要删除的能源对象能力主键
      * @return 结果
      */
     @Override
-    public int deleteAbilityByIds(Long[] ids) {
-        return abilityMapper.deleteAbilityByIds(ids);
+    public int deleteObjAbilityByIds(Long[] ids)
+    {
+        return objAbilityMapper.deleteObjAbilityByIds(ids);
     }
 
     /**
-     * 删除能源设施能力信息
-     *
-     * @param id 能源设施能力主键
+     * 删除能源对象能力信息
+     * 
+     * @param id 能源对象能力主键
      * @return 结果
      */
     @Override
-    public int deleteAbilityById(Long id) {
-        return abilityMapper.deleteAbilityById(id);
+    public int deleteObjAbilityById(Long id)
+    {
+        return objAbilityMapper.deleteObjAbilityById(id);
     }
 
     @Override
-    public int deleteAbilityByGroupCode(String groupCode) {
-        if (groupCode == null) {
-            return 0;
-        }
-        return abilityMapper.deleteAbilityGroupCode(groupCode);
+    public int deleteByModelCode(String modelCode) {
+        return objAbilityMapper.deleteByModelCode(modelCode);
     }
 }

+ 55 - 58
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjAttrServiceImpl.java

@@ -1,112 +1,109 @@
 package com.ruoyi.ems.service.impl;
 
-import java.util.List;
-
 import com.ruoyi.ems.domain.EmsObjAttr;
 import com.ruoyi.ems.mapper.EmsObjAttrMapper;
 import com.ruoyi.ems.service.IEmsObjAttrService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
- * 能源设施/系统属性Service业务层处理
- *
+ * 能源对象属性Service业务层处理
+ * 
  * @author ruoyi
- * @date 2024-07-10
+ * @date 2024-09-23
  */
 @Service
-public class EmsObjAttrServiceImpl implements IEmsObjAttrService {
+public class EmsObjAttrServiceImpl implements IEmsObjAttrService
+{
     @Autowired
-    private EmsObjAttrMapper emsObjAttrMapper;
+    private EmsObjAttrMapper objAttrMapper;
 
     /**
-     * 查询能源设施/系统属性
-     *
-     * @param id 能源设施/系统属性主键
-     * @return 能源设施/系统属性
+     * 查询能源对象属性
+     * 
+     * @param id 能源对象属性主键
+     * @return 能源对象属性
      */
     @Override
-    public EmsObjAttr selectAttrById(Long id) {
-        return emsObjAttrMapper.selectAttrById(id);
+    public EmsObjAttr selectObjAttrById(Long id)
+    {
+        return objAttrMapper.selectObjAttrById(id);
     }
 
     /**
-     * 查询能源设施/系统属性列表
-     *
-     * @param attr 能源设施/系统属性
-     * @return 能源设施/系统属性
+     * 查询能源对象属性列表
+     * 
+     * @param objAttr 能源对象属性
+     * @return 能源对象属性
      */
     @Override
-    public List<EmsObjAttr> selectAttrList(EmsObjAttr attr) {
-        return emsObjAttrMapper.selectAttrList(attr);
+    public List<EmsObjAttr> selectObjAttrList(EmsObjAttr objAttr)
+    {
+        return objAttrMapper.selectObjAttrList(objAttr);
     }
 
-    /**
-     * 新增能源设施/系统属性
-     *
-     * @param attr 能源设施/系统属性
-     * @return 结果
-     */
     @Override
-    public int insertAttr(EmsObjAttr attr) {
-        return emsObjAttrMapper.insertAttr(attr);
+    public List<EmsObjAttr> selectByModelCode(String modelCode) {
+        return objAttrMapper.selectByModelCode(modelCode);
     }
 
     /**
-     * 批量新增能源设施/系统属性
-     *
-     * @param attrs 能源设施/系统属性
+     * 新增能源对象属性
+     * 
+     * @param objAttr 能源对象属性
      * @return 结果
      */
     @Override
-    public int insertAttrBatch(List<EmsObjAttr> attrs) {
-        return emsObjAttrMapper.insertAttrBatch(attrs);
+    public int insertObjAttr(EmsObjAttr objAttr)
+    {
+        return objAttrMapper.insertObjAttr(objAttr);
     }
 
-    /**
-     * 修改能源设施/系统属性
-     *
-     * @param attr 能源设施/系统属性
-     * @return 结果
-     */
     @Override
-    public int updateAttr(EmsObjAttr attr) {
-        return emsObjAttrMapper.updateAttr(attr);
+    public int insertBatch(List<EmsObjAttr> list) {
+        return objAttrMapper.insertBatch(list);
     }
 
     /**
-     * 批量删除能源设施/系统属性
-     *
-     * @param ids 需要删除的能源设施/系统属性主键
+     * 修改能源对象属性
+     * 
+     * @param objAttr 能源对象属性
      * @return 结果
      */
     @Override
-    public int deleteAttrByIds(Long[] ids) {
-        return emsObjAttrMapper.deleteAttrByIds(ids);
+    public int updateObjAttr(EmsObjAttr objAttr)
+    {
+        return objAttrMapper.updateObjAttr(objAttr);
     }
 
     /**
-     * 删除能源设施/系统属性信息
-     *
-     * @param id 能源设施/系统属性主键
+     * 批量删除能源对象属性
+     * 
+     * @param ids 需要删除的能源对象属性主键
      * @return 结果
      */
     @Override
-    public int deleteAttrById(Long id) {
-        return emsObjAttrMapper.deleteAttrById(id);
+    public int deleteObjAttrByIds(Long[] ids)
+    {
+        return objAttrMapper.deleteObjAttrByIds(ids);
     }
 
     /**
-     * 批量删除能源设施/系统属性
-     *
-     * @param groupCode 设施编码
+     * 删除能源对象属性信息
+     * 
+     * @param id 能源对象属性主键
      * @return 结果
      */
     @Override
-    public int deleteAttrByGroupCode(String groupCode) {
-        if (groupCode == null) {
-            return 0;
-        }
-        return emsObjAttrMapper.deleteAttrByGroupCode(groupCode);
+    public int deleteObjAttrById(Long id)
+    {
+        return objAttrMapper.deleteObjAttrById(id);
+    }
+
+    @Override
+    public int deleteByModelCode(String modelCode) {
+        return objAttrMapper.deleteByModelCode(modelCode);
     }
 }

+ 56 - 47
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjEventServiceImpl.java

@@ -1,100 +1,109 @@
 package com.ruoyi.ems.service.impl;
 
-import java.util.List;
-
 import com.ruoyi.ems.domain.EmsObjEvent;
+import com.ruoyi.ems.mapper.EmsObjEventMapper;
 import com.ruoyi.ems.service.IEmsObjEventService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.ems.mapper.EmsObjEventMapper;
+
+import java.util.List;
 
 /**
- * 能源设施事件Service业务层处理
- *
+ * 能源对象事件Service业务层处理
+ * 
  * @author ruoyi
- * @date 2024-08-22
+ * @date 2024-09-23
  */
 @Service
-public class EmsObjEventServiceImpl implements IEmsObjEventService {
+public class EmsObjEventServiceImpl implements IEmsObjEventService
+{
     @Autowired
-    private EmsObjEventMapper eventMapper;
+    private EmsObjEventMapper objEventMapper;
 
     /**
-     * 查询能源设施事件
-     *
-     * @param id 能源设施事件主键
-     * @return 能源设施事件
+     * 查询能源对象事件
+     * 
+     * @param id 能源对象事件主键
+     * @return 能源对象事件
      */
     @Override
-    public EmsObjEvent selectEventById(Long id) {
-        return eventMapper.selectEventById(id);
+    public EmsObjEvent selectObjEventById(Long id)
+    {
+        return objEventMapper.selectObjEventById(id);
     }
 
     /**
-     * 查询能源设施事件列表
-     *
-     * @param event 能源设施事件
-     * @return 能源设施事件
+     * 查询能源对象事件列表
+     * 
+     * @param admEmsObjEvent 能源对象事件
+     * @return 能源对象事件
      */
     @Override
-    public List<EmsObjEvent> selectEventList(EmsObjEvent event) {
-        return eventMapper.selectEventList(event);
+    public List<EmsObjEvent> selectObjEventList(EmsObjEvent admEmsObjEvent)
+    {
+        return objEventMapper.selectObjEventList(admEmsObjEvent);
+    }
+
+    @Override
+    public List<EmsObjEvent> selectByModelCode(String modelCode) {
+        return objEventMapper.selectByModelCode(modelCode);
     }
 
     /**
-     * 新增能源设施事件
-     *
-     * @param event 能源设施事件
+     * 新增能源对象事件
+     * 
+     * @param admEmsObjEvent 能源对象事件
      * @return 结果
      */
     @Override
-    public int insertEvent(EmsObjEvent event) {
-        return eventMapper.insertEvent(event);
+    public int insertObjEvent(EmsObjEvent admEmsObjEvent)
+    {
+        return objEventMapper.insertObjEvent(admEmsObjEvent);
     }
 
     @Override
-    public int insertEventBatch(List<EmsObjEvent> events) {
-        return eventMapper.insertEventBatch(events);
+    public int insertBatch(List<EmsObjEvent> list) {
+        return objEventMapper.insertBatch(list);
     }
 
     /**
-     * 修改能源设施事件
-     *
-     * @param Event 能源设施事件
+     * 修改能源对象事件
+     * 
+     * @param admEmsObjEvent 能源对象事件
      * @return 结果
      */
     @Override
-    public int updateEvent(EmsObjEvent Event) {
-        return eventMapper.updateEvent(Event);
+    public int updateObjEvent(EmsObjEvent admEmsObjEvent)
+    {
+        return objEventMapper.updateObjEvent(admEmsObjEvent);
     }
 
     /**
-     * 批量删除能源设施事件
-     *
-     * @param ids 需要删除的能源设施事件主键
+     * 批量删除能源对象事件
+     * 
+     * @param ids 需要删除的能源对象事件主键
      * @return 结果
      */
     @Override
-    public int deleteEventByIds(Long[] ids) {
-        return eventMapper.deleteEventByIds(ids);
+    public int deleteObjEventByIds(Long[] ids)
+    {
+        return objEventMapper.deleteObjEventByIds(ids);
     }
 
     /**
-     * 删除能源设施事件信息
-     *
-     * @param id 能源设施事件主键
+     * 删除能源对象事件信息
+     * 
+     * @param id 能源对象事件主键
      * @return 结果
      */
     @Override
-    public int deleteEventById(Long id) {
-        return eventMapper.deleteEventById(id);
+    public int deleteObjEventById(Long id)
+    {
+        return objEventMapper.deleteObjEventById(id);
     }
 
     @Override
-    public int deleteEventByGroupCode(String groupCode) {
-        if (groupCode == null) {
-            return 0;
-        }
-        return eventMapper.deleteEventByGroupCode(groupCode);
+    public int deleteByModelCode(String modelCode) {
+        return objEventMapper.deleteByModelCode(modelCode);
     }
 }

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

@@ -0,0 +1,125 @@
+package com.ruoyi.ems.service.impl;
+
+import com.ruoyi.ems.domain.EmsObjModel;
+import com.ruoyi.ems.mapper.EmsObjModelMapper;
+import com.ruoyi.ems.service.IEmsObjAbilityService;
+import com.ruoyi.ems.service.IEmsObjAttrService;
+import com.ruoyi.ems.service.IEmsObjEventService;
+import com.ruoyi.ems.service.IEmsObjModelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 能源对象属性Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-09-23
+ */
+@Service
+public class EmsObjModelServiceImpl implements IEmsObjModelService {
+    @Autowired
+    private EmsObjModelMapper objModelMapper;
+
+    @Autowired
+    private IEmsObjAbilityService abilityService;
+
+    @Autowired
+    private IEmsObjAttrService attrService;
+
+    @Autowired
+    private IEmsObjEventService eventService;
+
+    /**
+     * 查询能源对象属性
+     *
+     * @param id 能源对象属性主键
+     * @return 能源对象属性
+     */
+    @Override
+    public EmsObjModel selectObjModelById(Long id) {
+        EmsObjModel objModel = objModelMapper.selectObjModelById(id);
+
+        if (null != objModel) {
+            objModel.setAttrList(attrService.selectByModelCode(objModel.getModelCode()));
+            objModel.setAbilityList(abilityService.selectByModelCode(objModel.getModelCode()));
+            objModel.setEventList(eventService.selectByModelCode(objModel.getModelCode()));
+        }
+
+        return objModel;
+    }
+
+    /**
+     * 查询能源对象属性列表
+     *
+     * @param objModel 能源对象属性
+     * @return 能源对象属性
+     */
+    @Override
+    public List<EmsObjModel> selectObjModelList(EmsObjModel objModel) {
+        return objModelMapper.selectObjModelList(objModel);
+    }
+
+    /**
+     * 新增能源对象属性
+     *
+     * @param objModel 能源对象属性
+     * @return 结果
+     */
+    @Override
+    public int insertObjModel(EmsObjModel objModel) {
+        return objModelMapper.insertObjModel(objModel);
+    }
+
+    /**
+     * 修改能源对象属性
+     *
+     * @param objModel 能源对象属性
+     * @return 结果
+     */
+    @Override
+    public int updateObjModel(EmsObjModel objModel) {
+        return objModelMapper.updateObjModel(objModel);
+    }
+
+    /**
+     * 批量删除能源对象属性
+     *
+     * @param ids 需要删除的能源对象属性主键
+     * @return 结果
+     */
+    @Override
+    public int deleteObjModelByIds(Long[] ids) {
+        for (Long id : ids) {
+            EmsObjModel objModel = objModelMapper.selectObjModelById(id);
+
+            if (null != objModel) {
+                attrService.deleteByModelCode(objModel.getModelCode());
+                abilityService.deleteByModelCode(objModel.getModelCode());
+                eventService.deleteByModelCode(objModel.getModelCode());
+            }
+        }
+
+        return objModelMapper.deleteObjModelByIds(ids);
+    }
+
+    /**
+     * 删除能源对象属性信息
+     *
+     * @param id 能源对象属性主键
+     * @return 结果
+     */
+    @Override
+    public int deleteObjModelById(Long id) {
+        EmsObjModel objModel = objModelMapper.selectObjModelById(id);
+
+        if (null != objModel) {
+            attrService.deleteByModelCode(objModel.getModelCode());
+            abilityService.deleteByModelCode(objModel.getModelCode());
+            eventService.deleteByModelCode(objModel.getModelCode());
+        }
+
+        return objModelMapper.deleteObjModelById(id);
+    }
+}

+ 93 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceComponentMapper.xml

@@ -0,0 +1,93 @@
+<?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.EmsDeviceComponentMapper">
+    
+    <resultMap type="com.ruoyi.ems.domain.EmsDeviceComponent" id="DeviceComponentResult">
+        <result property="id"    column="id"    />
+        <result property="deviceCode"    column="device_code"    />
+        <result property="compoCode"    column="compo_code"    />
+        <result property="extCompoCode"    column="ext_compo_code"    />
+        <result property="compoModel"    column="compo_model"    />
+        <result property="compoBrand"    column="compo_brand"    />
+        <result property="compoSpec"    column="compo_spec"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="parentCompo"    column="parent_compo"    />
+    </resultMap>
+
+    <sql id="selectDeviceComponentVo">
+        select id, device_code, compo_code, ext_compo_code, compo_model, compo_brand, compo_spec, ancestors, parent_compo from adm_ems_device_component
+    </sql>
+
+    <select id="selectDeviceComponentList" parameterType="com.ruoyi.ems.domain.EmsDeviceComponent" resultMap="DeviceComponentResult">
+        <include refid="selectDeviceComponentVo"/>
+        <where>  
+            <if test="deviceCode != null  and deviceCode != ''"> and device_code = #{deviceCode}</if>
+            <if test="compoCode != null  and compoCode != ''"> and compo_code = #{compoCode}</if>
+            <if test="extCompoCode != null  and extCompoCode != ''"> and ext_compo_code = #{extCompoCode}</if>
+            <if test="compoModel != null  and compoModel != ''"> and compo_model = #{compoModel}</if>
+            <if test="parentCompo != null  and parentCompo != ''"> and parent_compo = #{parentCompo}</if>
+        </where>
+    </select>
+
+    <select id="selectByDeviceCode" parameterType="java.lang.String" resultMap="DeviceComponentResult">
+        <include refid="selectDeviceComponentVo"/>
+        where deviceCode = #{deviceCode}
+    </select>
+
+    <select id="selectDeviceComponentById" parameterType="Long" resultMap="DeviceComponentResult">
+        <include refid="selectDeviceComponentVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDeviceComponent" parameterType="com.ruoyi.ems.domain.EmsDeviceComponent" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_ems_device_component
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deviceCode != null and deviceCode != ''">device_code,</if>
+            <if test="compoCode != null and compoCode != ''">compo_code,</if>
+            <if test="extCompoCode != null">ext_compo_code,</if>
+            <if test="compoModel != null">compo_model,</if>
+            <if test="compoBrand != null">compo_brand,</if>
+            <if test="compoSpec != null">compo_spec,</if>
+            <if test="ancestors != null">ancestors,</if>
+            <if test="parentCompo != null">parent_compo,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
+            <if test="compoCode != null and compoCode != ''">#{compoCode},</if>
+            <if test="extCompoCode != null">#{extCompoCode},</if>
+            <if test="compoModel != null">#{compoModel},</if>
+            <if test="compoBrand != null">#{compoBrand},</if>
+            <if test="compoSpec != null">#{compoSpec},</if>
+            <if test="ancestors != null">#{ancestors},</if>
+            <if test="parentCompo != null">#{parentCompo},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDeviceComponent" parameterType="com.ruoyi.ems.domain.EmsDeviceComponent">
+        update adm_ems_device_component
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
+            <if test="compoCode != null and compoCode != ''">compo_code = #{compoCode},</if>
+            <if test="extCompoCode != null">ext_compo_code = #{extCompoCode},</if>
+            <if test="compoModel != null">compo_model = #{compoModel},</if>
+            <if test="compoBrand != null">compo_brand = #{compoBrand},</if>
+            <if test="compoSpec != null">compo_spec = #{compoSpec},</if>
+            <if test="ancestors != null">ancestors = #{ancestors},</if>
+            <if test="parentCompo != null">parent_compo = #{parentCompo},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDeviceComponentById" parameterType="Long">
+        delete from adm_ems_device_component where id = #{id}
+    </delete>
+
+    <delete id="deleteDeviceComponentByIds" parameterType="String">
+        delete from adm_ems_device_component where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 36 - 33
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAbilityMapper.xml

@@ -4,66 +4,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ems.mapper.EmsObjAbilityMapper">
     
-    <resultMap type="com.ruoyi.ems.domain.EmsObjAbility" id="AbilityResult">
+    <resultMap type="com.ruoyi.ems.domain.EmsObjAbility" id="ObjAbilityResult">
         <result property="id"    column="id"    />
-        <result property="groupCode"    column="group_code"    />
-        <result property="groupName"    column="group_name"    />
-        <result property="objType"      column="obj_type"    />
+        <result property="modelCode"    column="model_code"    />
+        <result property="abilityKey"    column="ability_key"    />
         <result property="abilityName"    column="ability_name"    />
         <result property="abilityDesc"    column="ability_desc"    />
         <result property="abilityParam"    column="ability_param"    />
     </resultMap>
 
-    <sql id="selectAbilityVo">
-        select id, group_code, group_name, obj_type, ability_name, ability_desc, ability_param from adm_ems_obj_ability
+    <sql id="selectObjAbilityVo">
+        select id, model_code, ability_key, ability_name, ability_desc, ability_param from adm_ems_obj_ability
     </sql>
 
-    <select id="selectAbilityList" parameterType="com.ruoyi.ems.domain.EmsObjAbility" resultMap="AbilityResult">
-        <include refid="selectAbilityVo"/>
+    <select id="selectObjAbilityList" parameterType="com.ruoyi.ems.domain.EmsObjAbility" resultMap="ObjAbilityResult">
+        <include refid="selectObjAbilityVo"/>
         <where>  
-            <if test="groupCode != null  and groupCode != ''"> and group_code = #{groupCode}</if>
-            <if test="objType != null"> and obj_type = #{objType}</if>
+            <if test="modelCode != null  and modelCode != ''"> and model_code = #{modelCode}</if>
+            <if test="abilityKey != null  and abilityKey != ''"> and ability_key = #{abilityKey}</if>
+            <if test="abilityName != null  and abilityName != ''"> and ability_name like concat('%', #{abilityName}, '%')</if>
         </where>
     </select>
+
+    <select id="selectByModelCode" parameterType="java.lang.String" resultMap="ObjAbilityResult">
+        <include refid="selectObjAbilityVo"/>
+        where model_code = #{modelCode}
+    </select>
     
-    <select id="selectAbilityById" parameterType="Long" resultMap="AbilityResult">
-        <include refid="selectAbilityVo"/>
+    <select id="selectObjAbilityById" parameterType="Long" resultMap="ObjAbilityResult">
+        <include refid="selectObjAbilityVo"/>
         where id = #{id}
     </select>
         
-    <insert id="insertAbility" parameterType="com.ruoyi.ems.domain.EmsObjAbility" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertObjAbility" parameterType="com.ruoyi.ems.domain.EmsObjAbility" useGeneratedKeys="true" keyProperty="id">
         insert into adm_ems_obj_ability
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">group_code,</if>
-            <if test="groupName != null and groupName != ''">group_name,</if>
-            <if test="objType != null">obj_type,</if>
+            <if test="modelCode != null and modelCode != ''">model_code,</if>
+            <if test="abilityKey != null and abilityKey != ''">ability_key,</if>
             <if test="abilityName != null and abilityName != ''">ability_name,</if>
             <if test="abilityDesc != null">ability_desc,</if>
             <if test="abilityParam != null">ability_param,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">#{groupCode},</if>
-            <if test="groupName != null and groupName != ''">#{groupName},</if>
-            <if test="objType != null">#{objType},</if>
+            <if test="modelCode != null and modelCode != ''">#{modelCode},</if>
+            <if test="abilityKey != null and abilityKey != ''">#{abilityKey},</if>
             <if test="abilityName != null and abilityName != ''">#{abilityName},</if>
             <if test="abilityDesc != null">#{abilityDesc},</if>
             <if test="abilityParam != null">#{abilityParam},</if>
          </trim>
     </insert>
 
-    <insert id="insertAbilityBatch" parameterType="java.util.List">
-        insert into adm_ems_obj_ability (group_code, group_name, obj_type, ability_name, ability_desc, ability_param) values
+    <insert id="insertBatch" parameterType="java.util.List">
+        insert into adm_ems_obj_ability (model_code, ability_key, ability_name, ability_desc, ability_param)
+        values
         <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.groupCode},#{item.groupName},#{item.objType},#{item.abilityName},#{item.abilityDesc},#{item.abilityParam})
+            (#{item.modelCode}, #{item.abilityKey}, #{item.abilityName}, #{item.abilityDesc}, #{item.abilityParam})
         </foreach>
     </insert>
 
-    <update id="updateAbility" parameterType="com.ruoyi.ems.domain.EmsObjAbility">
+    <update id="updateObjAbility" parameterType="com.ruoyi.ems.domain.EmsObjAbility">
         update adm_ems_obj_ability
         <trim prefix="SET" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">group_code = #{groupCode},</if>
-            <if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
-            <if test="objType != null">obj_type = #{objType},</if>
+            <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if>
+            <if test="abilityKey != null and abilityKey != ''">ability_key = #{abilityKey},</if>
             <if test="abilityName != null and abilityName != ''">ability_name = #{abilityName},</if>
             <if test="abilityDesc != null">ability_desc = #{abilityDesc},</if>
             <if test="abilityParam != null">ability_param = #{abilityParam},</if>
@@ -71,18 +74,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
-    <delete id="deleteAbilityById" parameterType="Long">
+    <delete id="deleteObjAbilityById" parameterType="Long">
         delete from adm_ems_obj_ability where id = #{id}
     </delete>
 
-    <delete id="deleteAbilityByIds" parameterType="String">
-        delete from adm_ems_obj_ability where id in
+    <delete id="deleteByModelCode" parameterType="String">
+        delete from adm_ems_obj_ability where model_code = #{modelCode}
+    </delete>
+
+    <delete id="deleteObjAbilityByIds" parameterType="String">
+        delete from adm_ems_obj_ability where id in 
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-
-    <delete id="deleteAbilityGroupCode" parameterType="String">
-        delete from adm_ems_obj_ability where group_code = #{groupCode}
-    </delete>
 </mapper>

+ 38 - 39
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAttrMapper.xml

@@ -4,89 +4,88 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ems.mapper.EmsObjAttrMapper">
     
-    <resultMap type="com.ruoyi.ems.domain.EmsObjAttr" id="EmsAttrResult">
+    <resultMap type="com.ruoyi.ems.domain.EmsObjAttr" id="ObjAttrResult">
         <result property="id"    column="id"    />
-        <result property="groupCode"    column="group_code"    />
-        <result property="groupName"    column="group_name"    />
-        <result property="objType"      column="obj_type"    />
-        <result property="attrName"     column="attr_name"    />
-        <result property="attrDesc"     column="attr_desc"    />
+        <result property="modelCode"    column="model_code"    />
+        <result property="attrKey"    column="attr_key"    />
+        <result property="attrName"    column="attr_name"    />
         <result property="attrValue"    column="attr_value"    />
-        <result property="attrUnit"     column="attr_unit"    />
+        <result property="attrUnit"    column="attr_unit"    />
     </resultMap>
 
-    <sql id="selectAttrVo">
-        select id, group_code, group_name, obj_type, attr_name, attr_desc, attr_value, attr_unit from adm_ems_obj_attr
+    <sql id="selectAdmEmsObjAttrVo">
+        select id, model_code, attr_key, attr_name, attr_value, attr_unit from adm_ems_obj_attr
     </sql>
 
-    <select id="selectAttrList" parameterType="com.ruoyi.ems.domain.EmsObjAttr" resultMap="EmsAttrResult">
-        <include refid="selectAttrVo"/>
+    <select id="selectObjAttrList" parameterType="com.ruoyi.ems.domain.EmsObjAttr" resultMap="ObjAttrResult">
+        <include refid="selectAdmEmsObjAttrVo"/>
         <where>  
-            <if test="groupCode != null  and groupCode != ''"> and group_code = #{groupCode}</if>
-            <if test="objType != null"> and obj_type = #{objType}</if>
+            <if test="modelCode != null  and modelCode != ''"> and model_code = #{modelCode}</if>
+            <if test="attrKey != null  and attrKey != ''"> and attr_key = #{attrKey}</if>
+            <if test="attrName != null  and attrName != ''"> and attr_name like concat('%', #{attrName}, '%')</if>
         </where>
     </select>
+
+    <select id="selectByModelCode" parameterType="java.lang.String" resultMap="ObjAttrResult">
+        <include refid="selectAdmEmsObjAttrVo"/>
+        where model_code = #{modelCode}
+    </select>
     
-    <select id="selectAttrById" parameterType="Long" resultMap="EmsAttrResult">
-        <include refid="selectAttrVo"/>
+    <select id="selectObjAttrById" parameterType="Long" resultMap="ObjAttrResult">
+        <include refid="selectAdmEmsObjAttrVo"/>
         where id = #{id}
     </select>
         
-    <insert id="insertAttr" parameterType="com.ruoyi.ems.domain.EmsObjAttr" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertObjAttr" parameterType="com.ruoyi.ems.domain.EmsObjAttr" useGeneratedKeys="true" keyProperty="id">
         insert into adm_ems_obj_attr
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">group_code,</if>
-            <if test="groupName != null and groupName != ''">group_name,</if>
-            <if test="objType != null">obj_type,</if>
+            <if test="modelCode != null and modelCode != ''">model_code,</if>
+            <if test="attrKey != null and attrKey != ''">attr_key,</if>
             <if test="attrName != null and attrName != ''">attr_name,</if>
-            <if test="attrDesc != null">attr_desc,</if>
             <if test="attrValue != null">attr_value,</if>
             <if test="attrUnit != null">attr_unit,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">#{groupCode},</if>
-            <if test="groupName != null and groupName != ''">#{groupName},</if>
-            <if test="objType != null">#{objType},</if>
+            <if test="modelCode != null and modelCode != ''">#{modelCode},</if>
+            <if test="attrKey != null and attrKey != ''">#{attrKey},</if>
             <if test="attrName != null and attrName != ''">#{attrName},</if>
-            <if test="attrDesc != null">#{attrDesc},</if>
             <if test="attrValue != null">#{attrValue},</if>
             <if test="attrUnit != null">#{attrUnit},</if>
          </trim>
     </insert>
 
-    <insert id="insertAttrBatch" parameterType="java.util.List">
-        insert into adm_ems_obj_attr (group_code, group_name, obj_type, attr_name, attr_desc, attr_value, attr_unit) values
+    <insert id="insertBatch" parameterType="java.util.List">
+        insert into adm_ems_obj_attr (model_code, attr_key, attr_name, attr_value, attr_unit)
+        values
         <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.groupCode},#{item.groupName},#{item.objType},#{item.attrName},#{item.attrDesc},#{item.attrValue},#{item.attrUnit})
+            (#{item.modelCode}, #{item.attrKey}, #{item.attrName}, #{item.attrValue}, #{item.attrUnit})
         </foreach>
     </insert>
 
-    <update id="updateAttr" parameterType="com.ruoyi.ems.domain.EmsObjAttr">
+    <update id="updateObjAttr" parameterType="com.ruoyi.ems.domain.EmsObjAttr">
         update adm_ems_obj_attr
         <trim prefix="SET" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">group_code = #{groupCode},</if>
-            <if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
-            <if test="objType != null">obj_type = #{objType},</if>
+            <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if>
+            <if test="attrKey != null and attrKey != ''">attr_key = #{attrKey},</if>
             <if test="attrName != null and attrName != ''">attr_name = #{attrName},</if>
-            <if test="attrDesc != null">attr_desc = #{attrDesc},</if>
             <if test="attrValue != null">attr_value = #{attrValue},</if>
             <if test="attrUnit != null">attr_unit = #{attrUnit},</if>
         </trim>
         where id = #{id}
     </update>
 
-    <delete id="deleteAttrById" parameterType="Long">
+    <delete id="deleteObjAttrById" parameterType="Long">
         delete from adm_ems_obj_attr where id = #{id}
     </delete>
 
-    <delete id="deleteAttrByIds" parameterType="String">
-        delete from adm_ems_obj_attr where id in
+    <delete id="deleteByModelCode" parameterType="String">
+        delete from adm_ems_obj_attr where model_code = #{modelCode}
+    </delete>
+
+    <delete id="deleteObjAttrByIds" parameterType="String">
+        delete from adm_ems_obj_attr where id in 
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-
-    <delete id="deleteAttrByGroupCode" parameterType="String">
-        delete from adm_ems_obj_attr where group_code = #{groupCode}
-    </delete>
 </mapper>

+ 43 - 38
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjEventMapper.xml

@@ -4,74 +4,79 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ems.mapper.EmsObjEventMapper">
     
-    <resultMap type="com.ruoyi.ems.domain.EmsObjEvent" id="EventResult">
+    <resultMap type="com.ruoyi.ems.domain.EmsObjEvent" id="ObjEventResult">
         <result property="id"    column="id"    />
-        <result property="groupCode"    column="group_code"    />
-        <result property="groupName"    column="group_name"    />
-        <result property="objType"      column="obj_type"    />
-        <result property="eventName"    column="event_name"    />
+        <result property="modelCode"    column="model_code"    />
+        <result property="eventKey"    column="event_key"    />
         <result property="eventType"    column="event_type"    />
+        <result property="eventName"    column="event_name"    />
         <result property="eventDesc"    column="event_desc"    />
         <result property="eventCode"    column="event_code"    />
         <result property="extEventCode"    column="ext_event_code"    />
     </resultMap>
 
-    <sql id="selectEventVo">
-        select id, group_code, group_name, obj_type, event_name, event_type, event_desc, event_code, ext_event_code from adm_ems_obj_event
+    <sql id="selectObjEventVo">
+        select id, model_code, event_key, event_type, event_name, event_desc, event_code, ext_event_code from adm_ems_obj_event
     </sql>
 
-    <select id="selectEventList" parameterType="com.ruoyi.ems.domain.EmsObjEvent" resultMap="EventResult">
-        <include refid="selectEventVo"/>
+    <select id="selectObjEventList" parameterType="com.ruoyi.ems.domain.EmsObjEvent" resultMap="ObjEventResult">
+        <include refid="selectObjEventVo"/>
         <where>  
-            <if test="groupCode != null  and groupCode != ''"> and group_code = #{groupCode}</if>
-            <if test="objType != null"> and obj_type = #{objType}</if>
+            <if test="modelCode != null  and modelCode != ''"> and model_code = #{modelCode}</if>
+            <if test="eventKey != null  and eventKey != ''"> and event_key = #{eventKey}</if>
+            <if test="eventType != null "> and event_type = #{eventType}</if>
+            <if test="eventName != null  and eventName != ''"> and event_name like concat('%', #{eventName}, '%')</if>
+            <if test="eventCode != null  and eventCode != ''"> and event_code = #{eventCode}</if>
         </where>
     </select>
-    
-    <select id="selectEventById" parameterType="Long" resultMap="EventResult">
-        <include refid="selectEventVo"/>
+
+    <select id="selectByModelCode" parameterType="java.lang.String" resultMap="ObjEventResult">
+        <include refid="selectObjEventVo"/>
+        where model_code = #{modelCode}
+    </select>
+
+    <select id="selectObjEventById" parameterType="Long" resultMap="ObjEventResult">
+        <include refid="selectObjEventVo"/>
         where id = #{id}
     </select>
         
-    <insert id="insertEvent" parameterType="com.ruoyi.ems.domain.EmsObjEvent" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertObjEvent" parameterType="com.ruoyi.ems.domain.EmsObjEvent" useGeneratedKeys="true" keyProperty="id">
         insert into adm_ems_obj_event
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">group_code,</if>
-            <if test="groupName != null and groupName != ''">group_name,</if>
-            <if test="objType != null">obj_type,</if>
-            <if test="eventName != null and eventName != ''">event_name,</if>
+            <if test="modelCode != null and modelCode != ''">model_code,</if>
+            <if test="eventKey != null and eventKey != ''">event_key,</if>
             <if test="eventType != null">event_type,</if>
+            <if test="eventName != null and eventName != ''">event_name,</if>
             <if test="eventDesc != null">event_desc,</if>
             <if test="eventCode != null">event_code,</if>
             <if test="extEventCode != null">ext_event_code,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">#{groupCode},</if>
-            <if test="groupName != null and groupName != ''">#{groupName},</if>
-            <if test="objType != null">#{objType},</if>
-            <if test="eventName != null and eventName != ''">#{eventName},</if>
+            <if test="modelCode != null and modelCode != ''">#{modelCode},</if>
+            <if test="eventKey != null and eventKey != ''">#{eventKey},</if>
             <if test="eventType != null">#{eventType},</if>
+            <if test="eventName != null and eventName != ''">#{eventName},</if>
             <if test="eventDesc != null">#{eventDesc},</if>
             <if test="eventCode != null">#{eventCode},</if>
             <if test="extEventCode != null">#{extEventCode},</if>
          </trim>
     </insert>
 
-    <insert id="insertEventBatch" parameterType="java.util.List">
-        insert into adm_ems_obj_event (group_code, group_name, obj_type, event_name, event_type, event_desc, event_code, ext_event_code) values
+    <insert id="insertBatch" parameterType="java.util.List">
+        insert into adm_ems_obj_event (model_code, event_key, event_type, event_name, event_desc, event_code, ext_event_code)
+        values
         <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.groupCode},#{item.groupName},#{item.objType},#{item.eventName},#{item.eventType},#{item.eventDesc},#{item.eventCode},#{item.extEventCode})
+            (#{item.modelCode}, #{item.eventKey}, #{item.eventType}, #{item.eventName}, #{item.eventDesc}, #{item.eventCode}, #{item.extEventCode}
         </foreach>
     </insert>
 
-    <update id="updateEvent" parameterType="com.ruoyi.ems.domain.EmsObjEvent">
+    <update id="updateObjEvent" parameterType="com.ruoyi.ems.domain.EmsObjEvent">
         update adm_ems_obj_event
         <trim prefix="SET" suffixOverrides=",">
-            <if test="groupCode != null and groupCode != ''">group_code = #{groupCode},</if>
-            <if test="groupnName != null and groupnName != ''">group_name = #{groupnName},</if>
-            <if test="objType != null">obj_type = #{objType},</if>
-            <if test="eventName != null and eventName != ''">event_name = #{eventName},</if>
+            <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if>
+            <if test="eventKey != null and eventKey != ''">event_key = #{eventKey},</if>
             <if test="eventType != null">event_type = #{eventType},</if>
+            <if test="eventName != null and eventName != ''">event_name = #{eventName},</if>
             <if test="eventDesc != null">event_desc = #{eventDesc},</if>
             <if test="eventCode != null">event_code = #{eventCode},</if>
             <if test="extEventCode != null">ext_event_code = #{extEventCode},</if>
@@ -79,18 +84,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
-    <delete id="deleteEventById" parameterType="Long">
+    <delete id="deleteObjEventById" parameterType="Long">
         delete from adm_ems_obj_event where id = #{id}
     </delete>
 
-    <delete id="deleteEventByIds" parameterType="String">
-        delete from adm_ems_obj_event where id in
+    <delete id="deleteByModelCode" parameterType="String">
+        delete from adm_ems_obj_event where model_code = #{modelCode}
+    </delete>
+
+    <delete id="deleteObjEventByIds" parameterType="String">
+        delete from adm_ems_obj_event where id in 
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-
-    <delete id="deleteEventByGroupCode" parameterType="String">
-        delete from adm_ems_obj_event where group_code = #{groupCode}
-    </delete>
 </mapper>

+ 66 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjModelMapper.xml

@@ -0,0 +1,66 @@
+<?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.EmsObjModelMapper">
+    
+    <resultMap type="com.ruoyi.ems.domain.EmsObjModel" id="objModelResult">
+        <result property="id"    column="id"    />
+        <result property="modelCode"    column="model_code"    />
+        <result property="modelName"    column="model_name"    />
+        <result property="objType"    column="obj_type"    />
+    </resultMap>
+
+    <sql id="selectObjModelVo">
+        select id, model_code, model_name, obj_type from adm_ems_obj_model
+    </sql>
+
+    <select id="selectObjModelList" parameterType="com.ruoyi.ems.domain.EmsObjModel" resultMap="objModelResult">
+        <include refid="selectObjModelVo"/>
+        <where>  
+            <if test="modelCode != null  and modelCode != ''"> and model_code = #{modelCode}</if>
+            <if test="modelName != null  and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
+            <if test="objType != null "> and obj_type = #{objType}</if>
+        </where>
+    </select>
+    
+    <select id="selectObjModelById" parameterType="Long" resultMap="objModelResult">
+        <include refid="selectObjModelVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertObjModel" parameterType="com.ruoyi.ems.domain.EmsObjModel" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_ems_obj_model
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="modelCode != null and modelCode != ''">model_code,</if>
+            <if test="modelName != null and modelName != ''">model_name,</if>
+            <if test="objType != null">obj_type,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="modelCode != null and modelCode != ''">#{modelCode},</if>
+            <if test="modelName != null and modelName != ''">#{modelName},</if>
+            <if test="objType != null">#{objType},</if>
+         </trim>
+    </insert>
+
+    <update id="updateObjModel" parameterType="com.ruoyi.ems.domain.EmsObjModel">
+        update adm_ems_obj_model
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if>
+            <if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
+            <if test="objType != null">obj_type = #{objType},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteObjModelById" parameterType="Long">
+        delete from adm_ems_obj_model where id = #{id}
+    </delete>
+
+    <delete id="deleteObjModelByIds" parameterType="String">
+        delete from adm_ems_obj_model where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

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

@@ -258,13 +258,6 @@ INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_type`, `devi
 INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_type`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-1002', '配电柜', 3, '安科瑞', 'DX2121021', '广场配电柜',   1, 'Area', '321283124S3002', '321283124S3002', null, 'W202', 'AP', null);
 
 
-
--- 配电柜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', '照明');

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

@@ -553,7 +553,7 @@ create table adm_ems_obj_model  (
   `obj_type`        int             not null                     comment '对象类型',
   primary key (`id`),
   unique key ux_ems_obj_attr(`model_code`)
-) engine=innodb auto_increment=1 comment = '能源对象属性表';
+) engine=innodb auto_increment=1 comment = '能源对象模型表';
 
 
 -- ----------------------------