Browse Source

手工抄表开发

lv.wenbin 11 months ago
parent
commit
aca8425b76

+ 71 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/MeterReadingManualController.java

@@ -0,0 +1,71 @@
+package com.ruoyi.ems.controller;
+
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+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.MeterReadingManual;
+import com.ruoyi.ems.domain.vo.QueryMeterReading;
+import com.ruoyi.ems.service.IMeterReadingManualService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 手动抄记录Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-28
+ */
+@RestController
+@RequestMapping("/meterReading")
+public class MeterReadingManualController extends BaseController {
+    @Autowired
+    private IMeterReadingManualService meterReadingManualService;
+
+    /**
+     * 查询手动抄记录列表
+     */
+    @GetMapping("/listByParam")
+    public AjaxResult listByParam(QueryMeterReading queryMeterReading) {
+        List<MeterReadingManual> list = meterReadingManualService.selectList(queryMeterReading);
+        return success(list);
+    }
+
+    /**
+     * 获取设备最后一条抄表记录
+     */
+    @GetMapping(value = "/getLastRecord")
+    public AjaxResult getLastRecord(@RequestParam(name = "areaCode") String areaCode,
+        @RequestParam(name = "deviceCode") String deviceCode) {
+        return success(meterReadingManualService.selectLastItem(areaCode, deviceCode));
+    }
+
+    /**
+     * 新增手动抄记录
+     */
+    @RequiresPermissions("ems:meterReading:add")
+    @Log(title = "手动抄记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody MeterReadingManual meterReadingManual) {
+        return toAjax(meterReadingManualService.insert(meterReadingManual));
+    }
+
+    /**
+     * 修改手动抄记录
+     */
+    @RequiresPermissions("ems:meterReading:edit")
+    @Log(title = "手动抄记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody MeterReadingManual meterReadingManual) {
+        return toAjax(meterReadingManualService.update(meterReadingManual));
+    }
+}

+ 38 - 48
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/CoChargingConfig.java

@@ -33,11 +33,11 @@ public class CoChargingConfig extends BaseEntity
 
     /** 电计量单价 1度 */
     @Excel(name = "电计量单价")
-    private Long elecUnitPrice;
+    private Double elecUnitPrice;
 
     /** 电公摊计算类型 */
     @Excel(name = "电公摊计算类型")
-    private Long elecGtComputeType;
+    private Integer elecGtComputeType;
 
     /** 电费计算说明 */
     @Excel(name = "电费计算说明")
@@ -45,11 +45,11 @@ public class CoChargingConfig extends BaseEntity
 
     /** 水计量单价 1吨 */
     @Excel(name = "水计量单价")
-    private Long waterUnitPrice;
+    private Double waterUnitPrice;
 
     /** 水公摊计算类型 */
     @Excel(name = "水公摊计算类型")
-    private Long waterGtComputeType;
+    private Integer waterGtComputeType;
 
     /** 水费计算说明 */
     @Excel(name = "水费计算说明")
@@ -57,25 +57,22 @@ public class CoChargingConfig extends BaseEntity
 
     private List<CoChargingConfigRel> relCoList;
 
