فهرست منبع

业务模型配置

lv.wenbin 1 سال پیش
والد
کامیت
9817ccacbb
27فایلهای تغییر یافته به همراه703 افزوده شده و 241 حذف شده
  1. 105 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmissionFactorController.java
  2. 105 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/FacsTypeController.java
  3. 6 6
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/Area.java
  4. 24 1
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AreaBuilding.java
  5. 27 17
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AreaBuildingZoning.java
  6. 3 3
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmissionFactor.java
  7. 24 2
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevice.java
  8. 36 3
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacs.java
  9. 24 2
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacsFlowRel.java
  10. 22 6
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsFacsSubtypeMapper.java
  11. 6 6
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsFacsTypeMapper.java
  12. 2 1
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsAttrService.java
  13. 20 6
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsSubtypeService.java
  14. 6 6
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsTypeService.java
  15. 2 1
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsAttrServiceImpl.java
  16. 6 4
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsServiceImpl.java
  17. 34 27
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsSubtypeServiceImpl.java
  18. 89 29
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsTypeServiceImpl.java
  19. 12 10
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AreaBuildingMapper.xml
  20. 18 17
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AreaBuildingZoningMapper.xml
  21. 13 11
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceMapper.xml
  22. 10 8
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsFlowRelMapper.xml
  23. 12 9
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsMapper.xml
  24. 22 11
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsSubtypeMapper.xml
  25. 10 10
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsTypeMapper.xml
  26. 29 28
      ems-cloud/sql/ems_server.sql
  27. 36 17
      ems-cloud/sql/ems_sys.sql

+ 105 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmissionFactorController.java

