Browse Source

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

hsshuxian 10 months ago
parent
commit
df359db35b
40 changed files with 2437 additions and 1150 deletions
  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. 167 37
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevice.java
  8. 140 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDeviceComponent.java
  9. 17 65
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacs.java
  10. 42 58
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAbility.java
  11. 40 69
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAttr.java
  12. 69 92
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjEvent.java
  13. 107 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjModel.java
  14. 22 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/QueryDevice.java
  15. 70 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsDeviceComponentMapper.java
  16. 46 37
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjAbilityMapper.java
  17. 39 29
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjAttrMapper.java
  18. 41 31
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjEventMapper.java
  19. 62 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsObjModelMapper.java
  20. 69 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsDeviceComponentService.java
  21. 37 31
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjAbilityService.java
  22. 38 29
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjAttrService.java
  23. 46 36
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjEventService.java
  24. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsObjModelService.java
  25. 98 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsDeviceComponentServiceImpl.java
  26. 5 89
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsServiceImpl.java
  27. 56 52
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjAbilityServiceImpl.java
  28. 55 58
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjAttrServiceImpl.java
  29. 56 47
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjEventServiceImpl.java
  30. 125 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsObjModelServiceImpl.java
  31. 93 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceComponentMapper.xml
  32. 33 11
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceMapper.xml
  33. 10 14
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsMapper.xml
  34. 36 33
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAbilityMapper.xml
  35. 38 39
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAttrMapper.xml
  36. 43 38
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjEventMapper.xml
  37. 66 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjModelMapper.xml
  38. 139 133
      ems-cloud/sql/ems_init_data.sql
  39. 35 31
      ems-cloud/sql/ems_server.sql
  40. 1 1
      ems-cloud/sql/ems_sys.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();
+    }
+}

+ 167 - 37
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevice.java

@@ -11,60 +11,129 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
  * @author ruoyi
  * @date 2024-07-10
  */
-public class EmsDevice extends BaseEntity
-{
+public class EmsDevice extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 序号 */
+    /**
+     * 序号
+     */
     private Long id;
 
-    /** 设备代码 */
+    /**
+     * 设备代码
+     */
     @Excel(name = "设备代码")
     private String deviceCode;
 
-    /** 设备名称 */
+    /**
+     * 设备名称
+     */
     @Excel(name = "设备名称")
     private String deviceName;
 
-    /** 设备类型 */
+    /**
+     * 设备类型
+     */
     private Long deviceType;
 
-    /** 设备类型名称 */
+    /**
+     * 设备类型名称
+     */
     @Excel(name = "设备类型")
     private String deviceTypeName;
 
-    /** 设备状态 */
+    /**
+     * 设备品牌
+     */
+    @Excel(name = "设备品牌")
+    private String deviceBrand;
+
+    /**
+     * 设备型号
+     */
+    @Excel(name = "设备型号")
+    private String deviceSpec;
+
+    /**
+     * 安装位置
+     */
+    @Excel(name = "安装位置")
+    private String location;
+
+    /**
+     * 设备状态
+     */
     @Excel(name = "设备状态")
     private Long deviceStatus;
 
-   private String  areaAncestors;
-
-    /** 区域类型 */
+    /**
+     * 区域类型
+     */
     private String areaType;
 
-    /** 归属区域代码 */
+    /**
+     * 归属区域代码
+     */
     private String refArea;
 
-    /** 归属区域名称 */
+    /**
+     * 归属区域名称
+     */
     @Excel(name = "归属区域")
     private String refAreaName;
 
-    /** 归属设施代码 */
+    /**
+     * 区域祖级
+     */
+    private String areaAncestors;
+
+    /**
+     * 归属区域路径
+     */
+    private String areaPath;
+
+    /**
+     * 归属设施代码
+     */
     private String refFacs;
 
-    /** 归属子系统代码 */
+    /**
+     * 归属设施名称
+     */
+    @Excel(name = "归属设施")
+    private String refFacsName;
+
+    /**
+     * 归属子系统代码
+     */
     private String subsystemCode;
 
-    /** 归属子系统名称 */
+    /**
+     * 归属子系统名称
+     */
     @Excel(name = "子系统")
     private String subsystemName;
 
-    /** 归属设施名称 */
-    @Excel(name = "归属设施")
-    private String refFacsName;
+    /**
+     * 设备模型代码
+     */
+    private String deviceModel;
 
-    /** 归属区域路径 */
-    private String areaPath;
+    /**
+     * 设备模型名称
+     */
+    @Excel(name = "设备模型")
+    private String deviceModelName;
+
+    /**
+     * 工艺标识代码
+     */
+    private String psCode;
+
+    /**
+     * 工艺标识名称
+     */
+    private String psName;
 
     public Long getId() {
         return id;
@@ -106,6 +175,30 @@ public class EmsDevice extends BaseEntity
         this.deviceTypeName = deviceTypeName;
     }
 
+    public String getDeviceBrand() {
+        return deviceBrand;
+    }
+
+    public void setDeviceBrand(String deviceBrand) {
+        this.deviceBrand = deviceBrand;
+    }
+
+    public String getDeviceSpec() {
+        return deviceSpec;
+    }
+
+    public void setDeviceSpec(String deviceSpec) {
+        this.deviceSpec = deviceSpec;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
     public Long getDeviceStatus() {
         return deviceStatus;
     }
@@ -138,6 +231,22 @@ public class EmsDevice extends BaseEntity
         this.refAreaName = refAreaName;
     }
 
+    public String getAreaAncestors() {
+        return areaAncestors;
+    }
+
+    public void setAreaAncestors(String areaAncestors) {
+        this.areaAncestors = areaAncestors;
+    }
+
+    public String getAreaPath() {
+        return areaPath;
+    }
+
+    public void setAreaPath(String areaPath) {
+        this.areaPath = areaPath;
+    }
+
     public String getRefFacs() {
         return refFacs;
     }
@@ -146,6 +255,14 @@ public class EmsDevice extends BaseEntity
         this.refFacs = refFacs;
     }
 
+    public String getRefFacsName() {
+        return refFacsName;
+    }
+
+    public void setRefFacsName(String refFacsName) {
+        this.refFacsName = refFacsName;
+    }
+
     public String getSubsystemCode() {
         return subsystemCode;
     }
@@ -162,48 +279,61 @@ public class EmsDevice extends BaseEntity
         this.subsystemName = subsystemName;
     }
 