-    public void setId(Long id) 
-    {
-        this.id = id;
-    }
-
-    public Long getId() 
-    {
+    public Long getId() {
         return id;
     }
-    public void setAreaCode(String areaCode) 
-    {
-        this.areaCode = areaCode;
+
+    public void setId(Long id) {
+        this.id = id;
     }
 
-    public String getAreaCode() 
-    {
+    public String getAreaCode() {
         return areaCode;
     }
 
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
     public String getAreaName() {
         return areaName;
     }
@@ -92,61 +89,54 @@ public class CoChargingConfig extends BaseEntity
         this.areaShortName = areaShortName;
     }
 
-    public void setElecUnitPrice(Long elecUnitPrice)
-    {
-        this.elecUnitPrice = elecUnitPrice;
-    }
-
-    public Long getElecUnitPrice()
-    {
+    public Double getElecUnitPrice() {
         return elecUnitPrice;
     }
-    public void setElecGtComputeType(Long elecGtComputeType)
-    {
-        this.elecGtComputeType = elecGtComputeType;
+
+    public void setElecUnitPrice(Double elecUnitPrice) {
+        this.elecUnitPrice = elecUnitPrice;
     }
 
-    public Long getElecGtComputeType()
-    {
+    public Integer getElecGtComputeType() {
         return elecGtComputeType;
     }
-    public void setElecComputeDesc(String elecComputeDesc)
-    {
-        this.elecComputeDesc = elecComputeDesc;
+
+    public void setElecGtComputeType(Integer elecGtComputeType) {
+        this.elecGtComputeType = elecGtComputeType;
     }
 
-    public String getElecComputeDesc()
-    {
+    public String getElecComputeDesc() {
         return elecComputeDesc;
     }
-    public void setWaterUnitPrice(Long waterUnitPrice)
-    {
-        this.waterUnitPrice = waterUnitPrice;
+
+    public void setElecComputeDesc(String elecComputeDesc) {
+        this.elecComputeDesc = elecComputeDesc;
     }
 
-    public Long getWaterUnitPrice()
-    {
+    public Double getWaterUnitPrice() {
         return waterUnitPrice;
     }
-    public void setWaterGtComputeType(Long waterGtComputeType)
-    {
-        this.waterGtComputeType = waterGtComputeType;
+
+    public void setWaterUnitPrice(Double waterUnitPrice) {
+        this.waterUnitPrice = waterUnitPrice;
     }
 
-    public Long getWaterGtComputeType()
-    {
+    public Integer getWaterGtComputeType() {
         return waterGtComputeType;
     }
-    public void setWaterComputeDesc(String waterComputeDesc)
-    {
-        this.waterComputeDesc = waterComputeDesc;
+
+    public void setWaterGtComputeType(Integer waterGtComputeType) {
+        this.waterGtComputeType = waterGtComputeType;
     }
 
-    public String getWaterComputeDesc()
-    {
+    public String getWaterComputeDesc() {
         return waterComputeDesc;
     }
 
+    public void setWaterComputeDesc(String waterComputeDesc) {
+        this.waterComputeDesc = waterComputeDesc;
+    }
+
     public List<CoChargingConfigRel> getRelCoList() {
         return relCoList;
     }

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

@@ -10,7 +10,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
  * @author ruoyi
  * @date 2024-08-26
  */
-public class CoChargingConfigRel extends BaseEntity
+public class CoChargingConfigRel
 {
     private static final long serialVersionUID = 1L;
 

+ 13 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterDevice.java

@@ -31,7 +31,8 @@ public class MeterDevice extends BaseEntity
      * 计量对象类型
      * obj_type=1
      *  - 1: 园区  2: 建筑  3:区块
-     *
+     * obj_type =2
+     *    1: 设施  2:设备
      */
     private Long objSubType;
 
@@ -46,6 +47,9 @@ public class MeterDevice extends BaseEntity
     /** 采集方式 */
     private Long colMode;
 
+    /** 倍率 */
+    private Integer magnification;
+
     /** 规格描述 */
     private String specDesc;
 
@@ -129,6 +133,14 @@ public class MeterDevice extends BaseEntity
         this.colMode = colMode;
     }
 
+    public Integer getMagnification() {
+        return magnification;
+    }
+
+    public void setMagnification(Integer magnification) {
+        this.magnification = magnification;
+    }
+
     public String getSpecDesc() {
         return specDesc;
     }

+ 169 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReadingManual.java

@@ -0,0 +1,169 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 手动抄记录对象 adm_meter_reading_manual
+ * 
+ * @author ruoyi
+ * @date 2024-08-28
+ */
+public class MeterReadingManual extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 计量设备code */
+    @Excel(name = "计量设备code")
+    private String deviceCode;
+
+    /** 服务区代码 */
+    @Excel(name = "服务区代码")
+    private String areaCode;
+
+    /** 年份yyyy */
+    @Excel(name = "年份yyyy")
+    private String year;
+
+    /** 计量月yyyyMM */
+    @Excel(name = "计量月yyyyMM")
+    private String meterMonth;
+
+    /** 上次示数 */
+    @Excel(name = "上次示数")
+    private Long lastReading;
+
+    /** 上次抄表日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "上次抄表日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date lastTime;
+
+    /** 抄表值 */
+    @Excel(name = "抄表值")
+    private Long meterReading;
+
+    /** 本次抄表日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "本次抄表日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date meterTime;
+
+    /** 增量 */
+    @Excel(name = "增量")
+    private Long increase;
+
+    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 setAreaCode(String areaCode) 
+    {
+        this.areaCode = areaCode;
+    }
+
+    public String getAreaCode() 
+    {
+        return areaCode;
+    }
+    public void setYear(String year) 
+    {
+        this.year = year;
+    }
+
+    public String getYear() 
+    {
+        return year;
+    }
+    public void setMeterMonth(String meterMonth) 
+    {
+        this.meterMonth = meterMonth;
+    }
+
+    public String getMeterMonth() 
+    {
+        return meterMonth;
+    }
+    public void setLastReading(Long lastReading) 
+    {
+        this.lastReading = lastReading;
+    }
+
+    public Long getLastReading() 
+    {
+        return lastReading;
+    }
+    public void setLastTime(Date lastTime) 
+    {
+        this.lastTime = lastTime;
+    }
+
+    public Date getLastTime() 
+    {
+        return lastTime;
+    }
+    public void setMeterReading(Long meterReading) 
+    {
+        this.meterReading = meterReading;
+    }
+
+    public Long getMeterReading() 
+    {
+        return meterReading;
+    }
+    public void setMeterTime(Date meterTime) 
+    {
+        this.meterTime = meterTime;
+    }
+
+    public Date getMeterTime() 
+    {
+        return meterTime;
+    }
+    public void setIncrease(Long increase) 
+    {
+        this.increase = increase;
+    }
+
+    public Long getIncrease() 
+    {
+        return increase;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("deviceCode", getDeviceCode())
+            .append("areaCode", getAreaCode())
+            .append("year", getYear())
+            .append("meterMonth", getMeterMonth())
+            .append("lastReading", getLastReading())
+            .append("lastTime", getLastTime())
+            .append("meterReading", getMeterReading())
+            .append("meterTime", getMeterTime())
+            .append("increase", getIncrease())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

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

@@ -0,0 +1,77 @@
+/*
+ * 文 件 名:  QueryMeterReading
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/8/28
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.domain.vo;
+
+/**
+ * 查询抄表记录
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/8/28]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public class QueryMeterReading {
+    /** 服务区代码 */
+    private String areaCode;
+
+    /** 设备编号 */
+    private String deviceCode;
+
+    /** 年份 */
+    private String year;
+
+    /** 开始月份 */
+    private String startMonth;
+
+    /** 结束月份 */
+    private String endMonth;
+
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
+    public String getDeviceCode() {
+        return deviceCode;
+    }
+
+    public void setDeviceCode(String deviceCode) {
+        this.deviceCode = deviceCode;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getStartMonth() {
+        return startMonth;
+    }
+
+    public void setStartMonth(String startMonth) {
+        this.startMonth = startMonth;
+    }
+
+    public String getEndMonth() {
+        return endMonth;
+    }
+
+    public void setEndMonth(String endMonth) {
+        this.endMonth = endMonth;
+    }
+}

+ 56 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterReadingManualMapper.java

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

+ 56 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterReadingManualService.java

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

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

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

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

@@ -15,11 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="objName"     column="obj_name"    />
         <result property="colCycle"    column="col_cycle"    />
         <result property="colMode"     column="col_mode"    />
+        <result property="magnification" column="magnification" />
         <result property="specDesc"    column="spec_desc"    />
     </resultMap>
 
     <sql id="selectMeterDeviceVo">
-        select id, device_code, area_code, meter_cls, obj_type, obj_sub_type, obj_code, col_cycle, col_mode, spec_desc from adm_meter_device
+        select id, device_code, area_code, meter_cls, obj_type, obj_sub_type, obj_code, col_cycle, col_mode, magnification, spec_desc from adm_meter_device
     </sql>
 
     <select id="selectMeterDeviceList" parameterType="com.ruoyi.ems.domain.MeterDevice" resultMap="meterDeviceResult">
@@ -33,7 +34,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objCode != null  and objCode != ''"> and obj_code = #{objCode}</if>
             <if test="colCycle != null "> and col_cycle = #{colCycle}</if>
             <if test="colMode != null "> and col_mode = #{colMode}</if>
-            <if test="specDesc != null  and specDesc != ''"> and spec_desc = #{specDesc}</if>
         </where>
         ORDER BY obj_type, obj_sub_type
     </select>
@@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objCode != null and objCode != ''">obj_code,</if>
             <if test="colCycle != null">col_cycle,</if>
             <if test="colMode != null">col_mode,</if>
+            <if test="magnification != null">magnification,</if>
             <if test="specDesc != null">spec_desc,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -65,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objCode != null and objCode != ''">#{objCode},</if>
             <if test="colCycle != null">#{colCycle},</if>
             <if test="colMode != null">#{colMode},</if>
+            <if test="magnification != null">#{magnification},</if>
             <if test="specDesc != null">#{specDesc},</if>
          </trim>
     </insert>
@@ -80,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
             <if test="colCycle != null">col_cycle = #{colCycle},</if>
             <if test="colMode != null">col_mode = #{colMode},</if>
+            <if test="magnification != null">magnification = #{magnification},</if>
             <if test="specDesc != null">spec_desc = #{specDesc},</if>
         </trim>
         where id = #{id}

+ 88 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterReadingManualMapper.xml

@@ -0,0 +1,88 @@
+<?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.MeterReadingManualMapper">
+    
+    <resultMap type="com.ruoyi.ems.domain.MeterReadingManual" id="MeterReadingManualResult">
+        <result property="id"    column="id"    />
+        <result property="deviceCode"    column="device_code"    />
+        <result property="areaCode"    column="area_code"    />
+        <result property="year"    column="year"    />
+        <result property="meterMonth"    column="meter_month"    />
+        <result property="lastReading"    column="last_reading"    />
+        <result property="lastTime"    column="last_time"    />
+        <result property="meterReading"    column="meter_reading"    />
+        <result property="meterTime"    column="meter_time"    />
+        <result property="increase"    column="increase"    />
+        <result property="increase"    column="increase"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectMeterReadingManualVo">
+        select id, device_code, area_code, `year`, meter_month, last_reading, last_time, meter_reading, meter_time, increase, create_time, update_time from adm_meter_reading_manual
+    </sql>
+
+    <select id="selectLastItem"  resultMap="MeterReadingManualResult">
+        <include refid="selectMeterReadingManualVo"/>
+        where area_code = #{areaCode} and device_code = #{deviceCode}
+        order by meter_time desc
+        limit 1
+    </select>
+
+    <select id="selectList" parameterType="com.ruoyi.ems.domain.vo.QueryMeterReading" resultMap="MeterReadingManualResult">
+        <include refid="selectMeterReadingManualVo"/>
+        <where>  
+            <if test="deviceCode != null  and deviceCode != ''"> and device_code = #{deviceCode}</if>
+            <if test="areaCode != null  and areaCode != ''"> and area_code = #{areaCode}</if>
+            <if test="year != null  and year != ''"> and year = #{year}</if>
+            <if test="startMonth != null  and startMonth != ''"> and meter_month &gt;= #{startMonth}</if>
+            <if test="endMonth != null  and endMonth != ''"> and meter_month &lt;= #{endMonth}</if>
+        </where>
+    </select>
+
+    <insert id="insert" parameterType="com.ruoyi.ems.domain.MeterReadingManual" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_meter_reading_manual
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deviceCode != null and deviceCode != ''">device_code,</if>
+            <if test="areaCode != null and areaCode != ''">area_code,</if>
+            <if test="year != null and year != ''">year,</if>
+            <if test="meterMonth != null and meterMonth != ''">meter_month,</if>
+            <if test="lastReading != null">last_reading,</if>
+            <if test="lastTime != null">last_time,</if>
+            <if test="meterReading != null">meter_reading,</if>
+            <if test="meterTime != null">meter_time,</if>
+            <if test="increase != null">increase,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
+            <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
+            <if test="year != null and year != ''">#{year},</if>
+            <if test="meterMonth != null and meterMonth != ''">#{meterMonth},</if>
+            <if test="lastReading != null">#{lastReading},</if>
+            <if test="lastTime != null">#{lastTime},</if>
+            <if test="meterReading != null">#{meterReading},</if>
+            <if test="meterTime != null">#{meterTime},</if>
+            <if test="increase != null">#{increase},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="update" parameterType="com.ruoyi.ems.domain.MeterReadingManual">
+        update adm_meter_reading_manual
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="meterReading != null">meter_reading = #{meterReading},</if>
+            <if test="meterTime != null">meter_time = #{meterTime},</if>
+            <if test="increase != null">increase = #{increase},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteById" parameterType="Long">
+        delete from adm_meter_reading_manual where id = #{id}
+    </delete>
+</mapper>

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

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

+ 58 - 195
ems-cloud/sql/ems_server.sql

@@ -398,9 +398,6 @@ create table adm_service_area (
   unique key ux_area_code(`area_code`)
 ) engine=innodb auto_increment=1 comment = '服务区表';
 
--- 服务区初始数据
-INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3001', '常泰高速服务区(北区)', '北区', 4, '泰州', 'S30如常高速', '常州方向', '江苏省泰州市泰兴市虹桥镇常泰高速常州方向', null, null, '2025-01-01', '72.5', '6000', '120.050937', '32.071956');
-INSERT INTO `adm_service_area` (`area_code`, `area_name`, `short_name`, `service_star`, `city`, `highway`, `direction`, `address`, `attr_org`, `mgr_org`, `open_date`, `land_area`, `floor_area`, `longitude`, `latitude`) VALUES ('321283124S3002', '常泰高速服务区(南区)', '南区', 4, '泰州', 'S30如常高速', '泰兴方向', '江苏省泰州市泰兴市虹桥镇常泰高速泰州方向', null, null, '2025-01-01', '72.5', '6000', '120.052389', '32.070408');
 
 -- ----------------------------
 -- 建筑基本信息表
@@ -421,21 +418,6 @@ create table adm_area_building (
   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`, `area_code`) VALUES ('321283124S300101', '综合楼', '北区中部', 2, 1, 13.7, 4700, '一层提供商业、餐饮、卫生间、开水服务,二层为办公区、会议区', '321283124S3001');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300102', '配电泵房', '北区西北角', 1, 0, null, 300, '配电设施,水泵设施工作区', '321283124S3001');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300103', '维修间&货车之家', '北区东侧', 2, 0, null, 300, '提供车辆维修服务', '321283124S3001');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300104', '加油站', '北区西南角', 1, 0, null, 200, '提供加油服务', '321283124S3001');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300105', '警务站', '北区东北角', 1, 0, null, 50000, '警务办公场地', '321283124S3001');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300106', '停车场', '北区广场', 1, 0, null, 50000, '车位', '321283124S3001');
-
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300201', '综合楼', '南区中部', 2, 1, 14.2, 4788.2, '一层提供商业、餐饮、卫生间、开水服务,二层为员工餐厅、展厅', '321283124S3002');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300202', '配电泵房', '南区东南角', 1, 0, null, 300, '配电设施,水泵设施工作区', '321283124S3002');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300203', '维修间&货车之家', '南区西侧', 2, 0, null, 300, '提供车辆维修服务', '321283124S3002');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300204', '加油站', '南区东北角', 1, 0, null, 200, '提供加油服务', '321283124S3002');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300205', '宿舍楼', '南区西南角', 2, 0, null, 920, '提供员工住宿服务', '321283124S3002');
-INSERT INTO `adm_area_building` (`bldg_code`, `bldg_name`, `address`, `up_bldg_floor`, `down_bldg_floor`, `bldg_height`, `floor_area`, `bldg_usage`, `area_code`) VALUES ('321283124S300206', '停车场', '南区广场', 1, 0, null, 50000, '车位', '321283124S3002');
-
 
 -- ----------------------------
 -- 建筑划分表
@@ -454,59 +436,6 @@ create table adm_area_building_zoning (
   unique key ux_building_zoning_code(`bldg_code`, `zoning_code`)
 ) engine=innodb auto_increment=1 comment = '建筑区域划分表';
 
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-101', '开水泡面间', 1, '101', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-102', '超市', 1, '102', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-103', '中式糕点', 1, '103', 150, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-104', '特色产品市集', 1, '104', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-105', '奶茶/咖啡', 1, '105', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-106', '中式套餐', 1, '106', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-107', '特色小吃', 1, '107', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-108', '串串/卤味', 1, '108', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-109', '糖葫芦/水果', 1, '109', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-110', '美食广场', 1, '110', 300, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-111', '男卫', 1, '111', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-112', '男盥洗室', 1, '112', 150, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-113', '女卫', 1, '113', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-114', '女盥洗室', 1, '114', 150, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-115', '工具间1', 1, '115', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-116', '工具间2', 1, '116', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-117', '工具间3', 1, '117', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-118', '工具间4', 1, '118', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300101', 'B-119', '货车服务空间', 1, '119', 50, '使用中');
-                                                                                                                                   
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-XK', '小客停车位', 1, 'CW-XK', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-CD', '充电车位', 1, 'CW-CD', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-WZA', '无障碍车位', 1, 'CW-WZA', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-DKC', '大客车停车位', 1, 'CW-DKC', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-HC', '货车车位', 1, 'CW-HC', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300106', '321283124S3001_CW-WXP', '危险品车位', 1, 'CW-WXP', 100, '使用中');
-
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-101', '开水泡面间', 1, '101', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-102', '超市', 1, '102', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-103', '中式糕点', 1, '103', 150, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-104', '特色产品市集', 1, '104', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-105', '奶茶/咖啡', 1, '105', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-106', '中式套餐', 1, '106', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-107', '特色小吃', 1, '107', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-108', '串串/卤味', 1, '108', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-109', '糖葫芦/水果', 1, '109', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-110', '美食广场', 1, '110', 300, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-111', '男卫', 1, '111', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-112', '男盥洗室', 1, '112', 150, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-113', '女卫', 1, '113', 200, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-114', '女盥洗室', 1, '114', 150, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-115', '工具间1', 1, '115', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-116', '工具间2', 1, '116', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-117', '工具间3', 1, '117', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-118', '工具间4', 1, '118', 50, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300201', 'N-119', '货车服务空间', 1, '119', 50, '使用中');
-
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-XK', '小客停车位', 1, 'CW-XK', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-CD', '充电车位', 1, 'CW-XK', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-WZA', '无障碍车位', 1, 'CW-XK', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-DKC', '大客车停车位', 1, 'CW-XK', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-HC', '货车车位', 1, 'CW-XK', 100, '使用中');
-INSERT INTO adm_area_building_zoning (`bldg_code`, `zoning_code`, `zoning_name`, `floor`, `room_no`, `bldg_ld_area`, `usage_detail`) VALUES ('321283124S300206', '321283124S3002_CW-WXP','危险品车位', 1, 'CW-XK', 100, '使用中');
 
 -- ----------------------------
 -- 能源设施/系统表
@@ -526,20 +455,6 @@ create table adm_ems_facs  (
   unique key ux_ems_facs_code(`facs_code`)
 ) engine=innodb auto_increment=1 comment = '能源设施表';
 
--- 能源设施/系统DEMO数据
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('W201', '北区-供电网', 'W', 'W2', 1, '321283124S3001');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('W202', '南区-供电网', 'W', 'W2', 1, '321283124S3002');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('E501', '北区-光伏', 'E', 'E5', 1, '321283124S3001');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('E502', '南区-光伏', 'E', 'E5', 1, '321283124S3002');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z101', '北区-室内照明', 'Z', 'Z001', 1, '321283124S3001');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z102', '北区-室外照明', 'Z', 'Z002', 1, '321283124S3001');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z110', '北区-公共设施', 'Z', 'Z010', 1, '321283124S3001');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z120', '北区-空调设施', 'Z', 'Z020', 1, '321283124S3001');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z201', '南区-室内照明', 'Z', 'Z001', 1, '321283124S3002');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z202', '南区-室外照明', 'Z', 'Z002', 1, '321283124S3002');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z210', '南区-公共设施', 'Z', 'Z010', 1, '321283124S3002');
-INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_type`, `facs_subtype`, `enable`, `ref_area`) VALUES ('Z220', '南区-空调设施', 'Z', 'Z020', 1, '321283124S3002');
-
 
 -- ----------------------------
 -- 能源设施属性表
@@ -556,10 +471,6 @@ create table adm_ems_facs_attr  (
    key ux_ems_facs_code(`facs_code`)
 ) engine=innodb auto_increment=1 comment = '能源设施属性表';
 
--- 设施属性DEMO数据
-INSERT INTO `adm_ems_facs_attr` (`facs_code`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('W201', 'input_load', '进线负荷', '293.55', 'kw/h');
-INSERT INTO `adm_ems_facs_attr` (`facs_code`, `attr_name`, `attr_desc`, `attr_value`, `attr_unit`) VALUES ('E501', 'installed_capacity', '装机容量', '2000', 'MW');
-
 
 -- ----------------------------
 -- 能源设施能力表
@@ -575,10 +486,6 @@ create table adm_ems_facs_ability  (
   key ux_ems_facs_ability(`facs_code`)
 ) engine=innodb auto_increment=1 comment = '能源设施能力表';
 
--- 设施属性DEMO数据
-INSERT INTO `adm_ems_facs_ability` (`facs_code`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('Z020', '开启', '开启空调', '{\"enable\":1}');
-INSERT INTO `adm_ems_facs_ability` (`facs_code`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('Z020', '关闭', '关闭空调', '{\"enable\":0}');
-
 
 -- ----------------------------
 -- 能源设施事件表
@@ -596,8 +503,6 @@ create table adm_ems_facs_event  (
   key ux_ems_facs_event(`facs_code`)
 ) engine=innodb auto_increment=1 comment = '能源设施事件表';
 
-INSERT INTO `adm_ems_facs_event` (`facs_code`, `event_name`, `event_type`, `event_desc`, `event_code`, `ext_event_code`) VALUES ('Z101', '电压告警', '2', '电压过低告警', 'LOW_V',  '10001001');
-
 
 -- ----------------------------
 -- 能源子系统表
@@ -638,11 +543,6 @@ create table adm_ems_facs_flow_rel  (
   key idx_ems_facs_flow_rel_code(`export_facs_code`,`input_facs_code`)
 ) engine=innodb auto_increment=1 comment = '能源设施能流关系表';
 
--- 能源设施DEMO数据
-INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('W201_Z101', 'W201', 'Z101', '45', 1, '4501');
-INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_W201', 'E501', 'W201', '45', 1, '4502');
-INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_code`, `ems_cls`, `state`, `action_type`) VALUES ('E501_Z101', 'E501', 'Z101', '45', 1, '4505');
-
 
 -- ----------------------------
 -- 用能设备表
@@ -679,6 +579,7 @@ create table adm_meter_device  (
   `obj_code`        varchar(32)     not null                     comment '计量对象编码',
   `col_cycle`       int             default null                 comment '采集周期',
   `col_mode`        int             default null                 comment '采集方式',
+  `magnification`   int             default 1                    comment '倍率',
   `spec_desc`       varchar(128)    default null                 comment '规格描述',
   primary key (`id`),
   unique key ux_meter_device(`device_code`)
@@ -833,6 +734,7 @@ drop table if exists adm_op_alarm;
 create table adm_op_alarm  (
   `id`                  bigint(20)      not null auto_increment      comment '序号',
   `area_code`           varchar(32)     not null                     comment '园区代码',
+  `system_code`         varchar(16)     default null                 comment '子系统代码',
   `obj_type`            int             not null                     comment '对象类型 0:园区,1:区块,2:设施,3:设备',
   `obj_code`            varchar(32)     not null                     comment '对象代码',
   `alarm_date`          date            default null                 comment '告警日期',
@@ -916,59 +818,40 @@ create table adm_obj_tag_rel (
   key inx_obj_tag_rel(`tag_type`, `tag_code`)
 ) engine=innodb auto_increment=1 comment = '对象&标签关系表';
 
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-101','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-102','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-103','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-104','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-105','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-106','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-107','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-108','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-109','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-110','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-111','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-112','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-113','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-114','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-115','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-116','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-117','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-118','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','B-119','Area_00');
-
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-CD','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-DKC','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-HC','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-WXP','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-WZA','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3001_CW-XK','Area_00');
-
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-101','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-102','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-103','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-104','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-105','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-106','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-107','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-108','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-109','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-110','Area_01');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-111','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-112','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-113','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-114','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-115','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-116','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-117','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-118','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','N-119','Area_00');
-
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-CD','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-DKC','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-HC','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-WXP','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-WZA','Area_00');
-insert into adm_obj_tag_rel(`tag_type`,`obj_code`,`tag_code`) VALUES ('3','321283124S3002_CW-XK','Area_00');
+
+-- ----------------------------
+-- 手动抄表记录表
+-- ----------------------------
+drop table if exists adm_meter_reading_manual;
+create table adm_meter_reading_manual (
+  `id`               bigint(20)      not null auto_increment      comment '序号',
+  `device_code`      varchar(16)     not null                     comment '计量设备code',
+  `area_code`        varchar(16)     not null                     comment '服务区代码',
+  `year`             year            not null                     comment '年份yyyy',
+  `meter_month`      varchar(6)      not null                     comment '计量月yyyyMM',
+  `last_reading`     int             default null                 comment '上次示数',
+  `last_time`        date            default null                 comment '上次抄表日期',
+  `meter_reading`    int             not null                     comment '抄表值',
+  `meter_time`       date            not null                     comment '本次抄表日期',
+  `increase`         int             not null                     comment '增量',
+  `create_time`      datetime        default null                 comment '创建时间',
+  `update_time`      datetime        default null                 comment '更新时间',
+  primary key (`id`),
+  key meter_reading_manual(`device_code`)
+) engine=innodb auto_increment=1 comment = '手动抄表记录表';
+
+
+-- ----------------------------
+-- 对象&标签关系表
+-- ----------------------------
+drop table if exists adm_obj_tag_rel;
+create table adm_obj_tag_rel (
+  `tag_type`         int             not null                     comment '标签类型',
+  `tag_code`         varchar(64)     not null                     comment '标签代码',
+  `obj_code`         varchar(64)     not null                     comment '对象代码',
+  key inx_obj_tag_rel(`tag_type`, `tag_code`)
+) engine=innodb auto_increment=1 comment = '对象&标签关系表';
+
 
 -- ----------------------------
 -- 服务区用电属性表
@@ -987,8 +870,6 @@ create table adm_area_elec_attr (
   unique key ux_area_elec_attr(`area_code`)
 ) engine=innodb auto_increment=1 comment = '服务区用电属性表';
 
-INSERT INTO adm_area_elec_attr (`area_code`, `price_code`, `req_capacity_flag`, `trans_capacity`, `req_quantity`) VALUES ('321283124S3001', '4001', 1, 630, NULL);
-INSERT INTO adm_area_elec_attr (`area_code`, `price_code`, `req_capacity_flag`, `trans_capacity`, `req_quantity`) VALUES ('321283124S3002', '4001', 1, 630, NULL);
 
 -- ----------------------------
 -- 国网电价配置表
@@ -1010,16 +891,6 @@ create table adm_gw_elecprice_config (
   unique key ux_gw_elecprice_config(`cfg_code`)
 ) engine=innodb auto_increment=1 comment = '电价配置表';
 
--- 单一制初始电价数据
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('3001', 3, '不满1千伏', 0.7624, 1.5296, 1.2747, 0.7624, 0.3445, NULL, NULL);
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('3002', 3, '1-10(20)千伏', 0.7364, 1.4774, 1.2312, 0.7364, 0.3327, NULL, NULL);
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('3003', 3, '35千伏', 0.7114, 1.4273, 1.1894, 0.7114, 0.3214, NULL, NULL);
-
--- 两部制初始电价数据
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4001', 4, '1-10(20)千伏', 0.6587, 1.3592, 1.1327, 0.6587, 0.2757, 51.2, 32);
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4002', 4, '35千伏', 0.6337, 1.3076, 1.0897, 0.6337, 0.2652, 48, 30);
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4003', 4, '110千伏', 0.6087, 1.256, 1.0467, 0.6087, 0.2547, 44.8, 28);
-INSERT INTO adm_gw_elecprice_config (`cfg_code`, `elec_type`, `voltage_level`, `degree_price`, `fs_peak_degree_price`, `fs_high_degree_price`, `fs_flat_degree_price`, `fs_low_degree_price`, `max_req_price`, `trans_capacity_price`) VALUES ('4004', 4, '220千伏及以上', 0.5827, 1.2024, 1.002, 0.5827, 0.2439, 41.6, 26);
 
 -- ----------------------------
 -- 光伏电价配置表
@@ -1056,8 +927,6 @@ create table adm_elecprice_strategy (
   unique key ux_elecprice_strategy(`strategy_code`)
 ) engine=innodb auto_increment=1 comment = '电价策略表';
 
--- 默认策略
-INSERT INTO adm_elecprice_strategy (`strategy_code`, `strategy_name`, `strategy_desc`, `repeat_type`, `repeat_param`, `priority`) VALUES ('-1', '默认策略', '0:00-24:00 执行平峰电价', 2, null, 0);
 
 -- ----------------------------
 -- 电价策略小时表
@@ -1072,8 +941,6 @@ create table adm_elecprice_strategy_hour (
   primary key (`id`)
 ) engine=innodb auto_increment=1 comment = '电价策略小时表';
 
-INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_time`, `type`) VALUES ('-1', '00:00:00', '23:59:59', 0);
-
 
 -- ----------------------------
 -- 商户能源计费配置
@@ -1094,27 +961,6 @@ create table adm_co_charging_config (
 
 
 -- ----------------------------
--- 商户能源计费配置
--- ----------------------------
-drop table if exists adm_co_charging_config;
-create table adm_co_charging_config (
-  `id`                    bigint(20)      not null auto_increment      comment '序号',
-  `area_code`             varchar(16)     not null                     comment '服务区代码',
-  `elec_unit_price`       double          not null                     comment '电计量单价 1度',
-  `elec_gt_compute_type`  int             not null                     comment '电公摊计算类型',
-  `elec_compute_desc`     varchar(200)    default null                 comment '电费计算说明',
-  `water_unit_price`      double          not null                     comment '水计量单价 1吨',
-  `water_gt_compute_type` int             not null                     comment '水公摊计算类型',
-  `water_compute_desc`    varchar(200)    default null                 comment '水费计算说明',
-  primary key (`id`),
-  unique key ux_co_charging_config(`area_code`)
-) engine=innodb auto_increment=1 comment = '商户能源计费配置';
-
-INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_compute_type`, `elec_compute_desc`, `water_unit_price`, `water_gt_compute_type`, `water_compute_desc`) VALUES ('321283124S3001', 0.6068, 1, '1.按户数均摊\n公摊电费每户收费 = 公摊电费 / 户数\n2、按面积分摊\n单户公摊电费 = 公摊电费 * (单户面积 / 总面积)', 3.04, 0, NULL);
-INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_compute_type`, `elec_compute_desc`, `water_unit_price`, `water_gt_compute_type`, `water_compute_desc`) VALUES ('321283124S3002', 0.6068, 1, '1.按户数均摊\n公摊电费每户收费 = 公摊电费 / 户数\n2、按面积分摊\n单户公摊电费 = 公摊电费 * (单户面积 / 总面积)', 3.04, 0, NULL);
-
-
--- ----------------------------
 -- 商户能源计费关系表
 -- ----------------------------
 drop table if exists adm_co_charging_config_rel;
@@ -1238,6 +1084,23 @@ create table adm_ems_ca_meter_d (
 
 
 -- ----------------------------
+-- 能源指标范围表
+-- ----------------------------
+drop table if exists adm_ems_index_range;
+create table adm_ems_index_range (
+  `id`                        bigint(20)      not null auto_increment      comment '序号',
+  `obj_code`                  varchar(16)     not null                     comment '对象代码',
+  `obj_type`                  int             not null                     comment '对象类型',
+  `index_name`                varchar(64)     not null                     comment '指标名称',
+  `index_desc`                varchar(200)    default null                 comment '指标描述',
+  `index_upper_limit`         double          default null                 comment '指标上限',
+  `index_lower_limit`         double          default null                 comment '指标下限',
+  primary key (`id`),
+  key ux_ems_elec_pg_index(`obj_code`)
+) engine=innodb auto_increment=1 comment = '能源指标范围表';
+
+
+-- ----------------------------
 -- 电网设施指标表
 -- ----------------------------
 drop table if exists adm_ems_elec_pg_index;
@@ -1248,7 +1111,7 @@ create table adm_ems_elec_pg_index (
   `date`                      date            not null                     comment '日期 yyyy-MM-dd',
   `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
   `voltage`                   double          default null                 comment '电压 单位:kV(千伏)',
-  `amperage`                  double          default null                 comment '电流 单位:A(安培)',
+  `electricity`               double          default null                 comment '电流 单位:A(安培)',
   `power`                     double          default null                 comment '功率 单位:kW(千瓦)',
   primary key (`id`),
   unique key ux_ems_elec_pg_index(`facs_code`, `time`)
@@ -1266,7 +1129,7 @@ create table adm_ems_elec_pv_index (
   `date`                      date            not null                     comment '日期 yyyy-MM-dd',
   `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
   `voltage`                   double          default null                 comment '电压 单位:kV(千伏)',
-  `amperage`                  double          default null                 comment '电流 单位:A(安培)',
+  `electricity`               double          default null                 comment '电流 单位:A(安培)',
   `power`                     double          default null                 comment '功率 单位:kW(千瓦)',
   primary key (`id`),
   unique key ux_ems_elec_pg_index(`facs_code`, `time`)
@@ -1284,9 +1147,9 @@ create table adm_ems_elec_store_index (
   `date`                      date            not null                     comment '日期 yyyy-MM-dd',
   `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
   `input_voltage`             double          default null                 comment '输入电压 单位:kV(千伏)',
-  `input_amperage`            double          default null                 comment '输入电流 单位:A(安培)',
+  `input_electricity`         double          default null                 comment '输入电流 单位:A(安培)',
   `output_voltage`            double          default null                 comment '输出电压 单位:kV(千伏)',
-  `output_amperage`           double          default null                 comment '输出电流 单位:A(安培)',
+  `output_electricity`        double          default null                 comment '输出电流 单位:A(安培)',
   `current_capacity`          double          default null                 comment '当前容量 单位:kW-h(千瓦·时)',
   primary key (`id`),
   unique key ux_ems_elec_store_index(`facs_code`, `time`)
@@ -1304,7 +1167,7 @@ create table adm_ems_elec_load_index (
   `date`                      date            not null                     comment '日期 yyyy-MM-dd',
   `time`                      datetime        not null                     comment '时间 yyyy-MM-dd HH:mm:ss',
   `voltage`                   double          default null                 comment '电压 单位:kV(千伏)',
-  `amperage`                  double          default null                 comment '电流 单位:A(安培)',
+  `electricity`               double          default null                 comment '电流 单位:A(安培)',
   `power`                     double          default null                 comment '功率 单位:kW(千瓦)',
   primary key (`id`),
   unique key ux_ems_elec_load_index(`facs_code`, `time`)