@@ -0,0 +1,105 @@
+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.EmissionFactor;
+import com.ruoyi.ems.service.IEmissionFactorService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/basecfg/emissionFactor")
+public class EmissionFactorController extends BaseController
+{
+    @Autowired
+    private IEmissionFactorService emissionFactorService;
+
+    /**
+     * 查询排放因子维列表
+     */
+    @RequiresPermissions("basecfg:emissionFactor:list")
+    @GetMapping("/list")
+    public TableDataInfo list(EmissionFactor emissionFactor)
+    {
+        startPage();
+        List<EmissionFactor> list = emissionFactorService.selectEmissionFactorList(emissionFactor);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出排放因子维列表
+     */
+    @RequiresPermissions("basecfg:emissionFactor:export")
+    @Log(title = "排放因子维", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmissionFactor emissionFactor)
+    {
+        List<EmissionFactor> list = emissionFactorService.selectEmissionFactorList(emissionFactor);
+        ExcelUtil<EmissionFactor> util = new ExcelUtil<EmissionFactor>(EmissionFactor.class);
+        util.exportExcel(response, list, "排放因子维数据");
+    }
+
+    /**
+     * 获取排放因子维详细信息
+     */
+    @RequiresPermissions("ems:factor:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(emissionFactorService.selectEmissionFactorById(id));
+    }
+
+    /**
+     * 新增排放因子维
+     */
+    @RequiresPermissions("ems:factor:add")
+    @Log(title = "排放因子维", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EmissionFactor emissionFactor)
+    {
+        return toAjax(emissionFactorService.insertEmissionFactor(emissionFactor));
+    }
+
+    /**
+     * 修改排放因子维
+     */
+    @RequiresPermissions("ems:factor:edit")
+    @Log(title = "排放因子维", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody EmissionFactor emissionFactor)
+    {
+        return toAjax(emissionFactorService.updateEmissionFactor(emissionFactor));
+    }
+
+    /**
+     * 删除排放因子维
+     */
+    @RequiresPermissions("ems:factor:remove")
+    @Log(title = "排放因子维", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(emissionFactorService.deleteEmissionFactorByIds(ids));
+    }
+}

+ 105 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/FacsTypeController.java

@@ -0,0 +1,105 @@
+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.EmsFacsType;
+import com.ruoyi.ems.service.IEmsFacsTypeService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/basecfg/facstype")
+public class FacsTypeController extends BaseController
+{
+    @Autowired
+    private IEmsFacsTypeService emsFacsTypeService;
+
+    /**
+     * 查询能源设施/系统分类列表
+     */
+    @RequiresPermissions("basecfg:facstype:list")
+    @GetMapping("/list")
+    public TableDataInfo list(EmsFacsType emsFacsType)
+    {
+        startPage();
+        List<EmsFacsType> list = emsFacsTypeService.selectFacsTypeList(emsFacsType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出能源设施/系统分类列表
+     */
+    @RequiresPermissions("basecfg:facstype:export")
+    @Log(title = "能源设施/系统分类", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EmsFacsType emsFacsType)
+    {
+        List<EmsFacsType> list = emsFacsTypeService.selectFacsTypeList(emsFacsType);
+        ExcelUtil<EmsFacsType> util = new ExcelUtil<EmsFacsType>(EmsFacsType.class);
+        util.exportExcel(response, list, "能源设施/系统分类数据");
+    }
+
+    /**
+     * 获取能源设施/系统分类详细信息
+     */
+    @RequiresPermissions("basecfg:facstype:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(emsFacsTypeService.selectFacsTypeById(id));
+    }
+
+    /**
+     * 新增能源设施/系统分类
+     */
+    @RequiresPermissions("basecfg:facstype:add")
+    @Log(title = "能源设施/系统分类", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EmsFacsType emsFacsType)
+    {
+        return toAjax(emsFacsTypeService.insertFacsType(emsFacsType));
+    }
+
+    /**
+     * 修改能源设施/系统分类
+     */
+    @RequiresPermissions("basecfg:facstype:edit")
+    @Log(title = "能源设施/系统分类", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody EmsFacsType emsFacsType)
+    {
+        return toAjax(emsFacsTypeService.updateFacsType(emsFacsType));
+    }
+
+    /**
+     * 删除能源设施/系统分类
+     */
+    @RequiresPermissions("basecfg:facstype:remove")
+    @Log(title = "能源设施/系统分类", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(emsFacsTypeService.deleteFacsTypeByIds(ids));
+    }
+}

+ 6 - 6
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/Area.java

@@ -71,11 +71,11 @@ public class Area extends BaseEntity
 
     /** 经度 */
     @Excel(name = "经度")
-    private Long longitude;
+    private Double longitude;
 
     /** 纬度 */
     @Excel(name = "纬度")
-    private Long latitude;
+    private Double latitude;
 
     public void setId(Long id) 
     {
@@ -194,21 +194,21 @@ public class Area extends BaseEntity
     {
         return floorArea;
     }
-    public void setLongitude(Long longitude) 
+    public void setLongitude(Double longitude)
     {
         this.longitude = longitude;
     }
 
-    public Long getLongitude() 
+    public Double getLongitude()
     {
         return longitude;
     }
-    public void setLatitude(Long latitude) 
+    public void setLatitude(Double latitude)
     {
         this.latitude = latitude;
     }
 
-    public Long getLatitude() 
+    public Double getLatitude()
     {
         return latitude;
     }

+ 24 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AreaBuilding.java

@@ -19,7 +19,6 @@ public class AreaBuilding extends BaseEntity
     private Long id;
 
     /** 建筑编码 */
-    @Excel(name = "建筑编码")
     private String bldgCode;
 
     /** 建筑名称 */
@@ -50,6 +49,13 @@ public class AreaBuilding extends BaseEntity
     @Excel(name = "主要用途")
     private String bldgUsage;
 
+    /** 所属园区code */
+    private String areaCode;
+
+    /** 所属园区名称 */
+    @Excel(name = "园区")
+    private String areaName;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -132,6 +138,22 @@ public class AreaBuilding extends BaseEntity
         return bldgUsage;
     }
 
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -144,6 +166,7 @@ public class AreaBuilding extends BaseEntity
             .append("bldgHeight", getBldgHeight())
             .append("floorArea", getFloorArea())
             .append("bldgUsage", getBldgUsage())
+            .append("areaCode", getAreaCode())
             .toString();
     }
 }

+ 27 - 17
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AreaBuildingZoning.java

@@ -22,13 +22,16 @@ public class AreaBuildingZoning extends BaseEntity
     @Excel(name = "建筑编码")
     private String bldgCode;
 
+    @Excel(name = "建筑名称")
+    private String bldgName;
+
     /** 分区编码 */
     @Excel(name = "分区编码")
-    private String divisionCode;
+    private String zoningCode;
 
     /** 分区名称 */
     @Excel(name = "分区名称")
-    private String divisionName;
+    private String zoningName;
 
     /** 楼层 */
     @Excel(name = "楼层")
@@ -64,25 +67,32 @@ public class AreaBuildingZoning extends BaseEntity
     {
         return bldgCode;
     }
-    public void setDivisionCode(String divisionCode) 
-    {
-        this.divisionCode = divisionCode;
+
+    public String getBldgName() {
+        return bldgName;
     }
 
-    public String getDivisionCode() 
-    {
-        return divisionCode;
+    public void setBldgName(String bldgName) {
+        this.bldgName = bldgName;
     }
-    public void setDivisionName(String divisionName) 
-    {
-        this.divisionName = divisionName;
+
+    public String getZoningCode() {
+        return zoningCode;
     }
 
-    public String getDivisionName() 
-    {
-        return divisionName;
+    public void setZoningCode(String zoningCode) {
+        this.zoningCode = zoningCode;
+    }
+
+    public String getZoningName() {
+        return zoningName;
     }
-    public void setFloor(Long floor) 
+
+    public void setZoningName(String zoningName) {
+        this.zoningName = zoningName;
+    }
+
+    public void setFloor(Long floor)
     {
         this.floor = floor;
     }
@@ -124,8 +134,8 @@ public class AreaBuildingZoning extends BaseEntity
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("bldgCode", getBldgCode())
-            .append("divisionCode", getDivisionCode())
-            .append("divisionName", getDivisionName())
+            .append("zoningCode", getZoningCode())
+            .append("zoningName", getZoningName())
             .append("floor", getFloor())
             .append("roomNo", getRoomNo())
             .append("bldgLdArea", getBldgLdArea())

+ 3 - 3
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmissionFactor.java

@@ -32,7 +32,7 @@ public class EmissionFactor extends BaseEntity
 
     /** 因子值 单位: kgCO2/kWh */
     @Excel(name = "因子值(单位: kgCO2/kWh)")
-    private Long factorValue;
+    private Double factorValue;
 
     /** 因子类型
      * 1:电力平均二氧化碳排放因子
@@ -82,12 +82,12 @@ public class EmissionFactor extends BaseEntity
     {
         return regionType;
     }
-    public void setFactorValue(Long factorValue) 
+    public void setFactorValue(Double factorValue)
     {
         this.factorValue = factorValue;
     }
 
-    public Long getFactorValue() 
+    public Double getFactorValue()
     {
         return factorValue;
     }

+ 24 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsDevice.java

@@ -35,13 +35,19 @@ public class EmsDevice extends BaseEntity
     private Long deviceStatus;
 
     /** 归属区域代码 */
-    @Excel(name = "归属区域代码")
     private String refArea;
 
+    /** 归属区域名称 */
+    @Excel(name = "归属区域")
+    private String refAreaName;
+
     /** 归属设施代码 */
-    @Excel(name = "归属设施代码")
     private String refFacs;
 
+    /** 归属设施名称 */
+    @Excel(name = "归属设施")
+    private String refFacsName;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -106,6 +112,22 @@ public class EmsDevice extends BaseEntity
         return refFacs;
     }
 
+    public String getRefAreaName() {
+        return refAreaName;
+    }
+
+    public void setRefAreaName(String refAreaName) {
+        this.refAreaName = refAreaName;
+    }
+
+    public String getRefFacsName() {
+        return refFacsName;
+    }
+
+    public void setRefFacsName(String refFacsName) {
+        this.refFacsName = refFacsName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 36 - 3
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacs.java

@@ -28,22 +28,31 @@ public class EmsFacs extends BaseEntity
     @Excel(name = "设施名称")
     private String facsName;
 
-    /** 设施分类 */
     @Excel(name = "设施分类")
     private String facsType;
 
+    /** 设施分类-名称 */
+    @Excel(name = "设施分类")
+    private String facsTypeName;
+
     /** 设施子类 */
-    @Excel(name = "设施子类")
     private String facsSubtype;
 
+    /** 设施子类名称 */
+    @Excel(name = "设施子类")
+    private String facsSubtypeName;
+
     /** 启用状态0-停用,1-启用 */
     @Excel(name = "启用状态0-停用,1-启用")
     private Long enable;
 
     /** 归属区域代码 */
-    @Excel(name = "归属区域代码")
     private String refArea;
 
+    /** 归属区域名称 */
+    @Excel(name = "归属区域")
+    private String refAreaName;
+
     /** 厂商 */
     @Excel(name = "厂商")
     private String manufacturer;
@@ -132,6 +141,30 @@ public class EmsFacs extends BaseEntity
         this.facsAttrs = facsAttrs;
     }
 
+    public String getFacsTypeName() {
+        return facsTypeName;
+    }
+
+    public void setFacsTypeName(String facsTypeName) {
+        this.facsTypeName = facsTypeName;
+    }
+
+    public String getFacsSubtypeName() {
+        return facsSubtypeName;
+    }
+
+    public void setFacsSubtypeName(String facsSubtypeName) {
+        this.facsSubtypeName = facsSubtypeName;
+    }
+
+    public String getRefAreaName() {
+        return refAreaName;
+    }
+
+    public void setRefAreaName(String refAreaName) {
+        this.refAreaName = refAreaName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 24 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacsFlowRel.java

@@ -23,13 +23,19 @@ public class EmsFacsFlowRel extends BaseEntity
     private String code;
 
     /** 能源输出设施 */
-    @Excel(name = "能源输出设施")
     private String exportFacsCode;
 
+    /** 能源输出设施名称 */
+    @Excel(name = "能源输出设施")
+    private String exportFacsName;
+
     /** 能源流入设施 */
-    @Excel(name = "能源流入设施")
     private String inputFacsCode;
 
+    /** 能源流入设施名称 */
+    @Excel(name = "能源流入设施")
+    private String inputFacsName;
+
     /** 能源流动介质 */
     @Excel(name = "能源流动介质")
     private String emsCls;
@@ -111,6 +117,22 @@ public class EmsFacsFlowRel extends BaseEntity
         return actionType;
     }
 
+    public String getExportFacsName() {
+        return exportFacsName;
+    }
+
+    public void setExportFacsName(String exportFacsName) {
+        this.exportFacsName = exportFacsName;
+    }
+
+    public String getInputFacsName() {
+        return inputFacsName;
+    }
+
+    public void setInputFacsName(String inputFacsName) {
+        this.inputFacsName = inputFacsName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 22 - 6
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsFacsSubtypeMapper.java

@@ -17,7 +17,7 @@ public interface EmsFacsSubtypeMapper {
      * @param id 能源设施/系统子类主键
      * @return 能源设施/系统子类
      */
-    EmsFacsSubtype selectEmsFacsSubtypeById(Long id);
+    EmsFacsSubtype selectFacsSubtypeById(Long id);
 
     /**
      * 查询能源设施/系统子类列表
@@ -25,7 +25,7 @@ public interface EmsFacsSubtypeMapper {
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 能源设施/系统子类集合
      */
-    List<EmsFacsSubtype> selectEmsFacsSubtypeList(EmsFacsSubtype emsFacsSubtype);
+    List<EmsFacsSubtype> selectFacsSubtypeList(EmsFacsSubtype emsFacsSubtype);
 
     /**
      * 新增能源设施/系统子类
@@ -33,7 +33,15 @@ public interface EmsFacsSubtypeMapper {
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 结果
      */
-    int insertEmsFacsSubtype(EmsFacsSubtype emsFacsSubtype);
+    int insertFacsSubtype(EmsFacsSubtype emsFacsSubtype);
+
+    /**
+     * 批量新增能源设施/系统子类
+     *
+     * @param emsFacsSubtypes 能源设施/系统子类列表
+     * @return 结果
+     */
+    void insertFacsSubtypeBatch(List<EmsFacsSubtype> emsFacsSubtypes);
 
     /**
      * 修改能源设施/系统子类
@@ -41,7 +49,7 @@ public interface EmsFacsSubtypeMapper {
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 结果
      */
-    int updateEmsFacsSubtype(EmsFacsSubtype emsFacsSubtype);
+    int updateFacsSubtype(EmsFacsSubtype emsFacsSubtype);
 
     /**
      * 删除能源设施/系统子类
@@ -49,7 +57,7 @@ public interface EmsFacsSubtypeMapper {
      * @param id 能源设施/系统子类主键
      * @return 结果
      */
-    int deleteEmsFacsSubtypeById(Long id);
+    int deleteFacsSubtypeById(Long id);
 
     /**
      * 批量删除能源设施/系统子类
@@ -57,5 +65,13 @@ public interface EmsFacsSubtypeMapper {
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    int deleteEmsFacsSubtypeByIds(Long[] ids);
+    int deleteFacsSubtypeByIds(Long[] ids);
+
+    /**
+     * 批量删除能源设施/系统子类
+     *
+     * @param code 父分类ID
+     * @return 结果
+     */
+    int deleteFacsSubtypeByParentCode(String code);
 }

+ 6 - 6
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsFacsTypeMapper.java

@@ -17,7 +17,7 @@ public interface EmsFacsTypeMapper {
      * @param id 能源设施/系统分类主键
      * @return 能源设施/系统分类
      */
-    EmsFacsType selectEmsFacsTypeById(Long id);
+    EmsFacsType selectFacsTypeById(Long id);
 
     /**
      * 查询能源设施/系统分类列表
@@ -25,7 +25,7 @@ public interface EmsFacsTypeMapper {
      * @param emsFacsType 能源设施/系统分类
      * @return 能源设施/系统分类集合
      */
-    List<EmsFacsType> selectEmsFacsTypeList(EmsFacsType emsFacsType);
+    List<EmsFacsType> selectFacsTypeList(EmsFacsType emsFacsType);
 
     /**
      * 新增能源设施/系统分类
@@ -33,7 +33,7 @@ public interface EmsFacsTypeMapper {
      * @param emsFacsType 能源设施/系统分类
      * @return 结果
      */
-    int insertEmsFacsType(EmsFacsType emsFacsType);
+    int insertFacsType(EmsFacsType emsFacsType);
 
     /**
      * 修改能源设施/系统分类
@@ -41,7 +41,7 @@ public interface EmsFacsTypeMapper {
      * @param emsFacsType 能源设施/系统分类
      * @return 结果
      */
-    int updateEmsFacsType(EmsFacsType emsFacsType);
+    int updateFacsType(EmsFacsType emsFacsType);
 
     /**
      * 删除能源设施/系统分类
@@ -49,7 +49,7 @@ public interface EmsFacsTypeMapper {
      * @param id 能源设施/系统分类主键
      * @return 结果
      */
-    int deleteEmsFacsTypeById(Long id);
+    int deleteFacsTypeById(Long id);
 
     /**
      * 批量删除能源设施/系统分类
@@ -57,5 +57,5 @@ public interface EmsFacsTypeMapper {
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    int deleteEmsFacsTypeByIds(Long[] ids);
+    int deleteFacsTypeByIds(Long[] ids);
 }

+ 2 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsAttrService.java

@@ -37,10 +37,11 @@ public interface IEmsFacsAttrService {
     /**
      * 批量新增能源设施/系统属性
      *
+     * @param facsCode 设施分类
      * @param emsFacsAttrs 能源设施/系统属性
      * @return 结果
      */
-    int insertEmsFacsAttrBatch(List<EmsFacsAttr> emsFacsAttrs);
+    int insertEmsFacsAttrBatch(String facsCode, List<EmsFacsAttr> emsFacsAttrs);
 
     /**
      * 修改能源设施/系统属性

+ 20 - 6
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IEmsFacsSubtypeService.java

@@ -16,7 +16,7 @@ public interface IEmsFacsSubtypeService {
      * @param id 能源设施/系统子类主键
      * @return 能源设施/系统子类
      */
-    EmsFacsSubtype selectEmsFacsSubtypeById(Long id);
+    EmsFacsSubtype selectFacsSubtypeById(Long id);
 
     /**
      * 查询能源设施/系统子类列表
@@ -24,7 +24,7 @@ public interface IEmsFacsSubtypeService {
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 能源设施/系统子类集合
      */
-    List<EmsFacsSubtype> selectEmsFacsSubtypeList(EmsFacsSubtype emsFacsSubtype);
+    List<EmsFacsSubtype> selectFacsSubtypeList(EmsFacsSubtype emsFacsSubtype);
 
     /**
      * 新增能源设施/系统子类
@@ -32,7 +32,14 @@ public interface IEmsFacsSubtypeService {
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 结果
      */
-    int insertEmsFacsSubtype(EmsFacsSubtype emsFacsSubtype);
+    int insertFacsSubtype(EmsFacsSubtype emsFacsSubtype);
+
+    /**
+     * 批量新增能源设施/系统子类
+     * @param emsFacsSubtypes 能源设施/系统子类列表
+     * @return 结果
+     */
+    void insertFacsSubtypeBatch(String facsType, List<EmsFacsSubtype> emsFacsSubtypes);
 
     /**
      * 修改能源设施/系统子类
@@ -40,7 +47,7 @@ public interface IEmsFacsSubtypeService {
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 结果
      */
-    int updateEmsFacsSubtype(EmsFacsSubtype emsFacsSubtype);
+    int updateFacsSubtype(EmsFacsSubtype emsFacsSubtype);
 
     /**
      * 批量删除能源设施/系统子类
@@ -48,7 +55,7 @@ public interface IEmsFacsSubtypeService {
      * @param ids 需要删除的能源设施/系统子类主键集合
      * @return 结果
      */
-    int deleteEmsFacsSubtypeByIds(Long[] ids);
+    int deleteFacsSubtypeByIds(Long[] ids);
 
     /**
      * 删除能源设施/系统子类信息
@@ -56,5 +63,12 @@ public interface IEmsFacsSubtypeService {
      * @param id 能源设施/系统子类主键
      * @return 结果
      */
-    int deleteEmsFacsSubtypeById(Long id);
+    int deleteFacsSubtypeById(Long id);
+
+    /**
+     * 删除能源设施/系统子类信息
+     * @param code 上级分类code
+     * @return 结果
+     */
+    int deleteFacsSubtypeByParentCode(String code);
 }

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

@@ -16,7 +16,7 @@ public interface IEmsFacsTypeService {
      * @param id 能源设施/系统分类主键
      * @return 能源设施/系统分类
      */
-    EmsFacsType selectEmsFacsTypeById(Long id);
+    EmsFacsType selectFacsTypeById(Long id);
 
     /**
      * 查询能源设施/系统分类列表
@@ -24,7 +24,7 @@ public interface IEmsFacsTypeService {
      * @param emsFacsType 能源设施/系统分类
      * @return 能源设施/系统分类集合
      */
-    List<EmsFacsType> selectEmsFacsTypeList(EmsFacsType emsFacsType);
+    List<EmsFacsType> selectFacsTypeList(EmsFacsType emsFacsType);
 
     /**
      * 新增能源设施/系统分类
@@ -32,7 +32,7 @@ public interface IEmsFacsTypeService {
      * @param emsFacsType 能源设施/系统分类
      * @return 结果
      */
-    int insertEmsFacsType(EmsFacsType emsFacsType);
+    int insertFacsType(EmsFacsType emsFacsType);
 
     /**
      * 修改能源设施/系统分类
@@ -40,7 +40,7 @@ public interface IEmsFacsTypeService {
      * @param emsFacsType 能源设施/系统分类
      * @return 结果
      */
-    int updateEmsFacsType(EmsFacsType emsFacsType);
+    int updateFacsType(EmsFacsType emsFacsType);
 
     /**
      * 批量删除能源设施/系统分类
@@ -48,7 +48,7 @@ public interface IEmsFacsTypeService {
      * @param ids 需要删除的能源设施/系统分类主键集合
      * @return 结果
      */
-    int deleteEmsFacsTypeByIds(Long[] ids);
+    int deleteFacsTypeByIds(Long[] ids);
 
     /**
      * 删除能源设施/系统分类信息
@@ -56,5 +56,5 @@ public interface IEmsFacsTypeService {
      * @param id 能源设施/系统分类主键
      * @return 结果
      */
-    int deleteEmsFacsTypeById(Long id);
+    int deleteFacsTypeById(Long id);
 }

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

@@ -62,10 +62,11 @@ public class EmsFacsAttrServiceImpl implements IEmsFacsAttrService {
      * @return 结果
      */
     @Override
-    public int insertEmsFacsAttrBatch(List<EmsFacsAttr> emsFacsAttrs) {
+    public int insertEmsFacsAttrBatch(String facsCode, List<EmsFacsAttr> emsFacsAttrs) {
         Date date = DateUtils.getNowDate();
 
         emsFacsAttrs.forEach(emsFacsAttr -> {
+            emsFacsAttr.setFacsCode(facsCode);
             emsFacsAttr.setCreateTime(date);
         });
 

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

@@ -79,8 +79,9 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
 
         if (CollectionUtils.isNotEmpty(emsFacs.getFacsAttrs())) {
             facsAttrService.deleteEmsFacsAttrByFacsCode(emsFacs.getFacsCode());
-            facsAttrService.insertEmsFacsAttrBatch(emsFacs.getFacsAttrs());
-        } else {
+            facsAttrService.insertEmsFacsAttrBatch(emsFacs.getFacsCode(), emsFacs.getFacsAttrs());
+        }
+        else {
             facsAttrService.deleteEmsFacsAttrByFacsCode(emsFacs.getFacsCode());
         }
 
@@ -100,8 +101,9 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
 
         if (CollectionUtils.isNotEmpty(emsFacs.getFacsAttrs())) {
             facsAttrService.deleteEmsFacsAttrByFacsCode(emsFacs.getFacsCode());
-            facsAttrService.insertEmsFacsAttrBatch(emsFacs.getFacsAttrs());
-        } else {
+            facsAttrService.insertEmsFacsAttrBatch(emsFacs.getFacsCode(), emsFacs.getFacsAttrs());
+        }
+        else {
             facsAttrService.deleteEmsFacsAttrByFacsCode(emsFacs.getFacsCode());
         }
 

+ 34 - 27
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsSubtypeServiceImpl.java

@@ -10,85 +10,92 @@ import org.springframework.stereotype.Service;
 
 /**
  * 能源设施/系统子类Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2024-07-10
  */
 @Service
-public class EmsFacsSubtypeServiceImpl implements IEmsFacsSubtypeService
-{
+public class EmsFacsSubtypeServiceImpl implements IEmsFacsSubtypeService {
     @Autowired
     private EmsFacsSubtypeMapper emsFacsSubtypeMapper;
 
     /**
      * 查询能源设施/系统子类
-     * 
+     *
      * @param id 能源设施/系统子类主键
      * @return 能源设施/系统子类
      */
     @Override
-    public EmsFacsSubtype selectEmsFacsSubtypeById(Long id)
-    {
-        return emsFacsSubtypeMapper.selectEmsFacsSubtypeById(id);
+    public EmsFacsSubtype selectFacsSubtypeById(Long id) {
+        return emsFacsSubtypeMapper.selectFacsSubtypeById(id);
     }
 
     /**
      * 查询能源设施/系统子类列表
-     * 
+     *
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 能源设施/系统子类
      */
     @Override
-    public List<EmsFacsSubtype> selectEmsFacsSubtypeList(EmsFacsSubtype emsFacsSubtype)
-    {
-        return emsFacsSubtypeMapper.selectEmsFacsSubtypeList(emsFacsSubtype);
+    public List<EmsFacsSubtype> selectFacsSubtypeList(EmsFacsSubtype emsFacsSubtype) {
+        return emsFacsSubtypeMapper.selectFacsSubtypeList(emsFacsSubtype);
     }
 
     /**
      * 新增能源设施/系统子类
-     * 
+     *
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 结果
      */
     @Override
-    public int insertEmsFacsSubtype(EmsFacsSubtype emsFacsSubtype)
-    {
-        return emsFacsSubtypeMapper.insertEmsFacsSubtype(emsFacsSubtype);
+    public int insertFacsSubtype(EmsFacsSubtype emsFacsSubtype) {
+        return emsFacsSubtypeMapper.insertFacsSubtype(emsFacsSubtype);
+    }
+
+    @Override
+    public void insertFacsSubtypeBatch(String facsTypeCode, List<EmsFacsSubtype> emsFacsSubtypes) {
+        emsFacsSubtypes.forEach(facsSubtype -> {
+            facsSubtype.setParentCode(facsTypeCode);
+        });
+
+        emsFacsSubtypeMapper.insertFacsSubtypeBatch(emsFacsSubtypes);
     }
 
     /**
      * 修改能源设施/系统子类
-     * 
+     *
      * @param emsFacsSubtype 能源设施/系统子类
      * @return 结果
      */
     @Override
-    public int updateEmsFacsSubtype(EmsFacsSubtype emsFacsSubtype)
-    {
-        return emsFacsSubtypeMapper.updateEmsFacsSubtype(emsFacsSubtype);
+    public int updateFacsSubtype(EmsFacsSubtype emsFacsSubtype) {
+        return emsFacsSubtypeMapper.updateFacsSubtype(emsFacsSubtype);
     }
 
     /**
      * 批量删除能源设施/系统子类
-     * 
+     *
      * @param ids 需要删除的能源设施/系统子类主键
      * @return 结果
      */
     @Override
-    public int deleteEmsFacsSubtypeByIds(Long[] ids)
-    {
-        return emsFacsSubtypeMapper.deleteEmsFacsSubtypeByIds(ids);
+    public int deleteFacsSubtypeByIds(Long[] ids) {
+        return emsFacsSubtypeMapper.deleteFacsSubtypeByIds(ids);
     }
 
     /**
      * 删除能源设施/系统子类信息
-     * 
+     *
      * @param id 能源设施/系统子类主键
      * @return 结果
      */
     @Override
-    public int deleteEmsFacsSubtypeById(Long id)
-    {
-        return emsFacsSubtypeMapper.deleteEmsFacsSubtypeById(id);
+    public int deleteFacsSubtypeById(Long id) {
+        return emsFacsSubtypeMapper.deleteFacsSubtypeById(id);
+    }
+
+    @Override
+    public int deleteFacsSubtypeByParentCode(String code) {
+        return emsFacsSubtypeMapper.deleteFacsSubtypeByParentCode(code);
     }
 }

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

@@ -1,94 +1,154 @@
 package com.ruoyi.ems.service.impl;
 
-import java.util.List;
-
+import com.ruoyi.ems.domain.EmsFacsSubtype;
 import com.ruoyi.ems.domain.EmsFacsType;
 import com.ruoyi.ems.mapper.EmsFacsTypeMapper;
+import com.ruoyi.ems.service.IEmsFacsSubtypeService;
 import com.ruoyi.ems.service.IEmsFacsTypeService;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 能源设施/系统分类Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2024-07-10
  */
 @Service
-public class EmsFacsTypeServiceImpl implements IEmsFacsTypeService
-{
+public class EmsFacsTypeServiceImpl implements IEmsFacsTypeService {
     @Autowired
     private EmsFacsTypeMapper emsFacsTypeMapper;
 
+    @Autowired
+    private IEmsFacsSubtypeService facsSubtypeService;
+
     /**
      * 查询能源设施/系统分类
-     * 
+     *
      * @param id 能源设施/系统分类主键
      * @return 能源设施/系统分类
      */
     @Override
-    public EmsFacsType selectEmsFacsTypeById(Long id)
-    {
-        return emsFacsTypeMapper.selectEmsFacsTypeById(id);
+    public EmsFacsType selectFacsTypeById(Long id) {
+        // 查询主分类
+        EmsFacsType facsType = emsFacsTypeMapper.selectFacsTypeById(id);
+
+        // 查询子分类
+        if (null != facsType) {
+            facsType.setSubtypeList(getFacsSubtypes(facsType));
+        }
+
+        return facsType;
     }
 
     /**
      * 查询能源设施/系统分类列表
-     * 
+     *
      * @param emsFacsType 能源设施/系统分类
      * @return 能源设施/系统分类
      */
     @Override
-    public List<EmsFacsType> selectEmsFacsTypeList(EmsFacsType emsFacsType)
-    {
-        return emsFacsTypeMapper.selectEmsFacsTypeList(emsFacsType);
+    public List<EmsFacsType> selectFacsTypeList(EmsFacsType emsFacsType) {
+        // 查询主分类
+        List<EmsFacsType> list = emsFacsTypeMapper.selectFacsTypeList(emsFacsType);
+
+        // 查询子分类
+        if (CollectionUtils.isNotEmpty(list)) {
+            list.forEach(facsType -> {
+                facsType.setSubtypeList(getFacsSubtypes(facsType));
+            });
+        }
+
+        return list;
     }
 
     /**
      * 新增能源设施/系统分类
-     * 
+     *
      * @param emsFacsType 能源设施/系统分类
      * @return 结果
      */
     @Override
-    public int insertEmsFacsType(EmsFacsType emsFacsType)
-    {
-        return emsFacsTypeMapper.insertEmsFacsType(emsFacsType);
+    public int insertFacsType(EmsFacsType emsFacsType) {
+        int count = emsFacsTypeMapper.insertFacsType(emsFacsType);
+
+        if (CollectionUtils.isNotEmpty(emsFacsType.getSubtypeList())) {
+            facsSubtypeService.deleteFacsSubtypeByParentCode(emsFacsType.getCode());
+            facsSubtypeService.insertFacsSubtypeBatch(emsFacsType.getCode(), emsFacsType.getSubtypeList());
+        }
+        else {
+            facsSubtypeService.deleteFacsSubtypeByParentCode(emsFacsType.getCode());
+        }
+
+        return count;
     }
 
     /**
      * 修改能源设施/系统分类
-     * 
+     *
      * @param emsFacsType 能源设施/系统分类
      * @return 结果
      */
     @Override
-    public int updateEmsFacsType(EmsFacsType emsFacsType)
-    {
-        return emsFacsTypeMapper.updateEmsFacsType(emsFacsType);
+    public int updateFacsType(EmsFacsType emsFacsType) {
+        int count = emsFacsTypeMapper.updateFacsType(emsFacsType);
+
+        if (CollectionUtils.isNotEmpty(emsFacsType.getSubtypeList())) {
+            facsSubtypeService.deleteFacsSubtypeByParentCode(emsFacsType.getCode());
+            facsSubtypeService.insertFacsSubtypeBatch(emsFacsType.getCode(), emsFacsType.getSubtypeList());
+        }
+        else {
+            facsSubtypeService.deleteFacsSubtypeByParentCode(emsFacsType.getCode());
+        }
+
+        return count;
     }
 
     /**
      * 批量删除能源设施/系统分类
-     * 
+     *
      * @param ids 需要删除的能源设施/系统分类主键
      * @return 结果
      */
     @Override
-    public int deleteEmsFacsTypeByIds(Long[] ids)
-    {
-        return emsFacsTypeMapper.deleteEmsFacsTypeByIds(ids);
+    public int deleteFacsTypeByIds(Long[] ids) {
+        for (Long id : ids) {
+            EmsFacsType facsType = emsFacsTypeMapper.selectFacsTypeById(id);
+
+            // 查询扩展属性
+            if (null != facsType) {
+                facsSubtypeService.deleteFacsSubtypeByParentCode(facsType.getCode());
+            }
+        }
+
+        return emsFacsTypeMapper.deleteFacsTypeByIds(ids);
     }
 
     /**
      * 删除能源设施/系统分类信息
-     * 
+     *
      * @param id 能源设施/系统分类主键
      * @return 结果
      */
     @Override
-    public int deleteEmsFacsTypeById(Long id)
-    {
-        return emsFacsTypeMapper.deleteEmsFacsTypeById(id);
+    public int deleteFacsTypeById(Long id) {
+        EmsFacsType facsType = emsFacsTypeMapper.selectFacsTypeById(id);
+
+        // 查询扩展属性
+        if (null != facsType) {
+            facsSubtypeService.deleteFacsSubtypeByParentCode(facsType.getCode());
+        }
+
+        return emsFacsTypeMapper.deleteFacsTypeById(id);
+    }
+
+    private List<EmsFacsSubtype> getFacsSubtypes(EmsFacsType emsFacsType) {
+        EmsFacsSubtype param = new EmsFacsSubtype();
+        param.setParentCode(emsFacsType.getCode());
+
+        return facsSubtypeService.selectFacsSubtypeList(param);
     }
 }

+ 12 - 10
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AreaBuildingMapper.xml

@@ -14,29 +14,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="bldgHeight"    column="bldg_height"    />
         <result property="floorArea"    column="floor_area"    />
         <result property="bldgUsage"    column="bldg_usage"    />
+        <result property="areaCode"    column="area_code"    />
+        <result property="areaName"    column="area_name"    />
     </resultMap>
 
     <sql id="selectAreaBuildingVo">
-        select id, bldg_code, bldg_name, address, up_bldg_floor, down_bldg_floor, bldg_height, floor_area, bldg_usage from adm_area_building
+        select b.`id`, b.`bldg_code`, b.`bldg_name`, b.`address`, b.`up_bldg_floor`, b.`down_bldg_floor`, b.`bldg_height`, b.`floor_area`, b.`bldg_usage`, b.`area_code`, a.`area_name` from adm_area_building b LEFT JOIN adm_service_area a ON b.`area_code` = a.`area_code`
     </sql>
 
     <select id="selectAreaBuildingList" parameterType="com.ruoyi.ems.domain.AreaBuilding" resultMap="AreaBuildingResult">
         <include refid="selectAreaBuildingVo"/>
         <where>  
-            <if test="bldgCode != null  and bldgCode != ''"> and bldg_code = #{bldgCode}</if>
-            <if test="bldgName != null  and bldgName != ''"> and bldg_name like concat('%', #{bldgName}, '%')</if>
-            <if test="address != null  and address != ''"> and address = #{address}</if>
-            <if test="upBldgFloor != null "> and up_bldg_floor = #{upBldgFloor}</if>
-            <if test="downBldgFloor != null "> and down_bldg_floor = #{downBldgFloor}</if>
-            <if test="bldgHeight != null "> and bldg_height = #{bldgHeight}</if>
-            <if test="floorArea != null "> and floor_area = #{floorArea}</if>
-            <if test="bldgUsage != null  and bldgUsage != ''"> and bldg_usage = #{bldgUsage}</if>
+            <if test="bldgCode != null  and bldgCode != ''"> and b.`bldg_code` = #{bldgCode}</if>
+            <if test="bldgName != null  and bldgName != ''"> and b.`bldg_name` like concat('%', #{bldgName}, '%')</if>
+            <if test="address != null  and address != ''"> and b.`address` = #{address}</if>
+            <if test="upBldgFloor != null "> and b.`up_bldg_floor` = #{upBldgFloor}</if>
+            <if test="downBldgFloor != null "> and b.`down_bldg_floor` = #{downBldgFloor}</if>
+            <if test="bldgHeight != null "> and b.`bldg_height` = #{bldgHeight}</if>
+            <if test="floorArea != null "> and b.`floor_area` = #{floorArea}</if>
+            <if test="bldgUsage != null  and bldgUsage != ''"> and b.`bldg_usage` = #{bldgUsage}</if>
         </where>
     </select>
     
     <select id="selectAreaBuildingById" parameterType="Long" resultMap="AreaBuildingResult">
         <include refid="selectAreaBuildingVo"/>
-        where id = #{id}
+        where b.`id` = #{id}
     </select>
 
     <insert id="insertAreaBuilding" parameterType="com.ruoyi.ems.domain.AreaBuilding" useGeneratedKeys="true" keyProperty="id">

+ 18 - 17
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AreaBuildingZoningMapper.xml

@@ -7,8 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.ruoyi.ems.domain.AreaBuildingZoning" id="AreaBuildingZoningResult">
         <result property="id"    column="id"    />
         <result property="bldgCode"    column="bldg_code"    />
-        <result property="divisionCode"    column="division_code"    />
-        <result property="divisionName"    column="division_name"    />
+        <result property="bldgName"    column="bldg_name"    />
+        <result property="zoningCode"    column="zoning_code"    />
+        <result property="zoningName"    column="zoning_name"    />
         <result property="floor"    column="floor"    />
         <result property="roomNo"    column="room_no"    />
         <result property="bldgLdArea"    column="bldg_ld_area"    />
@@ -16,33 +17,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAreaBuildingZoningVo">
-        select id, bldg_code, division_code, division_name, floor, room_no, bldg_ld_area, usage_detail from adm_area_building_zoning
+        select z.`id`, z.`bldg_code`, b.`bldg_name`, z.`zoning_code`, z.`zoning_name`, z.`floor`, z.`room_no`, z.`bldg_ld_area`, z.`usage_detail` from adm_area_building_zoning z LEFT JOIN adm_area_building b ON z.bldg_code = b.bldg_code
     </sql>
 
     <select id="selectAreaBuildingZoningList" parameterType="com.ruoyi.ems.domain.AreaBuildingZoning" resultMap="AreaBuildingZoningResult">
         <include refid="selectAreaBuildingZoningVo"/>
         <where>  
-            <if test="bldgCode != null  and bldgCode != ''"> and bldg_code = #{bldgCode}</if>
-            <if test="divisionCode != null  and divisionCode != ''"> and division_code = #{divisionCode}</if>
-            <if test="divisionName != null  and divisionName != ''"> and division_name like concat('%', #{divisionName}, '%')</if>
-            <if test="floor != null "> and floor = #{floor}</if>
-            <if test="roomNo != null  and roomNo != ''"> and room_no = #{roomNo}</if>
-            <if test="bldgLdArea != null "> and bldg_ld_area = #{bldgLdArea}</if>
-            <if test="usageDetail != null  and usageDetail != ''"> and usage_detail = #{usageDetail}</if>
+            <if test="bldgCode != null  and bldgCode != ''"> and z.`bldg_code` = #{bldgCode}</if>
+            <if test="zoningCode != null  and zoningCode != ''"> and z.`zoning_code` = #{zoningCode}</if>
+            <if test="zoningName != null  and zoningName != ''"> and z.`zoning_name` like concat('%', #{zoningName}, '%')</if>
+            <if test="floor != null "> and z.`floor` = #{floor}</if>
+            <if test="roomNo != null  and roomNo != ''"> and z.`room_no` = #{roomNo}</if>
+            <if test="bldgLdArea != null "> and z.`bldg_ld_area` = #{bldgLdArea}</if>
+            <if test="usageDetail != null  and usageDetail != ''"> and z.`usage_detail` = #{usageDetail}</if>
         </where>
     </select>
     
     <select id="selectAreaBuildingZoningById" parameterType="Long" resultMap="AreaBuildingZoningResult">
         <include refid="selectAreaBuildingZoningVo"/>
-        where id = #{id}
+        where z.`id` = #{id}
     </select>
         
     <insert id="insertAreaBuildingZoning" parameterType="com.ruoyi.ems.domain.AreaBuildingZoning" useGeneratedKeys="true" keyProperty="id">
         insert into adm_area_building_zoning
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="bldgCode != null and bldgCode != ''">bldg_code,</if>
-            <if test="divisionCode != null and divisionCode != ''">division_code,</if>
-            <if test="divisionName != null and divisionName != ''">division_name,</if>
+            <if test="zoningCode != null and zoningCode != ''">zoning_code,</if>
+            <if test="zoningName != null and zoningName != ''">zoning_name,</if>
             <if test="floor != null">floor,</if>
             <if test="roomNo != null">room_no,</if>
             <if test="bldgLdArea != null">bldg_ld_area,</if>
@@ -50,8 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="bldgCode != null and bldgCode != ''">#{bldgCode},</if>
-            <if test="divisionCode != null and divisionCode != ''">#{divisionCode},</if>
-            <if test="divisionName != null and divisionName != ''">#{divisionName},</if>
+            <if test="zoningCode != null and zoningCode != ''">#{zoningCode},</if>
+            <if test="zoningName != null and zoningName != ''">#{zoningName},</if>
             <if test="floor != null">#{floor},</if>
             <if test="roomNo != null">#{roomNo},</if>
             <if test="bldgLdArea != null">#{bldgLdArea},</if>
@@ -63,8 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update adm_area_building_zoning
         <trim prefix="SET" suffixOverrides=",">
             <if test="bldgCode != null and bldgCode != ''">bldg_code = #{bldgCode},</if>
-            <if test="divisionCode != null and divisionCode != ''">division_code = #{divisionCode},</if>
-            <if test="divisionName != null and divisionName != ''">division_name = #{divisionName},</if>
+            <if test="zoningCode != null and zoningCode != ''">zoning_code = #{zoningCode},</if>
+            <if test="zoningName != null and zoningName != ''">zoning_name = #{zoningName},</if>
             <if test="floor != null">floor = #{floor},</if>
             <if test="roomNo != null">room_no = #{roomNo},</if>
             <if test="bldgLdArea != null">bldg_ld_area = #{bldgLdArea},</if>

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

@@ -9,32 +9,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deviceCode"    column="device_code"    />
         <result property="deviceName"    column="device_name"    />
         <result property="deviceType"    column="device_type"    />
-        <result property="deviceStatus"    column="device_status"    />
-        <result property="refArea"    column="ref_area"    />
-        <result property="refFacs"    column="ref_facs"    />
+        <result property="deviceStatus"   column="device_status"    />
+        <result property="refArea"        column="ref_area"    />
+        <result property="refAreaName"    column="ref_area_name"    />
+        <result property="refFacs"        column="ref_facs"    />
+        <result property="refFacsName"    column="ref_facs_name"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
     </resultMap>
 
     <sql id="selectEmsDeviceVo">
-        select id, device_code, device_name, device_type, device_status, ref_area, ref_facs, create_time, update_time from adm_ems_device
+        select d.`id`, d.`device_code`, d.`device_name`, d.`device_type`, d.`device_status`, d.`ref_area`, z.`zoning_name` as ref_area_name, d.`ref_facs`, f.`facs_name` as ref_facs_name, d.`create_time`, d.`update_time` from adm_ems_device d LEFT JOIN adm_area_building_zoning z ON d.`ref_area` = z.`zoning_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">
         <include refid="selectEmsDeviceVo"/>
         <where>  
-            <if test="deviceCode != null  and deviceCode != ''"> and device_code = #{deviceCode}</if>
-            <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
-            <if test="deviceType != null "> and device_type = #{deviceType}</if>
-            <if test="deviceStatus != null "> and device_status = #{deviceStatus}</if>
-            <if test="refArea != null  and refArea != ''"> and ref_area = #{refArea}</if>
-            <if test="refFacs != null  and refFacs != ''"> and ref_facs = #{refFacs}</if>
+            <if test="deviceCode != null  and deviceCode != ''"> and d.`device_code` = #{deviceCode}</if>
+            <if test="deviceName != null  and deviceName != ''"> and d.`device_name` like concat('%', #{deviceName}, '%')</if>
+            <if test="deviceType != null "> and d.`device_type` = #{deviceType}</if>
+            <if test="deviceStatus != null "> and d.`device_status` = #{deviceStatus}</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>
         </where>
     </select>
     
     <select id="selectEmsDeviceById" parameterType="Long" resultMap="EmsDeviceResult">
         <include refid="selectEmsDeviceVo"/>
-        where id = #{id}
+        where d.`id` = #{id}
     </select>
         
     <insert id="insertEmsDevice" parameterType="com.ruoyi.ems.domain.EmsDevice" useGeneratedKeys="true" keyProperty="id">

+ 10 - 8
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsFlowRelMapper.xml

@@ -8,7 +8,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="code"    column="code"    />
         <result property="exportFacsCode"    column="export_facs_code"    />
+        <result property="exportFacsName"    column="export_facs_Name"    />
         <result property="inputFacsCode"    column="input_facs_code"    />
+        <result property="inputFacsName"    column="input_facs_name"    />
         <result property="emsCls"    column="ems_cls"    />
         <result property="state"    column="state"    />
         <result property="actionType"    column="action_type"    />
@@ -17,24 +19,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectEmsFacsFlowRelVo">
-        select id, code, export_facs_code, input_facs_code, ems_cls, state, action_type, create_time, update_time from adm_ems_facs_flow_rel
+        select r.`id`, r.`code`, r.`export_facs_code`, f1.`facs_name` as export_facs_name, r.`input_facs_code`, f2.`facs_name` as input_facs_name, r.`ems_cls`, r.`state`, r.`action_type`, r.`create_time`, r.`update_time` from adm_ems_facs_flow_rel r LEFT JOIN adm_ems_facs f1 ON r.`export_facs_code` = f1.`facs_code` LEFT JOIN adm_ems_facs f2 ON r.input_facs_code = f2.`facs_code`
     </sql>
 
     <select id="selectEmsFacsFlowRelList" parameterType="com.ruoyi.ems.domain.EmsFacsFlowRel" resultMap="EmsFacsFlowRelResult">
         <include refid="selectEmsFacsFlowRelVo"/>
         <where>  
-            <if test="code != null  and code != ''"> and code = #{code}</if>
-            <if test="exportFacsCode != null  and exportFacsCode != ''"> and export_facs_code = #{exportFacsCode}</if>
-            <if test="inputFacsCode != null  and inputFacsCode != ''"> and input_facs_code = #{inputFacsCode}</if>
-            <if test="emsCls != null  and emsCls != ''"> and ems_cls = #{emsCls}</if>
-            <if test="state != null "> and state = #{state}</if>
-            <if test="actionType != null  and actionType != ''"> and action_type = #{actionType}</if>
+            <if test="code != null  and code != ''"> and r.`code` = #{code}</if>
+            <if test="exportFacsCode != null  and exportFacsCode != ''"> and r.`export_facs_code` = #{exportFacsCode}</if>
+            <if test="inputFacsCode != null  and inputFacsCode != ''"> and r.`input_facs_code` = #{inputFacsCode}</if>
+            <if test="emsCls != null  and emsCls != ''"> and r.`ems_cls` = #{emsCls}</if>
+            <if test="state != null "> and r.`state` = #{state}</if>
+            <if test="actionType != null  and actionType != ''"> and r.`action_type` = #{actionType}</if>
         </where>
     </select>
     
     <select id="selectEmsFacsFlowRelById" parameterType="Long" resultMap="EmsFacsFlowRelResult">
         <include refid="selectEmsFacsFlowRelVo"/>
-        where id = #{id}
+        where r.`id` = #{id}
     </select>
         
     <insert id="insertEmsFacsFlowRel" parameterType="com.ruoyi.ems.domain.EmsFacsFlowRel" useGeneratedKeys="true" keyProperty="id">

+ 12 - 9
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsMapper.xml

@@ -9,34 +9,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="facsCode"    column="facs_code"    />
         <result property="facsName"    column="facs_name"    />
         <result property="facsType"    column="facs_type"    />
+        <result property="facsTypeName"    column="facs_type_name"    />
         <result property="facsSubtype"    column="facs_subtype"    />
+        <result property="facsSubtypeName"    column="facs_subtype_name"    />
         <result property="enable"    column="enable"    />
         <result property="refArea"    column="ref_area"    />
+        <result property="refAreaName"    column="ref_area_name"    />
         <result property="manufacturer"    column="manufacturer"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
     </resultMap>
 
     <sql id="selectEmsFacsVo">
-        select id, facs_code, facs_name, facs_type, facs_subtype, enable, ref_area, manufacturer, create_time, update_time from adm_ems_facs
+        select f.`id`, f.`facs_code`, f.`facs_name`, f.`facs_type`, t.`name` as facs_type_name, f.`facs_subtype`, s.`name` as facs_subtype_name, f.`enable`, f.`ref_area`, a.`area_name` as ref_area_name, f.`manufacturer`, f.`create_time`, f.`update_time` from adm_ems_facs f LEFT JOIN dim_ems_facs_type t ON f.`facs_type` = t.`code` LEFT JOIN dim_ems_facs_subtype s ON f.`facs_subtype`= s.`code` LEFT JOIN adm_service_area a ON f.`ref_area` = a.`area_code`
     </sql>
 
     <select id="selectEmsFacsList" parameterType="com.ruoyi.ems.domain.EmsFacs" resultMap="EmsFacsResult">
         <include refid="selectEmsFacsVo"/>
         <where>  
-            <if test="facsCode != null  and facsCode != ''"> and facs_code = #{facsCode}</if>
-            <if test="facsName != null  and facsName != ''"> and facs_name like concat('%', #{facsName}, '%')</if>
-            <if test="facsType != null  and facsType != ''"> and facs_type = #{facsType}</if>
-            <if test="facsSubtype != null  and facsSubtype != ''"> and facs_subtype = #{facsSubtype}</if>
-            <if test="enable != null "> and enable = #{enable}</if>
-            <if test="refArea != null  and refArea != ''"> and ref_area = #{refArea}</if>
-            <if test="manufacturer != null  and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
+            <if test="facsCode != null  and facsCode != ''"> and f.`facs_code` = #{facsCode}</if>
+            <if test="facsName != null  and facsName != ''"> and f.`facs_name` like concat('%', #{facsName}, '%')</if>
+            <if test="facsType != null  and facsType != ''"> and f.`facs_type` = #{facsType}</if>
+            <if test="facsSubtype != null  and facsSubtype != ''"> and f.`facs_subtype` = #{facsSubtype}</if>
+            <if test="enable != null "> and f.`enable` = #{enable}</if>
+            <if test="refArea != null  and refArea != ''"> and f.`ref_area` = #{refArea}</if>
+            <if test="manufacturer != null  and manufacturer != ''"> and f.`manufacturer` = #{manufacturer}</if>
         </where>
     </select>
     
     <select id="selectEmsFacsById" parameterType="Long" resultMap="EmsFacsResult">
         <include refid="selectEmsFacsVo"/>
-        where id = #{id}
+        where f.`id` = #{id}
     </select>
         
     <insert id="insertEmsFacs" parameterType="com.ruoyi.ems.domain.EmsFacs" useGeneratedKeys="true" keyProperty="id">

+ 22 - 11
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsSubtypeMapper.xml

@@ -13,12 +13,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="version"    column="version"    />
     </resultMap>
 
-    <sql id="selectEmsFacsSubtypeVo">
-        select id, code, name, parent_code, desc, version from dim_ems_facs_subtype
+    <sql id="selectFacsSubtypeVo">
+        select `id`, `code`, `name`, `parent_code`, `desc`, `version` from dim_ems_facs_subtype
     </sql>
 
-    <select id="selectEmsFacsSubtypeList" parameterType="com.ruoyi.ems.domain.EmsFacsSubtype" resultMap="EmsFacsSubtypeResult">
-        <include refid="selectEmsFacsSubtypeVo"/>
+    <select id="selectFacsSubtypeList" parameterType="com.ruoyi.ems.domain.EmsFacsSubtype" resultMap="EmsFacsSubtypeResult">
+        <include refid="selectFacsSubtypeVo"/>
         <where>  
             <if test="code != null  and code != ''"> and code = #{code}</if>
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
@@ -28,12 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     
-    <select id="selectEmsFacsSubtypeById" parameterType="Long" resultMap="EmsFacsSubtypeResult">
-        <include refid="selectEmsFacsSubtypeVo"/>
+    <select id="selectFacsSubtypeById" parameterType="Long" resultMap="EmsFacsSubtypeResult">
+        <include refid="selectFacsSubtypeVo"/>
         where id = #{id}
     </select>
         
-    <insert id="insertEmsFacsSubtype" parameterType="com.ruoyi.ems.domain.EmsFacsSubtype" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertFacsSubtype" parameterType="com.ruoyi.ems.domain.EmsFacsSubtype" useGeneratedKeys="true" keyProperty="id">
         insert into dim_ems_facs_subtype
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="code != null and code != ''">code,</if>
@@ -51,7 +51,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
-    <update id="updateEmsFacsSubtype" parameterType="com.ruoyi.ems.domain.EmsFacsSubtype">
+    <insert id="insertFacsSubtypeBatch" parameterType="java.util.List">
+        insert into dim_ems_facs_subtype (code, name, parent_code, desc, version) values
+        <foreach collection="emsFacsSubtypes" item="subtype" index="index" separator=",">
+            (#{subtype.code},#{subtype.name},#{subtype.parent_code},#{subtype.desc},#{subtype.version})
+        </foreach>
+    </insert>
+
+    <update id="updateFacsSubtype" parameterType="com.ruoyi.ems.domain.EmsFacsSubtype">
         update dim_ems_facs_subtype
         <trim prefix="SET" suffixOverrides=",">
             <if test="code != null and code != ''">code = #{code},</if>
@@ -63,14 +70,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
-    <delete id="deleteEmsFacsSubtypeById" parameterType="Long">
+    <delete id="deleteFacsSubtypeById" parameterType="Long">
         delete from dim_ems_facs_subtype where id = #{id}
     </delete>
 
-    <delete id="deleteEmsFacsSubtypeByIds" parameterType="String">
-        delete from dim_ems_facs_subtype where id in 
+    <delete id="deleteFacsSubtypeByIds" parameterType="String">
+        delete from dim_ems_facs_subtype where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
+
+    <delete id="deleteFacsSubtypeByParentCode" parameterType="String">
+        delete from dim_ems_facs_subtype where parent_code = #{code}
+    </delete>
 </mapper>

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

@@ -12,12 +12,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="version"    column="version"    />
     </resultMap>
 
-    <sql id="selectEmsFacsTypeVo">
-        select id, code, name, desc, version from dim_ems_facs_type
+    <sql id="selectFacsTypeVo">
+        select `id`, `code`, `name`, `desc`, `version` from dim_ems_facs_type
     </sql>
 
-    <select id="selectEmsFacsTypeList" parameterType="com.ruoyi.ems.domain.EmsFacsType" resultMap="EmsFacsTypeResult">
-        <include refid="selectEmsFacsTypeVo"/>
+    <select id="selectFacsTypeList" parameterType="com.ruoyi.ems.domain.EmsFacsType" resultMap="EmsFacsTypeResult">
+        <include refid="selectFacsTypeVo"/>
         <where>  
             <if test="code != null  and code != ''"> and code = #{code}</if>
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
@@ -26,12 +26,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     
-    <select id="selectEmsFacsTypeById" parameterType="Long" resultMap="EmsFacsTypeResult">
-        <include refid="selectEmsFacsTypeVo"/>
+    <select id="selectFacsTypeById" parameterType="Long" resultMap="EmsFacsTypeResult">
+        <include refid="selectFacsTypeVo"/>
         where id = #{id}
     </select>
         
-    <insert id="insertEmsFacsType" parameterType="com.ruoyi.ems.domain.EmsFacsType" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertFacsType" parameterType="com.ruoyi.ems.domain.EmsFacsType" useGeneratedKeys="true" keyProperty="id">
         insert into dim_ems_facs_type
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="code != null and code != ''">code,</if>
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
-    <update id="updateEmsFacsType" parameterType="com.ruoyi.ems.domain.EmsFacsType">
+    <update id="updateFacsType" parameterType="com.ruoyi.ems.domain.EmsFacsType">
         update dim_ems_facs_type
         <trim prefix="SET" suffixOverrides=",">
             <if test="code != null and code != ''">code = #{code},</if>
@@ -58,11 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
-    <delete id="deleteEmsFacsTypeById" parameterType="Long">
+    <delete id="deleteFacsTypeById" parameterType="Long">
         delete from dim_ems_facs_type where id = #{id}
     </delete>
 
-    <delete id="deleteEmsFacsTypeByIds" parameterType="String">
+    <delete id="deleteFacsTypeByIds" parameterType="String">
         delete from dim_ems_facs_type where id in 
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}

+ 29 - 28
ems-cloud/sql/ems_server.sql

@@ -324,8 +324,8 @@ create table adm_service_area (
 ) engine=innodb auto_increment=1 comment = '服务区表';
 
 -- 服务区初始数据
-INSERT INTO `adm_service_area` (`area_code`, `area_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3001', '常泰高速服务区(北区)', 4, '泰州', 'S30如常高速', '常州方向', '江苏省泰州市泰兴市虹桥镇常泰高速常州方向', null, null, '2025-01-01', '72.5', '6000', 120.050937, 32.071956);
-INSERT INTO `adm_service_area` (`area_code`, `area_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3002', '常泰高速服务区(南区)', 4, '泰州', 'S30如常高速', '泰兴方向', '江苏省泰州市泰兴市虹桥镇常泰高速泰州方向', null, null, '2025-01-01', '72.5', '6000', 120.052389, 32.070408);
+INSERT INTO `adm_service_area` (`area_code`, `area_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3001', '常泰高速服务区(北区)', 4, '泰州', 'S30如常高速', '常州方向', '江苏省泰州市泰兴市虹桥镇常泰高速常州方向', null, null, '2025-01-01', '72.5', '6000', '120.050937', '32.071956');
+INSERT INTO `adm_service_area` (`area_code`, `area_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3002', '常泰高速服务区(南区)', 4, '泰州', 'S30如常高速', '泰兴方向', '江苏省泰州市泰兴市虹桥镇常泰高速泰州方向', null, null, '2025-01-01', '72.5', '6000', '120.052389', '32.070408');
 
 -- ----------------------------
 -- 建筑基本信息表
@@ -341,34 +341,35 @@ create table adm_area_building (
   `bldg_height`      double          default null               comment '建筑高度',
   `floor_area`       double          default null               comment '建筑面积(平方米 m²)',
   `bldg_usage`       varchar(64)     default null               comment '主要用途',
+  `area_code`        varchar(32)     default null               comment '服务区代码',
   primary key (`id`),
   unique key ux_structure_code(`bldg_code`)
 ) engine=innodb auto_increment=1 comment = '建筑基本信息表';
 
 -- 建筑区块初始数据
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300101', '综合楼(北区)', '北区中部', 2, 1, 13.7, 4700, '一层提供商业、餐饮、卫生间、开水服务,二层为办公区、会议区');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300102', '配电泵房(北区)', '北区西北角', 1, 0, null, 300, '配电设施,水泵设施工作区');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300103', '维修间&货车之家(北区)', '北区东侧', 2, 0, null, 300, '提供车辆维修服务');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300104', '加油站(北区)', '北区西南角', 1, 0, null, 200, '提供加油服务');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300105', '警务站(北区)', '北区东北角', 1, 0, null, 70, '警务办公场地');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300106', '小客停车位(北区)', '北区前广场', 1, 0, null, null, '小客车停车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300107', '充电车位(北区)', '北区前广场', 1, 0, null, null, '充电停车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300108', '无障碍车位(北区)', '北区前广场', 1, 0, null, null, '无障碍车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300109', '大客车停车位(北区)', '北区后广场', 1, 0, null, null, '大客车车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300110', '货车车位(北区)', '北区后广场', 1, 0, null, null, '货车车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300111', '危险品车位(北区)', '北区后广场', 1, 0, null, null, '危险品车位');
-
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300201', '综合楼(南区)', '南区中部', 2, 1, 14.2, 4788.2, '一层提供商业、餐饮、卫生间、开水服务,二层为员工餐厅、展厅');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300202', '配电泵房(南区)', '南区东南角', 1, 0, null, 300, '配电设施,水泵设施工作区');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300203', '维修间&货车之家(南区)', '南区西侧', 2, 0, null, 300, '提供车辆维修服务');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300204', '加油站(南区)', '南区东北角', 1, 0, null, 200, '提供加油服务');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300205', '宿舍楼(南区)', '南区西南角', 2, 0, null, 920, '提供员工住宿服务');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300206', '小客停车位(南区)', '南区前广场', 1, 0, null, null, '小客车停车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300207', '充电车位(南区)', '南区前广场', 1, 0, null, null, '充电停车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300208', '无障碍车位(南区)', '南区前广场', 1, 0, null, null, '无障碍车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300209', '大客车停车位(南区)', '南区后广场', 1, 0, null, null, '大客车车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300210', '货车车位(南区)', '南区后广场', 1, 0, null, null, '货车车位');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`) VALUES ('321283124S300211', '危险品车位(南区)', '南区后广场', 1, 0, null, null, '危险品车位');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300101', '综合楼', '北区中部', 2, 1, 13.7, 4700, '一层提供商业、餐饮、卫生间、开水服务,二层为办公区、会议区', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300102', '配电泵房', '北区西北角', 1, 0, null, 300, '配电设施,水泵设施工作区', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300103', '维修间&货车之家', '北区东侧', 2, 0, null, 300, '提供车辆维修服务', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300104', '加油站', '北区西南角', 1, 0, null, 200, '提供加油服务', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300105', '警务站', '北区东北角', 1, 0, null, 70, '警务办公场地', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300106', '小客停车位', '北区前广场', 1, 0, null, null, '小客车停车位', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300107', '充电车位', '北区前广场', 1, 0, null, null, '充电停车位', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300108', '无障碍车位', '北区前广场', 1, 0, null, null, '无障碍车位', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300109', '大客车停车位', '北区后广场', 1, 0, null, null, '大客车车位', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300110', '货车车位', '北区后广场', 1, 0, null, null, '货车车位', '321283124S3001');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300111', '危险品车位', '北区后广场', 1, 0, null, null, '危险品车位', '321283124S3001');
+
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300201', '综合楼', '南区中部', 2, 1, 14.2, 4788.2, '一层提供商业、餐饮、卫生间、开水服务,二层为员工餐厅、展厅', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300202', '配电泵房', '南区东南角', 1, 0, null, 300, '配电设施,水泵设施工作区', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300203', '维修间&货车之家', '南区西侧', 2, 0, null, 300, '提供车辆维修服务', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300204', '加油站', '南区东北角', 1, 0, null, 200, '提供加油服务', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300205', '宿舍楼', '南区西南角', 2, 0, null, 920, '提供员工住宿服务', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300206', '小客停车位', '南区前广场', 1, 0, null, null, '小客车停车位', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300207', '充电车位', '南区前广场', 1, 0, null, null, '充电停车位', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300208', '无障碍车位', '南区前广场', 1, 0, null, null, '无障碍车位', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300209', '大客车停车位', '南区后广场', 1, 0, null, null, '大客车车位', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300210', '货车车位', '南区后广场', 1, 0, null, null, '货车车位', '321283124S3002');
+INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300211', '危险品车位', '南区后广场', 1, 0, null, null, '危险品车位', '321283124S3002');
 
 
 -- ----------------------------
@@ -378,14 +379,14 @@ drop table if exists adm_area_building_zoning;
 create table adm_area_building_zoning (
   `id`               bigint(20)      not null auto_increment    comment '序号',
   `bldg_code`        varchar(64)     not null                   comment '建筑编码',
-  `division_code`    varchar(64)     not null                   comment '分区编码',
-  `division_name`    varchar(64)     not null                   comment '分区名称',
+  `zoning_code`    varchar(64)     not null                     comment '分区编码',
+  `zoning_name`    varchar(64)     not null                     comment '分区名称',
   `floor`            int             default null               comment '楼层',
   `room_no`          varchar(16)     default null               comment '房间号',
   `bldg_ld_area`     double          default null               comment '建筑划分面积',
   `usage_detail`     varchar(200)    default null               comment '使用详情',
   primary key (`id`),
-    unique key ux_structure_division_code(`bldg_code`, `division_code`)
+    unique key ux_building_zoning_code(`bldg_code`, `zoning_code`)
 ) engine=innodb auto_increment=1 comment = '建筑区域划分表';
 
 -- ----------------------------

+ 36 - 17
ems-cloud/sql/ems_sys.sql

@@ -226,11 +226,14 @@ insert into sys_menu values ('533',  '自定义报表', '111', '4',  'statement-
 insert into sys_menu values ('534',  '服务区',     '123', '1',  'basecfg-servicearea',    'basecfg/area/index',             '', 1, 0, 'C', '0', '0',   'basecfg:area:list',           'cfgwrite',   'admin', sysdate(), '', null, '服务区配置');
 insert into sys_menu values ('535',  '建筑配置',   '123', '2',  'basecfg-building',       'basecfg/building/index',         '', 1, 0, 'C', '0', '0',   'basecfg:building:list',        'cfgwrite',   'admin', sysdate(), '', null, '楼宇建筑配置');
 insert into sys_menu values ('536',  '区块配置',   '123', '3',  'basecfg-zoning',         'basecfg/zoning/index',           '', 1, 0, 'C', '0', '0',   'basecfg:zoning:list',          'cfgwrite',   'admin', sysdate(), '', null, '区块配置');
-insert into sys_menu values ('537',  '能源设施',   '124', '1',  'basecfg-facscfg',        'basecfg/emsfacs/index',          '', 1, 0, 'C', '0', '0',   'basecfg:emsfacs:list',         'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
-insert into sys_menu values ('538',  '能流关系',   '124', '2',  'basecfg-flowrel',        'basecfg/flowrel/index',          '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
-insert into sys_menu values ('539',  '能源设备',   '124', '3',  'basecfg-devccfg',        'basecfg/device/index',           '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
-insert into sys_menu values ('540',  '电价配置',   '125', '1',  'basecfg-electrovalency', 'basecfg/electrovalency/index',   '', 1, 0, 'C', '0', '0',   'basecfg:electrovalency:list',  'cfgwrite',   'admin', sysdate(), '', null, '电价配置');
-insert into sys_menu values ('541',  '碳核算配置', '125', '2',  'basecfg-carbon',          'basecfg/carbon/index',          '', 1, 0, 'C', '0', '0',   'basecfg:carbon:list',           'cfgwrite',   'admin', sysdate(), '', null, '核算配置');
+insert into sys_menu values ('537',  '设施分类',   '124', '1',  'basecfg-facstype',       'basecfg/facstype/index',         '', 1, 0, 'C', '0', '0',   'basecfg:facstype:list',        'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
+insert into sys_menu values ('538',  '能源设施',   '124', '2',  'basecfg-facscfg',        'basecfg/emsfacs/index',          '', 1, 0, 'C', '0', '0',   'basecfg:emsfacs:list',         'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
+insert into sys_menu values ('539',  '能流关系',   '124', '3',  'basecfg-flowrel',        'basecfg/flowrel/index',          '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
+insert into sys_menu values ('540',  '能源设备',   '124', '4',  'basecfg-devccfg',        'basecfg/device/index',           '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
+insert into sys_menu values ('541',  '电价配置',   '125', '1',  'basecfg-electrovalency', 'basecfg/electrovalency/index',   '', 1, 0, 'C', '0', '0',   'basecfg:electrovalency:list',  'cfgwrite',   'admin', sysdate(), '', null, '电价配置');
+insert into sys_menu values ('542',  '碳核算',     '125', '2',  'basecfg-carbon',          'basecfg/carbon/index',          '', 1, 0, 'C', '0', '0',   'basecfg:carbon:list',          'cfgwrite',   'admin', sysdate(), '', null, '核算配置');
+insert into sys_menu values ('543',  '排放因子',   '125', '3',  'basecfg-emissionFactor',  'basecfg/emissionfactor/index',  '', 1, 0, 'C', '0', '0',   'basecfg:emissionFactor:list',  'cfgwrite',   'admin', sysdate(), '', null, '碳排因子');
+
 
 -- 用户管理按钮
 insert into sys_menu values ('1000', '用户查询', '190', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:query',          '#', 'admin', sysdate(), '', null, '');
@@ -307,21 +310,29 @@ insert into sys_menu values ('1057', '区块新增', '536', '1', '#', '', '', 1,
 insert into sys_menu values ('1058', '区块修改', '536', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:edit',  '#', 'admin', sysdate(), '', null, '');
 insert into sys_menu values ('1059', '区块删除', '536', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:remove','#', 'admin', sysdate(), '', null, '');
 insert into sys_menu values ('1060', '区块导出', '536', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:export','#', 'admin', sysdate(), '', null, '');
+-- 能源设施分类配置按钮
+insert into sys_menu values ('1061', '分类新增', '537', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:add',   '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1062', '分类修改', '537', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:edit',  '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1063', '分类删除', '537', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:remove','#', 'admin', sysdate(), '', null, '');
 -- 服务区能源设施配置按钮
-insert into sys_menu values ('1061', '设施新增', '537', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:add',   '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1062', '设施修改', '537', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:edit',  '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1063', '设施删除', '537', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:remove','#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1064', '设施导出', '537', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:export','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1064', '设施新增', '538', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:add',   '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1065', '设施修改', '538', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:edit',  '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1066', '设施删除', '538', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:remove','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1067', '设施导出', '538', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:export','#', 'admin', sysdate(), '', null, '');
 -- 服务区能流关系配置按钮
-insert into sys_menu values ('1065', '关系新增', '538', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1066', '关系修改', '538', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1067', '关系删除', '538', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1068', '关系导出', '538', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:export','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1068', '关系新增', '539', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1069', '关系修改', '539', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1070', '关系删除', '539', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
 -- 服务区设备配置按钮
-insert into sys_menu values ('1069', '设备新增', '539', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1070', '设备修改', '539', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1071', '设备删除', '539', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1072', '设备导出', '539', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:export','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1071', '设备新增', '540', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1072', '设备修改', '540', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1073', '设备删除', '540', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1074', '设备导出', '540', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:export','#', 'admin', sysdate(), '', null, '');
+-- 碳排因子配置按钮
+insert into sys_menu values ('1075', '新增因子', '543', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:add',   '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1076', '修改因子', '543', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:edit',  '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1077', '删除因子', '543', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:remove','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1078', '因子导出', '543', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:export','#', 'admin', sysdate(), '', null, '');
 
 
 -- ----------------------------
@@ -423,6 +434,8 @@ insert into sys_role_menu values ('2', '538');
 insert into sys_role_menu values ('2', '539');
 insert into sys_role_menu values ('2', '540');
 insert into sys_role_menu values ('2', '541');
+insert into sys_role_menu values ('2', '542');
+insert into sys_role_menu values ('2', '543');
 insert into sys_role_menu values ('2', '1000');
 insert into sys_role_menu values ('2', '1001');
 insert into sys_role_menu values ('2', '1002');
@@ -495,6 +508,12 @@ insert into sys_role_menu values ('2', '1068');
 insert into sys_role_menu values ('2', '1069');
 insert into sys_role_menu values ('2', '1071');
 insert into sys_role_menu values ('2', '1072');
+insert into sys_role_menu values ('2', '1073');
+insert into sys_role_menu values ('2', '1074');
+insert into sys_role_menu values ('2', '1075');
+insert into sys_role_menu values ('2', '1076');
+insert into sys_role_menu values ('2', '1077');
+insert into sys_role_menu values ('2', '1078');
 
 -- ----------------------------
 -- 8、角色和部门关联表  角色1-N部门