-    public String getRefFacsName() {
-        return refFacsName;
+    public String getDeviceModel() {
+        return deviceModel;
     }
 
-    public void setRefFacsName(String refFacsName) {
-        this.refFacsName = refFacsName;
+    public void setDeviceModel(String deviceModel) {
+        this.deviceModel = deviceModel;
     }
 
-    public String getAreaPath() {
-        return areaPath;
+    public String getDeviceModelName() {
+        return deviceModelName;
     }
 
-    public void setAreaPath(String areaPath) {
-        this.areaPath = areaPath;
+    public void setDeviceModelName(String deviceModelName) {
+        this.deviceModelName = deviceModelName;
     }
 
-    public String getAreaAncestors() {
-        return areaAncestors;
+    public String getPsCode() {
+        return psCode;
     }
 
-    public void setAreaAncestors(String areaAncestors) {
-        this.areaAncestors = areaAncestors;
+    public void setPsCode(String psCode) {
+        this.psCode = psCode;
+    }
+
+    public String getPsName() {
+        return psName;
+    }
+
+    public void setPsName(String psName) {
+        this.psName = psName;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("deviceCode", getDeviceCode())
             .append("deviceName", getDeviceName())
             .append("deviceType", getDeviceType())
             .append("deviceTypeName", getDeviceTypeName())
+            .append("deviceBrand", getDeviceBrand())
+            .append("deviceSpec", getDeviceSpec())
+            .append("location", getLocation())
             .append("deviceStatus", getDeviceStatus())
             .append("areaType", getAreaType())
             .append("refArea", getRefArea())
             .append("refAreaName", getRefAreaName())
+            .append("areaAncestors", getAreaAncestors())
+            .append("deviceModel", getDeviceModel())
+            .append("deviceModelName", getDeviceModelName())
             .append("refFacs", getRefFacs())
             .append("refFacsName", getRefFacsName())
             .append("subsystemCode", getSubsystemCode())
             .append("subsystemName", getSubsystemName())
-            .append("createTime", getCreateTime())
-            .append("updateTime", getUpdateTime())
-            .toString();
+            .append("psCode", getPsCode())
+            .append("psName", getPsName()).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();
+    }
+}

+ 17 - 65
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacs.java

@@ -1,11 +1,9 @@
 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;
-
-import java.util.List;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 能源设施/系统对象 adm_ems_facs
@@ -52,23 +50,12 @@ public class EmsFacs extends BaseEntity
     @Excel(name = "归属区域")
     private String refAreaName;
 
-    /** 属性分组代码 */
-    private String attrGroup;
-
-    /** 能力分组代码 */
-    private String abilityGroup;
-
-    /** 事件分组代码 */
-    private String eventGroup;
+    /** 设施模型code */
+    private String facsModel;
 
-    /** 设施属性 */
-    private List<EmsObjAttr> facsAttrs;
-
-    /** 设施能力 */
-    private List<EmsObjAbility> facsAbilities;
-
-    /** 设施事件 */
-    private List<EmsObjEvent> facsEvents;
+    /** 设施模型名称 */
+    @Excel(name = "设施模型")
+    private String facsModelName;
 
     public Long getId() {
         return id;
@@ -150,52 +137,20 @@ public class EmsFacs extends BaseEntity
         this.refAreaName = refAreaName;
     }
 
-    public String getAttrGroup() {
-        return attrGroup;
-    }
-
-    public void setAttrGroup(String attrGroup) {
-        this.attrGroup = attrGroup;
-    }
-
-    public String getAbilityGroup() {
-        return abilityGroup;
-    }
-
-    public void setAbilityGroup(String abilityGroup) {
-        this.abilityGroup = abilityGroup;
-    }
-
-    public String getEventGroup() {
-        return eventGroup;
-    }
-
-    public void setEventGroup(String eventGroup) {
-        this.eventGroup = eventGroup;
-    }
-
-    public List<EmsObjAttr> getFacsAttrs() {
-        return facsAttrs;
-    }
-
-    public void setFacsAttrs(List<EmsObjAttr> facsAttrs) {
-        this.facsAttrs = facsAttrs;
-    }
-
-    public List<EmsObjAbility> getFacsAbilities() {
-        return facsAbilities;
+    public String getFacsModel() {
+        return facsModel;
     }
 
-    public void setFacsAbilities(List<EmsObjAbility> facsAbilities) {
-        this.facsAbilities = facsAbilities;
+    public void setFacsModel(String facsModel) {
+        this.facsModel = facsModel;
     }
 
-    public List<EmsObjEvent> getFacsEvents() {
-        return facsEvents;
+    public String getFacsModelName() {
+        return facsModelName;
     }
 
-    public void setFacsEvents(List<EmsObjEvent> facsEvents) {
-        this.facsEvents = facsEvents;
+    public void setFacsModelName(String facsModelName) {
+        this.facsModelName = facsModelName;
     }
 
     @Override
@@ -208,11 +163,8 @@ public class EmsFacs extends BaseEntity
             .append("facsSubCategory", getFacsSubCategory())
             .append("enable", getEnable())
             .append("refArea", getRefArea())
-            .append("attrGroup", getAttrGroup())
-            .append("abilityGroup", getAbilityGroup())
-            .append("eventGroup", getEventGroup())
-            .append("createTime", getCreateTime())
-            .append("updateTime", getUpdateTime())
+            .append("facsModel", getFacsModel())
+            .append("facsModelName", getFacsModelName())
             .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();
+    }
+}

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

@@ -31,6 +31,9 @@ public class QueryDevice {
     /** 设备类型 */
     private Long deviceType;
 
+    /** 设备模型 */
+    private String deviceModel;
+
     private String refFacs;
 
     /** 区域类型 */
@@ -39,6 +42,9 @@ public class QueryDevice {
     /** 区域代码 */
     private String refArea;
 
+    /** 设备工艺标识编码 */
+    private String psCode;
+
     /** 所属子系统 */
     private String subsystemCode;
 
@@ -70,6 +76,14 @@ public class QueryDevice {
         this.deviceType = deviceType;
     }
 
+    public String getDeviceModel() {
+        return deviceModel;
+    }
+
+    public void setDeviceModel(String deviceModel) {
+        this.deviceModel = deviceModel;
+    }
+
     public String getRefFacs() {
         return refFacs;
     }
@@ -94,6 +108,14 @@ public class QueryDevice {
         this.refArea = refArea;
     }
 
+    public String getPsCode() {
+        return psCode;
+    }
+
+    public void setPsCode(String psCode) {
+        this.psCode = psCode;
+    }
+
     public String getSubsystemCode() {
         return subsystemCode;
     }

+ 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);
+    }
+}

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

@@ -4,23 +4,18 @@ import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.map.MapUtil;
 import com.ruoyi.common.core.enums.FacTypes;
-
 import com.ruoyi.common.core.utils.DateTimeUtil;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.ExpressUtil;
 import com.ruoyi.common.core.utils.StreamUtils;
 import com.ruoyi.ems.domain.EmsFacs;
-import com.ruoyi.ems.domain.EmsObjAbility;
-import com.ruoyi.ems.domain.EmsObjAttr;
-import com.ruoyi.ems.domain.EmsObjEvent;
-import com.ruoyi.ems.domain.common.ObjType;
 import com.ruoyi.ems.mapper.AdmEmsElecPgIndexMapper;
 import com.ruoyi.ems.mapper.AdmEmsIndexRangeMapper;
 import com.ruoyi.ems.mapper.EmsFacsMapper;
-import com.ruoyi.ems.service.IEmsObjEventService;
 import com.ruoyi.ems.service.IEmsFacsService;
 import com.ruoyi.ems.service.IEmsObjAbilityService;
 import com.ruoyi.ems.service.IEmsObjAttrService;
+import com.ruoyi.ems.service.IEmsObjEventService;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -68,52 +63,20 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
      */
     @Override
     public EmsFacs selectEmsFacsById(Long id) {
-        // 查询设施对象
-        EmsFacs emsFacs = emsFacsMapper.selectEmsFacsById(id);
-
-        // 查询扩展属性
-        if (null != emsFacs) {
-            emsFacs.setFacsAttrs(getFacsAttrs(emsFacs));
-            emsFacs.setFacsAbilities(getFacsAbilitys(emsFacs));
-            emsFacs.setFacsEvents(getFacsEvents(emsFacs));
-        }
-
-        return emsFacs;
+        return emsFacsMapper.selectEmsFacsById(id);
     }
 
     @Override
     public EmsFacs selectEmsFacsByCode(String code) {
         // 查询设施对象
-        EmsFacs emsFacs = emsFacsMapper.selectEmsFacsByCode(code);
-
-        // 查询扩展属性
-        if (null != emsFacs) {
-            emsFacs.setFacsAttrs(getFacsAttrs(emsFacs));
-            emsFacs.setFacsAbilities(getFacsAbilitys(emsFacs));
-            emsFacs.setFacsEvents(getFacsEvents(emsFacs));
-        }
-
-        return emsFacs;
+        return emsFacsMapper.selectEmsFacsByCode(code);
     }
 
     @Override
     public List<EmsFacs> selectFacsByArea(String areaCode) {
         EmsFacs param = new EmsFacs();
         param.setRefArea(areaCode);
-
-        // 查询设施对象
-        List<EmsFacs> list = emsFacsMapper.selectEmsFacsList(param);
-
-        // 查询扩展属性
-        if (CollectionUtils.isNotEmpty(list)) {
-            list.forEach(facsObj -> {
-                facsObj.setFacsAttrs(getFacsAttrs(facsObj));
-                facsObj.setFacsAbilities(getFacsAbilitys(facsObj));
-                facsObj.setFacsEvents(getFacsEvents(facsObj));
-            });
-        }
-
-        return list;
+        return emsFacsMapper.selectEmsFacsList(param);
     }
 
     /**
@@ -124,19 +87,7 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
      */
     @Override
     public List<EmsFacs> selectEmsFacsList(EmsFacs emsFacs) {
-        // 查询设施对象
-        List<EmsFacs> list = emsFacsMapper.selectEmsFacsList(emsFacs);
-
-        // 查询扩展属性
-        if (CollectionUtils.isNotEmpty(list)) {
-            list.forEach(facsObj -> {
-                facsObj.setFacsAttrs(getFacsAttrs(facsObj));
-                facsObj.setFacsAbilities(getFacsAbilitys(facsObj));
-                facsObj.setFacsEvents(getFacsEvents(facsObj));
-            });
-        }
-
-        return list;
+        return emsFacsMapper.selectEmsFacsList(emsFacs);
     }
 
     /**
@@ -171,17 +122,6 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
      */
     @Override
     public int deleteEmsFacsByIds(Long[] ids) {
-        for (Long id : ids) {
-            EmsFacs emsFacs = emsFacsMapper.selectEmsFacsById(id);
-
-            // 查询扩展属性
-            if (null != emsFacs) {
-                objAttrService.deleteAttrByGroupCode(emsFacs.getAttrGroup());
-                objAbilityService.deleteAbilityByGroupCode(emsFacs.getAbilityGroup());
-                objEventService.deleteEventByGroupCode(emsFacs.getEventGroup());
-            }
-        }
-
         return emsFacsMapper.deleteEmsFacsByIds(ids);
     }
 
@@ -193,15 +133,6 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
      */
     @Override
     public int deleteEmsFacsById(Long id) {
-        EmsFacs emsFacs = emsFacsMapper.selectEmsFacsById(id);
-
-        // 查询扩展属性
-        if (null != emsFacs) {
-            objAttrService.deleteAttrByGroupCode(emsFacs.getAttrGroup());
-            objAbilityService.deleteAbilityByGroupCode(emsFacs.getAbilityGroup());
-            objEventService.deleteEventByGroupCode(emsFacs.getEventGroup());
-        }
-
         return emsFacsMapper.deleteEmsFacsById(id);
     }
 
@@ -267,19 +198,4 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
             }
         }
     }
-
-    private List<EmsObjAttr> getFacsAttrs(EmsFacs emsFacs) {
-        EmsObjAttr param = new EmsObjAttr(emsFacs.getAttrGroup(), ObjType.FACS.getCode());
-        return objAttrService.selectAttrList(param);
-    }
-
-    private List<EmsObjAbility> getFacsAbilitys(EmsFacs emsFacs) {
-        EmsObjAbility param = new EmsObjAbility(emsFacs.getAbilityGroup(), ObjType.FACS.getCode());
-        return objAbilityService.selectAbilityList(param);
-    }
-
-    private List<EmsObjEvent> getFacsEvents(EmsFacs emsFacs) {
-        EmsObjEvent param = new EmsObjEvent(emsFacs.getEventGroup(), ObjType.FACS.getCode());
-        return objEventService.selectEventList(param);
-    }
 }

+ 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>

+ 33 - 11
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceMapper.xml

@@ -10,9 +10,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deviceName"        column="device_name"    />
         <result property="deviceType"        column="device_type"    />
         <result property="deviceTypeName"    column="device_type_name"    />
+        <result property="deviceBrand"       column="device_brand"    />
+        <result property="deviceSpec"        column="device_spec"    />
+        <result property="location"          column="location"    />
         <result property="deviceStatus"      column="device_status"    />
         <result property="areaType"          column="area_type"    />
         <result property="refArea"           column="ref_area"    />
+        <result property="areaAncestors"     column="area_ancestors"    />
+        <result property="deviceModel"       column="device_model"    />
+        <result property="psCode"            column="ps_code"    />
+        <result property="psName"            column="ps_name"    />
         <result property="refFacs"           column="ref_facs"    />
         <result property="refFacsName"       column="ref_facs_name"    />
         <result property="subsystemCode"     column="subsystem_code"    />
@@ -23,11 +30,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <sql id="selectEmsDeviceVo">
         select
-            d.`id`, d.`device_code`, d.`device_name`, d.`device_type`, dt.`type_name` as device_type_name, d.`device_status`, d.`area_type`, d.`ref_area`, d.`ref_facs`, f.`facs_name` as ref_facs_name, d.`create_time`, d.`update_time`, d.`subsystem_code`, s.`system_name` as subsystem_name
+            d.`id`, d.`device_code`, d.`device_name`, d.`device_type`, d.`device_status`, d.`area_type`, d.`ref_area`, d.`ref_facs`, d.`subsystem_code`, d.`ps_code`, d.`create_time`, d.`update_time`,
+            dt.`type_name` as device_type_name,
+            dp.`ps_name`,
+            s.`system_name` as subsystem_name,
+            f.`facs_name` as ref_facs_name
         from adm_ems_device d
             LEFT JOIN dim_devc_type dt ON d.`device_type` = dt.`type_code`
-            LEFT JOIN adm_ems_facs f ON d.`ref_facs` = f.`facs_code`
+            LEFT JOIN dim_ems_dev_process dp ON d.`ps_code` = dp.`ps_code`
             LEFT JOIN adm_ems_subsystem s ON d.`subsystem_code` = s.`system_code`
+            LEFT JOIN adm_ems_facs f ON d.`ref_facs` = f.`facs_code`
     </sql>
 
     <select id="selectEmsDeviceList" parameterType="com.ruoyi.ems.domain.EmsDevice" resultMap="EmsDeviceResult">
@@ -40,6 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="areaType != null and areaType != ''"> and d.`area_type` = #{areaType}</if>
             <if test="refArea != null  and refArea != ''"> and d.`ref_area` = #{refArea}</if>
             <if test="refFacs != null  and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
+            <if test="psCode != null  and psCode != ''"> and d.`ps_code` = #{psCode}</if>
+            <if test="deviceModel != null  and deviceModel != ''"> and d.`device_model` = #{device_model}</if>
             <if test="subsystemCode != null  and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
         </where>
     </select>
@@ -52,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceName != null  and deviceName != ''"> and d.`device_name` like concat('%', #{deviceName}, '%')</if>
             <if test="deviceType != null "> and d.`device_type` = #{deviceType}</if>
             <if test="refFacs != null  and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
+            <if test="psCode != null  and psCode != ''"> and d.`ps_code` = #{psCode}</if>
+            <if test="deviceModel != null  and deviceModel != ''"> and d.`device_model` = #{device_model}</if>
             <if test="subsystemCode != null  and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
             <if test="areaType == 'Area' and refArea != null and refArea != ''">
                 and ((d.`area_type` = 'Area' and d.`ref_area` = #{refArea})
@@ -100,14 +116,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceCode != null and deviceCode != ''">device_code,</if>
             <if test="deviceName != null and deviceName != ''">device_name,</if>
             <if test="deviceType != null">device_type,</if>
+            <if test="deviceBrand != null">device_brand,</if>
+            <if test="deviceSpec != null">device_spec,</if>
+            <if test="location != null">location,</if>
             <if test="deviceStatus != null">device_status,</if>
             <if test="areaType != null">area_type,</if>
             <if test="refArea != null">ref_area,</if>
+            <if test="areaAncestors !=null">area_ancestors,</if>
+            <if test="deviceModel !=null">device_model,</if>
             <if test="refFacs != null">ref_facs,</if>
+            <if test="psCode != null">ps_code,</if>
             <if test="subsystemCode != null">subsystem_code,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="areaAncestors !=null">area_ancestors,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
@@ -116,11 +135,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceStatus != null">#{deviceStatus},</if>
             <if test="areaType != null">#{areaType},</if>
             <if test="refArea != null">#{refArea},</if>
+            <if test="areaAncestors !=null">#{areaAncestors},</if>
+            <if test="deviceModel !=null">#{deviceModel},</if>
             <if test="refFacs != null">#{refFacs},</if>
+            <if test="psCode != null">#{psCode},</if>
             <if test="subsystemCode != null">#{subsystemCode},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="areaAncestors !=null">#{areaAncestors},</if>
          </trim>
     </insert>
 
@@ -130,14 +149,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
             <if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
             <if test="deviceType != null">device_type = #{deviceType},</if>
+            <if test="deviceBrand != null">device_brand = #{deviceBrand},</if>
+            <if test="deviceSpec != null">device_spec = #{deviceSpec},</if>
+            <if test="location != null">location = #{location},</if>
             <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
             <if test="areaType != null">area_type = #{areaType},</if>
             <if test="refArea != null">ref_area = #{refArea},</if>
+            <if test="areaAncestors !=null">area_ancestors = #{areaAncestors},</if>
+            <if test="deviceModel !=null">device_model = #{deviceModel},</if>
             <if test="refFacs != null">ref_facs = #{refFacs},</if>
+            <if test="psCode != null">ps_code = #{psCode},</if>
             <if test="subsystemCode != null">subsystem_code = #{subsystemCode},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="areaAncestors !=null">area_ancestors = #{areaAncestors},</if>
         </trim>
         where id = #{id}
     </update>

+ 10 - 14
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsMapper.xml

@@ -15,23 +15,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="enable"    column="enable"    />
         <result property="refArea"    column="ref_area"    />
         <result property="refAreaName"    column="ref_area_name"    />
-        <result property="attrGroup"    column="attr_group"    />
-        <result property="abilityGroup"    column="ability_group"    />
-        <result property="eventGroup"    column="event_group"    />
+        <result property="facsModel"    column="facs_model"    />
+        <result property="facsModelName"    column="facs_model_name"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
     </resultMap>
 
     <sql id="selectEmsFacsVo">
         SELECT
-            f.`id`, f.`facs_code`, f.`facs_name`, f.`facs_category`, f.`facs_subcategory`, f.`enable`, f.`ref_area`, f.`attr_group`, f.`ability_group`, f.`event_group`, f.`create_time`, f.`update_time`,
+            f.`id`, f.`facs_code`, f.`facs_name`, f.`facs_category`, f.`facs_subcategory`, f.`enable`, f.`ref_area`, f.`facs_model`, f.`create_time`, f.`update_time`,
             t.`name` as facs_category_name,
             s.`name` as facs_subcategory_name,
-            a.`area_name` as ref_area_name
+            a.`area_name` as ref_area_name,
+            m.`model_name` as facs_model_name
         FROM adm_ems_facs f
             LEFT JOIN dim_ems_facs_category t ON f.`facs_category` = t.`code`
             LEFT JOIN dim_ems_facs_subcategory s ON f.`facs_subcategory`= s.`code`
             LEFT JOIN adm_service_area a ON f.`ref_area` = a.`area_code`
+            LEFT JOIN adm_ems_obj_model m ON f.`facs_model` = m.`model_code`
     </sql>
 
     <select id="selectEmsFacsList" parameterType="com.ruoyi.ems.domain.EmsFacs" resultMap="EmsFacsResult">
@@ -41,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="facsName != null  and facsName != ''"> and f.`facs_name` like concat('%', #{facsName}, '%')</if>
             <if test="facsCategory != null  and facsCategory != ''"> and f.`facs_category` = #{facsCategory}</if>
             <if test="facsSubCategory != null  and facsSubCategory != ''"> and f.`facs_subcategory` = #{facsSubCategory}</if>
+            <if test="facsModel != null  and facsModel != ''"> and f.`facs_model` = #{facsModel}</if>
             <if test="enable != null "> and f.`enable` = #{enable}</if>
             <if test="refArea != null  and refArea != ''"> and f.`ref_area` = #{refArea}</if>
         </where>
@@ -65,9 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="facsSubCategory != null and facsSubCategory != ''">facs_subcategory,</if>
             <if test="enable != null">enable,</if>
             <if test="refArea != null and refArea != ''">ref_area,</if>
-            <if test="attrGroup != null and attrGroup != ''">attr_group,</if>
-            <if test="abilityGroup != null and abilityGroup != ''">ability_group,</if>
-            <if test="eventGroup != null and eventGroup != ''">event_group,</if>
+            <if test="facsModel != null and facsModel != ''">facs_model,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="facsCode != null and facsCode != ''">#{facsCode},</if>
@@ -76,9 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="facsSubCategory != null and facsSubCategory != ''">#{facsSubCategory},</if>
             <if test="enable != null">#{enable},</if>
             <if test="refArea != null and refArea != ''">#{refArea},</if>
-            <if test="attrGroup != null and attrGroup != ''">#{attrGroup},</if>
-            <if test="abilityGroup != null and abilityGroup != ''">#{abilityGroup},</if>
-            <if test="eventGroup != null and eventGroup != ''">#{eventGroup},</if>
+            <if test="facsModel != null and facsModel != ''">#{facsModel},</if>
          </trim>
     </insert>
 
@@ -91,9 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="facsSubCategory != null and facsSubCategory != ''">facs_subcategory = #{facsSubCategory},</if>
             <if test="enable != null">enable = #{enable},</if>
             <if test="refArea != null and refArea != ''">ref_area = #{refArea},</if>
-            <if test="attrGroup != null and attrGroup != ''">attr_group=#{attrGroup},</if>
-            <if test="abilityGroup != null and abilityGroup != ''">ability_group=#{abilityGroup},</if>
-            <if test="eventGroup != null and eventGroup != ''">event_group=#{eventGroup},</if>
+            <if test="facsModel != null and facsModel != ''">facs_model=#{facsModel},</if>
         </trim>
         where id = #{id}
     </update>

+ 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>

+ 139 - 133
ems-cloud/sql/ems_init_data.sql

@@ -103,38 +103,46 @@ INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`,
 INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-WXP','危险品车位', 1, 'CW-XK', 100, '使用中');
 
 -- 能源设施初始数据
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('W201', '北区-供电网', 'W', 'W2', 1, '321283124S3001', 'AT_W2', 'AB_W2', 'E_W2');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('W202', '南区-供电网', 'W', 'W2', 1, '321283124S3002', 'AT_W2', 'AB_W2', 'E_W2');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('E501', '北区-光伏', 'E', 'E5', 1, '321283124S3001', 'AT_E501', null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('E502', '南区-光伏', 'E', 'E5', 1, '321283124S3002', 'AT_E502', null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('E503', '主路-光伏', 'E', 'E5', 1, '321283124S3003', 'AT_E503', null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('C101', '北区-储能', 'C', 'C1', 1, '321283124S3001', 'AT_C101', null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('C102', '南区-储能', 'C', 'C1', 1, '321283124S3002', 'AT_C102', null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z101', '北区-室内照明', 'Z', 'Z001', 1, '321283124S3001', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z102', '北区-室外照明', 'Z', 'Z002', 1, '321283124S3001', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z110', '北区-公共设施', 'Z', 'Z010', 1, '321283124S3001', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z120', '北区-空调设施', 'Z', 'Z020', 1, '321283124S3001', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z201', '南区-室内照明', 'Z', 'Z001', 1, '321283124S3002', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z202', '南区-室外照明', 'Z', 'Z002', 1, '321283124S3002', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z210', '南区-公共设施', 'Z', 'Z010', 1, '321283124S3002', null, null, null);
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `attr_group`, `ability_group`, `event_group`) VALUES ('Z220', '南区-空调设施', 'Z', 'Z020', 1, '321283124S3002', null, null, null);
-
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('W201', '北区-供电网', 'W', 'W2', 1, '321283124S3001', 'M_W2');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('W202', '南区-供电网', 'W', 'W2', 1, '321283124S3002', 'M_W2');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('E501', '北区-光伏',   'E', 'E5', 1, '321283124S3001', 'M_E501');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('E502', '南区-光伏',   'E', 'E5', 1, '321283124S3002', 'M_E502');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('E503', '主路-光伏',   'E', 'E5', 1, '321283124S3003', 'M_E503');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('C101', '北区-储能',   'C', 'C1', 1, '321283124S3001', 'M_C101');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('C102', '南区-储能',   'C', 'C1', 1, '321283124S3002', 'M_C102');
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z101', '北区-室内照明', 'Z', 'Z001', 1, '321283124S3001', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z102', '北区-室外照明', 'Z', 'Z002', 1, '321283124S3001', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z110', '北区-公共设施', 'Z', 'Z010', 1, '321283124S3001', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z120', '北区-空调设施', 'Z', 'Z020', 1, '321283124S3001', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z201', '南区-室内照明', 'Z', 'Z001', 1, '321283124S3002', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z202', '南区-室外照明', 'Z', 'Z002', 1, '321283124S3002', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z210', '南区-公共设施', 'Z', 'Z010', 1, '321283124S3002', null);
+INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_subcategory`, `enable`, `ref_area`, `facs_model`) VALUES ('Z220', '南区-空调设施', 'Z', 'Z020', 1, '321283124S3002', null);
+
+
+-- 对象模型表
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2', '国网设施模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_E501', '北区光伏设施模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_E502', '南区光伏设施模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_E503', '主路光伏设施模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_C101', '北区储能模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_C102', '南区储能模型', 1);
 
 -- 对象属性DEMO数据
-INSERT INTO `adm_ems_obj_attr` (`group_code`, `group_name`, `obj_type`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('AT_W2', '电网属性', 1, 'voltageLevel', '电压等级', '10', 'kV');
-INSERT INTO `adm_ems_obj_attr` (`group_code`, `group_name`, `obj_type`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('AT_E501', '北区光伏属性', 1, 'installedCapacity', '装机容量', '150', 'kw');
-INSERT INTO `adm_ems_obj_attr` (`group_code`, `group_name`, `obj_type`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('AT_E502', '南区光伏属性', 1, 'installedCapacity', '装机容量', '150', 'kw');
-INSERT INTO `adm_ems_obj_attr` (`group_code`, `group_name`, `obj_type`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('AT_E503', '主路光伏属性', 1, 'installedCapacity', '装机容量', '150', 'kw');
-INSERT INTO `adm_ems_obj_attr` (`group_code`, `group_name`, `obj_type`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('AT_C101', '北区储能属性', 1, 'storageCapacity', '储能容量', '100', 'kW-h');
-INSERT INTO `adm_ems_obj_attr` (`group_code`, `group_name`, `obj_type`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('AT_C102', '南区储能属性', 1, 'storageCapacity', '储能容量', '100', 'kW-h');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_value`, `attr_unit`) VALUES ('M_W2',    'voltageLevel',      '电压等级', '10', 'kV');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_value`, `attr_unit`) VALUES ('M_E501',  'installedCapacity', '装机容量', '150', 'kw');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_value`, `attr_unit`) VALUES ('M_E502',  'installedCapacity', '装机容量', '150', 'kw');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_value`, `attr_unit`) VALUES ('M_E503',  'installedCapacity', '装机容量', '150', 'kw');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_value`, `attr_unit`) VALUES ('M_C101',  'storageCapacity',   '储能容量', '100', 'kW-h');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_value`, `attr_unit`) VALUES ('M_C102',  'storageCapacity',   '储能容量', '100', 'kW-h');
 
 -- 对象能力DEMO数据
-INSERT INTO `adm_ems_obj_ability` (`group_code`, `group_name`, `obj_type`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('AB_W2', '电网能力', 1, '通断检测', '链路测试', '{\"enable\":\"1\"}');
+INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('M_W2', 'checkLine', '线路检测', '执行xx方法进行测试', '{\"enable\":\"1\"}');
 
 
 -- 对象事件DEMO数据
-INSERT INTO `adm_ems_obj_event` (`group_code`, `group_name`, `obj_type`, `event_name`, `event_type`, `event_desc`, `event_code`, `ext_event_code`) VALUES ('E_W2', '电网事件', 1, 'overload', 2, '过载', 'e-gy-0001', '0x0001');
-INSERT INTO `adm_ems_obj_event` (`group_code`, `group_name`, `obj_type`, `event_name`, `event_type`, `event_desc`, `event_code`, `ext_event_code`) VALUES ('E_W2', '电网事件', 1, 'undervoltage', 2, '欠压', 'e-gy-0002', '0x0002');
+INSERT INTO `adm_ems_obj_event` (`model_code`, `event_type`, `event_key`, `event_name`, `event_desc`, `event_code`, `ext_event_code`) VALUES ('M_W2', 2, 'overload', '过载', '功率过载', 'e-gy-0001', '0x0001');
+INSERT INTO `adm_ems_obj_event` (`model_code`, `event_type`, `event_key`, `event_name`, `event_desc`, `event_code`, `ext_event_code`) VALUES ('M_W2', 2, 'undervoltage', '欠压', '电压不足', 'e-gy-0002', '0x0002');
 
 
 -- 能源设施能流关系DEMO数据
@@ -143,114 +151,112 @@ INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_cod
 INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_Z101', 'E501', 'Z101', '45', 1, '4505');
 
 -- 能源设备
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R101-001', '开水炉',       '1', '2', 'Zoning', 'B-101', '321283124S3001,321283124S300101,B-101', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R102-002', '超市照明灯',       '1', '2', 'Zoning', 'B-102', '321283124S3001,321283124S300101,B-102', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R102-003', '超市监控和防盗设备', '1', '2', 'Zoning', 'B-102', '321283124S3001,321283124S300101,B-102', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R103-001', '空调',             '2', '1', 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', 'Z120', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R103-002', '烤箱', '2', '2', 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R103-003', '搅拌机', '2','2' , 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R104-001', 'LED节能灯', '2', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R104-002', '智能电表', '2', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R104-003', '智慧路灯', '2', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R105-001', '电源管理器', '2', '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R105-002', '充电站', '1', '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R105-003', '调光系统', '1', '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R106-001', '吊灯', '2', '1', 'Zoning', 'B-106', '321283124S3001,321283124S300101,B-106', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R107-001', '橱窗照明','2', '1', 'Zoning', 'B-107', '321283124S3001,321283124S300101,B-107', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R107-002', 'UPS(不间断电源)系统', '1', '1', 'Zoning', 'B-107', '321283124S3001,321283124S300101,B-107', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R108-001', '吊灯', '2', '1', 'Zoning', 'B-108', '321283124S3001,321283124S300101,B-108', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R109-001', '指示灯', '2', '1', 'Zoning', 'B-109', '321283124S3001,321283124S300101,B-109', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R110-001', '应急照明', '2', '1', 'Zoning', 'B-110', '321283124S3001,321283124S300101,B-110', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R112-001', '自动感应灯', '2', '2', 'Zoning', 'B-112', '321283124S3001,321283124S300101,B-112', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R112-002', '电路保护装置', '1', '2', 'Zoning', 'B-112', '321283124S3001,321283124S300101,B-112', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R114-001', '自动感应灯', '2', '2', 'Zoning', 'B-114', '321283124S3001,321283124S300101,B-114', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R114-002', '电路保护装置', '1', '2', 'Zoning', 'B-114', '321283124S3001,321283124S300101,B-114', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R115-001', '工作灯', '1', '2', 'Zoning', 'B-115', '321283124S3001,321283124S300101,B-115', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R16-001',  '防水灯具', '1', '2', 'Zoning', 'B-116', '321283124S3001,321283124S300101,B-116', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R117-001', '防水灯具', '1', '2', 'Zoning', 'B-117', '321283124S3001,321283124S300101,B-117', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R118-001', '灯具', '1', '2', 'Zoning', 'B-118', '321283124S3001,321283124S300101,B-118', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R119-001', '防水灯具', '1', '2', 'Zoning', 'B-119', '321283124S3001,321283124S300101,B-119', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R120-001', '控制面板', '1', '1', 'Zoning', 'B-120', '321283124S3001,321283124S300102,B-120', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R121-001', '配电柜', '2', '1', 'Zoning', 'B-121', '321283124S3001,321283124S300102,B-121', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R122-001', '断路器', '1', '1', 'Zoning', 'B-122', '321283124S3001,321283124S300102,B-122', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R123-001', '电源插座', '1', '1', 'Zoning', 'B-123', '321283124S3001,321283124S300103,B-123', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R124-001', '加热器', '1', '1', 'Zoning', 'B-124', '321283124S3001,321283124S300103,B-124', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R125-001', '空调', '1', '1', 'Zoning', 'B-125', '321283124S3001,321283124S300104,B-125', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R126-001', '空调', '1', '1', 'Zoning', 'B-126', '321283124S3001,321283124S300104,B-126', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R127-001', '空调', '1', '1', 'Zoning', 'B-127', '321283124S3001,321283124S300104,B-127', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R128-001', '空调', '1', '1', 'Zoning', 'B-128', '321283124S3001,321283124S300104,B-128', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R129-001', '空调', '1', '1', 'Zoning', 'B-129', '321283124S3001,321283124S300105,B-129', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R130-001', '空调', '1', '1', 'Zoning', 'B-130', '321283124S3001,321283124S300105,B-130', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R131-001', '空调', '1', '1', 'Zoning', 'B-131', '321283124S3001,321283124S300105,B-131', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R132-001', '空调', '1', '1', 'Zoning', 'B-132', '321283124S3001,321283124S300105,B-132', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-001', '照明灯', '1', '1', 'Zoning', '321283124S3001_CW-XK', '321283124S3001,321283124S300106,321283124S3001_CW-XK', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-002', '智能监控系统', '1', NULL, 'Zoning', '321283124S3001_CW-CD', '321283124S3001,321283124S300106,321283124S3001_CW-CD', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-003', '照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-WZA', '321283124S3001,321283124S300106,321283124S3001_CW-WZA', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-004', '照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-DKC', '321283124S3001,321283124S300106,321283124S3001_CW-DKC', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-005', '照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-HC', '321283124S3001,321283124S300106,321283124S3001_CW-HC', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-006', '停车场照明灯', '1', NULL, 'Zoning', '321283124S3001_CW-WXP', '321283124S3001,321283124S300106,321283124S3001_CW-WXP', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-007', '智能监控系统', '1', NULL, 'Zoning', '321283124S3001_CW-WXP', '321283124S3001,321283124S300106,321283124S3001_CW-WXP', 'Z110', null, 'SYS_BA');
-
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R101-101', '开水炉', '1', '2', 'Zoning', 'N-101', '321283124S3002,321283124S300201,N-101', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R102-101', '超市区空调', '2', '1', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', 'Z120', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R102-102', '超市照明灯', '1', '2', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R102-103', '超市监控和防盗设备', '1', '2', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R103-101', '空调', '2', NULL, 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', 'Z120', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R103-102', '烤箱', '2', '2', 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R103-103', '搅拌机', '2','2' , 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R104-101', 'LED节能灯', '2', '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R104-102', '智能电表', '2', '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R104-103', '智慧路灯', '2', '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R105-101', '电源管理器', '2', '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R105-102', '充电站', '1', '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R105-103', '调光系统', '1', '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R106-101', '吊灯', '2', '1', 'Zoning', 'N-106', '321283124S3002,321283124S300201,N-106', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R107-101', '橱窗照明','2', '1', 'Zoning', 'N-107', '321283124S3002,321283124S300201,N-107', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R107-102', 'UPS(不间断电源)系统', '1', '1', 'Zoning', 'N-107', '321283124S3002,321283124S300201,N-107', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R108-101', '吊灯', '2', '1', 'Zoning', 'N-108', '321283124S3002,321283124S300201,N-108', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R109-101', '指示灯', '2', '1', 'Zoning', 'N-109', '321283124S3002,321283124S300201,N-109', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R110-101', '应急照明', '2', '1', 'Zoning', 'N-110', '321283124S3002,321283124S300201,N-110', 'Z101', null, 'SYS_BA');
-
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R112-101', '自动感应灯', '2', '2', 'Zoning', 'N-112', '321283124S3002,321283124S300201,N-112', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R112-102', '电路保护装置', '1', '2', 'Zoning', 'N-112', '321283124S3002,321283124S300201,N-112', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R114-101', '自动感应灯', '2', '2', 'Zoning', 'N-114', '321283124S3002,321283124S300201,N-114', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R114-102', '电路保护装置', '1', '2', 'Zoning', 'N-114', '321283124S3002,321283124S300201,N-114', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R115-101', '工作灯', '1', '2', 'Zoning', 'N-115', '321283124S3002,321283124S300201,N-115', 'Z101', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R16-101', '防水灯具', '1', '2', 'Zoning', 'N-116', '321283124S3002,321283124S300201,N-115', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R117-101', '防水灯具', '1', '2', 'Zoning', 'N-117', '321283124S3002,321283124S300201,N-117', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R118-101', '防水灯具', '1', '1', 'Zoning', 'N-118', '321283124S3002,321283124S300201,N-118', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R119-101', '防水灯具', '1', '1', 'Zoning', 'N-119', '321283124S3002,321283124S300201,N-119', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R120-101', '控制面板', '1', '1', 'Zoning', 'N-120', '321283124S3002,321283124S300202,N-120', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R121-101', '配电柜', '2', '1', 'Zoning', 'N-121', '321283124S3002,321283124S300202,N-121', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R122-101', '断路器', '1', '1', 'Zoning', 'N-122', '321283124S3002,321283124S300202,N-122', 'W201', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R123-101', '电源插座', '1', '1', 'Zoning', 'N-123', '321283124S3002,321283124S300203,N-123', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R124-101', '加热器', '1', '1', 'Zoning', 'N-124', '321283124S3002,321283124S300203,N-124', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R125-101', '空调', '1', '1', 'Zoning', 'N-125', '321283124S3002,321283124S300204,N-125', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R126-101', '空调', '1', '1', 'Zoning', 'N-126', '321283124S3002,321283124S300204,N-126', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R127-101', '空调', '1', '1', 'Zoning', 'N-127', '321283124S3002,321283124S300204,N-127', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R128-101', '空调', '1', '1', 'Zoning', 'N-128', '321283124S3002,321283124S300204,N-128', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R129-101', '空调', '1', '1', 'Zoning', 'N-129', '321283124S3002,321283124S300205,N-129', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R130-101', '空调', '1', '1', 'Zoning', 'N-130', '321283124S3002,321283124S300205,N-130', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R131-101', '空调', '1', '1', 'Zoning', 'N-131', '321283124S3002,321283124S300205,N-131', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Z010-R132-101', '空调', '1', '1', 'Zoning', 'N-132', '321283124S3002,321283124S300205,N-132', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-101', '照明灯', '1', '1', 'Zoning', '321283124S3002_CW-XK', '321283124S3002,321283124S300206,321283124S3002_CW-XK', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-102', '智能监控系统', '1', NULL, 'Zoning', '321283124S3002_CW-CD', '321283124S3002,321283124S300206,321283124S3002_CW-CD', 'Z110', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-103', '照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-WZA', '321283124S3002,321283124S300206,321283124S3002_CW-WZA', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-104', '照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-DKC', '321283124S3002,321283124S300206,321283124S3002_CW-DKC', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-105', '照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-HC', '321283124S3002,321283124S300206,321283124S3002_CW-HC', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-106', '停车场照明灯', '1', NULL, 'Zoning', '321283124S3002_CW-WXP', '321283124S3002,321283124S300206,321283124S3002_CW-WXP', 'Z102', null, 'SYS_BA');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'Car-107', '智能监控系统', '1', NULL, 'Zoning', '321283124S3002_CW-WXP', '321283124S3002,321283124S300206,321283124S3002_CW-WXP', 'Z110', null, 'SYS_BA');
-
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'E503-K140-K150-001', '光伏板1', '2', '1', 'Building', 'S30K140-S30K150', '321283124S3003,S30K140-S30K150', 'E503', null, 'SYS_GF');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'E503-K140-K150-002', '光伏板2', '2', '1', 'Building', 'S30K140-S30K150', '321283124S3003,S30K140-S30K150', 'E503', null, 'SYS_GF');
-INSERT INTO `adm_ems_device` ( `device_code`, `device_name`, `device_type`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'E503-K140-K150-003', '光伏板3', '2', '1', 'Building', 'S30K150-S30K180', '321283124S3003,S30K150-S30K180', 'E503', null, 'SYS_GF');
-
-
--- 配电柜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_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 ( 'Z010-R101-001', '开水炉',              '1', '美的', 'C10', '开水间', '2', 'Zoning', 'B-101', '321283124S3001,321283124S300101,B-101', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R102-002', '超市照明灯',           '1', '欧普', 'D20-x', '超市', '2', 'Zoning', 'B-102', '321283124S3001,321283124S300101,B-102', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R102-003', '超市监控和防盗设备',     '1', '萤石', 'Y-20', '超市', '2', 'Zoning', 'B-102', '321283124S3001,321283124S300101,B-102', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R103-001', '空调',                '2', '约克', 'Y-111', '超市', '1', 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', null, 'Z120', null, 'SYS_BA');
+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 ( 'Z010-R103-002', '烤箱',                '2', '格兰仕', 'G-111', '综合楼', '2', 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R103-003', '搅拌机',              '2', '9阳',    'G-111', '综合楼', '2' , 'Zoning', 'B-103', '321283124S3001,321283124S300101,B-103', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R104-001', 'LED节能灯',           '2', '欧普',    'G-111', '综合楼', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R104-002', '智能插座',            '2', '公牛',    'G-111', '综合楼', '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R104-003', '智慧路灯',            '2', '欧普',    'G-111', '广场',   '1', 'Zoning', 'B-104', '321283124S3001,321283124S300101,B-104', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R105-001', '电源管理器',           '2', null, null, null, '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R105-002', '充电站',              '1', null, null, null, '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R105-003', '调光系统',            '1', null, null, null, '1', 'Zoning', 'B-105', '321283124S3001,321283124S300101,B-105', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R106-001', '吊灯',                '2', null, null, null, '1', 'Zoning', 'B-106', '321283124S3001,321283124S300101,B-106', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R107-001', '橱窗照明',            '2', null, null, null, '1', 'Zoning', 'B-107', '321283124S3001,321283124S300101,B-107', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R107-002', 'UPS(不间断电源)系统', '1', null, null, null, '1', 'Zoning', 'B-107', '321283124S3001,321283124S300101,B-107', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R108-001', '吊灯',                '2', null, null, null, '1', 'Zoning', 'B-108', '321283124S3001,321283124S300101,B-108', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R109-001', '指示灯',              '2', null, null, null, '1', 'Zoning', 'B-109', '321283124S3001,321283124S300101,B-109', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R110-001', '应急照明',            '2', null, null, null, '1', 'Zoning', 'B-110', '321283124S3001,321283124S300101,B-110', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R112-001', '自动感应灯',           '2', null, null, null, '2', 'Zoning', 'B-112', '321283124S3001,321283124S300101,B-112', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R112-002', '电路保护装置',         '1', null, null, null, '2', 'Zoning', 'B-112', '321283124S3001,321283124S300101,B-112', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R114-001', '自动感应灯',           '2', null, null, null, '2', 'Zoning', 'B-114', '321283124S3001,321283124S300101,B-114', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R114-002', '电路保护装置',         '1', null, null, null, '2', 'Zoning', 'B-114', '321283124S3001,321283124S300101,B-114', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R115-001', '工作灯',              '1', null, null, null, '2', 'Zoning', 'B-115', '321283124S3001,321283124S300101,B-115', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R16-001',  '防水灯具',            '1', null, null, null, '2', 'Zoning', 'B-116', '321283124S3001,321283124S300101,B-116', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R117-001', '防水灯具',            '1', null, null, null, '2', 'Zoning', 'B-117', '321283124S3001,321283124S300101,B-117', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R118-001', '灯具',               '1', null, null, null, '2', 'Zoning', 'B-118', '321283124S3001,321283124S300101,B-118', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R119-001', '防水灯具',            '1', null, null, null, '2', 'Zoning', 'B-119', '321283124S3001,321283124S300101,B-119', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R120-001', '控制面板',            '1', null, null, null, '1', 'Zoning', 'B-120', '321283124S3001,321283124S300102,B-120', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R121-001', '配电柜',              '2', null, null, null, '1', 'Zoning', 'B-121', '321283124S3001,321283124S300102,B-121', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R122-001', '断路器',              '1', null, null, null, '1', 'Zoning', 'B-122', '321283124S3001,321283124S300102,B-122', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R123-001', '电源插座',            '1', null, null, null, '1', 'Zoning', 'B-123', '321283124S3001,321283124S300103,B-123', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R124-001', '加热器',              '1', null, null, null, '1', 'Zoning', 'B-124', '321283124S3001,321283124S300103,B-124', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R125-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-125', '321283124S3001,321283124S300104,B-125', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R126-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-126', '321283124S3001,321283124S300104,B-126', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R127-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-127', '321283124S3001,321283124S300104,B-127', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R128-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-128', '321283124S3001,321283124S300104,B-128', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R129-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-129', '321283124S3001,321283124S300105,B-129', null,'Z110', null, 'SYS_BA');
+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 ( 'Z010-R130-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-130', '321283124S3001,321283124S300105,B-130', null,'Z110', null, 'SYS_BA');
+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 ( 'Z010-R131-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-131', '321283124S3001,321283124S300105,B-131', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R132-001', '空调',                '1', '格力', null, null, '1', 'Zoning', 'B-132', '321283124S3001,321283124S300105,B-132', null, 'Z110', null, 'SYS_BA');
+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 ( 'Car-001', '照明灯',                    '1', '欧普', null, null, '1', 'Zoning', '321283124S3001_CW-XK', '321283124S3001,321283124S300106,321283124S3001_CW-XK', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-002', '智能监控系统',               '1', '中控', null, null, NULL, 'Zoning', '321283124S3001_CW-CD', '321283124S3001,321283124S300106,321283124S3001_CW-CD', null, 'Z110', null, 'SYS_BA');
+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 ( 'Car-003', '照明灯',                    '1', '欧普', null, null, NULL, 'Zoning', '321283124S3001_CW-WZA', '321283124S3001,321283124S300106,321283124S3001_CW-WZA', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-004', '照明灯',                    '1', '欧普', null, null, NULL, 'Zoning', '321283124S3001_CW-DKC', '321283124S3001,321283124S300106,321283124S3001_CW-DKC', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-005', '照明灯',                    '1', '欧普', null, null, NULL, 'Zoning', '321283124S3001_CW-HC', '321283124S3001,321283124S300106,321283124S3001_CW-HC', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-006', '停车场照明灯',               '1', '欧普', null, null, NULL, 'Zoning', '321283124S3001_CW-WXP', '321283124S3001,321283124S300106,321283124S3001_CW-WXP', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-007', '智能监控系统',               '1', '欧普', null, null, NULL, 'Zoning', '321283124S3001_CW-WXP', '321283124S3001,321283124S300106,321283124S3001_CW-WXP', null, 'Z110', null, 'SYS_BA');
+
+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 ( 'Z010-R101-101', '开水炉',              '1', '美的', 'C10', '开水间', '2', 'Zoning', 'N-101', '321283124S3002,321283124S300201,N-101',null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R102-101', '超市区空调',           '2', null, null, null, '1', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', null, 'Z120', null, 'SYS_BA');
+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 ( 'Z010-R102-102', '超市照明灯',           '1', null, null, null, '2', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R102-103', '超市监控和防盗设备',    '1', null, null, null, '2', 'Zoning', 'N-102', '321283124S3002,321283124S300201,N-102', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R103-101', '空调',                '2', null, null, null, NULL, 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', null, 'Z120', null, 'SYS_BA');
+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 ( 'Z010-R103-102', '烤箱',                '2', null, null, null, '2', 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R103-103', '搅拌机',              '2', null, null, null, '2' , 'Zoning', 'N-103', '321283124S3002,321283124S300201,N-103', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R104-101', 'LED节能灯',           '2', null, null, null, '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R104-102', '智能电表',             '2', null, null, null, '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R104-103', '智慧路灯',            '2', null, null, null, '1', 'Zoning', 'N-104', '321283124S3002,321283124S300201,N-104', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R105-101', '电源管理器',          '2', null, null, null, '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R105-102', '充电站',              '1', null, null, null, '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R105-103', '调光系统',            '1', null, null, null, '1', 'Zoning', 'N-105', '321283124S3002,321283124S300201,N-105', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R106-101', '吊灯',               '2', null, null, null, '1', 'Zoning', 'N-106', '321283124S3002,321283124S300201,N-106', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R107-101', '橱窗照明',            '2', null, null, null, '1', 'Zoning', 'N-107', '321283124S3002,321283124S300201,N-107', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R107-102', 'UPS(不间断电源)系统', '1', null, null, null, '1', 'Zoning', 'N-107', '321283124S3002,321283124S300201,N-107', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R108-101', '吊灯',               '2', null, null, null, '1', 'Zoning', 'N-108', '321283124S3002,321283124S300201,N-108', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R109-101', '指示灯',             '2', null, null, null, '1', 'Zoning', 'N-109', '321283124S3002,321283124S300201,N-109', null,  'Z101', null, 'SYS_BA');
+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 ( 'Z010-R110-101', '应急照明',           '2', null, null, null, '1', 'Zoning', 'N-110', '321283124S3002,321283124S300201,N-110', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R112-101', '自动感应灯',         '2', null, null, null, '2', 'Zoning', 'N-112', '321283124S3002,321283124S300201,N-112', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R112-102', '电路保护装置',       '1', null, null, null, '2', 'Zoning', 'N-112', '321283124S3002,321283124S300201,N-112', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R114-101', '自动感应灯',         '2', null, null, null, '2', 'Zoning', 'N-114', '321283124S3002,321283124S300201,N-114', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R114-102', '电路保护装置',       '1', null, null, null, '2', 'Zoning', 'N-114', '321283124S3002,321283124S300201,N-114', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R115-101', '工作灯',            '1', null, null, null, '2', 'Zoning', 'N-115', '321283124S3002,321283124S300201,N-115', null, 'Z101', null, 'SYS_BA');
+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 ( 'Z010-R16-101', '防水灯具',           '1', null, null, null, '2', 'Zoning', 'N-116', '321283124S3002,321283124S300201,N-115', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R117-101', '防水灯具',          '1', null, null, null, '2', 'Zoning', 'N-117', '321283124S3002,321283124S300201,N-117', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R118-101', '防水灯具',          '1', null, null, null, '1', 'Zoning', 'N-118', '321283124S3002,321283124S300201,N-118', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R119-101', '防水灯具',          '1', null, null, null, '1', 'Zoning', 'N-119', '321283124S3002,321283124S300201,N-119', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R120-101', '控制面板',          '1', null, null, null, '1', 'Zoning', 'N-120', '321283124S3002,321283124S300202,N-120', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R121-101', '配电柜',            '2', null, null, null, '1', 'Zoning', 'N-121', '321283124S3002,321283124S300202,N-121', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R122-101', '断路器',            '1', null, null, null, '1', 'Zoning', 'N-122', '321283124S3002,321283124S300202,N-122', null, 'W201', null, 'SYS_BA');
+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 ( 'Z010-R123-101', '电源插座',          '1', null, null, null, '1', 'Zoning', 'N-123', '321283124S3002,321283124S300203,N-123', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R124-101', '加热器',            '1', null, null, null, '1', 'Zoning', 'N-124', '321283124S3002,321283124S300203,N-124', null, 'Z102', null, 'SYS_BA');
+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 ( 'Z010-R125-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-125', '321283124S3002,321283124S300204,N-125' null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R126-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-126', '321283124S3002,321283124S300204,N-126' null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R127-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-127', '321283124S3002,321283124S300204,N-127' null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R128-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-128', '321283124S3002,321283124S300204,N-128' null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R129-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-129', '321283124S3002,321283124S300205,N-129' null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R130-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-130', '321283124S3002,321283124S300205,N-130' null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R131-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-131', '321283124S3002,321283124S300205,N-131', null, 'Z110', null, 'SYS_BA');
+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 ( 'Z010-R132-101', '空调',              '1', null, null, null, '1', 'Zoning', 'N-132', '321283124S3002,321283124S300205,N-132', null, 'Z110', null, 'SYS_BA');
+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 ( 'Car-101', '照明灯',                  '1', null, null, null, '1', 'Zoning', '321283124S3002_CW-XK', '321283124S3002,321283124S300206,321283124S3002_CW-XK', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-102', '智能监控系统',             '1', null, null, null, NULL, 'Zoning', '321283124S3002_CW-CD', '321283124S3002,321283124S300206,321283124S3002_CW-CD', null, 'Z110', null, 'SYS_BA');
+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 ( 'Car-103', '照明灯',                  '1', null, null, null, NULL, 'Zoning', '321283124S3002_CW-WZA', '321283124S3002,321283124S300206,321283124S3002_CW-WZA', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-104', '照明灯',                  '1', null, null, null, NULL, 'Zoning', '321283124S3002_CW-DKC', '321283124S3002,321283124S300206,321283124S3002_CW-DKC', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-105', '照明灯',                  '1', null, null, null, NULL, 'Zoning', '321283124S3002_CW-HC', '321283124S3002,321283124S300206,321283124S3002_CW-HC', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-106', '停车场照明灯',             '1', null, null, null, NULL, 'Zoning', '321283124S3002_CW-WXP', '321283124S3002,321283124S300206,321283124S3002_CW-WXP', null, 'Z102', null, 'SYS_BA');
+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 ( 'Car-107', '智能监控系统',             '1', null, null, null, NULL, 'Zoning', '321283124S3002_CW-WXP', '321283124S3002,321283124S300206,321283124S3002_CW-WXP', null, 'Z110', null, 'SYS_BA');
+
+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 ( 'E503-K140-K150-001', '光伏板1',      '2', null, null, null, '1', 'Building', 'S30K140-S30K150', '321283124S3003,S30K140-S30K150', null, 'E503', null, 'SYS_GF');
+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 ( 'E503-K140-K150-002', '光伏板2',      '2', null, null, null, '1', 'Building', 'S30K140-S30K150', '321283124S3003,S30K140-S30K150', null, 'E503', null, 'SYS_GF');
+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 ( 'E503-K140-K150-003', '光伏板3',      '2', null, null, null, '1', 'Building', 'S30K150-S30K180', '321283124S3003,S30K150-S30K180', null, 'E503', null, 'SYS_GF');
+
+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-B-1001', '配电柜', 3, '安科瑞', 'DX2121021', '综合楼配电间', 1, 'Area', '321283124S3001', '321283124S3001', null, 'W201', 'AP', null);
+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-B-1002', '配电柜', 3, '安科瑞', 'DX2121021', '广场配电柜',   1, 'Area', '321283124S3001', '321283124S3001', null, 'W201', 'AP', null);
+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-1001', '配电柜', 3, '安科瑞', 'DX2121021', '综合楼配电间', 1, 'Area', '321283124S3002', '321283124S3002', null, 'W202', 'AP', null);
+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);
+
 
 -- 动力箱柜电气设备表
 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', '分开');

+ 35 - 31
ems-cloud/sql/ems_server.sql

@@ -466,9 +466,7 @@ create table adm_ems_facs  (
   `facs_subcategory`  varchar(32)     not null                     comment '设施子类',
   `enable`            int             default '0'                  comment '启用状态0-停用,1-启用',
   `ref_area`          varchar(32)     not null                     comment '归属区域代码',
-  `attr_group`        varchar(16)     default null                 comment '属性分组代码',
-  `ability_group`     varchar(16)     default null                 comment '能力分组代码',
-  `event_group`       varchar(16)     default null                 comment '事件分组代码',
+  `facs_model`        varchar(16)     default null                 comment '设施模型',
   `create_time`       datetime        default CURRENT_TIMESTAMP    comment '创建时间',
   `update_time`       datetime        default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '更新时间',
   primary key (`id`),
@@ -492,9 +490,7 @@ create table adm_ems_device  (
   `area_type`       varchar(32)     default null                 comment '区域层级',
   `ref_area`        varchar(64)     default null                 comment '归属区域代码',
   `area_ancestors`  varchar(200)    default null                 comment '区域祖级代码',
-  `attr_group`      varchar(16)     default null                 comment '属性分组代码',
-  `ability_group`   varchar(16)     default null                 comment '能力分组代码',
-  `event_group`     varchar(16)     default null                 comment '事件分组代码',
+  `device_model`    varchar(16)     default null                 comment '设备模型',
   `ref_facs`        varchar(64)     default null                 comment '归属设施代码',
   `ps_code`         varchar(16)     default null                 comment '工艺标识',
   `subsystem_code`  varchar(16)     default null                 comment '子系统名称',
@@ -514,9 +510,7 @@ create table adm_ems_device_component  (
   `device_code`     varchar(64)     not null                     comment '设备编码',
   `compo_code`      varchar(64)     not null                     comment '部件编码',
   `ext_compo_code`  varchar(256)    default null                 comment '外部系统编码',
-  `ps_code`         varchar(16)     default null                 comment '工艺标识代码',
-  `ability_group`   varchar(16)     default null                 comment '能力分组代码',
-  `event_group`     varchar(16)     default null                 comment '事件分组代码',
+  `compo_model`     varchar(16)     default null                 comment '部件模型',
   `compo_brand`     varchar(128)    default null                 comment '部件品牌',
   `compo_spec`      varchar(128)    default null                 comment '部件型号',
   `ancestors`       varchar(256)    default null                 comment '祖籍列表',
@@ -549,20 +543,32 @@ create table adm_meter_device  (
 
 
 -- ----------------------------
+-- 能源对象模型表
+-- ----------------------------
+drop table if exists adm_ems_obj_model;
+create table adm_ems_obj_model  (
+  `id`              bigint(20)      not null auto_increment      comment '序号',
+  `model_code`      varchar(16)     not null                     comment '模型code',
+  `model_name`      varchar(128)    not null                     comment '模型名称',
+  `obj_type`        int             not null                     comment '对象类型',
+  primary key (`id`),
+  unique key ux_ems_obj_attr(`model_code`)
+) engine=innodb auto_increment=1 comment = '能源对象模型表';
+
+
+-- ----------------------------
 -- 能源对象属性表
 -- ----------------------------
 drop table if exists adm_ems_obj_attr;
 create table adm_ems_obj_attr  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `group_code`      varchar(16)     not null                     comment '属性分组代码',
-  `group_name`      varchar(128)    default null                 comment '属性分组名称',
-  `obj_type`        int             not null                     comment '对象类型',
-  `attr_name`       varchar(32)     not null                     comment '属性名称',
-  `attr_desc`       varchar(64)     default null                 comment '属性描述',
-  `attr_value`      varchar(64)     default null                 comment '属性值',
+  `model_code`      varchar(16)     not null                     comment '模型code',
+  `attr_key`        varchar(128)    not null                     comment '属性标识',
+  `attr_name`       varchar(256)    default null                 comment '属性名称',
+  `attr_value`      varchar(1024)   default null                 comment '属性值',
   `attr_unit`       varchar(32)     default null                 comment '属性单位',
-   primary key (`id`),
-   key ux_ems_obj_attr(`group_code`)
+  primary key (`id`),
+  unique key ux_ems_obj_attr(`model_code`, `attr_key`)
 ) engine=innodb auto_increment=1 comment = '能源对象属性表';
 
 
@@ -572,14 +578,13 @@ create table adm_ems_obj_attr  (
 drop table if exists adm_ems_obj_ability;
 create table adm_ems_obj_ability  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `group_code`      varchar(16)     not null                     comment '能力分组代码',
-  `group_name`      varchar(128)    default null                 comment '能力分组名称',
-  `obj_type`        int             not null                     comment '对象类型',
-  `ability_name`    varchar(32)     not null                     comment '能力名称',
-  `ability_desc`    varchar(64)     default null                 comment '能力描述',
+  `model_code`      varchar(16)     not null                     comment '模型code',
+  `ability_key`     varchar(128)    not null                     comment '能力键',
+  `ability_name`    varchar(256)    default null                 comment '能力名称',
+  `ability_desc`    varchar(1024)   default null                 comment '能力描述',
   `ability_param`   varchar(2048)   default null                 comment '能力参数',
   primary key (`id`),
-  key ux_ems_obj_ability(`group_code`)
+  unique key ux_ems_obj_ability(`model_code`, `ability_key`)
 ) engine=innodb auto_increment=1 comment = '能源对象能力表';
 
 
@@ -589,16 +594,15 @@ create table adm_ems_obj_ability  (
 drop table if exists adm_ems_obj_event;
 create table adm_ems_obj_event  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `group_code`      varchar(16)     not null                     comment '能力分组代码',
-  `group_name`      varchar(128)    default null                 comment '能力分组名称',
-  `obj_type`        int             not null                     comment '对象类型',
-  `event_name`      varchar(32)     not null                     comment '事件名称',
+  `model_code`      varchar(16)     not null                     comment '模型code',
+  `event_key`       varchar(128)    not null                     comment '事件名称',
   `event_type`      int             not null                     comment '事件类型',
-  `event_desc`      varchar(64)     default null                 comment '事件描述',
-  `event_code`      varchar(32)     default null                 comment '事件代码',
-  `ext_event_code`  varchar(64)     default null                 comment '外系统事件代码',
+  `event_name`      varchar(256)    default null                 comment '事件名称',
+  `event_desc`      varchar(1024)   default null                 comment '事件名称',
+  `event_code`      varchar(128)    default null                 comment '事件代码',
+  `ext_event_code`  varchar(128)    default null                 comment '外系统事件代码',
   primary key (`id`),
-  key ux_ems_obj_event(`group_code`)
+  unique key ux_ems_obj_event(`model_code`, `event_key`)
 ) engine=innodb auto_increment=1 comment = '能源对象事件表';
 
 

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

@@ -250,7 +250,7 @@ insert into sys_menu values ('1620',  '设施类别',   '162', '1',  'basecfg-fa
 insert into sys_menu values ('1621',  '能源设施',   '162', '2',  'basecfg-facscfg',        'basecfg/emsfacs/index',      '', 1, 0, 'C', '0', '0',   'basecfg:emsfacs:list',         'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
 insert into sys_menu values ('1622',  '能流关系',   '162', '3',  'basecfg-flowrel',        'basecfg/flowrel/index',      '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
 insert into sys_menu values ('1623',  '能源设备',   '162', '4',  'basecfg-devccfg',        'basecfg/device/index',       '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
-insert into sys_menu values ('1624',  '配电设施',   '162', '5',  'basecfg-powerbox',       'basecfg/powerbox/index',     '', 1, 0, 'C', '0', '0',   'ems:powerbox:list',            'cfgwrite',   'admin', sysdate(), '', null, '配电设施');
+insert into sys_menu values ('1624',  '设备模型',   '162', '5',  'basecfg-devmode',        'basecfg/devmode/index',     '', 1, 0, 'C', '0', '0',   'ems:devmode:list',            'cfgwrite',   'admin', sysdate(), '', null, '设备模型');
 insert into sys_menu values ('1630',  '价格策略',   '163', '1',  'basecfg-electricity',    'basecfg/price/index',        '', 1, 0, 'C', '0', '0',   'basecfg:price:list',           'cfgwrite',   'admin', sysdate(), '', null, '价格策略');
 insert into sys_menu values ('1631',  '计量设备',   '163', '2',  'basecfg-meterdevc',      'basecfg/meterdevc/index',     '', 1, 0, 'C', '0', '0',  'ems:meterdevc:list',           'cfgwrite',   'admin', sysdate(), '', null, '计量设备');
 insert into sys_menu values ('1632',  '碳核算',     '163', '3',  'basecfg-cacfg',          'basecfg/cacfg/index',        '', 1, 0, 'C', '0', '0',   'basecfg:cacfg:list',           'cfgwrite',   'admin', sysdate(), '', null, '碳排因子');