Compare commits

..

25 Commits

Author SHA1 Message Date
733afa99bd 电表类别-枚举 2025-07-05 23:24:46 +08:00
6a5504434d 电量指标-时间筛选数据 2025-07-05 23:24:13 +08:00
f42e8549b1 单站监控-电表取数逻辑修改 2025-07-04 13:51:42 +08:00
4bb23a7c75 奉贤电表数据接入 2025-07-04 12:37:18 +08:00
126b637932 BMS总览-获取堆下面簇数据 2025-07-03 16:12:19 +08:00
7bf4baf85f 设备列表接口 2025-07-03 15:40:27 +08:00
9dae47934f Merge remote-tracking branch 'origin/dev' into dev 2025-07-03 14:47:33 +08:00
0e726a214d 删除无用代码 2025-07-03 14:47:27 +08:00
7964806b94 站点配置-获取站点列表 2025-07-02 19:43:17 +08:00
b4302edd8a redis key常量 2025-07-02 17:34:09 +08:00
88fee64f46 redis key常量 2025-07-02 17:32:17 +08:00
8081e38d5e 本地调试-回退 2025-07-02 16:10:22 +08:00
8415e2749e 从redis取数 2025-07-02 16:08:50 +08:00
170bae19f8 修正部分参数 2025-07-02 12:26:09 +08:00
37fd07b0c8 修正部分参数 2025-07-02 12:10:46 +08:00
f73ba23b52 修正部分参数 2025-07-02 11:40:23 +08:00
a3f77113c9 字段值修改 2025-07-01 22:09:16 +08:00
a7e33afb19 修正部分参数 2025-07-01 22:03:43 +08:00
2c5d4ddd1b 修正部分参数 2025-07-01 21:58:26 +08:00
9efb87ed24 修正部分参数 2025-07-01 21:50:54 +08:00
4d5f2adef4 修正部分参数 2025-07-01 21:39:32 +08:00
0318b2455d Merge remote-tracking branch 'origin/dev' into dev 2025-07-01 21:28:30 +08:00
b2c624f452 修正部分参数 2025-07-01 21:28:25 +08:00
b207208623 Merge remote-tracking branch 'origin/dev' into dev 2025-07-01 21:22:18 +08:00
259784f525 概率统计-电量指标默认7天 2025-07-01 21:21:55 +08:00
52 changed files with 3996 additions and 1580 deletions

View File

@ -0,0 +1,64 @@
package com.xzzn.web.controller.ems;
import com.xzzn.common.core.controller.BaseController;
import com.xzzn.common.core.domain.AjaxResult;
import com.xzzn.common.core.page.TableDataInfo;
import com.xzzn.ems.domain.EmsDevicesSetting;
import com.xzzn.ems.domain.EmsSiteSetting;
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
import com.xzzn.ems.service.IEmsDeviceSettingService;
import com.xzzn.ems.service.IEmsSiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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;
/**
*
* 站点配置
*
*/
@RestController
@RequestMapping("/ems/siteConfig")
public class EmsSiteConfigController extends BaseController{
@Autowired
private IEmsSiteService iEmsSiteService;
@Autowired
private IEmsDeviceSettingService iEmsDeviceSettingService;
/**
* 获取站点列表
*/
@GetMapping("/getSiteInfoList")
public TableDataInfo getSiteInfoList(@RequestParam String siteName, @RequestParam String startTime, @RequestParam String endTime)
{
startPage();
List<EmsSiteSetting> list = iEmsSiteService.getAllSiteInfoList(siteName,startTime,endTime);
return getDataTable(list);
}
/**
* 获取设备列表
*/
@GetMapping("/getDeviceInfoList")
public TableDataInfo getDeviceInfoList(@RequestParam String siteId)
{
startPage();
List<SiteDeviceListVo> list = iEmsSiteService.getAllDeviceList(siteId);
return getDataTable(list);
}
/**
* 获取设备详细信息
*/
@GetMapping("/getDeviceDetailInfo")
public AjaxResult getDeviceDetailInfo(@RequestParam String deviceId)
{
return success(iEmsDeviceSettingService.getDeviceDetailInfo(deviceId));
}
}

View File

@ -114,7 +114,7 @@ public class EmsSiteMonitorController extends BaseController{
{ {
startPage(); startPage();
List<BatteryDataStatsListVo> list = iSingleSiteService.getClusterDataInfoList(clusterDeviceId,siteId); List<BatteryDataStatsListVo> list = iSingleSiteService.getClusterDataInfoList(clusterDeviceId,siteId);
return getDataTable(list); return getDataTable2(list);
} }
/** /**

View File

@ -10,8 +10,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/** /**
* 单站监控-统计报表 * 单站监控-统计报表
* *

View File

@ -1,29 +0,0 @@
package com.xzzn.web.controller.ems.data;
public class FXDataProcess {
public void batteryClusterProcess(String data) {
}
public void batteryStackProcess(String data) {
}
public void batteryDataProcess(String data) {
}
public void pcsProcess(String data) {
}
public void pcsBranchProcess(String data) {
}
public void coolingProcess(String data) {
}
public void ameterProcess(String data) {
}
}

View File

@ -0,0 +1,39 @@
package com.xzzn.common.constant;
/**
* 数据存储 Redis key 常量
*
* @author xzzn
*/
public class RedisKeyConstants
{
/**
* pcs数据 redis key
*/
public static final String PCS = "PCS_";
/**
* pcs branch数据 redis key
*/
public static final String BRANCH = "BRANCH_";
/**
* stack电池堆数据 redis key
*/
public static final String STACK = "STACK_";
/**
* cluster电池簇数据 redis key
*/
public static final String CLUSTER = "CLUSTER_";
/**
* battery单体电池数据 redis key
*/
public static final String BATTERY = "BATTERY_";
/**
* 电表数据 redis key
*/
public static final String AMMETER = "AMMETER_";
}

View File

@ -1,6 +1,8 @@
package com.xzzn.common.core.controller; package com.xzzn.common.core.controller;
import java.beans.PropertyEditorSupport; import java.beans.PropertyEditorSupport;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -199,4 +201,35 @@ public class BaseController
{ {
return getLoginUser().getUsername(); return getLoginUser().getUsername();
} }
/**
* 手动处理分页
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected TableDataInfo getDataTable2(List<?> list)
{
List<?> subList = new ArrayList<>();
// 分页梳理
PageDomain pageDomain = TableSupport.buildPageRequest();
int pageNum = pageDomain.getPageNum();
int pageSize = pageDomain.getPageSize();
if (pageNum > 0 && pageSize > 0) {
// 计算分页起始和结束索引
int startIndex = (pageNum - 1) * pageSize;
int endIndex = Math.min(startIndex + pageSize, list.size());
// 防止越界
if (startIndex >= list.size()) {
subList = Collections.emptyList();
}
// 截取当前页数据
subList = list.subList(startIndex, endIndex);
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(subList);
rspData.setTotal(list.size());
return rspData;
}
} }

View File

@ -265,4 +265,15 @@ public class RedisCache
{ {
return redisTemplate.keys(pattern); return redisTemplate.keys(pattern);
} }
/**
* 删除list
*
* @param key Redis键
* @return 对象列表
*/
public boolean deleteList(final String key)
{
return redisTemplate.delete(key);
}
} }

View File

@ -5,14 +5,18 @@ package com.xzzn.common.enums;
* *
* @author xzzn * @author xzzn
*/ */
public enum AmmeterCategoryStatus public enum AmmeterCategory
{ {
TOTAL_CHARGE("1", "累计充电量"), TOTAL_DISCHARGE("2", "累计放电量"), DAILY_CHARGE("3", "日充电量"), DAILY_DISCHARGE("4", "日放电量"); CURRENT_COMB_ACTIVE("1", "当前组合有功电能"),
CURRENT_COMB_REACTIVE("2", "当前组合无功电能"),
A_POWER("3", "A相功率"),
B_POWER("4", "B相功率"),
C_POWER("5", "C相功率");
private final String code; private final String code;
private final String info; private final String info;
AmmeterCategoryStatus(String code, String info) AmmeterCategory(String code, String info)
{ {
this.code = code; this.code = code;
this.info = info; this.info = info;

View File

@ -0,0 +1,35 @@
package com.xzzn.common.enums;
/**
* device-设备类别
*
* @author xzzn
*/
public enum DeviceCategory
{
PCS("PCS", "PCS设备"),
BRANCH("BRANCH", "PCS分支设备"),
STACK("STACK", "电池堆"),
CLUSTER("CLUSTER", "电池簇"),
BATTERY("BATTERY", "单体电池"),
AMMETER("AMMETER", "电表");
private final String code;
private final String info;
DeviceCategory(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@ -723,32 +723,32 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
public static BigDecimal getBigDecimal(Object s){ public static BigDecimal getBigDecimal(Object s){
BigDecimal result;
try { try {
return new BigDecimal(s.toString()); result = new BigDecimal(s.toString());
} catch (NumberFormatException e) { } catch (Exception e) {
return BigDecimal.ZERO; return BigDecimal.ZERO;
} }
return result;
} }
public static Long getLong(Object s){ public static Long getLong(Object s){
Long result;
try { try {
return Long.parseLong(s.toString()); result = Long.parseLong(s.toString());
} catch (NumberFormatException e) { } catch (Exception e) {
return Long.parseLong("0"); return Long.parseLong("0");
} }
return result;
} }
public static String getString(Object s){ public static String getString(Object s){
String result;
try { try {
return String.valueOf(s); result = String.valueOf(s);
} catch (NumberFormatException e) { } catch (Exception e) {
return "0"; return "0";
} }
return result;
} }
} }

View File

@ -11,7 +11,7 @@ import com.xzzn.common.annotation.Excel;
* Modbus设备配置对象 ems_devices_setting * Modbus设备配置对象 ems_devices_setting
* *
* @author xzzn * @author xzzn
* @date 2025-07-01 * @date 2025-07-02
*/ */
public class EmsDevicesSetting extends BaseEntity public class EmsDevicesSetting extends BaseEntity
{ {
@ -98,6 +98,10 @@ public class EmsDevicesSetting extends BaseEntity
@Excel(name = "上级设备id") @Excel(name = "上级设备id")
private String parentId; private String parentId;
/** 设备类别例如“STACK/CLUSTER/PCS等” */
@Excel(name = "设备类别例如“STACK/CLUSTER/PCS等”")
private String deviceCategory;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -298,6 +302,16 @@ public class EmsDevicesSetting extends BaseEntity
return parentId; return parentId;
} }
public void setDeviceCategory(String deviceCategory)
{
this.deviceCategory = deviceCategory;
}
public String getDeviceCategory()
{
return deviceCategory;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -321,6 +335,7 @@ public class EmsDevicesSetting extends BaseEntity
.append("communicationStatus", getCommunicationStatus()) .append("communicationStatus", getCommunicationStatus())
.append("deviceId", getDeviceId()) .append("deviceId", getDeviceId())
.append("parentId", getParentId()) .append("parentId", getParentId())
.append("deviceCategory", getDeviceCategory())
.toString(); .toString();
} }
} }

View File

@ -22,8 +22,8 @@ public class EmsPcsData extends BaseEntity
private Long id; private Long id;
/** 数据更新时间 */ /** 数据更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date dataUpdateTime; private Date dataUpdateTime;
/** 工作状态 */ /** 工作状态 */

View File

@ -30,8 +30,8 @@ public class EmsSiteSetting extends BaseEntity
private String siteAddress; private String siteAddress;
/** 运营时间 */ /** 运营时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "运营时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "运营时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date runningTime; private Date runningTime;
/** 纬度 */ /** 纬度 */

View File

@ -0,0 +1,31 @@
package com.xzzn.ems.domain.vo;
import java.util.List;
/**
* 电表数据
*/
public class AmmeterDataResponse {
/** 总表信息 */
private AmmeterLoadDataVo ammeterLoadData;
/** 储能表信息 */
private AmmeterMeteDataVo ammeterMeteData;
public AmmeterLoadDataVo getAmmeterLoadData() {
return ammeterLoadData;
}
public void setAmmeterLoadDataVoList(AmmeterLoadDataVo ammeterLoadData) {
this.ammeterLoadData = ammeterLoadData;
}
public AmmeterMeteDataVo getAmmeterMeteData() {
return ammeterMeteData;
}
public void setAmmeterMeteDataVoList(AmmeterMeteDataVo ammeterMeteData) {
this.ammeterMeteData = ammeterMeteData;
}
}

View File

@ -6,9 +6,9 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* 电表数据 * 电表-总表数据
*/ */
public class AmmeterDataVo { public class AmmeterLoadDataVo {
/** 电表名称 */ /** 电表名称 */
private String deviceName; private String deviceName;
@ -20,7 +20,8 @@ public class AmmeterDataVo {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dataUpdateTime; private Date dataUpdateTime;
private List<AmmeterDataDetailInfo> ammeterDataDetailInfos; /** 总表数据信息 */
private List<LoadDataDetailInfo> loadDataDetailInfo;
public String getDeviceName() { public String getDeviceName() {
return deviceName; return deviceName;
@ -46,11 +47,11 @@ public class AmmeterDataVo {
this.dataUpdateTime = dataUpdateTime; this.dataUpdateTime = dataUpdateTime;
} }
public List<AmmeterDataDetailInfo> getAmmeterDataDetailInfos() { public List<LoadDataDetailInfo> getLoadDataDetailInfo() {
return ammeterDataDetailInfos; return loadDataDetailInfo;
} }
public void setAmmeterDataDetailInfos(List<AmmeterDataDetailInfo> ammeterDataDetailInfos) { public void setLoadDataDetailInfo(List<LoadDataDetailInfo> loadDataDetailInfo) {
this.ammeterDataDetailInfos = ammeterDataDetailInfos; this.loadDataDetailInfo = loadDataDetailInfo;
} }
} }

View File

@ -0,0 +1,57 @@
package com.xzzn.ems.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List;
/**
* 电表-总表数据
*/
public class AmmeterMeteDataVo {
/** 电表名称 */
private String deviceName;
/** 通信状态 */
private String emsCommunicationStatus;
/** 数据更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dataUpdateTime;
/** 储能表数据信息 */
private List<MeteDataDetailInfo> meteDataDetailInfo;
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getEmsCommunicationStatus() {
return emsCommunicationStatus;
}
public void setEmsCommunicationStatus(String emsCommunicationStatus) {
this.emsCommunicationStatus = emsCommunicationStatus;
}
public Date getDataUpdateTime() {
return dataUpdateTime;
}
public void setDataUpdateTime(Date dataUpdateTime) {
this.dataUpdateTime = dataUpdateTime;
}
public List<MeteDataDetailInfo> getMeteDataDetailInfo() {
return meteDataDetailInfo;
}
public void setMeteDataDetailInfo(List<MeteDataDetailInfo> meteDataDetailInfo) {
this.meteDataDetailInfo = meteDataDetailInfo;
}
}

View File

@ -57,51 +57,6 @@ public class BMSBatteryClusterVo {
/** 设备唯一标识符 */ /** 设备唯一标识符 */
private String deviceId; private String deviceId;
/** 单体温度平均值 */
private BigDecimal avgTemp;
/** 单体温度最小值 */
private BigDecimal minTemp;
/** 单体温度最小值ID */
private String minTempID;
/** 单体温度最大值 */
private BigDecimal maxTemp;
/** 单体温度最大值ID */
private String maxTempID;
/** 单体电压平均值 */
private BigDecimal avgVoltage;
/** 单体电压最小值 */
private BigDecimal minVoltage;
/** 单体电压最小值ID */
private String minVoltageID;
/** 单体电压最大值 */
private BigDecimal maxVoltage;
/** 单体电压最大值ID */
private String maxVoltageID;
/** 单体Soc平均值 */
private BigDecimal avgSoc;
/** 单体Soc最小值 */
private BigDecimal minSoc;
/** 单体Soc最小值ID */
private String minSocID;
/** 单体Soc最大值 */
private BigDecimal maxSoc;
/** 单体Soc最大值ID */
private String maxSocID;
private List<BMSBatteryClusterDataList> batteryDataList; private List<BMSBatteryClusterDataList> batteryDataList;
public String getDeviceName() { public String getDeviceName() {
@ -239,124 +194,4 @@ public class BMSBatteryClusterVo {
public void setBatteryDataList(List<BMSBatteryClusterDataList> batteryDataList) { public void setBatteryDataList(List<BMSBatteryClusterDataList> batteryDataList) {
this.batteryDataList = batteryDataList; this.batteryDataList = batteryDataList;
} }
public String getMaxSocID() {
return maxSocID;
}
public void setMaxSocID(String maxSocID) {
this.maxSocID = maxSocID;
}
public BigDecimal getMaxSoc() {
return maxSoc;
}
public void setMaxSoc(BigDecimal maxSoc) {
this.maxSoc = maxSoc;
}
public String getMinSocID() {
return minSocID;
}
public void setMinSocID(String minSocID) {
this.minSocID = minSocID;
}
public BigDecimal getMinSoc() {
return minSoc;
}
public void setMinSoc(BigDecimal minSoc) {
this.minSoc = minSoc;
}
public BigDecimal getAvgSoc() {
return avgSoc;
}
public void setAvgSoc(BigDecimal avgSoc) {
this.avgSoc = avgSoc;
}
public String getMaxVoltageID() {
return maxVoltageID;
}
public void setMaxVoltageID(String maxVoltageID) {
this.maxVoltageID = maxVoltageID;
}
public BigDecimal getMaxVoltage() {
return maxVoltage;
}
public void setMaxVoltage(BigDecimal maxVoltage) {
this.maxVoltage = maxVoltage;
}
public String getMinVoltageID() {
return minVoltageID;
}
public void setMinVoltageID(String minVoltageID) {
this.minVoltageID = minVoltageID;
}
public BigDecimal getMinVoltage() {
return minVoltage;
}
public void setMinVoltage(BigDecimal minVoltage) {
this.minVoltage = minVoltage;
}
public BigDecimal getAvgVoltage() {
return avgVoltage;
}
public void setAvgVoltage(BigDecimal avgVoltage) {
this.avgVoltage = avgVoltage;
}
public String getMaxTempID() {
return maxTempID;
}
public void setMaxTempID(String maxTempID) {
this.maxTempID = maxTempID;
}
public BigDecimal getMaxTemp() {
return maxTemp;
}
public void setMaxTemp(BigDecimal maxTemp) {
this.maxTemp = maxTemp;
}
public String getMinTempID() {
return minTempID;
}
public void setMinTempID(String minTempID) {
this.minTempID = minTempID;
}
public BigDecimal getMinTemp() {
return minTemp;
}
public void setMinTemp(BigDecimal minTemp) {
this.minTemp = minTemp;
}
public BigDecimal getAvgTemp() {
return avgTemp;
}
public void setAvgTemp(BigDecimal avgTemp) {
this.avgTemp = avgTemp;
}
} }

View File

@ -21,16 +21,16 @@ public class BMSBatteryDataList {
private BigDecimal currentSoc; private BigDecimal currentSoc;
/** 单体最高电压 (V) */ /** 单体最高电压 (V) */
private BigDecimal maxVoltage; private BigDecimal maxCellVoltage;
/** 单体最低电压 (V) */ /** 单体最低电压 (V) */
private BigDecimal minVoltage; private BigDecimal minCellVoltage;
/** 单体最高温度 (℃) */ /** 单体最高温度 (℃) */
private BigDecimal maxTemperature; private BigDecimal maxCellTemp;
/** 单体最低温度 (℃) */ /** 单体最低温度 (℃) */
private BigDecimal minTemperature; private BigDecimal minCellTemp;
/** 换电站id */ /** 换电站id */
private String siteId; private String siteId;
@ -46,36 +46,52 @@ public class BMSBatteryDataList {
this.clusterId = clusterId; this.clusterId = clusterId;
} }
public BigDecimal getMinTemperature() { public String getStackDeviceId() {
return minTemperature; return stackDeviceId;
} }
public void setMinTemperature(BigDecimal minTemperature) { public void setStackDeviceId(String stackDeviceId) {
this.minTemperature = minTemperature; this.stackDeviceId = stackDeviceId;
} }
public BigDecimal getMaxTemperature() { public String getSiteId() {
return maxTemperature; return siteId;
} }
public void setMaxTemperature(BigDecimal maxTemperature) { public void setSiteId(String siteId) {
this.maxTemperature = maxTemperature; this.siteId = siteId;
} }
public BigDecimal getMinVoltage() { public BigDecimal getMinCellTemp() {
return minVoltage; return minCellTemp;
} }
public void setMinVoltage(BigDecimal minVoltage) { public void setMinCellTemp(BigDecimal minCellTemp) {
this.minVoltage = minVoltage; this.minCellTemp = minCellTemp;
} }
public BigDecimal getMaxVoltage() { public BigDecimal getMaxCellTemp() {
return maxVoltage; return maxCellTemp;
} }
public void setMaxVoltage(BigDecimal maxVoltage) { public void setMaxCellTemp(BigDecimal maxCellTemp) {
this.maxVoltage = maxVoltage; this.maxCellTemp = maxCellTemp;
}
public BigDecimal getMinCellVoltage() {
return minCellVoltage;
}
public void setMinCellVoltage(BigDecimal minCellVoltage) {
this.minCellVoltage = minCellVoltage;
}
public BigDecimal getMaxCellVoltage() {
return maxCellVoltage;
}
public void setMaxCellVoltage(BigDecimal maxCellVoltage) {
this.maxCellVoltage = maxCellVoltage;
} }
public BigDecimal getCurrentSoc() { public BigDecimal getCurrentSoc() {

View File

@ -22,34 +22,34 @@ public class BMSOverViewVo {
private String emsCommunicationStatus; private String emsCommunicationStatus;
/** 电池堆总电压 (V) */ /** 电池堆总电压 (V) */
private BigDecimal totalVoltage; private BigDecimal stackVoltage;
/** 可充电量 (kWh) */ /** 可充电量 (kWh) */
private BigDecimal chargeableCapacity; private BigDecimal availableChargeCapacity;
/** 累计充电量 (kWh) */ /** 累计充电量 (kWh) */
private BigDecimal totalChargedCapacity; private BigDecimal totalChargeCapacity;
/** 电池堆总电流 (A) */ /** 电池堆总电流 (A) */
private BigDecimal totalCurrent; private BigDecimal stackCurrent;
/** 可放电量 (kWh) */ /** 可放电量 (kWh) */
private BigDecimal dischargeableCapacity; private BigDecimal availableDischargeCapacity;
/** 累计放电量 (kWh) */ /** 累计放电量 (kWh) */
private BigDecimal totalDischargedCapacity; private BigDecimal totalDischargeCapacity;
/** SOH (%) */ /** SOH (%) */
private BigDecimal soh; private BigDecimal stackSoh;
/** 平均温度 (℃) */ /** 平均温度 (℃) */
private BigDecimal averageTemperature; private BigDecimal operatingTemp;
/** 绝缘电阻 (Ω) */ /** 绝缘电阻 (Ω) */
private BigDecimal insulationResistance; private BigDecimal stackInsulationResistance;
/** 当前SOC (%) */ /** 当前SOC (%) */
private BigDecimal currentSoc; private BigDecimal stackSoc;
/** 站点id */ /** 站点id */
private String siteId; private String siteId;
@ -91,92 +91,84 @@ public class BMSOverViewVo {
this.emsCommunicationStatus = emsCommunicationStatus; this.emsCommunicationStatus = emsCommunicationStatus;
} }
public BigDecimal getTotalVoltage() { public BigDecimal getStackVoltage() {
return totalVoltage; return stackVoltage;
} }
public void setTotalVoltage(BigDecimal totalVoltage) { public void setStackVoltage(BigDecimal stackVoltage) {
this.totalVoltage = totalVoltage; this.stackVoltage = stackVoltage;
} }
public BigDecimal getChargeableCapacity() { public BigDecimal getAvailableChargeCapacity() {
return chargeableCapacity; return availableChargeCapacity;
} }
public void setChargeableCapacity(BigDecimal chargeableCapacity) { public void setAvailableChargeCapacity(BigDecimal availableChargeCapacity) {
this.chargeableCapacity = chargeableCapacity; this.availableChargeCapacity = availableChargeCapacity;
} }
public BigDecimal getTotalChargedCapacity() { public BigDecimal getTotalChargeCapacity() {
return totalChargedCapacity; return totalChargeCapacity;
} }
public void setTotalChargedCapacity(BigDecimal totalChargedCapacity) { public void setTotalChargeCapacity(BigDecimal totalChargeCapacity) {
this.totalChargedCapacity = totalChargedCapacity; this.totalChargeCapacity = totalChargeCapacity;
} }
public BigDecimal getTotalCurrent() { public BigDecimal getStackCurrent() {
return totalCurrent; return stackCurrent;
} }
public void setTotalCurrent(BigDecimal totalCurrent) { public void setStackCurrent(BigDecimal stackCurrent) {
this.totalCurrent = totalCurrent; this.stackCurrent = stackCurrent;
} }
public BigDecimal getDischargeableCapacity() { public BigDecimal getAvailableDischargeCapacity() {
return dischargeableCapacity; return availableDischargeCapacity;
} }
public void setDischargeableCapacity(BigDecimal dischargeableCapacity) { public void setAvailableDischargeCapacity(BigDecimal availableDischargeCapacity) {
this.dischargeableCapacity = dischargeableCapacity; this.availableDischargeCapacity = availableDischargeCapacity;
} }
public BigDecimal getTotalDischargedCapacity() { public BigDecimal getTotalDischargeCapacity() {
return totalDischargedCapacity; return totalDischargeCapacity;
} }
public void setTotalDischargedCapacity(BigDecimal totalDischargedCapacity) { public void setTotalDischargeCapacity(BigDecimal totalDischargeCapacity) {
this.totalDischargedCapacity = totalDischargedCapacity; this.totalDischargeCapacity = totalDischargeCapacity;
} }
public BigDecimal getSoh() { public BigDecimal getStackSoh() {
return soh; return stackSoh;
} }
public void setSoh(BigDecimal soh) { public void setStackSoh(BigDecimal stackSoh) {
this.soh = soh; this.stackSoh = stackSoh;
} }
public BigDecimal getAverageTemperature() { public BigDecimal getOperatingTemp() {
return averageTemperature; return operatingTemp;
} }
public void setAverageTemperature(BigDecimal averageTemperature) { public void setOperatingTemp(BigDecimal operatingTemp) {
this.averageTemperature = averageTemperature; this.operatingTemp = operatingTemp;
} }
public BigDecimal getInsulationResistance() { public BigDecimal getStackInsulationResistance() {
return insulationResistance; return stackInsulationResistance;
} }
public void setInsulationResistance(BigDecimal insulationResistance) { public void setStackInsulationResistance(BigDecimal stackInsulationResistance) {
this.insulationResistance = insulationResistance; this.stackInsulationResistance = stackInsulationResistance;
} }
public BigDecimal getCurrentSoc() { public BigDecimal getStackSoc() {
return currentSoc; return stackSoc;
} }
public void setCurrentSoc(BigDecimal currentSoc) { public void setStackSoc(BigDecimal stackSoc) {
this.currentSoc = currentSoc; this.stackSoc = stackSoc;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
} }
public String getSiteId() { public String getSiteId() {
@ -187,6 +179,14 @@ public class BMSOverViewVo {
this.siteId = siteId; this.siteId = siteId;
} }
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<BMSBatteryDataList> getBatteryDataList() { public List<BMSBatteryDataList> getBatteryDataList() {
return batteryDataList; return batteryDataList;
} }

View File

@ -1,6 +1,7 @@
package com.xzzn.ems.domain.vo; package com.xzzn.ems.domain.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 实时运行-电池平均SOC数据 * 实时运行-电池平均SOC数据
@ -8,26 +9,21 @@ import java.math.BigDecimal;
*/ */
public class BatteryAveSOCVo { public class BatteryAveSOCVo {
/** /**
* 月份 月+日 * 数据时间
*/ */
private String monthDay; private Date createDate;
/** /**
* 实时SOC * 实时SOC
*/ */
private BigDecimal batterySOC; private BigDecimal batterySOC;
/** public Date getCreateDate() {
* 昨日SOC return createDate;
*/
private BigDecimal ytdBatterySOC;
public String getMonthDay() {
return monthDay;
} }
public void setMonthDay(String monthDay) { public void setCreateDate(Date createDate) {
this.monthDay = monthDay; this.createDate = createDate;
} }
public BigDecimal getBatterySOC() { public BigDecimal getBatterySOC() {
@ -37,12 +33,4 @@ public class BatteryAveSOCVo {
public void setBatterySOC(BigDecimal batterySOC) { public void setBatterySOC(BigDecimal batterySOC) {
this.batterySOC = batterySOC; this.batterySOC = batterySOC;
} }
public BigDecimal getYtdBatterySOC() {
return ytdBatterySOC;
}
public void setYtdBatterySOC(BigDecimal ytdBatterySOC) {
this.ytdBatterySOC = ytdBatterySOC;
}
} }

View File

@ -1,6 +1,7 @@
package com.xzzn.ems.domain.vo; package com.xzzn.ems.domain.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 实时运行-电池平均温度数据 * 实时运行-电池平均温度数据
@ -8,27 +9,21 @@ import java.math.BigDecimal;
*/ */
public class BatteryAveTempVo { public class BatteryAveTempVo {
/** /**
* 月份 月+日 * 数据时间
*/ */
private String monthDay; private Date createDate;
/** /**
* 实时温度 * 实时温度
*/ */
private BigDecimal batteryTemp; private BigDecimal batteryTemp;
/** public Date getCreateDate() {
* 昨日温度 return createDate;
*/
private BigDecimal batteryYtdTemp;
public String getMonthDay() {
return monthDay;
} }
public void setMonthDay(String monthDay) { public void setCreateDate(Date createDate) {
this.monthDay = monthDay; this.createDate = createDate;
} }
public BigDecimal getBatteryTemp() { public BigDecimal getBatteryTemp() {
@ -38,12 +33,4 @@ public class BatteryAveTempVo {
public void setBatteryTemp(BigDecimal batteryTemp) { public void setBatteryTemp(BigDecimal batteryTemp) {
this.batteryTemp = batteryTemp; this.batteryTemp = batteryTemp;
} }
public BigDecimal getBatteryYtdTemp() {
return batteryYtdTemp;
}
public void setBatteryYtdTemp(BigDecimal batteryYtdTemp) {
this.batteryYtdTemp = batteryYtdTemp;
}
} }

View File

@ -1,5 +1,6 @@
package com.xzzn.ems.domain.vo; package com.xzzn.ems.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -24,7 +25,8 @@ public class BatteryDataStatsListVo {
/** SOH (%) */ /** SOH (%) */
private BigDecimal soh; private BigDecimal soh;
private Date updateTime; @JsonFormat(pattern = "yyyy-MM-dd")
private Date dataTimestamp;
/** 簇号 */ /** 簇号 */
private String clusterDeviceId; private String clusterDeviceId;
@ -69,12 +71,12 @@ public class BatteryDataStatsListVo {
this.soh = soh; this.soh = soh;
} }
public Date getUpdateTime() { public Date getDataTimestamp() {
return updateTime; return dataTimestamp;
} }
public void setUpdateTime(Date updateTime) { public void setDataTimestamp(Date dataTimestamp) {
this.updateTime = updateTime; this.dataTimestamp = dataTimestamp;
} }
public String getClusterDeviceId() { public String getClusterDeviceId() {

View File

@ -9,6 +9,11 @@ import java.util.List;
*/ */
public class ElectricDataInfoVo { public class ElectricDataInfoVo {
/**
* 显示时间单位
*/
private String unit;
/** /**
* 总充电量 * 总充电量
*/ */
@ -29,6 +34,14 @@ public class ElectricDataInfoVo {
*/ */
private List<SiteMonitorDataVo> sevenDayDisChargeStats; private List<SiteMonitorDataVo> sevenDayDisChargeStats;
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public BigDecimal getTotalChargedCap() { public BigDecimal getTotalChargedCap() {
return totalChargedCap; return totalChargedCap;
} }

View File

@ -1,6 +1,7 @@
package com.xzzn.ems.domain.vo; package com.xzzn.ems.domain.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 实时运行-储能功率数据 * 实时运行-储能功率数据
@ -8,9 +9,9 @@ import java.math.BigDecimal;
*/ */
public class EnergyStoragePowVo { public class EnergyStoragePowVo {
/** /**
* 月份 月+日 * 显示日期
*/ */
private String monthDay; private Date createDate;
/** /**
* pcs实时有功功率 * pcs实时有功功率
@ -22,22 +23,13 @@ public class EnergyStoragePowVo {
*/ */
private BigDecimal pcsTotalReactivePower; private BigDecimal pcsTotalReactivePower;
/**
* pcs昨日有功功率
*/
private BigDecimal pcsYtdActPower;
/** public Date getCreateDate() {
* pcs昨日无功功率 return createDate;
*/
private BigDecimal pcsYtdReactivePower;
public String getMonthDay() {
return monthDay;
} }
public void setMonthDay(String monthDay) { public void setCreateDate(Date createDate) {
this.monthDay = monthDay; this.createDate = createDate;
} }
public BigDecimal getPcsTotalActPower() { public BigDecimal getPcsTotalActPower() {
@ -55,20 +47,4 @@ public class EnergyStoragePowVo {
public void setPcsTotalReactivePower(BigDecimal pcsTotalReactivePower) { public void setPcsTotalReactivePower(BigDecimal pcsTotalReactivePower) {
this.pcsTotalReactivePower = pcsTotalReactivePower; this.pcsTotalReactivePower = pcsTotalReactivePower;
} }
public BigDecimal getPcsYtdActPower() {
return pcsYtdActPower;
}
public void setPcsYtdActPower(BigDecimal pcsYtdActPower) {
this.pcsYtdActPower = pcsYtdActPower;
}
public BigDecimal getPcsYtdReactivePower() {
return pcsYtdReactivePower;
}
public void setPcsYtdReactivePower(BigDecimal pcsYtdReactivePower) {
this.pcsYtdReactivePower = pcsYtdReactivePower;
}
} }

View File

@ -1,36 +1,30 @@
package com.xzzn.ems.domain.vo; package com.xzzn.ems.domain.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 电表详细数据 * 电表-总表数据展示
*/ */
public class AmmeterDataDetailInfo public class LoadDataDetailInfo
{ {
/** 类别 */ /** 类别 */
private String category; private String category;
/** 总 (kWh) */ /** 总 (kWh) */
private BigDecimal totalKwh; private BigDecimal totalKwh = BigDecimal.ZERO;
/** 尖 (kWh) */ /** 尖 (kWh) */
private BigDecimal sharpKwh; private BigDecimal peakKwh = BigDecimal.ZERO;
/** 峰 (kWh) */ /** 峰 (kWh) */
private BigDecimal peakKwh; private BigDecimal highKwh = BigDecimal.ZERO;
/** 平 (kWh) */ /** 平 (kWh) */
private BigDecimal flatKwh; private BigDecimal flatKwh = BigDecimal.ZERO;
/** 谷 (kWh) */ /** 谷 (kWh) */
private BigDecimal valleyKwh; private BigDecimal valleyKwh = BigDecimal.ZERO;
/** 总表设备Id */
private String deviceId;
/** 数据更新时间 */
private Date updateTime;
public BigDecimal getValleyKwh() { public BigDecimal getValleyKwh() {
return valleyKwh; return valleyKwh;
@ -56,12 +50,12 @@ public class AmmeterDataDetailInfo
this.peakKwh = peakKwh; this.peakKwh = peakKwh;
} }
public BigDecimal getSharpKwh() { public BigDecimal getHighKwh() {
return sharpKwh; return highKwh;
} }
public void setSharpKwh(BigDecimal sharpKwh) { public void setHighKwh(BigDecimal highKwh) {
this.sharpKwh = sharpKwh; this.highKwh = highKwh;
} }
public BigDecimal getTotalKwh() { public BigDecimal getTotalKwh() {
@ -79,20 +73,4 @@ public class AmmeterDataDetailInfo
public void setCategory(String category) { public void setCategory(String category) {
this.category = category; this.category = category;
} }
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
} }

View File

@ -0,0 +1,42 @@
package com.xzzn.ems.domain.vo;
import java.math.BigDecimal;
/**
* 电表-储能表数据展示
*/
public class MeteDataDetailInfo
{
/** 类别A相 B相 C相*/
private String category;
/** 有功功率 */
private BigDecimal activePower = BigDecimal.ZERO;
/** 无功功率 */
private BigDecimal reactivePower = BigDecimal.ZERO;
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public BigDecimal getActivePower() {
return activePower;
}
public void setActivePower(BigDecimal activePower) {
this.activePower = activePower;
}
public BigDecimal getReactivePower() {
return reactivePower;
}
public void setReactivePower(BigDecimal reactivePower) {
this.reactivePower = reactivePower;
}
}

View File

@ -1,6 +1,7 @@
package com.xzzn.ems.domain.vo; package com.xzzn.ems.domain.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 实时运行-pcs平均温度数据 * 实时运行-pcs平均温度数据
@ -8,26 +9,22 @@ import java.math.BigDecimal;
*/ */
public class PCSAveTempVo { public class PCSAveTempVo {
/** /**
* 月份 月+日 * 数据时间
*/ */
private String monthDay; private Date createDate;
/** /**
* 实时温度 * 实时温度
*/ */
private BigDecimal pcsTemp; private BigDecimal pcsTemp;
/**
* 昨日同时段温度(到分)
*/
private BigDecimal pcsYtdTemp;
public String getMonthDay() { public Date getCreateDate() {
return monthDay; return createDate;
} }
public void setMonthDay(String monthDay) { public void setCreateDate(Date createDate) {
this.monthDay = monthDay; this.createDate = createDate;
} }
public BigDecimal getPcsTemp() { public BigDecimal getPcsTemp() {
@ -37,12 +34,4 @@ public class PCSAveTempVo {
public void setPcsTemp(BigDecimal pcsTemp) { public void setPcsTemp(BigDecimal pcsTemp) {
this.pcsTemp = pcsTemp; this.pcsTemp = pcsTemp;
} }
public BigDecimal getPcsYtdTemp() {
return pcsYtdTemp;
}
public void setPcsYtdTemp(BigDecimal pcsYtdTemp) {
this.pcsYtdTemp = pcsYtdTemp;
}
} }

View File

@ -31,7 +31,7 @@ public class PcsBranchInfo
private String deviceId; private String deviceId;
/** 支路id */ /** 支路id */
private Long branchId; private String branchId;
public String getDischargeStatus() { public String getDischargeStatus() {
return dischargeStatus; return dischargeStatus;
@ -81,11 +81,11 @@ public class PcsBranchInfo
this.deviceId = deviceId; this.deviceId = deviceId;
} }
public Long getBranchId() { public String getBranchId() {
return branchId; return branchId;
} }
public void setBranchId(Long branchId) { public void setBranchId(String branchId) {
this.branchId = branchId; this.branchId = branchId;
} }
} }

View File

@ -51,12 +51,12 @@ public class SingleSiteBaseInfo {
/** /**
* 装机功率MW * 装机功率MW
*/ */
private BigDecimal installedPower; private BigDecimal installPower;
/** /**
* 装机容量MW * 装机容量MW
*/ */
private BigDecimal installedCap; private BigDecimal installCapacity;
/** /**
* 七天放电统计 * 七天放电统计
@ -79,20 +79,20 @@ public class SingleSiteBaseInfo {
this.dayChargedCap = dayChargedCap; this.dayChargedCap = dayChargedCap;
} }
public BigDecimal getInstalledCap() { public BigDecimal getInstallPower() {
return installedCap; return installPower;
} }
public void setInstalledCap(BigDecimal installedCap) { public void setInstallPower(BigDecimal installPower) {
this.installedCap = installedCap; this.installPower = installPower;
} }
public BigDecimal getInstalledPower() { public BigDecimal getInstallCapacity() {
return installedPower; return installCapacity;
} }
public void setInstalledPower(BigDecimal installedPower) { public void setInstallCapacity(BigDecimal installCapacity) {
this.installedPower = installedPower; this.installCapacity = installCapacity;
} }
public String getRunningTime() { public String getRunningTime() {

View File

@ -0,0 +1,68 @@
package com.xzzn.ems.domain.vo;
/**
* 站点管理-站点设备列表
*
*/
public class SiteDeviceListVo {
/** 站点id */
private String siteId;
/** 站点名称 */
private String siteName;
/** 设备id */
private String deviceId;
/** 设备名称 */
private String deviceName;
/** 设备类型 */
private String deviceType;
/** 通信状态 */
private String communicationStatus;
public String getSiteId() {
return siteId;
}
public void setSiteId(String siteId) {
this.siteId = siteId;
}
public String getSiteName() {
return siteName;
}
public void setSiteName(String siteName) {
this.siteName = siteName;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getCommunicationStatus() {
return communicationStatus;
}
public void setCommunicationStatus(String communicationStatus) {
this.communicationStatus = communicationStatus;
}
}

View File

@ -2,14 +2,12 @@ package com.xzzn.ems.mapper;
import java.util.List; import java.util.List;
import com.xzzn.ems.domain.EmsAmmeterData; import com.xzzn.ems.domain.EmsAmmeterData;
import com.xzzn.ems.domain.vo.AmmeterDataDetailInfo;
import org.apache.ibatis.annotations.Param;
/** /**
* 总数据Mapper接口 * 总数据Mapper接口
* *
* @author xzzn * @author xzzn
* @date 2025-06-27 * @date 2025-07-03
*/ */
public interface EmsAmmeterDataMapper public interface EmsAmmeterDataMapper
{ {
@ -60,11 +58,4 @@ public interface EmsAmmeterDataMapper
* @return 结果 * @return 结果
*/ */
public int deleteEmsAmmeterDataByIds(Long[] ids); public int deleteEmsAmmeterDataByIds(Long[] ids);
/**
* 获取总表详细数据
* @param siteId
* @return
*/
public List<AmmeterDataDetailInfo> getAmmeterDetailInfo(@Param("siteId")String siteId,@Param("deviceId") String deviceId);
} }

View File

@ -2,7 +2,6 @@ package com.xzzn.ems.mapper;
import java.util.List; import java.util.List;
import com.xzzn.ems.domain.EmsBatteryCluster; import com.xzzn.ems.domain.EmsBatteryCluster;
import com.xzzn.ems.domain.vo.BMSBatteryClusterVo;
import com.xzzn.ems.domain.vo.BMSBatteryDataList; import com.xzzn.ems.domain.vo.BMSBatteryDataList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -62,13 +61,6 @@ public interface EmsBatteryClusterMapper
*/ */
public int deleteEmsBatteryClusterByIds(Long[] ids); public int deleteEmsBatteryClusterByIds(Long[] ids);
/**
* 根据site_id获取电池簇数据
* @param siteId
* @return
*/
public List<BMSBatteryClusterVo> getBMSBatteryCluster(String siteId);
/** /**
* 根据site_di和堆id获取簇数据和单体数据 * 根据site_di和堆id获取簇数据和单体数据
* @param siteId * @param siteId

View File

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.xzzn.ems.domain.EmsDevicesSetting; import com.xzzn.ems.domain.EmsDevicesSetting;
import org.apache.ibatis.annotations.Param;
/** /**
* Modbus设备配置Mapper接口 * Modbus设备配置Mapper接口
@ -60,24 +61,31 @@ public interface EmsDevicesSettingMapper
* @return 结果 * @return 结果
*/ */
public int deleteEmsDevicesSettingByIds(Long[] ids); public int deleteEmsDevicesSettingByIds(Long[] ids);
/** /**
* 根据site_id获取所有电池堆 * 根据父类设备id获取子设备id
* @param siteId * @param parentId
* @return * @return
*/ */
public List<Map<String, Object>> getAllStackInfoBySiteId(String siteId); public List<Map<String, Object>> getDeviceInfoByParentId(String parentId);
/**
* 根据电池堆id获取所有电池簇
* @param stackDeviceId
* @return
*/
public List<Map<String, Object>> getAllClusterInfoByStackId(String stackDeviceId);
/** /**
* 获取该设备下的所有电表 * 获取该设备下的所有电表
* @param siteId * @param siteId
* @return * @return
*/ */
public List<EmsDevicesSetting> getAllBatteryDeviceBySiteId(String siteId); public List<EmsDevicesSetting> getAllBatteryDeviceBySiteId(String siteId);
/**
* 根据site_id和device_category获取指定设备信息
* @param siteId
* @param deviceCategory
* @return
*/
public List<Map<String, Object>> getDeviceInfosBySiteIdAndCategory(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory);
/**
* 获取该设备的详细数据
* @param deviceId
* @return
*/
public EmsDevicesSetting getDeviceDetailInfo(String deviceId);
} }

View File

@ -100,8 +100,48 @@ public interface EmsPcsDataMapper
/** /**
* 根据时间按天获取充放电量 * 根据时间按天获取充放电量
* @param requestVo * @param siteId
* @param startDate
* @param endDate
* @return * @return
*/ */
public List<SiteMonitorDataVo> getPcsDataByDate(DateSearchRequest requestVo); public List<SiteMonitorDataVo> getPcsDataByDay(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
/**
* 根据时间按月获取充放电量
* @param siteId
* @param startDate
* @param endDate
* @return
*/
public List<SiteMonitorDataVo> getPcsDataByMonth(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
/**
* 根据时间按小时获取充放电量
* @param siteId
* @param startDate
* @param endDate
* @return
*/
public List<SiteMonitorDataVo> getPcsDataByHour(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
/**
* 获取实时运行-储能功率
* @param siteId
* @param startDate
* @param endDate
* @return
*/
public List<EnergyStoragePowVo> getStoragePowerList(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
/**
* 获取实时运行-pcs平均温度
* @param siteId
* @param startDate
* @param endDate
* @return
*/
public List<PCSAveTempVo> getPcsAveTempList(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
public List<BatteryAveSOCVo> getAveSocList(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
public List<BatteryAveTempVo> getBatteryAveTempList(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
} }

View File

@ -2,7 +2,9 @@ package com.xzzn.ems.mapper;
import java.util.List; import java.util.List;
import com.xzzn.ems.domain.EmsSiteSetting; import com.xzzn.ems.domain.EmsSiteSetting;
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
import com.xzzn.ems.domain.vo.SiteTotalInfoVo; import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
import org.apache.ibatis.annotations.Param;
/** /**
* 站点Mapper接口 * 站点Mapper接口
@ -72,4 +74,20 @@ public interface EmsSiteSettingMapper
* @return * @return
*/ */
public EmsSiteSetting selectEmsSiteSettingBySiteId(String siteId); public EmsSiteSetting selectEmsSiteSettingBySiteId(String siteId);
/**
* 根据站点名称和投运时间获取站点列表
* @param siteName
* @param startTime
* @param endTime
* @return
*/
public List<EmsSiteSetting> getSiteInfoList(@Param("siteName")String siteName, @Param("startTime")String startTime, @Param("endTime")String endTime);
/**
* 获取站点的设备列表
* @return
*/
public List<SiteDeviceListVo> getAllSiteDeviceList(String siteId);
} }

View File

@ -0,0 +1,13 @@
package com.xzzn.ems.service;
import com.xzzn.ems.domain.EmsDevicesSetting;
/**
* 设备信息 服务层
*
*/
public interface IEmsDeviceSettingService
{
public EmsDevicesSetting getDeviceDetailInfo(String deviceId);
}

View File

@ -1,6 +1,7 @@
package com.xzzn.ems.service; package com.xzzn.ems.service;
import com.xzzn.ems.domain.EmsSiteSetting; import com.xzzn.ems.domain.EmsSiteSetting;
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
import com.xzzn.ems.domain.vo.SiteTotalInfoVo; import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
import java.util.List; import java.util.List;
@ -22,5 +23,7 @@ public interface IEmsSiteService
public List<Map<String,Object>> getAllClusterInfo(String stackDeviceId); public List<Map<String,Object>> getAllClusterInfo(String stackDeviceId);
public List<EmsSiteSetting> getAllSiteInfoList(String siteName, String startTime, String endTime);
public List<SiteDeviceListVo> getAllDeviceList(String siteId);
} }

View File

@ -29,5 +29,5 @@ public interface ISingleSiteService
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId); public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId);
public List<AmmeterDataVo> getAmmeterDataList(String siteId); public AmmeterDataResponse getAmmeterDataList(String siteId);
} }

View File

@ -0,0 +1,28 @@
package com.xzzn.ems.service.impl;
import com.xzzn.ems.domain.EmsDevicesSetting;
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
import com.xzzn.ems.service.IEmsDeviceSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 站点信息 服务层实现
*
*/
@Service
public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService
{
@Autowired
private EmsDevicesSettingMapper emsDevicesMapper;
/**
* 获取设备详细信息
* @param deviceId
* @return
*/
@Override
public EmsDevicesSetting getDeviceDetailInfo(String deviceId) {
return emsDevicesMapper.getDeviceDetailInfo(deviceId);
}
}

View File

@ -1,6 +1,8 @@
package com.xzzn.ems.service.impl; package com.xzzn.ems.service.impl;
import com.xzzn.common.enums.DeviceCategory;
import com.xzzn.ems.domain.EmsSiteSetting; import com.xzzn.ems.domain.EmsSiteSetting;
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
import com.xzzn.ems.domain.vo.SiteTotalInfoVo; import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
import com.xzzn.ems.mapper.EmsDevicesSettingMapper; import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
import com.xzzn.ems.mapper.EmsSiteSettingMapper; import com.xzzn.ems.mapper.EmsSiteSettingMapper;
@ -41,17 +43,39 @@ public class EmsSiteServiceImpl implements IEmsSiteService
*/ */
@Override @Override
public List<Map<String, Object>> getAllStackInfo(String siteId) { public List<Map<String, Object>> getAllStackInfo(String siteId) {
return emsDevicesMapper.getAllStackInfoBySiteId(siteId); return emsDevicesMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.STACK.getCode());
} }
/** /**
* 根据电池堆Id获取电池簇 * 根据父类设备id获取子设备id
* @param stackDeviceId * @param parentId
* @return * @return
*/ */
@Override @Override
public List<Map<String, Object>> getAllClusterInfo(String stackDeviceId) { public List<Map<String, Object>> getAllClusterInfo(String parentId) {
return emsDevicesMapper.getAllClusterInfoByStackId(stackDeviceId); return emsDevicesMapper.getDeviceInfoByParentId(parentId);
} }
/**
* 获取站点列表
* @param siteName
* @param startTime
* @param endTime
* @return
*/
@Override
public List<EmsSiteSetting> getAllSiteInfoList(String siteName, String startTime, String endTime) {
return emsSiteMapper.getSiteInfoList(siteName,startTime,endTime);
}
/**
* 获取设备列表
*
* @param siteId
* @return
*/
@Override
public List<SiteDeviceListVo> getAllDeviceList(String siteId) {
return emsSiteMapper.getAllSiteDeviceList(siteId);
}
} }

View File

@ -1,16 +1,22 @@
package com.xzzn.ems.service.impl; package com.xzzn.ems.service.impl;
import com.xzzn.common.utils.DateUtils;
import com.xzzn.ems.domain.vo.DateSearchRequest; import com.xzzn.ems.domain.vo.DateSearchRequest;
import com.xzzn.ems.domain.vo.ElectricDataInfoVo; import com.xzzn.ems.domain.vo.ElectricDataInfoVo;
import com.xzzn.ems.domain.vo.SiteMonitorDataVo; import com.xzzn.ems.domain.vo.SiteMonitorDataVo;
import com.xzzn.ems.mapper.EmsPcsDataMapper; import com.xzzn.ems.mapper.EmsPcsDataMapper;
import com.xzzn.ems.service.IEmsStatsReportService; import com.xzzn.ems.service.IEmsStatsReportService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -23,6 +29,8 @@ import java.util.List;
public class EmsStatsReportServiceImpl implements IEmsStatsReportService public class EmsStatsReportServiceImpl implements IEmsStatsReportService
{ {
private static final Logger log = LoggerFactory.getLogger(EmsStatsReportServiceImpl.class);
@Autowired @Autowired
private EmsPcsDataMapper emsPcsDataMapper; private EmsPcsDataMapper emsPcsDataMapper;
@ -30,8 +38,34 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
public ElectricDataInfoVo getElectricDataResult(DateSearchRequest requestVo) { public ElectricDataInfoVo getElectricDataResult(DateSearchRequest requestVo) {
ElectricDataInfoVo electricDataInfoVo = new ElectricDataInfoVo(); ElectricDataInfoVo electricDataInfoVo = new ElectricDataInfoVo();
Date startDate = requestVo.getStartDate();
Date endDate = requestVo.getEndDate();
if (startDate == null && endDate == null) {
// 如果没有传时间默认从今天往前7天
LocalDate sevenDaysAgo = LocalDate.now().minusDays(6);
startDate = DateUtils.toDate(sevenDaysAgo);
endDate = new Date();
}
List<SiteMonitorDataVo> dataList = new ArrayList();
// 开始日期和结束日期同一天,展示 0-24 小时数据
if (DateUtils.isSameDay(startDate, endDate)){
electricDataInfoVo.setUnit("");
endDate = DateUtils.addDays(endDate, 1);
dataList = emsPcsDataMapper.getPcsDataByHour(requestVo.getSiteId(), startDate, endDate);
} else if (DateUtils.differentDaysByMillisecond(endDate, startDate) >= 1
&& DateUtils.differentDaysByMillisecond(endDate, startDate) < 30){
electricDataInfoVo.setUnit("");
endDate = DateUtils.addDays(endDate, 1);
// 开始日期-结束日期大于 1 天小于30 天,按天展示数据
dataList = emsPcsDataMapper.getPcsDataByDay(requestVo.getSiteId(), startDate, endDate);
} else if (DateUtils.differentDaysByMillisecond(endDate, startDate) >= 30){
electricDataInfoVo.setUnit("");
endDate = DateUtils.addDays(endDate, 1);
// 开始日期-结束日期大于 1 个月,按月展示数据
dataList = emsPcsDataMapper.getPcsDataByMonth(requestVo.getSiteId(), startDate, endDate);
}
// 根据时间获取每天的充放电量 // 根据时间获取每天的充放电量
List<SiteMonitorDataVo> dataList = emsPcsDataMapper.getPcsDataByDate(requestVo);
if (!CollectionUtils.isEmpty(dataList)){ if (!CollectionUtils.isEmpty(dataList)){
// 总充、总放、效率 // 总充、总放、效率
BigDecimal totalDischarge = new BigDecimal(0); BigDecimal totalDischarge = new BigDecimal(0);

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference; import com.alibaba.fastjson2.TypeReference;
import com.xzzn.common.constant.RedisKeyConstants;
import com.xzzn.common.core.redis.RedisCache; import com.xzzn.common.core.redis.RedisCache;
import com.xzzn.common.enums.*; import com.xzzn.common.enums.*;
import com.xzzn.common.utils.DateUtils; import com.xzzn.common.utils.DateUtils;
@ -16,13 +17,12 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
@Service @Service
public class FXXDataProcessServiceImpl implements IFXXDataProcessService { public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
private static final Log log = LogFactory.getLog(FXXDataProcessServiceImpl.class); private static final Log log = LogFactory.getLog(FXXDataProcessServiceImpl.class);
private static final String SITE_ID = "021_FXX_01";
@Autowired @Autowired
private EmsBatteryClusterMapper emsBatteryClusterMapper; private EmsBatteryClusterMapper emsBatteryClusterMapper;
@ -41,6 +41,11 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired
private EmsDevicesSettingMapper emsDevicesSettingMapper;
@Autowired
private EmsAmmeterDataMapper emsAmmeterDataMapper;;
@Override @Override
public void handleFxData(String message) { public void handleFxData(String message) {
@ -58,15 +63,20 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
} else if (deviceId.contains("BMSC")) { } else if (deviceId.contains("BMSC")) {
log.info("BMSC data:"+ jsonData); log.info("BMSC data:"+ jsonData);
batteryCluserDataProcess(deviceId, jsonData); batteryClusterDataProcess(deviceId, jsonData);
batteryDataProcess(deviceId, jsonData); batteryDataProcess(deviceId, jsonData);
} else if (deviceId.contains("PCS")) { } else if (deviceId.contains("PCS")) {
pcsDataProcess(deviceId, jsonData); pcsDataProcess(deviceId, jsonData);
pcsBranchDataProcess(deviceId, jsonData); pcsBranchDataProcess(deviceId, jsonData);
} else if (deviceId.contains("LOAD")) {
loadDataProcess(deviceId, jsonData);
} else if (deviceId.contains("METE")) {
meteDataProcess(deviceId, jsonData);
} }
} }
} }
private void batteryStackDataProcess(String deviceId, String dataJson) { private void batteryStackDataProcess(String deviceId, String dataJson) {
//电池堆 //电池堆
@ -75,70 +85,93 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
//BMS 电池簇 //BMS 电池簇
EmsBatteryStack dataStack = new EmsBatteryStack(); EmsBatteryStack dataStack = new EmsBatteryStack();
// 设置所有 BigDecimal 类型字段为 ZERO
dataStack.setChargeableCapacity(StringUtils.getBigDecimal(obj.get("KCDL")));
dataStack.setTotalChargedCapacity(StringUtils.getBigDecimal(obj.get("LJCDDL")));
dataStack.setDischargeableCapacity(StringUtils.getBigDecimal(obj.get("KFDL")));
dataStack.setTotalDischargedCapacity(StringUtils.getBigDecimal(obj.get("LJFDDL")));
dataStack.setSoh(StringUtils.getBigDecimal(obj.get("ZSOH")));
dataStack.setAverageTemperature(StringUtils.getBigDecimal(obj.get("MKWD")));
dataStack.setInsulationResistance(StringUtils.getBigDecimal(obj.get("ZJYDZ")));
dataStack.setCurrentSoc(StringUtils.getBigDecimal(obj.get("ZSOC")));
dataStack.setMaxAllowedChargePower(StringUtils.getBigDecimal(obj.get("YXCDZDGL")));
dataStack.setMaxAllowedDischargePower(StringUtils.getBigDecimal(obj.get("YXFDZDGL")));
dataStack.setMaxAllowedChargeVoltage(StringUtils.getBigDecimal(obj.get("YXCDZDDY")));
dataStack.setMaxAllowedDischargeVoltage(StringUtils.getBigDecimal(obj.get("YXFDZDDY")));
dataStack.setMaxAllowedChargeCurrent(StringUtils.getBigDecimal(obj.get("YXCDZDDL")));
dataStack.setMaxAllowedDischargeCurrent(StringUtils.getBigDecimal(obj.get("YXFDZDDL")));
dataStack.setBatteryPackVoltage(StringUtils.getBigDecimal(obj.get("ZDY")));
dataStack.setBatteryPackCurrent(StringUtils.getBigDecimal(obj.get("ZDL")));
dataStack.setBatteryPackTemp(StringUtils.getBigDecimal(obj.get("MKWD")));
dataStack.setBatteryPackSoc(StringUtils.getBigDecimal(obj.get("ZSOC")));
dataStack.setBatteryPackSoh(StringUtils.getBigDecimal(obj.get("ZSOH")));
dataStack.setBatteryPackInsulationResistance(StringUtils.getBigDecimal(obj.get("ZJYDZ")));
dataStack.setAvgCellVoltage(StringUtils.getBigDecimal(obj.get("PJDTDY")));
dataStack.setAvgCellTemp(StringUtils.getBigDecimal(obj.get("PJDTWD")));
dataStack.setMaxCellVoltage(StringUtils.getBigDecimal(obj.get("ZGDTDY")));
dataStack.setMinCellVoltage(StringUtils.getBigDecimal(obj.get("ZDDTDY")));
dataStack.setMaxCellTemp(StringUtils.getBigDecimal(obj.get("ZGDTWD")));
dataStack.setMinCellTemp(StringUtils.getBigDecimal(obj.get("ZDDTWD")));
dataStack.setMaxCellSoc(StringUtils.getBigDecimal(obj.get("ZGDTSOC")));
dataStack.setMinCellSoc(StringUtils.getBigDecimal(obj.get("ZDDTSOC")));
dataStack.setMaxCellSoh(StringUtils.getBigDecimal(obj.get("ZGDTSOH")));
dataStack.setMinCellSoh(StringUtils.getBigDecimal(obj.get("ZDDTSOH")));
dataStack.setTotalChargeEnergy(StringUtils.getBigDecimal(obj.get("DCLJCDDL")));
dataStack.setTotalDischargeEnergy(StringUtils.getBigDecimal(obj.get("DCLJFDDL")));
// 其他非 BigDecimal 字段 // 其他非 BigDecimal 字段
dataStack.setWorkStatus(WorkStatus.NORMAL.getCode()); // 或其他默认值 dataStack.setWorkStatus(WorkStatus.NORMAL.getCode()); // 或其他默认值
dataStack.setPcsCommunicationStatus(CommunicationStatus.OK.getCode()); dataStack.setPcsCommunicationStatus(CommunicationStatus.OK.getCode());
dataStack.setEmsCommunicationStatus(CommunicationStatus.OK.getCode()); dataStack.setEmsCommunicationStatus(CommunicationStatus.OK.getCode());
// 电池堆状态数据设置
dataStack.setOperationStatus(StringUtils.getString(obj.get("DCZT")));
dataStack.setStackVoltage(StringUtils.getBigDecimal(obj.get("DCDDY")));
dataStack.setStackCurrent(StringUtils.getBigDecimal(obj.get("DCDDL")));
dataStack.setStackSoc(StringUtils.getBigDecimal(obj.get("DCDSOC")));
dataStack.setStackSoh(StringUtils.getBigDecimal(obj.get("DCDSOH")));
// 电压极值信息
dataStack.setMaxCellVoltage(StringUtils.getBigDecimal(obj.get("ZGDCDY")));
dataStack.setMaxVoltageGroupId(StringUtils.getLong(obj.get("ZGDCDYZH")));
dataStack.setMaxVoltageCellId(StringUtils.getLong(obj.get("ZGDCDYZHDH")));
dataStack.setMinCellVoltage(StringUtils.getBigDecimal(obj.get("ZDDCDY")));
dataStack.setMinVoltageGroupId(StringUtils.getLong(obj.get("ZDDCDYZH")));
dataStack.setMinVoltageCellId(StringUtils.getLong(obj.get("ZDDCDYZHDH")));
// 温度极值信息
dataStack.setMaxCellTemp(StringUtils.getBigDecimal(obj.get("ZGDCWD")));
dataStack.setMaxTempGroupId(StringUtils.getLong(obj.get("ZGDCWDZH")));
dataStack.setMaxTempCellId(StringUtils.getLong(obj.get("ZGDCWDZHDH")));
dataStack.setMinCellTemp(StringUtils.getBigDecimal(obj.get("ZDDCWD")));
dataStack.setMinTempGroupId(StringUtils.getLong(obj.get("ZDDCWDZH")));
dataStack.setMinTempCellId(StringUtils.getLong(obj.get("ZDDCWDZHDH")));
// 电量统计信息
dataStack.setTotalChargeCapacity(StringUtils.getBigDecimal(obj.get("DLJCDDL")));
dataStack.setTotalDischargeCapacity(StringUtils.getBigDecimal(obj.get("DLCFDDL")));
dataStack.setSessionChargeCapacity(StringUtils.getBigDecimal(obj.get("DDCLJCDDL")));
dataStack.setSessionDischargeCapacity(StringUtils.getBigDecimal(obj.get("DDCLJFDDL")));
dataStack.setAvailableChargeCapacity(StringUtils.getBigDecimal(obj.get("DKCDL")));
dataStack.setAvailableDischargeCapacity(StringUtils.getBigDecimal(obj.get("DKFDL")));
// 时间信息
dataStack.setRemainingDischargeTime(StringUtils.getLong(obj.get("KYFDSJ")));
dataStack.setRemainingChargeTime(StringUtils.getLong(obj.get("KYCDSJ")));
// 功率/电流限制
dataStack.setMaxDischargePower(StringUtils.getBigDecimal(obj.get("YXZDFDGL")));
dataStack.setMaxChargePower(StringUtils.getBigDecimal(obj.get("YXZDCDGL")));
dataStack.setMaxDischargeCurrent(StringUtils.getBigDecimal(obj.get("YXZDFDDL")));
dataStack.setMaxChargeCurrent(StringUtils.getBigDecimal(obj.get("YXZDCDDL")));
// 当日统计
dataStack.setDailyDischargeCycles(StringUtils.getLong(obj.get("DTFDCS")));
dataStack.setDailyChargeCycles(StringUtils.getLong(obj.get("DTCDCS")));
dataStack.setDailyDischargeCapacity(StringUtils.getBigDecimal(obj.get("DTFDDL")));
dataStack.setDailyChargeCapacity(StringUtils.getBigDecimal(obj.get("DTCDDL")));
// 系统状态
dataStack.setOperatingTemp(StringUtils.getBigDecimal(obj.get("YXWD")));
dataStack.setBmsStatus(StringUtils.getString(obj.get("BMSDDQZT")));
dataStack.setBmsChargeStatus(StringUtils.getString(obj.get("BMSCFDZT")));
dataStack.setStackInsulationResistance(StringUtils.getBigDecimal(obj.get("DCDJYDZ")));
dataStack.setCreateBy("system"); dataStack.setCreateBy("system");
dataStack.setCreateTime(DateUtils.getNowDate()); dataStack.setCreateTime(DateUtils.getNowDate());
dataStack.setUpdateBy("system"); dataStack.setUpdateBy("system");
dataStack.setUpdateTime(DateUtils.getNowDate()); dataStack.setUpdateTime(DateUtils.getNowDate());
dataStack.setSiteId("021_FXX_01"); dataStack.setSiteId(SITE_ID);
dataStack.setDeviceId(deviceId); dataStack.setDeviceId(deviceId);
dataStack.setMaxCellVoltageId(StringUtils.getLong(obj.get("ZGDTDYDYD")));
dataStack.setMinCellVoltageId(StringUtils.getLong(obj.get("ZDDTDYDYD")));
dataStack.setMaxCellTempId(StringUtils.getLong(obj.get("ZGDTWDDYD")));
dataStack.setMinCellTempId(StringUtils.getLong(obj.get("ZDDTWDDYD")));
dataStack.setMaxCellSocId(StringUtils.getLong(obj.get("ZGDTSOCDYD")));
dataStack.setMinCellSocId(StringUtils.getLong(obj.get("ZDDTSOCDYD")));
dataStack.setMaxCellSohId(StringUtils.getLong(obj.get("ZGDTSOHDYD")));
dataStack.setMinCellSohId(StringUtils.getLong(obj.get("ZDDTSOHDYD")));
emsBatteryStackMapper.insertEmsBatteryStack(dataStack); emsBatteryStackMapper.insertEmsBatteryStack(dataStack);
redisCache.setCacheObject(RedisKeyConstants.STACK + SITE_ID + "_" +deviceId, dataStack);
} }
private void batteryCluserDataProcess(String deviceId, String dataJson) { private void batteryClusterDataProcess(String deviceId, String dataJson) {
Map<String, Object> obj = JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() { Map<String, Object> obj = JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {
}); });
EmsDevicesSetting joken = new EmsDevicesSetting();
joken.setDeviceId(deviceId);
List<EmsDevicesSetting> up = emsDevicesSettingMapper.selectEmsDevicesSettingList(joken);
String stackDeviceId = "";
if (up != null && up.size() >0) {
stackDeviceId = up.get(0).getParentId();
if (stackDeviceId == null || stackDeviceId.isEmpty()) {
stackDeviceId = "1";
}
}
//BMS 电池簇 //BMS 电池簇
EmsBatteryCluster data = new EmsBatteryCluster(); EmsBatteryCluster data = new EmsBatteryCluster();
// 设置所有 BigDecimal 类型字段为 ZERO // 设置所有 BigDecimal 类型字段为 ZERO
@ -185,7 +218,7 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
data.setCreateTime(DateUtils.getNowDate()); data.setCreateTime(DateUtils.getNowDate());
data.setUpdateBy("system"); data.setUpdateBy("system");
data.setUpdateTime(DateUtils.getNowDate()); data.setUpdateTime(DateUtils.getNowDate());
data.setSiteId("021_FXX_01"); data.setSiteId(SITE_ID);
data.setDeviceId(deviceId); data.setDeviceId(deviceId);
data.setMaxCellVoltageId(StringUtils.getLong(obj.get("ZGDTDYDYD"))); data.setMaxCellVoltageId(StringUtils.getLong(obj.get("ZGDTDYDYD")));
data.setMinCellVoltageId(StringUtils.getLong(obj.get("ZDDTDYDYD"))); data.setMinCellVoltageId(StringUtils.getLong(obj.get("ZDDTDYDYD")));
@ -195,14 +228,28 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
data.setMinCellSocId(StringUtils.getLong(obj.get("ZDDTSOCDYD"))); data.setMinCellSocId(StringUtils.getLong(obj.get("ZDDTSOCDYD")));
data.setMaxCellSohId(StringUtils.getLong(obj.get("ZGDTSOHDYD"))); data.setMaxCellSohId(StringUtils.getLong(obj.get("ZGDTSOHDYD")));
data.setMinCellSohId(StringUtils.getLong(obj.get("ZDDTSOHDYD"))); data.setMinCellSohId(StringUtils.getLong(obj.get("ZDDTSOHDYD")));
if (StringUtils.isNotBlank(stackDeviceId)) {
data.setStackDeviceId(stackDeviceId);
} else {
data.setStackDeviceId("1"); data.setStackDeviceId("1");
}
emsBatteryClusterMapper.insertEmsBatteryCluster(data); emsBatteryClusterMapper.insertEmsBatteryCluster(data);
redisCache.setCacheObject(RedisKeyConstants.CLUSTER + SITE_ID + "_" +deviceId, data);
} }
private void batteryDataProcess(String deviceId, String dataJson) { private void batteryDataProcess(String deviceId, String dataJson) {
EmsDevicesSetting joken = new EmsDevicesSetting();
joken.setDeviceId(deviceId);
List<EmsDevicesSetting> up = emsDevicesSettingMapper.selectEmsDevicesSettingList(joken);
String stackDeviceId = "";
if (up != null && up.size() >0) {
stackDeviceId = up.get(0).getParentId();
if (stackDeviceId == null || stackDeviceId.isEmpty()) {
stackDeviceId = "1";
}
}
//单体电池 //单体电池
Map<String, Map<String, Object>> records = processData(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {})); Map<String, Map<String, Object>> records = processData(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {}));
List<EmsBatteryData> list = new ArrayList<>(); List<EmsBatteryData> list = new ArrayList<>();
@ -220,21 +267,22 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
batteryData.setVoltage(StringUtils.getBigDecimal(fields.get("DTDY"))); batteryData.setVoltage(StringUtils.getBigDecimal(fields.get("DTDY")));
batteryData.setBatteryCluster(deviceId); batteryData.setBatteryCluster(deviceId);
batteryData.setBatteryPack(deviceId); batteryData.setBatteryPack(stackDeviceId);
// 时间戳 // 时间戳
batteryData.setDataTimestamp(new Date()); batteryData.setDataTimestamp(new Date());
// ID字段 // ID字段
batteryData.setSiteId(("021_FXX_01")); batteryData.setSiteId(SITE_ID);
batteryData.setClusterDeviceId(("021")); batteryData.setClusterDeviceId(deviceId);
list.add(batteryData); list.add(batteryData);
} }
if (list.size() > 0 ) { if (list.size() > 0 ) {
emsBatteryDataMapper.insertEmsBatteryDataList(list); emsBatteryDataMapper.insertEmsBatteryDataList(list);
redisCache.setCacheList(deviceId + "_DATA_LIST", list); redisCache.deleteList(RedisKeyConstants.BATTERY + SITE_ID + "_" +deviceId);
redisCache.setCacheList(RedisKeyConstants.BATTERY + SITE_ID + "_" +deviceId, list);
} }
} }
@ -252,9 +300,9 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
pcsData.setControlMode(ControlModeStatus.REMOTE.getCode()); pcsData.setControlMode(ControlModeStatus.REMOTE.getCode());
// 功率与能量类字段 // 功率与能量类字段
pcsData.setTotalActivePower(StringUtils.getBigDecimal(obj.get("JLCCDYGGL"))); pcsData.setTotalActivePower(StringUtils.getBigDecimal(obj.get("YGGL")));
pcsData.setDailyAcChargeEnergy(StringUtils.getBigDecimal(obj.get("RCDL"))); pcsData.setDailyAcChargeEnergy(StringUtils.getBigDecimal(obj.get("RCDL")));
pcsData.setTotalReactivePower(StringUtils.getBigDecimal(obj.get("JLCRXWGGL"))); pcsData.setTotalReactivePower(StringUtils.getBigDecimal(obj.get("XTWGGL")));
pcsData.setDailyAcDischargeEnergy(StringUtils.getBigDecimal(obj.get("RFDL"))); pcsData.setDailyAcDischargeEnergy(StringUtils.getBigDecimal(obj.get("RFDL")));
pcsData.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("XTSZGL"))); pcsData.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("XTSZGL")));
pcsData.setTotalPowerFactor(StringUtils.getBigDecimal(obj.get("GLYS"))); pcsData.setTotalPowerFactor(StringUtils.getBigDecimal(obj.get("GLYS")));
@ -295,16 +343,16 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
pcsData.setCreateTime(DateUtils.getNowDate()); pcsData.setCreateTime(DateUtils.getNowDate());
pcsData.setUpdateBy("system"); pcsData.setUpdateBy("system");
pcsData.setUpdateTime(DateUtils.getNowDate()); pcsData.setUpdateTime(DateUtils.getNowDate());
pcsData.setSiteId("021_FXX_01"); pcsData.setSiteId(SITE_ID);
pcsData.setDeviceId(deviceId); pcsData.setDeviceId(deviceId);
pcsData.setDateMonth(DateUtils.getNowMonthLong()); pcsData.setDateMonth(DateUtils.getNowMonthLong());
pcsData.setDateDay(DateUtils.getNowDayLong()); pcsData.setDateDay(DateUtils.getNowDayLong());
emsPcsDataMapper.insertEmsPcsData(pcsData); emsPcsDataMapper.insertEmsPcsData(pcsData);
redisCache.setCacheObject(RedisKeyConstants.PCS + SITE_ID + "_" +deviceId, pcsData);
} }
private void pcsBranchDataProcess(String deviceId, String dataJson) { private void pcsBranchDataProcess(String deviceId, String dataJson) {
Map<String, Map<String, Object>> records = processDataPrefix(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {})); Map<String, Map<String, Object>> records = processDataPrefix(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {}));
@ -345,11 +393,199 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
} }
if (list.size() > 0 ) { if (list.size() > 0 ) {
emsPcsBranchDataMapper.insertPcsBranchDataList(list); emsPcsBranchDataMapper.insertPcsBranchDataList(list);
redisCache.setCacheObject(RedisKeyConstants.BRANCH + SITE_ID + "_" +deviceId, list);
} }
} }
private void loadDataProcess(String deviceId, String dataJson) {
//总表
Map<String, Object> obj = JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {
});
EmsAmmeterData dataLoad = new EmsAmmeterData();
// 更新时间
dataLoad.setDataUpdateTime(new Date());
// 电能设置-组合有功
dataLoad.setCurrentCombActiveTotal(StringUtils.getBigDecimal(obj.get("DQZHYGZDN")));
dataLoad.setCurrentCombActivePeak(StringUtils.getBigDecimal(obj.get("DQZHYGJDN")));
dataLoad.setCurrentCombActiveHigh(StringUtils.getBigDecimal(obj.get("DQZHYGFDN")));
dataLoad.setCurrentCombActiveFlat(StringUtils.getBigDecimal(obj.get("DQZHYGPDN")));
dataLoad.setCurrentCombActiveValley(StringUtils.getBigDecimal(obj.get("DQZHYGGDN")));
// 电能设置-正向有功
dataLoad.setCurrentForwardActiveTotal(StringUtils.getBigDecimal(obj.get("DQZXYGZDN")));
dataLoad.setCurrentForwardActivePeak(StringUtils.getBigDecimal(obj.get("DQZXYGJDN")));
dataLoad.setCurrentForwardActiveHigh(StringUtils.getBigDecimal(obj.get("DQZXYGFDN")));
dataLoad.setCurrentForwardActiveFlat(StringUtils.getBigDecimal(obj.get("DQZXYGPDN")));
dataLoad.setCurrentForwardActiveValley(StringUtils.getBigDecimal(obj.get("DQZXYGGDN")));
// 电能设置-反向有功
dataLoad.setCurrentReverseActiveTotal(StringUtils.getBigDecimal(obj.get("DQFXYGZDN")));
dataLoad.setCurrentReverseActivePeak(StringUtils.getBigDecimal(obj.get("DQFXYGJDN")));
dataLoad.setCurrentReverseActiveHigh(StringUtils.getBigDecimal(obj.get("DQFXYGFDN")));
dataLoad.setCurrentReverseActiveFlat(StringUtils.getBigDecimal(obj.get("DQFXYGPDN")));
dataLoad.setCurrentReverseActiveValley(StringUtils.getBigDecimal(obj.get("DQFXYGGDN")));
// 电能设置-组合无功
dataLoad.setCurrentCombReactiveTotal(StringUtils.getBigDecimal(obj.get("DQZHWGZDN")));
dataLoad.setCurrentCombReactivePeak(StringUtils.getBigDecimal(obj.get("DQZHWGJDN")));
dataLoad.setCurrentCombReactiveHigh(StringUtils.getBigDecimal(obj.get("DQZHWGFDN")));
dataLoad.setCurrentCombReactiveFlat(StringUtils.getBigDecimal(obj.get("DQZHWGPDN")));
dataLoad.setCurrentCombReactiveValley(StringUtils.getBigDecimal(obj.get("DQZHWGGDN")));
// 电能设置-正向无功
dataLoad.setCurrentForwardReactiveTotal(StringUtils.getBigDecimal(obj.get("DQZXWGZDN")));
dataLoad.setCurrentForwardReactivePeak(StringUtils.getBigDecimal(obj.get("DQZXWGJDN")));
dataLoad.setCurrentForwardReactiveHigh(StringUtils.getBigDecimal(obj.get("DQZXWGFDN")));
dataLoad.setCurrentForwardReactiveFlat(StringUtils.getBigDecimal(obj.get("DQZXWGPDN")));
dataLoad.setCurrentForwardReactiveValley(StringUtils.getBigDecimal(obj.get("DQZXWGGDN")));
// 电能设置-反向无功
dataLoad.setCurrentReverseReactiveTotal(StringUtils.getBigDecimal(obj.get("DQFXWGZDN")));
dataLoad.setCurrentReverseReactivePeak(StringUtils.getBigDecimal(obj.get("DQFXWGJDN")));
dataLoad.setCurrentReverseReactiveHigh(StringUtils.getBigDecimal(obj.get("DQFXWGFDN")));
dataLoad.setCurrentReverseReactiveFlat(StringUtils.getBigDecimal(obj.get("DQFXWGPDN")));
dataLoad.setCurrentReverseReactiveValley(StringUtils.getBigDecimal(obj.get("DQFXWGGDN")));
// 电压+电流
dataLoad.setPhaseAVoltage(StringUtils.getBigDecimal(obj.get("AXDY")));
dataLoad.setPhaseBVoltage(StringUtils.getBigDecimal(obj.get("BXDY")));
dataLoad.setPhaseCVoltage(StringUtils.getBigDecimal(obj.get("CXDY")));
dataLoad.setPhaseACurrent(StringUtils.getBigDecimal(obj.get("AXDL")));
dataLoad.setPhaseBCurrent(StringUtils.getBigDecimal(obj.get("BXDL")));
dataLoad.setPhaseCCurrent(StringUtils.getBigDecimal(obj.get("CXDL")));
dataLoad.setAbLineVoltage(StringUtils.getBigDecimal(obj.get("ABXDY")));
dataLoad.setCbLineVoltage(StringUtils.getBigDecimal(obj.get("CBXDY")));
dataLoad.setAcLineVoltage(StringUtils.getBigDecimal(obj.get("ACXDY")));
// 频率
dataLoad.setFrequency(StringUtils.getBigDecimal(obj.get("PL")));
// 功率 有功+总+无功+无总+视在
dataLoad.setPhaseAActivePower(StringUtils.getBigDecimal(obj.get("AXYGGL")));
dataLoad.setPhaseBActivePower(StringUtils.getBigDecimal(obj.get("BXYGGL")));
dataLoad.setPhaseCActivePower(StringUtils.getBigDecimal(obj.get("CXYGGL")));
dataLoad.setTotalActivePower(StringUtils.getBigDecimal(obj.get("ZYGGL")));
dataLoad.setPhaseAReactivePower(StringUtils.getBigDecimal(obj.get("AXWGGL")));
dataLoad.setPhaseBReactivePower(StringUtils.getBigDecimal(obj.get("BXWGGL")));
dataLoad.setPhaseCReactivePower(StringUtils.getBigDecimal(obj.get("CXWGGL")));
dataLoad.setTotalReactivePower(StringUtils.getBigDecimal(obj.get("ZWGGL")));
dataLoad.setPhaseAApparentPower(StringUtils.getBigDecimal(obj.get("AXSZGL")));
dataLoad.setPhaseBApparentPower(StringUtils.getBigDecimal(obj.get("BXSZGL")));
dataLoad.setPhaseCApparentPower(StringUtils.getBigDecimal(obj.get("CXSZGL")));
dataLoad.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("ZSZGL")));
// 功率因数
dataLoad.setPhaseAPowerFactor(StringUtils.getBigDecimal(obj.get("AXGLYS")));
dataLoad.setPhaseBPowerFactor(StringUtils.getBigDecimal(obj.get("BXGLYS")));
dataLoad.setPhaseCPowerFactor(StringUtils.getBigDecimal(obj.get("CXGLYS")));
dataLoad.setTotalPowerFactor(StringUtils.getBigDecimal(obj.get("ZGLYS")));
// 需量
dataLoad.setForwardAcMaxDemand(StringUtils.getBigDecimal(obj.get("ZXYGZDXL")));
dataLoad.setReverseAcMaxDemand(StringUtils.getBigDecimal(obj.get("FXYGZDXL")));
dataLoad.setDailyForwardMaxDemand(StringUtils.getBigDecimal(obj.get("DRZXYGZDXL")));
dataLoad.setCreateBy("system");
dataLoad.setCreateTime(DateUtils.getNowDate());
dataLoad.setUpdateBy("system");
dataLoad.setUpdateTime(DateUtils.getNowDate());
dataLoad.setSiteId(SITE_ID);
dataLoad.setDeviceId(deviceId);
emsAmmeterDataMapper.insertEmsAmmeterData(dataLoad);
redisCache.setCacheObject(RedisKeyConstants.AMMETER + SITE_ID + "_" +deviceId, dataLoad);
}
private void meteDataProcess(String deviceId, String dataJson) {
//总表
Map<String, Object> obj = JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {
});
EmsAmmeterData dataLoad = new EmsAmmeterData();
// 更新时间
dataLoad.setDataUpdateTime(new Date());
// 电压+电流
dataLoad.setPhaseAVoltage(StringUtils.getBigDecimal(obj.get("AXDY")));
dataLoad.setPhaseBVoltage(StringUtils.getBigDecimal(obj.get("BXDY")));
dataLoad.setPhaseCVoltage(StringUtils.getBigDecimal(obj.get("CXDY")));
dataLoad.setPhaseACurrent(StringUtils.getBigDecimal(obj.get("AXDL")));
dataLoad.setPhaseBCurrent(StringUtils.getBigDecimal(obj.get("BXDL")));
dataLoad.setPhaseCCurrent(StringUtils.getBigDecimal(obj.get("CXDL")));
dataLoad.setAbLineVoltage(StringUtils.getBigDecimal(obj.get("ABXDY")));
dataLoad.setCbLineVoltage(StringUtils.getBigDecimal(obj.get("BCXDY")));
dataLoad.setAcLineVoltage(StringUtils.getBigDecimal(obj.get("CAXDY")));
// 频率
dataLoad.setFrequency(StringUtils.getBigDecimal(obj.get("DWPL")));
// 功率
dataLoad.setPhaseAActivePower(StringUtils.getBigDecimal(obj.get("AXYGGL")));
dataLoad.setPhaseBActivePower(StringUtils.getBigDecimal(obj.get("BXYGGL")));
dataLoad.setPhaseCActivePower(StringUtils.getBigDecimal(obj.get("CXYGGL")));
dataLoad.setTotalActivePower(StringUtils.getBigDecimal(obj.get("ZYGGL")));
dataLoad.setPhaseAReactivePower(StringUtils.getBigDecimal(obj.get("AXWGGL")));
dataLoad.setPhaseBReactivePower(StringUtils.getBigDecimal(obj.get("BXWGGL")));
dataLoad.setPhaseCReactivePower(StringUtils.getBigDecimal(obj.get("CXWGGL")));
dataLoad.setTotalReactivePower(StringUtils.getBigDecimal(obj.get("ZWGGL")));
dataLoad.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("ZSZGL")));
dataLoad.setTotalPowerFactor(StringUtils.getBigDecimal(obj.get("ZGLYS")));
// 二次相关数据
dataLoad.setSecondaryAbLineVoltage(StringUtils.getBigDecimal(obj.get("ECABXDY")));
dataLoad.setSecondaryAPhaseCurrent(StringUtils.getBigDecimal(obj.get("ECAXDL")));
dataLoad.setSecondaryAPhaseVoltage(StringUtils.getBigDecimal(obj.get("ECAXDY")));
dataLoad.setSecondaryAPowerFactor(StringUtils.getBigDecimal(obj.get("ECAXGLYS")));
dataLoad.setSecondaryAApparentPower(StringUtils.getBigDecimal(obj.get("ECAXSZGL")));
dataLoad.setSecondaryAReactivePower(StringUtils.getBigDecimal(obj.get("ECAXWGGL")));
dataLoad.setSecondaryAActivePower(StringUtils.getBigDecimal(obj.get("ECAXYGGL")));
dataLoad.setSecondaryBcLineVoltage(StringUtils.getBigDecimal(obj.get("ECBCXDY")));
dataLoad.setSecondaryBPhaseCurrent(StringUtils.getBigDecimal(obj.get("ECBXDL")));
dataLoad.setSecondaryBPhaseVoltage(StringUtils.getBigDecimal(obj.get("ECBXDY")));
dataLoad.setSecondaryBPowerFactor(StringUtils.getBigDecimal(obj.get("ECBXGLYS")));
dataLoad.setSecondaryBApparentPower(StringUtils.getBigDecimal(obj.get("ECBXSZGL")));
dataLoad.setSecondaryBReactivePower(StringUtils.getBigDecimal(obj.get("ECBXWGGL")));
dataLoad.setSecondaryBActivePower(StringUtils.getBigDecimal(obj.get("ECBXYGGL")));
dataLoad.setSecondaryCaLineVoltage(StringUtils.getBigDecimal(obj.get("ECCAXDY")));
dataLoad.setSecondaryCPhaseCurrent(StringUtils.getBigDecimal(obj.get("ECCXDL")));
dataLoad.setSecondaryCPhaseVoltage(StringUtils.getBigDecimal(obj.get("ECCXDY")));
dataLoad.setSecondaryCPowerFactor(StringUtils.getBigDecimal(obj.get("ECCXGLYS")));
dataLoad.setSecondaryCApparentPower(StringUtils.getBigDecimal(obj.get("ECCXSZGL")));
dataLoad.setSecondaryCReactivePower(StringUtils.getBigDecimal(obj.get("ECCXWGGL")));
dataLoad.setSecondaryCActivePower(StringUtils.getBigDecimal(obj.get("ECCXYGGL")));
dataLoad.setSecondaryGridFrequency(StringUtils.getBigDecimal(obj.get("ECDWPL")));
dataLoad.setSecondaryReverseReactiveEnergy(StringUtils.getBigDecimal(obj.get("ECFXWGDN")));
dataLoad.setSecondaryNegativeActiveEnergy(StringUtils.getBigDecimal(obj.get("ECFXYGDN")));
dataLoad.setSecondaryTotalPowerFactor(StringUtils.getBigDecimal(obj.get("ECZGLYS")));
dataLoad.setSecondaryTotalApparentPower(StringUtils.getBigDecimal(obj.get("ECZSZFL")));
dataLoad.setSecondaryTotalReactivePower(StringUtils.getBigDecimal(obj.get("ECZWGGL")));
dataLoad.setSecondaryPositiveReactiveEnergy(StringUtils.getBigDecimal(obj.get("ECZXWGDN")));
dataLoad.setSecondaryPositiveActiveEnergy(StringUtils.getBigDecimal(obj.get("ECZXYGDN")));
dataLoad.setSecondaryTotalActivePower(StringUtils.getBigDecimal(obj.get("ECZYGGL")));
// 需量
dataLoad.setReverseReactiveEnergyEqMinus(StringUtils.getBigDecimal(obj.get("FXWGDN")));
dataLoad.setReverseActiveEnergyEpMinus(StringUtils.getBigDecimal(obj.get("FXYGDN")));
dataLoad.setPositiveReactiveEnergyEqPlus(StringUtils.getBigDecimal(obj.get("ZXWGDN")));
dataLoad.setPositiveActiveEnergyEpPlus(StringUtils.getBigDecimal(obj.get("ZXYGDN")));
dataLoad.setCreateBy("system");
dataLoad.setCreateTime(DateUtils.getNowDate());
dataLoad.setUpdateBy("system");
dataLoad.setUpdateTime(DateUtils.getNowDate());
dataLoad.setSiteId(SITE_ID);
dataLoad.setDeviceId(deviceId);
emsAmmeterDataMapper.insertEmsAmmeterData(dataLoad);
redisCache.setCacheObject(RedisKeyConstants.AMMETER + SITE_ID + "_" +deviceId, dataLoad);
}
// 数据分组处理 // 数据分组处理
private static Map<String, Map<String, Object>> processData(Map<String, Object> rawData) { private static Map<String, Map<String, Object>> processData(Map<String, Object> rawData) {
Map<String, Map<String, Object>> records = new HashMap<>(); Map<String, Map<String, Object>> records = new HashMap<>();

View File

@ -57,8 +57,8 @@ public class HomePageServiceImpl implements IHomePageService
if (emsSite != null) { if (emsSite != null) {
// 装机功率+装机容量 // 装机功率+装机容量
singleSiteBaseInfo.setSiteName(emsSite.getSiteName()); singleSiteBaseInfo.setSiteName(emsSite.getSiteName());
singleSiteBaseInfo.setInstalledCap(emsSite.getInstallCapacity()); singleSiteBaseInfo.setInstallCapacity(emsSite.getInstallCapacity());
singleSiteBaseInfo.setInstalledPower(emsSite.getInstallPower()); singleSiteBaseInfo.setInstallPower(emsSite.getInstallPower());
String[] siteLocation = new String[2]; String[] siteLocation = new String[2];
siteLocation[0] = emsSite.getLongitude() == null ? "" : emsSite.getLongitude().toString(); siteLocation[0] = emsSite.getLongitude() == null ? "" : emsSite.getLongitude().toString();
siteLocation[1] = emsSite.getLatitude() == null ? "" : emsSite.getLatitude().toString(); siteLocation[1] = emsSite.getLatitude() == null ? "" : emsSite.getLatitude().toString();

View File

@ -1,19 +1,22 @@
package com.xzzn.ems.service.impl; package com.xzzn.ems.service.impl;
import com.xzzn.common.constant.RedisKeyConstants;
import com.xzzn.common.core.redis.RedisCache;
import com.xzzn.common.enums.AmmeterCategory;
import com.xzzn.common.enums.DeviceCategory;
import com.xzzn.common.utils.DateUtils;
import com.xzzn.common.utils.StringUtils; import com.xzzn.common.utils.StringUtils;
import com.xzzn.ems.domain.EmsBatteryData; import com.xzzn.ems.domain.*;
import com.xzzn.ems.domain.EmsCoolingData;
import com.xzzn.ems.domain.EmsDevicesSetting;
import com.xzzn.ems.domain.vo.*; import com.xzzn.ems.domain.vo.*;
import com.xzzn.ems.mapper.*; import com.xzzn.ems.mapper.*;
import com.xzzn.ems.service.ISingleSiteService; import com.xzzn.ems.service.ISingleSiteService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 单点监控 服务层实现 * 单点监控 服务层实现
@ -27,6 +30,10 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
private static final String CLUSTER_DATA_SOC = "SOC"; private static final String CLUSTER_DATA_SOC = "SOC";
private static final String AMMETER_DEVICE_LOAD = "LOAD";
private static final String AMMETER_DEVICE_METE = "METE";
@Autowired @Autowired
private EmsPcsDataMapper emsPcsDataMapper; private EmsPcsDataMapper emsPcsDataMapper;
@Autowired @Autowired
@ -46,6 +53,9 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
@Autowired @Autowired
private EmsDevicesSettingMapper emsDevicesSettingMapper; private EmsDevicesSettingMapper emsDevicesSettingMapper;
@Autowired
private RedisCache redisCache;
@Override @Override
public SiteMonitorHomeVo getSiteMonitorDataVo(String siteId) { public SiteMonitorHomeVo getSiteMonitorDataVo(String siteId) {
SiteMonitorHomeVo siteMonitorHomeVo = new SiteMonitorHomeVo(); SiteMonitorHomeVo siteMonitorHomeVo = new SiteMonitorHomeVo();
@ -123,10 +133,21 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
public SiteMonitorRuningInfoVo getRunningGraph(String siteId) { public SiteMonitorRuningInfoVo getRunningGraph(String siteId) {
SiteMonitorRuningInfoVo siteMonitorRuningInfoVo = new SiteMonitorRuningInfoVo(); SiteMonitorRuningInfoVo siteMonitorRuningInfoVo = new SiteMonitorRuningInfoVo();
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
// 时间暂定今日+昨日
Date today = new Date();
Date yesterday = DateUtils.addDays(today, -1);
//储能功率list //储能功率list
List<EnergyStoragePowVo> energyStoragePowList = emsPcsDataMapper.getStoragePowerList(siteId, yesterday, today);
siteMonitorRuningInfoVo.setEnergyStoragePowList(energyStoragePowList);
//pcs平均温度list //pcs平均温度list
List<PCSAveTempVo> pcsAveTempVos = emsPcsDataMapper.getPcsAveTempList(siteId, yesterday, today);
siteMonitorRuningInfoVo.setPcsAveTempList(pcsAveTempVos);
//电池平均soclist //电池平均soclist
List<BatteryAveSOCVo> batteryAveSOCList = emsPcsDataMapper.getAveSocList(siteId, yesterday, today);
siteMonitorRuningInfoVo.setBatteryAveSOCList(batteryAveSOCList);
//电池平均温度list //电池平均温度list
List<BatteryAveTempVo> batteryAveTempList = emsPcsDataMapper.getBatteryAveTempList(siteId, yesterday, today);
siteMonitorRuningInfoVo.setBatteryAveTempList(batteryAveTempList);
} }
return siteMonitorRuningInfoVo; return siteMonitorRuningInfoVo;
} }
@ -137,92 +158,145 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
List<PcsDetailInfoVo> pcsDetailInfoVoList = new ArrayList<>(); List<PcsDetailInfoVo> pcsDetailInfoVoList = new ArrayList<>();
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
// 获取pcs最新数据 // 获取该设备下所有pcs的id
pcsDetailInfoVoList = emsPcsDataMapper.getPcsDetailInfoBySiteId(siteId); List<Map<String, Object>> pcsIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.PCS.getCode());
if (!CollectionUtils.isEmpty(pcsDetailInfoVoList)) {
for (PcsDetailInfoVo pcsDetailInfoVo : pcsDetailInfoVoList) { for (Map<String, Object> pcsDevice : pcsIds) {
String deviceId = pcsDetailInfoVo.getDeviceId(); PcsDetailInfoVo pcsDetailInfoVo = new PcsDetailInfoVo();
// 获取支路最新数据 pcsDetailInfoVo.setDeviceName(pcsDevice.get("deviceName").toString());
if (!StringUtils.isEmpty(deviceId)) { pcsDetailInfoVo.setCommunicationStatus(pcsDevice.get("communicationStatus").toString());
List<PcsBranchInfo> pcsBranchInfoList = emsPcsBranchDataMapper.getPcsBranchInfoList(siteId, deviceId); // 从redis取pcs单个详细数据
String pcsId = pcsDevice.get("id").toString();
EmsPcsData pcsData = redisCache.getCacheObject(RedisKeyConstants.PCS +siteId+"_"+pcsId);
if (pcsData != null) {
BeanUtils.copyProperties(pcsData, pcsDetailInfoVo);
}
// 支路信息数据
List<PcsBranchInfo> pcsBranchInfoList = new ArrayList<>();
processBranchDataInfo(siteId,pcsId,pcsBranchInfoList);
pcsDetailInfoVo.setPcsBranchInfoList(pcsBranchInfoList); pcsDetailInfoVo.setPcsBranchInfoList(pcsBranchInfoList);
}
} pcsDetailInfoVoList.add(pcsDetailInfoVo);
} }
} }
return pcsDetailInfoVoList; return pcsDetailInfoVoList;
} }
private void processBranchDataInfo(String siteId, String pcsId, List<PcsBranchInfo> pcsBranchInfoList) {
if (!StringUtils.isEmpty(pcsId)) {
List<EmsPcsBranchData> pcsBranchData = redisCache.getCacheObject(RedisKeyConstants.BRANCH +siteId+"_"+pcsId);
if (pcsBranchData != null) {
for(EmsPcsBranchData emsPcsBranchData : pcsBranchData) {
PcsBranchInfo pcsBranchInfo = new PcsBranchInfo();
BeanUtils.copyProperties(emsPcsBranchData, pcsBranchInfo);
pcsBranchInfoList.add(pcsBranchInfo);
}
}
}
}
// 获取BMS总览数据 // 获取BMS总览数据
@Override @Override
public List<BMSOverViewVo> getBMSOverView(String siteId) { public List<BMSOverViewVo> getBMSOverView(String siteId) {
List<BMSOverViewVo> bmsOverViewVoList = new ArrayList<>(); List<BMSOverViewVo> bmsOverViewVoList = new ArrayList<>();
// 获取所有电池堆
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
// 获取电池堆list List<Map<String, Object>> stackIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.STACK.getCode());
bmsOverViewVoList = emsBatteryStackMapper.selectEmsBatteryStackBySiteId(siteId); for (Map<String, Object> stackDevice : stackIds) {
if (!CollectionUtils.isEmpty(bmsOverViewVoList)) { BMSOverViewVo bmsOverViewVo = new BMSOverViewVo();
for (BMSOverViewVo bmsOverViewVo : bmsOverViewVoList) { bmsOverViewVo.setDeviceName(stackDevice.get("deviceName").toString());
// 获取单体电池数据 // 从redis取堆单个详细数据
String stackDeviceId = bmsOverViewVo.getDeviceId(); String stackId = stackDevice.get("id").toString();
if (!StringUtils.isEmpty(stackDeviceId)) { EmsBatteryStack stackData = redisCache.getCacheObject(RedisKeyConstants.STACK +siteId+"_"+stackId);
List<BMSBatteryDataList> batteryDataList = emsBatteryClusterMapper.getBmsBatteryData(siteId,stackDeviceId); if (stackData != null) {
bmsOverViewVo.setBatteryDataList(batteryDataList); BeanUtils.copyProperties(stackData, bmsOverViewVo);
} }
// 下面簇列表数据
if (!StringUtils.isEmpty(stackId)) {
getBMSClusterListInfo(siteId,stackId,bmsOverViewVo);
} }
bmsOverViewVoList.add(bmsOverViewVo);
} }
} }
return bmsOverViewVoList; return bmsOverViewVoList;
} }
private void getBMSClusterListInfo(String siteId, String stackId, BMSOverViewVo bmsOverViewVo) {
List<BMSBatteryDataList> batteryDataList = new ArrayList();
List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfoByParentId(stackId);
for (Map<String, Object> clusterDevice : clusterIds) {
BMSBatteryDataList bmsBatteryDataList= new BMSBatteryDataList();
// 从redis取单个簇的详细数据
String clusterId = clusterDevice.get("id").toString();
bmsBatteryDataList.setClusterId(clusterId);
EmsBatteryCluster clusterData = redisCache.getCacheObject(RedisKeyConstants.CLUSTER + siteId + "_" + clusterId);
if (clusterData != null) {
BeanUtils.copyProperties(clusterData, bmsBatteryDataList);
}
batteryDataList.add(bmsBatteryDataList);
}
bmsOverViewVo.setBatteryDataList(batteryDataList);
}
// 获取BMS电池簇数据 // 获取BMS电池簇数据
@Override @Override
public List<BMSBatteryClusterVo> getBMSBatteryCluster(String siteId) { public List<BMSBatteryClusterVo> getBMSBatteryCluster(String siteId) {
List<BMSBatteryClusterVo> bmsBatteryClusterVoList = new ArrayList<>(); List<BMSBatteryClusterVo> bmsBatteryClusterVoList = new ArrayList<>();
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
bmsBatteryClusterVoList = emsBatteryClusterMapper.getBMSBatteryCluster(siteId); // 获取所有设备下的电池簇id
if (!CollectionUtils.isEmpty(bmsBatteryClusterVoList)) { List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.CLUSTER.getCode());
for (BMSBatteryClusterVo bmsBatteryClusterVo : bmsBatteryClusterVoList) { for (Map<String, Object> clusterDevice : clusterIds) {
BMSBatteryClusterVo bmsBatteryClusterVo = new BMSBatteryClusterVo();
String clusterDeviceId = bmsBatteryClusterVo.getDeviceId(); bmsBatteryClusterVo.setDeviceName(clusterDevice.get("deviceName").toString());
// 从redis取单个簇详细数据
String clusterId = clusterDevice.get("id").toString();
EmsBatteryCluster clusterData = redisCache.getCacheObject(RedisKeyConstants.CLUSTER +siteId+"_"+clusterId);
if (clusterData != null) {
BeanUtils.copyProperties(clusterData, bmsBatteryClusterVo);
// 处理单体电池数据-平均/最大/最小
List<BMSBatteryClusterDataList> clusterDataList = new ArrayList<>(); List<BMSBatteryClusterDataList> clusterDataList = new ArrayList<>();
if (!StringUtils.isEmpty(clusterDeviceId)) { dealWithBatteryClusterData(clusterData,clusterDataList);
// 获取单体电池数据-平均/最大/最小 bmsBatteryClusterVo.setBatteryDataList(clusterDataList);
//BatteryClusterDataDetailVo batteryClusterDataDetailVo = emsBatteryDataMapper.getBatteryDataByClusterId(siteId,clusterDeviceId); }
// 处理数据
bmsBatteryClusterVoList.add(bmsBatteryClusterVo);
}
}
return bmsBatteryClusterVoList;
}
private void dealWithBatteryClusterData(EmsBatteryCluster clusterData, List<BMSBatteryClusterDataList> clusterDataList) {
BMSBatteryClusterDataList voltageData = new BMSBatteryClusterDataList(); BMSBatteryClusterDataList voltageData = new BMSBatteryClusterDataList();
BMSBatteryClusterDataList tempData = new BMSBatteryClusterDataList(); BMSBatteryClusterDataList tempData = new BMSBatteryClusterDataList();
BMSBatteryClusterDataList socData = new BMSBatteryClusterDataList(); BMSBatteryClusterDataList socData = new BMSBatteryClusterDataList();
// 设值 // 设值
voltageData.setDataName(CLUSTER_DATA_VOLTAGE); voltageData.setDataName(CLUSTER_DATA_VOLTAGE);
voltageData.setAvgData(bmsBatteryClusterVo.getAvgVoltage()); voltageData.setAvgData(clusterData.getAvgCellVoltage());
voltageData.setMaxData(bmsBatteryClusterVo.getMaxVoltage()); voltageData.setMaxData(clusterData.getMaxCellVoltage());
voltageData.setMaxDataID(bmsBatteryClusterVo.getMaxVoltageID()); voltageData.setMaxDataID(clusterData.getMaxCellVoltageId().toString());
voltageData.setMinData(bmsBatteryClusterVo.getMinVoltage()); voltageData.setMinData(clusterData.getMinCellVoltage());
voltageData.setMinDataID(bmsBatteryClusterVo.getMinVoltageID()); voltageData.setMinDataID(clusterData.getMinCellVoltageId().toString());
tempData.setDataName(CLUSTER_DATA_TEP); tempData.setDataName(CLUSTER_DATA_TEP);
tempData.setAvgData(bmsBatteryClusterVo.getAvgTemp()); tempData.setAvgData(clusterData.getAvgCellTemp());
tempData.setMaxData(bmsBatteryClusterVo.getMaxTemp()); tempData.setMaxData(clusterData.getMaxCellTemp());
tempData.setMaxDataID(bmsBatteryClusterVo.getMaxTempID()); tempData.setMaxDataID(clusterData.getMaxCellTempId().toString());
tempData.setMinData(bmsBatteryClusterVo.getMinTemp()); tempData.setMinData(clusterData.getMinCellTemp());
tempData.setMinDataID(bmsBatteryClusterVo.getMinTempID()); tempData.setMinDataID(clusterData.getMinCellTempId().toString());
socData.setDataName(CLUSTER_DATA_SOC); socData.setDataName(CLUSTER_DATA_SOC);
socData.setAvgData(bmsBatteryClusterVo.getAvgSoc()); socData.setAvgData(clusterData.getCurrentSoc());
socData.setMaxData(bmsBatteryClusterVo.getMaxSoc()); socData.setMaxData(clusterData.getMaxCellSoc());
socData.setMaxDataID(bmsBatteryClusterVo.getMaxSocID()); socData.setMaxDataID(clusterData.getMaxCellSocId().toString());
socData.setMinData(bmsBatteryClusterVo.getMinSoc()); socData.setMinData(clusterData.getMinCellSoc());
socData.setMinDataID(bmsBatteryClusterVo.getMinSocID()); socData.setMinDataID(clusterData.getMinCellSocId().toString());
clusterDataList.add(voltageData); clusterDataList.add(voltageData);
clusterDataList.add(tempData); clusterDataList.add(tempData);
clusterDataList.add(socData); clusterDataList.add(socData);
bmsBatteryClusterVo.setBatteryDataList(clusterDataList);
}
}
}
}
return bmsBatteryClusterVoList;
} }
// 获取液冷设备参数 // 获取液冷设备参数
@ -237,14 +311,33 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
/** /**
* 根据电池堆获取单体柱状数据 * 根据电池堆获取单体电池数据
* @param clusterDeviceId * @param clusterDeviceId
* @return * @return
*/ */
@Override @Override
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId) { public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId) {
List<BatteryDataStatsListVo> batteryDataStatsListVo = new ArrayList<>(); List<BatteryDataStatsListVo> batteryDataStatsListVo = new ArrayList<>();
batteryDataStatsListVo = emsBatteryDataMapper.getAllBatteryDataByClusterId(clusterDeviceId,siteId); List<Map<String, Object>> clusterIds = new ArrayList<>();
if (StringUtils.isEmpty(clusterDeviceId)) {
clusterIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.CLUSTER.getCode());
} else {
Map<String, Object> map = new HashMap<>();
map.put("id", clusterDeviceId);
clusterIds.add(map);
}
for (Map<String, Object> clusterDevice : clusterIds) {
// 从redis取单个簇详细数据
String clusterId = clusterDevice.get("id").toString();
List<EmsBatteryData> batteryDataList = redisCache.getCacheList(RedisKeyConstants.BATTERY + siteId + "_" + clusterId);
if (batteryDataList != null) {
for (EmsBatteryData batteryData : batteryDataList) {
BatteryDataStatsListVo batteryDataStatsVo = new BatteryDataStatsListVo();
BeanUtils.copyProperties(batteryData, batteryDataStatsVo);
batteryDataStatsListVo.add(batteryDataStatsVo);
}
}
}
return batteryDataStatsListVo; return batteryDataStatsListVo;
} }
@ -254,29 +347,96 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
* @return * @return
*/ */
@Override @Override
public List<AmmeterDataVo> getAmmeterDataList(String siteId) { public AmmeterDataResponse getAmmeterDataList(String siteId) {
List<AmmeterDataVo> ammeterDataVos = new ArrayList<>(); AmmeterDataResponse ammeterResponse = new AmmeterDataResponse();
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
// 先获取所有电表设备 // 先获取电表设备
List<EmsDevicesSetting> devicesList = emsDevicesSettingMapper.getAllBatteryDeviceBySiteId(siteId); List<Map<String, Object>> ammeterIdList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.AMMETER.getCode());
if (!CollectionUtils.isEmpty(devicesList)) {
for (EmsDevicesSetting devicesSetting : devicesList) {
AmmeterDataVo ammeterDataVo = new AmmeterDataVo();
ammeterDataVo.setDeviceName(devicesSetting.getDeviceName());
ammeterDataVo.setEmsCommunicationStatus(devicesSetting.getCommunicationStatus());
String deviceId = devicesSetting.getDeviceId();
// 获取类别数据
List<AmmeterDataDetailInfo> ammeterDataDetailInfos = emsAmmeterDataMapper.getAmmeterDetailInfo(siteId,deviceId);
ammeterDataVo.setAmmeterDataDetailInfos(ammeterDataDetailInfos);
// 数据更新时间
ammeterDataVo.setDataUpdateTime(ammeterDataDetailInfos.get(0).getUpdateTime());
ammeterDataVos.add(ammeterDataVo); for (Map<String, Object> ammeterDevice : ammeterIdList) {
String ammeterId = ammeterDevice.get("id").toString();
// 从redis取总表详细数据
EmsAmmeterData ammeterData = redisCache.getCacheObject(RedisKeyConstants.AMMETER + siteId + "_" +ammeterId);
// 判断电表类型
if (AMMETER_DEVICE_LOAD.equals(ammeterId)) {
AmmeterLoadDataVo ammeterLoadDataVo = new AmmeterLoadDataVo();
ammeterLoadDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
ammeterLoadDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus").toString());
// 处理总表数据
dealAmmeterLoadData(ammeterData,ammeterLoadDataVo);
ammeterResponse.setAmmeterLoadDataVoList(ammeterLoadDataVo);
} else if (AMMETER_DEVICE_METE.equals(ammeterId)) {
AmmeterMeteDataVo ammeterMeteDataVo = new AmmeterMeteDataVo();
ammeterMeteDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
ammeterMeteDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus").toString());
// 处理储能表数据
dealAmmeterMeteData(ammeterData,ammeterMeteDataVo);
ammeterResponse.setAmmeterMeteDataVoList(ammeterMeteDataVo);
} }
} }
} }
return ammeterDataVos; return ammeterResponse;
}
private void dealAmmeterMeteData(EmsAmmeterData ammeterData, AmmeterMeteDataVo ammeterMeteDataVo) {
if (ammeterData != null) {
// 数据更新时间
ammeterMeteDataVo.setDataUpdateTime(ammeterData.getDataUpdateTime());
List<MeteDataDetailInfo> meteDataDetailInfos = new ArrayList<>();
// 拼接数据
// a相
MeteDataDetailInfo meteDataDetailInfo1 = new MeteDataDetailInfo();
meteDataDetailInfo1.setCategory(AmmeterCategory.A_POWER.getInfo());
meteDataDetailInfo1.setActivePower(ammeterData.getPhaseAActivePower());
meteDataDetailInfo1.setReactivePower(ammeterData.getPhaseAReactivePower());
meteDataDetailInfos.add(meteDataDetailInfo1);
// b相
MeteDataDetailInfo meteDataDetailInfo2 = new MeteDataDetailInfo();
meteDataDetailInfo2.setCategory(AmmeterCategory.B_POWER.getInfo());
meteDataDetailInfo2.setActivePower(ammeterData.getPhaseBActivePower());
meteDataDetailInfo2.setReactivePower(ammeterData.getPhaseBReactivePower());
meteDataDetailInfos.add(meteDataDetailInfo2);
// c相
MeteDataDetailInfo meteDataDetailInfo3 = new MeteDataDetailInfo();
meteDataDetailInfo3.setCategory(AmmeterCategory.C_POWER.getInfo());
meteDataDetailInfo3.setActivePower(ammeterData.getPhaseCActivePower());
meteDataDetailInfo3.setReactivePower(ammeterData.getPhaseCReactivePower());
meteDataDetailInfos.add(meteDataDetailInfo3);
ammeterMeteDataVo.setMeteDataDetailInfo(meteDataDetailInfos);
}
}
private void dealAmmeterLoadData(EmsAmmeterData ammeterData, AmmeterLoadDataVo ammeterDataVo) {
if (ammeterData != null) {
// 数据更新时间
ammeterDataVo.setDataUpdateTime(ammeterData.getDataUpdateTime());
List<LoadDataDetailInfo> loadDataDetailInfos = new ArrayList<>();
// 拼接数据
// 组合有功
LoadDataDetailInfo ammeterDataDetailInfo1 = new LoadDataDetailInfo();
ammeterDataDetailInfo1.setCategory(AmmeterCategory.CURRENT_COMB_ACTIVE.getInfo());
ammeterDataDetailInfo1.setTotalKwh(ammeterData.getCurrentCombActiveTotal());
ammeterDataDetailInfo1.setPeakKwh(ammeterData.getCurrentCombActivePeak());
ammeterDataDetailInfo1.setHighKwh(ammeterData.getCurrentCombActiveHigh());
ammeterDataDetailInfo1.setFlatKwh(ammeterData.getCurrentCombActiveFlat());
ammeterDataDetailInfo1.setValleyKwh(ammeterData.getCurrentCombActiveValley());
loadDataDetailInfos.add(ammeterDataDetailInfo1);
// 组合无功
LoadDataDetailInfo ammeterDataDetailInfo2 = new LoadDataDetailInfo();
ammeterDataDetailInfo2.setCategory(AmmeterCategory.CURRENT_COMB_REACTIVE.getInfo());
ammeterDataDetailInfo2.setTotalKwh(ammeterData.getCurrentCombReactiveTotal());
ammeterDataDetailInfo2.setPeakKwh(ammeterData.getCurrentCombReactivePeak());
ammeterDataDetailInfo2.setHighKwh(ammeterData.getCurrentCombReactiveHigh());
ammeterDataDetailInfo2.setFlatKwh(ammeterData.getCurrentCombReactiveFlat());
ammeterDataDetailInfo2.setValleyKwh(ammeterData.getCurrentCombReactiveValley());
loadDataDetailInfos.add(ammeterDataDetailInfo2);
ammeterDataVo.setLoadDataDetailInfo(loadDataDetailInfos);
}
} }
} }

View File

@ -7,37 +7,211 @@
<resultMap type="EmsAmmeterData" id="EmsAmmeterDataResult"> <resultMap type="EmsAmmeterData" id="EmsAmmeterDataResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="dataUpdateTime" column="data_update_time" /> <result property="dataUpdateTime" column="data_update_time" />
<result property="category" column="category" /> <result property="currentCombActiveTotal" column="current_comb_active_total" />
<result property="totalKwh" column="total_kwh" /> <result property="currentCombActivePeak" column="current_comb_active_peak" />
<result property="sharpKwh" column="sharp_kwh" /> <result property="currentCombActiveHigh" column="current_comb_active_high" />
<result property="peakKwh" column="peak_kwh" /> <result property="currentCombActiveFlat" column="current_comb_active_flat" />
<result property="flatKwh" column="flat_kwh" /> <result property="currentCombActiveValley" column="current_comb_active_valley" />
<result property="valleyKwh" column="valley_kwh" /> <result property="currentForwardActiveTotal" column="current_forward_active_total" />
<result property="currentForwardActivePeak" column="current_forward_active_peak" />
<result property="currentForwardActiveHigh" column="current_forward_active_high" />
<result property="currentForwardActiveFlat" column="current_forward_active_flat" />
<result property="currentForwardActiveValley" column="current_forward_active_valley" />
<result property="currentReverseActiveTotal" column="current_reverse_active_total" />
<result property="currentReverseActivePeak" column="current_reverse_active_peak" />
<result property="currentReverseActiveHigh" column="current_reverse_active_high" />
<result property="currentReverseActiveFlat" column="current_reverse_active_flat" />
<result property="currentReverseActiveValley" column="current_reverse_active_valley" />
<result property="currentCombReactiveTotal" column="current_comb_reactive_total" />
<result property="currentCombReactivePeak" column="current_comb_reactive_peak" />
<result property="currentCombReactiveHigh" column="current_comb_reactive_high" />
<result property="currentCombReactiveFlat" column="current_comb_reactive_flat" />
<result property="currentCombReactiveValley" column="current_comb_reactive_valley" />
<result property="currentForwardReactiveTotal" column="current_forward_reactive_total" />
<result property="currentForwardReactivePeak" column="current_forward_reactive_peak" />
<result property="currentForwardReactiveHigh" column="current_forward_reactive_high" />
<result property="currentForwardReactiveFlat" column="current_forward_reactive_flat" />
<result property="currentForwardReactiveValley" column="current_forward_reactive_valley" />
<result property="currentReverseReactiveTotal" column="current_reverse_reactive_total" />
<result property="currentReverseReactivePeak" column="current_reverse_reactive_peak" />
<result property="currentReverseReactiveHigh" column="current_reverse_reactive_high" />
<result property="currentReverseReactiveFlat" column="current_reverse_reactive_flat" />
<result property="currentReverseReactiveValley" column="current_reverse_reactive_valley" />
<result property="phaseAVoltage" column="phase_a_voltage" />
<result property="phaseBVoltage" column="phase_b_voltage" />
<result property="phaseCVoltage" column="phase_c_voltage" />
<result property="phaseACurrent" column="phase_a_current" />
<result property="phaseBCurrent" column="phase_b_current" />
<result property="phaseCCurrent" column="phase_c_current" />
<result property="frequency" column="frequency" />
<result property="abLineVoltage" column="ab_line_voltage" />
<result property="cbLineVoltage" column="cb_line_voltage" />
<result property="acLineVoltage" column="ac_line_voltage" />
<result property="forwardAcMaxDemand" column="forward_ac_max_demand" />
<result property="reverseAcMaxDemand" column="reverse_ac_max_demand" />
<result property="phaseAActivePower" column="phase_a_active_power" />
<result property="phaseBActivePower" column="phase_b_active_power" />
<result property="phaseCActivePower" column="phase_c_active_power" />
<result property="totalActivePower" column="total_active_power" />
<result property="phaseAReactivePower" column="phase_a_reactive_power" />
<result property="phaseBReactivePower" column="phase_b_reactive_power" />
<result property="phaseCReactivePower" column="phase_c_reactive_power" />
<result property="totalReactivePower" column="total_reactive_power" />
<result property="phaseAApparentPower" column="phase_a_apparent_power" />
<result property="phaseBApparentPower" column="phase_b_apparent_power" />
<result property="phaseCApparentPower" column="phase_c_apparent_power" />
<result property="totalApparentPower" column="total_apparent_power" />
<result property="phaseAPowerFactor" column="phase_a_power_factor" />
<result property="phaseBPowerFactor" column="phase_b_power_factor" />
<result property="phaseCPowerFactor" column="phase_c_power_factor" />
<result property="totalPowerFactor" column="total_power_factor" />
<result property="dailyForwardMaxDemand" column="daily_forward_max_demand" />
<result property="siteId" column="site_id" />
<result property="deviceId" column="device_id" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="siteId" column="site_id" /> <result property="secondaryAbLineVoltage" column="secondary_ab_line_voltage" />
<result property="deviceId" column="device_id" /> <result property="secondaryAPhaseCurrent" column="secondary_a_phase_current" />
<result property="secondaryAPhaseVoltage" column="secondary_a_phase_voltage" />
<result property="secondaryAPowerFactor" column="secondary_a_power_factor" />
<result property="secondaryAApparentPower" column="secondary_a_apparent_power" />
<result property="secondaryAReactivePower" column="secondary_a_reactive_power" />
<result property="secondaryAActivePower" column="secondary_a_active_power" />
<result property="secondaryBcLineVoltage" column="secondary_bc_line_voltage" />
<result property="secondaryBPhaseCurrent" column="secondary_b_phase_current" />
<result property="secondaryBPhaseVoltage" column="secondary_b_phase_voltage" />
<result property="secondaryBPowerFactor" column="secondary_b_power_factor" />
<result property="secondaryBApparentPower" column="secondary_b_apparent_power" />
<result property="secondaryBReactivePower" column="secondary_b_reactive_power" />
<result property="secondaryBActivePower" column="secondary_b_active_power" />
<result property="secondaryCaLineVoltage" column="secondary_ca_line_voltage" />
<result property="secondaryCPhaseCurrent" column="secondary_c_phase_current" />
<result property="secondaryCPhaseVoltage" column="secondary_c_phase_voltage" />
<result property="secondaryCPowerFactor" column="secondary_c_power_factor" />
<result property="secondaryCApparentPower" column="secondary_c_apparent_power" />
<result property="secondaryCReactivePower" column="secondary_c_reactive_power" />
<result property="secondaryCActivePower" column="secondary_c_active_power" />
<result property="secondaryGridFrequency" column="secondary_grid_frequency" />
<result property="secondaryReverseReactiveEnergy" column="secondary_reverse_reactive_energy" />
<result property="secondaryNegativeActiveEnergy" column="secondary_negative_active_energy" />
<result property="secondaryTotalPowerFactor" column="secondary_total_power_factor" />
<result property="secondaryTotalApparentPower" column="secondary_total_apparent_power" />
<result property="secondaryTotalReactivePower" column="secondary_total_reactive_power" />
<result property="secondaryPositiveReactiveEnergy" column="secondary_positive_reactive_energy" />
<result property="secondaryPositiveActiveEnergy" column="secondary_positive_active_energy" />
<result property="secondaryTotalActivePower" column="secondary_total_active_power" />
<result property="reverseReactiveEnergyEqMinus" column="reverse_reactive_energy_eq_minus" />
<result property="reverseActiveEnergyEpMinus" column="reverse_active_energy_ep_minus" />
<result property="positiveReactiveEnergyEqPlus" column="positive_reactive_energy_eq_plus" />
<result property="positiveActiveEnergyEpPlus" column="positive_active_energy_ep_plus" />
</resultMap> </resultMap>
<sql id="selectEmsAmmeterDataVo"> <sql id="selectEmsAmmeterDataVo">
select id, data_update_time, category, total_kwh, sharp_kwh, peak_kwh, flat_kwh, valley_kwh, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_ammeter_data select id, data_update_time, current_comb_active_total, current_comb_active_peak, current_comb_active_high, current_comb_active_flat, current_comb_active_valley, current_forward_active_total, current_forward_active_peak, current_forward_active_high, current_forward_active_flat, current_forward_active_valley, current_reverse_active_total, current_reverse_active_peak, current_reverse_active_high, current_reverse_active_flat, current_reverse_active_valley, current_comb_reactive_total, current_comb_reactive_peak, current_comb_reactive_high, current_comb_reactive_flat, current_comb_reactive_valley, current_forward_reactive_total, current_forward_reactive_peak, current_forward_reactive_high, current_forward_reactive_flat, current_forward_reactive_valley, current_reverse_reactive_total, current_reverse_reactive_peak, current_reverse_reactive_high, current_reverse_reactive_flat, current_reverse_reactive_valley, phase_a_voltage, phase_b_voltage, phase_c_voltage, phase_a_current, phase_b_current, phase_c_current, frequency, ab_line_voltage, cb_line_voltage, ac_line_voltage, forward_ac_max_demand, reverse_ac_max_demand, phase_a_active_power, phase_b_active_power, phase_c_active_power, total_active_power, phase_a_reactive_power, phase_b_reactive_power, phase_c_reactive_power, total_reactive_power, phase_a_apparent_power, phase_b_apparent_power, phase_c_apparent_power, total_apparent_power, phase_a_power_factor, phase_b_power_factor, phase_c_power_factor, total_power_factor, daily_forward_max_demand, site_id, device_id, create_by, create_time, update_by, update_time, remark, secondary_ab_line_voltage, secondary_a_phase_current, secondary_a_phase_voltage, secondary_a_power_factor, secondary_a_apparent_power, secondary_a_reactive_power, secondary_a_active_power, secondary_bc_line_voltage, secondary_b_phase_current, secondary_b_phase_voltage, secondary_b_power_factor, secondary_b_apparent_power, secondary_b_reactive_power, secondary_b_active_power, secondary_ca_line_voltage, secondary_c_phase_current, secondary_c_phase_voltage, secondary_c_power_factor, secondary_c_apparent_power, secondary_c_reactive_power, secondary_c_active_power, secondary_grid_frequency, secondary_reverse_reactive_energy, secondary_negative_active_energy, secondary_total_power_factor, secondary_total_apparent_power, secondary_total_reactive_power, secondary_positive_reactive_energy, secondary_positive_active_energy, secondary_total_active_power, reverse_reactive_energy_eq_minus, reverse_active_energy_ep_minus, positive_reactive_energy_eq_plus, positive_active_energy_ep_plus from ems_ammeter_data
</sql> </sql>
<select id="selectEmsAmmeterDataList" parameterType="EmsAmmeterData" resultMap="EmsAmmeterDataResult"> <select id="selectEmsAmmeterDataList" parameterType="EmsAmmeterData" resultMap="EmsAmmeterDataResult">
<include refid="selectEmsAmmeterDataVo"/> <include refid="selectEmsAmmeterDataVo"/>
<where> <where>
<if test="dataUpdateTime != null "> and data_update_time = #{dataUpdateTime}</if> <if test="dataUpdateTime != null "> and data_update_time = #{dataUpdateTime}</if>
<if test="category != null and category != ''"> and category = #{category}</if> <if test="currentCombActiveTotal != null "> and current_comb_active_total = #{currentCombActiveTotal}</if>
<if test="totalKwh != null "> and total_kwh = #{totalKwh}</if> <if test="currentCombActivePeak != null "> and current_comb_active_peak = #{currentCombActivePeak}</if>
<if test="sharpKwh != null "> and sharp_kwh = #{sharpKwh}</if> <if test="currentCombActiveHigh != null "> and current_comb_active_high = #{currentCombActiveHigh}</if>
<if test="peakKwh != null "> and peak_kwh = #{peakKwh}</if> <if test="currentCombActiveFlat != null "> and current_comb_active_flat = #{currentCombActiveFlat}</if>
<if test="flatKwh != null "> and flat_kwh = #{flatKwh}</if> <if test="currentCombActiveValley != null "> and current_comb_active_valley = #{currentCombActiveValley}</if>
<if test="valleyKwh != null "> and valley_kwh = #{valleyKwh}</if> <if test="currentForwardActiveTotal != null "> and current_forward_active_total = #{currentForwardActiveTotal}</if>
<if test="currentForwardActivePeak != null "> and current_forward_active_peak = #{currentForwardActivePeak}</if>
<if test="currentForwardActiveHigh != null "> and current_forward_active_high = #{currentForwardActiveHigh}</if>
<if test="currentForwardActiveFlat != null "> and current_forward_active_flat = #{currentForwardActiveFlat}</if>
<if test="currentForwardActiveValley != null "> and current_forward_active_valley = #{currentForwardActiveValley}</if>
<if test="currentReverseActiveTotal != null "> and current_reverse_active_total = #{currentReverseActiveTotal}</if>
<if test="currentReverseActivePeak != null "> and current_reverse_active_peak = #{currentReverseActivePeak}</if>
<if test="currentReverseActiveHigh != null "> and current_reverse_active_high = #{currentReverseActiveHigh}</if>
<if test="currentReverseActiveFlat != null "> and current_reverse_active_flat = #{currentReverseActiveFlat}</if>
<if test="currentReverseActiveValley != null "> and current_reverse_active_valley = #{currentReverseActiveValley}</if>
<if test="currentCombReactiveTotal != null "> and current_comb_reactive_total = #{currentCombReactiveTotal}</if>
<if test="currentCombReactivePeak != null "> and current_comb_reactive_peak = #{currentCombReactivePeak}</if>
<if test="currentCombReactiveHigh != null "> and current_comb_reactive_high = #{currentCombReactiveHigh}</if>
<if test="currentCombReactiveFlat != null "> and current_comb_reactive_flat = #{currentCombReactiveFlat}</if>
<if test="currentCombReactiveValley != null "> and current_comb_reactive_valley = #{currentCombReactiveValley}</if>
<if test="currentForwardReactiveTotal != null "> and current_forward_reactive_total = #{currentForwardReactiveTotal}</if>
<if test="currentForwardReactivePeak != null "> and current_forward_reactive_peak = #{currentForwardReactivePeak}</if>
<if test="currentForwardReactiveHigh != null "> and current_forward_reactive_high = #{currentForwardReactiveHigh}</if>
<if test="currentForwardReactiveFlat != null "> and current_forward_reactive_flat = #{currentForwardReactiveFlat}</if>
<if test="currentForwardReactiveValley != null "> and current_forward_reactive_valley = #{currentForwardReactiveValley}</if>
<if test="currentReverseReactiveTotal != null "> and current_reverse_reactive_total = #{currentReverseReactiveTotal}</if>
<if test="currentReverseReactivePeak != null "> and current_reverse_reactive_peak = #{currentReverseReactivePeak}</if>
<if test="currentReverseReactiveHigh != null "> and current_reverse_reactive_high = #{currentReverseReactiveHigh}</if>
<if test="currentReverseReactiveFlat != null "> and current_reverse_reactive_flat = #{currentReverseReactiveFlat}</if>
<if test="currentReverseReactiveValley != null "> and current_reverse_reactive_valley = #{currentReverseReactiveValley}</if>
<if test="phaseAVoltage != null "> and phase_a_voltage = #{phaseAVoltage}</if>
<if test="phaseBVoltage != null "> and phase_b_voltage = #{phaseBVoltage}</if>
<if test="phaseCVoltage != null "> and phase_c_voltage = #{phaseCVoltage}</if>
<if test="phaseACurrent != null "> and phase_a_current = #{phaseACurrent}</if>
<if test="phaseBCurrent != null "> and phase_b_current = #{phaseBCurrent}</if>
<if test="phaseCCurrent != null "> and phase_c_current = #{phaseCCurrent}</if>
<if test="frequency != null "> and frequency = #{frequency}</if>
<if test="abLineVoltage != null "> and ab_line_voltage = #{abLineVoltage}</if>
<if test="cbLineVoltage != null "> and cb_line_voltage = #{cbLineVoltage}</if>
<if test="acLineVoltage != null "> and ac_line_voltage = #{acLineVoltage}</if>
<if test="forwardAcMaxDemand != null "> and forward_ac_max_demand = #{forwardAcMaxDemand}</if>
<if test="reverseAcMaxDemand != null "> and reverse_ac_max_demand = #{reverseAcMaxDemand}</if>
<if test="phaseAActivePower != null "> and phase_a_active_power = #{phaseAActivePower}</if>
<if test="phaseBActivePower != null "> and phase_b_active_power = #{phaseBActivePower}</if>
<if test="phaseCActivePower != null "> and phase_c_active_power = #{phaseCActivePower}</if>
<if test="totalActivePower != null "> and total_active_power = #{totalActivePower}</if>
<if test="phaseAReactivePower != null "> and phase_a_reactive_power = #{phaseAReactivePower}</if>
<if test="phaseBReactivePower != null "> and phase_b_reactive_power = #{phaseBReactivePower}</if>
<if test="phaseCReactivePower != null "> and phase_c_reactive_power = #{phaseCReactivePower}</if>
<if test="totalReactivePower != null "> and total_reactive_power = #{totalReactivePower}</if>
<if test="phaseAApparentPower != null "> and phase_a_apparent_power = #{phaseAApparentPower}</if>
<if test="phaseBApparentPower != null "> and phase_b_apparent_power = #{phaseBApparentPower}</if>
<if test="phaseCApparentPower != null "> and phase_c_apparent_power = #{phaseCApparentPower}</if>
<if test="totalApparentPower != null "> and total_apparent_power = #{totalApparentPower}</if>
<if test="phaseAPowerFactor != null "> and phase_a_power_factor = #{phaseAPowerFactor}</if>
<if test="phaseBPowerFactor != null "> and phase_b_power_factor = #{phaseBPowerFactor}</if>
<if test="phaseCPowerFactor != null "> and phase_c_power_factor = #{phaseCPowerFactor}</if>
<if test="totalPowerFactor != null "> and total_power_factor = #{totalPowerFactor}</if>
<if test="dailyForwardMaxDemand != null "> and daily_forward_max_demand = #{dailyForwardMaxDemand}</if>
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if> <if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if> <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="secondaryAbLineVoltage != null "> and secondary_ab_line_voltage = #{secondaryAbLineVoltage}</if>
<if test="secondaryAPhaseCurrent != null "> and secondary_a_phase_current = #{secondaryAPhaseCurrent}</if>
<if test="secondaryAPhaseVoltage != null "> and secondary_a_phase_voltage = #{secondaryAPhaseVoltage}</if>
<if test="secondaryAPowerFactor != null "> and secondary_a_power_factor = #{secondaryAPowerFactor}</if>
<if test="secondaryAApparentPower != null "> and secondary_a_apparent_power = #{secondaryAApparentPower}</if>
<if test="secondaryAReactivePower != null "> and secondary_a_reactive_power = #{secondaryAReactivePower}</if>
<if test="secondaryAActivePower != null "> and secondary_a_active_power = #{secondaryAActivePower}</if>
<if test="secondaryBcLineVoltage != null "> and secondary_bc_line_voltage = #{secondaryBcLineVoltage}</if>
<if test="secondaryBPhaseCurrent != null "> and secondary_b_phase_current = #{secondaryBPhaseCurrent}</if>
<if test="secondaryBPhaseVoltage != null "> and secondary_b_phase_voltage = #{secondaryBPhaseVoltage}</if>
<if test="secondaryBPowerFactor != null "> and secondary_b_power_factor = #{secondaryBPowerFactor}</if>
<if test="secondaryBApparentPower != null "> and secondary_b_apparent_power = #{secondaryBApparentPower}</if>
<if test="secondaryBReactivePower != null "> and secondary_b_reactive_power = #{secondaryBReactivePower}</if>
<if test="secondaryBActivePower != null "> and secondary_b_active_power = #{secondaryBActivePower}</if>
<if test="secondaryCaLineVoltage != null "> and secondary_ca_line_voltage = #{secondaryCaLineVoltage}</if>
<if test="secondaryCPhaseCurrent != null "> and secondary_c_phase_current = #{secondaryCPhaseCurrent}</if>
<if test="secondaryCPhaseVoltage != null "> and secondary_c_phase_voltage = #{secondaryCPhaseVoltage}</if>
<if test="secondaryCPowerFactor != null "> and secondary_c_power_factor = #{secondaryCPowerFactor}</if>
<if test="secondaryCApparentPower != null "> and secondary_c_apparent_power = #{secondaryCApparentPower}</if>
<if test="secondaryCReactivePower != null "> and secondary_c_reactive_power = #{secondaryCReactivePower}</if>
<if test="secondaryCActivePower != null "> and secondary_c_active_power = #{secondaryCActivePower}</if>
<if test="secondaryGridFrequency != null "> and secondary_grid_frequency = #{secondaryGridFrequency}</if>
<if test="secondaryReverseReactiveEnergy != null "> and secondary_reverse_reactive_energy = #{secondaryReverseReactiveEnergy}</if>
<if test="secondaryNegativeActiveEnergy != null "> and secondary_negative_active_energy = #{secondaryNegativeActiveEnergy}</if>
<if test="secondaryTotalPowerFactor != null "> and secondary_total_power_factor = #{secondaryTotalPowerFactor}</if>
<if test="secondaryTotalApparentPower != null "> and secondary_total_apparent_power = #{secondaryTotalApparentPower}</if>
<if test="secondaryTotalReactivePower != null "> and secondary_total_reactive_power = #{secondaryTotalReactivePower}</if>
<if test="secondaryPositiveReactiveEnergy != null "> and secondary_positive_reactive_energy = #{secondaryPositiveReactiveEnergy}</if>
<if test="secondaryPositiveActiveEnergy != null "> and secondary_positive_active_energy = #{secondaryPositiveActiveEnergy}</if>
<if test="secondaryTotalActivePower != null "> and secondary_total_active_power = #{secondaryTotalActivePower}</if>
<if test="reverseReactiveEnergyEqMinus != null "> and reverse_reactive_energy_eq_minus = #{reverseReactiveEnergyEqMinus}</if>
<if test="reverseActiveEnergyEpMinus != null "> and reverse_active_energy_ep_minus = #{reverseActiveEnergyEpMinus}</if>
<if test="positiveReactiveEnergyEqPlus != null "> and positive_reactive_energy_eq_plus = #{positiveReactiveEnergyEqPlus}</if>
<if test="positiveActiveEnergyEpPlus != null "> and positive_active_energy_ep_plus = #{positiveActiveEnergyEpPlus}</if>
</where> </where>
</select> </select>
@ -50,35 +224,209 @@
insert into ems_ammeter_data insert into ems_ammeter_data
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dataUpdateTime != null">data_update_time,</if> <if test="dataUpdateTime != null">data_update_time,</if>
<if test="category != null">category,</if> <if test="currentCombActiveTotal != null">current_comb_active_total,</if>
<if test="totalKwh != null">total_kwh,</if> <if test="currentCombActivePeak != null">current_comb_active_peak,</if>
<if test="sharpKwh != null">sharp_kwh,</if> <if test="currentCombActiveHigh != null">current_comb_active_high,</if>
<if test="peakKwh != null">peak_kwh,</if> <if test="currentCombActiveFlat != null">current_comb_active_flat,</if>
<if test="flatKwh != null">flat_kwh,</if> <if test="currentCombActiveValley != null">current_comb_active_valley,</if>
<if test="valleyKwh != null">valley_kwh,</if> <if test="currentForwardActiveTotal != null">current_forward_active_total,</if>
<if test="currentForwardActivePeak != null">current_forward_active_peak,</if>
<if test="currentForwardActiveHigh != null">current_forward_active_high,</if>
<if test="currentForwardActiveFlat != null">current_forward_active_flat,</if>
<if test="currentForwardActiveValley != null">current_forward_active_valley,</if>
<if test="currentReverseActiveTotal != null">current_reverse_active_total,</if>
<if test="currentReverseActivePeak != null">current_reverse_active_peak,</if>
<if test="currentReverseActiveHigh != null">current_reverse_active_high,</if>
<if test="currentReverseActiveFlat != null">current_reverse_active_flat,</if>
<if test="currentReverseActiveValley != null">current_reverse_active_valley,</if>
<if test="currentCombReactiveTotal != null">current_comb_reactive_total,</if>
<if test="currentCombReactivePeak != null">current_comb_reactive_peak,</if>
<if test="currentCombReactiveHigh != null">current_comb_reactive_high,</if>
<if test="currentCombReactiveFlat != null">current_comb_reactive_flat,</if>
<if test="currentCombReactiveValley != null">current_comb_reactive_valley,</if>
<if test="currentForwardReactiveTotal != null">current_forward_reactive_total,</if>
<if test="currentForwardReactivePeak != null">current_forward_reactive_peak,</if>
<if test="currentForwardReactiveHigh != null">current_forward_reactive_high,</if>
<if test="currentForwardReactiveFlat != null">current_forward_reactive_flat,</if>
<if test="currentForwardReactiveValley != null">current_forward_reactive_valley,</if>
<if test="currentReverseReactiveTotal != null">current_reverse_reactive_total,</if>
<if test="currentReverseReactivePeak != null">current_reverse_reactive_peak,</if>
<if test="currentReverseReactiveHigh != null">current_reverse_reactive_high,</if>
<if test="currentReverseReactiveFlat != null">current_reverse_reactive_flat,</if>
<if test="currentReverseReactiveValley != null">current_reverse_reactive_valley,</if>
<if test="phaseAVoltage != null">phase_a_voltage,</if>
<if test="phaseBVoltage != null">phase_b_voltage,</if>
<if test="phaseCVoltage != null">phase_c_voltage,</if>
<if test="phaseACurrent != null">phase_a_current,</if>
<if test="phaseBCurrent != null">phase_b_current,</if>
<if test="phaseCCurrent != null">phase_c_current,</if>
<if test="frequency != null">frequency,</if>
<if test="abLineVoltage != null">ab_line_voltage,</if>
<if test="cbLineVoltage != null">cb_line_voltage,</if>
<if test="acLineVoltage != null">ac_line_voltage,</if>
<if test="forwardAcMaxDemand != null">forward_ac_max_demand,</if>
<if test="reverseAcMaxDemand != null">reverse_ac_max_demand,</if>
<if test="phaseAActivePower != null">phase_a_active_power,</if>
<if test="phaseBActivePower != null">phase_b_active_power,</if>
<if test="phaseCActivePower != null">phase_c_active_power,</if>
<if test="totalActivePower != null">total_active_power,</if>
<if test="phaseAReactivePower != null">phase_a_reactive_power,</if>
<if test="phaseBReactivePower != null">phase_b_reactive_power,</if>
<if test="phaseCReactivePower != null">phase_c_reactive_power,</if>
<if test="totalReactivePower != null">total_reactive_power,</if>
<if test="phaseAApparentPower != null">phase_a_apparent_power,</if>
<if test="phaseBApparentPower != null">phase_b_apparent_power,</if>
<if test="phaseCApparentPower != null">phase_c_apparent_power,</if>
<if test="totalApparentPower != null">total_apparent_power,</if>
<if test="phaseAPowerFactor != null">phase_a_power_factor,</if>
<if test="phaseBPowerFactor != null">phase_b_power_factor,</if>
<if test="phaseCPowerFactor != null">phase_c_power_factor,</if>
<if test="totalPowerFactor != null">total_power_factor,</if>
<if test="dailyForwardMaxDemand != null">daily_forward_max_demand,</if>
<if test="siteId != null">site_id,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="siteId != null">site_id,</if> <if test="secondaryAbLineVoltage != null">secondary_ab_line_voltage,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if> <if test="secondaryAPhaseCurrent != null">secondary_a_phase_current,</if>
<if test="secondaryAPhaseVoltage != null">secondary_a_phase_voltage,</if>
<if test="secondaryAPowerFactor != null">secondary_a_power_factor,</if>
<if test="secondaryAApparentPower != null">secondary_a_apparent_power,</if>
<if test="secondaryAReactivePower != null">secondary_a_reactive_power,</if>
<if test="secondaryAActivePower != null">secondary_a_active_power,</if>
<if test="secondaryBcLineVoltage != null">secondary_bc_line_voltage,</if>
<if test="secondaryBPhaseCurrent != null">secondary_b_phase_current,</if>
<if test="secondaryBPhaseVoltage != null">secondary_b_phase_voltage,</if>
<if test="secondaryBPowerFactor != null">secondary_b_power_factor,</if>
<if test="secondaryBApparentPower != null">secondary_b_apparent_power,</if>
<if test="secondaryBReactivePower != null">secondary_b_reactive_power,</if>
<if test="secondaryBActivePower != null">secondary_b_active_power,</if>
<if test="secondaryCaLineVoltage != null">secondary_ca_line_voltage,</if>
<if test="secondaryCPhaseCurrent != null">secondary_c_phase_current,</if>
<if test="secondaryCPhaseVoltage != null">secondary_c_phase_voltage,</if>
<if test="secondaryCPowerFactor != null">secondary_c_power_factor,</if>
<if test="secondaryCApparentPower != null">secondary_c_apparent_power,</if>
<if test="secondaryCReactivePower != null">secondary_c_reactive_power,</if>
<if test="secondaryCActivePower != null">secondary_c_active_power,</if>
<if test="secondaryGridFrequency != null">secondary_grid_frequency,</if>
<if test="secondaryReverseReactiveEnergy != null">secondary_reverse_reactive_energy,</if>
<if test="secondaryNegativeActiveEnergy != null">secondary_negative_active_energy,</if>
<if test="secondaryTotalPowerFactor != null">secondary_total_power_factor,</if>
<if test="secondaryTotalApparentPower != null">secondary_total_apparent_power,</if>
<if test="secondaryTotalReactivePower != null">secondary_total_reactive_power,</if>
<if test="secondaryPositiveReactiveEnergy != null">secondary_positive_reactive_energy,</if>
<if test="secondaryPositiveActiveEnergy != null">secondary_positive_active_energy,</if>
<if test="secondaryTotalActivePower != null">secondary_total_active_power,</if>
<if test="reverseReactiveEnergyEqMinus != null">reverse_reactive_energy_eq_minus,</if>
<if test="reverseActiveEnergyEpMinus != null">reverse_active_energy_ep_minus,</if>
<if test="positiveReactiveEnergyEqPlus != null">positive_reactive_energy_eq_plus,</if>
<if test="positiveActiveEnergyEpPlus != null">positive_active_energy_ep_plus,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dataUpdateTime != null">#{dataUpdateTime},</if> <if test="dataUpdateTime != null">#{dataUpdateTime},</if>
<if test="category != null">#{category},</if> <if test="currentCombActiveTotal != null">#{currentCombActiveTotal},</if>
<if test="totalKwh != null">#{totalKwh},</if> <if test="currentCombActivePeak != null">#{currentCombActivePeak},</if>
<if test="sharpKwh != null">#{sharpKwh},</if> <if test="currentCombActiveHigh != null">#{currentCombActiveHigh},</if>
<if test="peakKwh != null">#{peakKwh},</if> <if test="currentCombActiveFlat != null">#{currentCombActiveFlat},</if>
<if test="flatKwh != null">#{flatKwh},</if> <if test="currentCombActiveValley != null">#{currentCombActiveValley},</if>
<if test="valleyKwh != null">#{valleyKwh},</if> <if test="currentForwardActiveTotal != null">#{currentForwardActiveTotal},</if>
<if test="currentForwardActivePeak != null">#{currentForwardActivePeak},</if>
<if test="currentForwardActiveHigh != null">#{currentForwardActiveHigh},</if>
<if test="currentForwardActiveFlat != null">#{currentForwardActiveFlat},</if>
<if test="currentForwardActiveValley != null">#{currentForwardActiveValley},</if>
<if test="currentReverseActiveTotal != null">#{currentReverseActiveTotal},</if>
<if test="currentReverseActivePeak != null">#{currentReverseActivePeak},</if>
<if test="currentReverseActiveHigh != null">#{currentReverseActiveHigh},</if>
<if test="currentReverseActiveFlat != null">#{currentReverseActiveFlat},</if>
<if test="currentReverseActiveValley != null">#{currentReverseActiveValley},</if>
<if test="currentCombReactiveTotal != null">#{currentCombReactiveTotal},</if>
<if test="currentCombReactivePeak != null">#{currentCombReactivePeak},</if>
<if test="currentCombReactiveHigh != null">#{currentCombReactiveHigh},</if>
<if test="currentCombReactiveFlat != null">#{currentCombReactiveFlat},</if>
<if test="currentCombReactiveValley != null">#{currentCombReactiveValley},</if>
<if test="currentForwardReactiveTotal != null">#{currentForwardReactiveTotal},</if>
<if test="currentForwardReactivePeak != null">#{currentForwardReactivePeak},</if>
<if test="currentForwardReactiveHigh != null">#{currentForwardReactiveHigh},</if>
<if test="currentForwardReactiveFlat != null">#{currentForwardReactiveFlat},</if>
<if test="currentForwardReactiveValley != null">#{currentForwardReactiveValley},</if>
<if test="currentReverseReactiveTotal != null">#{currentReverseReactiveTotal},</if>
<if test="currentReverseReactivePeak != null">#{currentReverseReactivePeak},</if>
<if test="currentReverseReactiveHigh != null">#{currentReverseReactiveHigh},</if>
<if test="currentReverseReactiveFlat != null">#{currentReverseReactiveFlat},</if>
<if test="currentReverseReactiveValley != null">#{currentReverseReactiveValley},</if>
<if test="phaseAVoltage != null">#{phaseAVoltage},</if>
<if test="phaseBVoltage != null">#{phaseBVoltage},</if>
<if test="phaseCVoltage != null">#{phaseCVoltage},</if>
<if test="phaseACurrent != null">#{phaseACurrent},</if>
<if test="phaseBCurrent != null">#{phaseBCurrent},</if>
<if test="phaseCCurrent != null">#{phaseCCurrent},</if>
<if test="frequency != null">#{frequency},</if>
<if test="abLineVoltage != null">#{abLineVoltage},</if>
<if test="cbLineVoltage != null">#{cbLineVoltage},</if>
<if test="acLineVoltage != null">#{acLineVoltage},</if>
<if test="forwardAcMaxDemand != null">#{forwardAcMaxDemand},</if>
<if test="reverseAcMaxDemand != null">#{reverseAcMaxDemand},</if>
<if test="phaseAActivePower != null">#{phaseAActivePower},</if>
<if test="phaseBActivePower != null">#{phaseBActivePower},</if>
<if test="phaseCActivePower != null">#{phaseCActivePower},</if>
<if test="totalActivePower != null">#{totalActivePower},</if>
<if test="phaseAReactivePower != null">#{phaseAReactivePower},</if>
<if test="phaseBReactivePower != null">#{phaseBReactivePower},</if>
<if test="phaseCReactivePower != null">#{phaseCReactivePower},</if>
<if test="totalReactivePower != null">#{totalReactivePower},</if>
<if test="phaseAApparentPower != null">#{phaseAApparentPower},</if>
<if test="phaseBApparentPower != null">#{phaseBApparentPower},</if>
<if test="phaseCApparentPower != null">#{phaseCApparentPower},</if>
<if test="totalApparentPower != null">#{totalApparentPower},</if>
<if test="phaseAPowerFactor != null">#{phaseAPowerFactor},</if>
<if test="phaseBPowerFactor != null">#{phaseBPowerFactor},</if>
<if test="phaseCPowerFactor != null">#{phaseCPowerFactor},</if>
<if test="totalPowerFactor != null">#{totalPowerFactor},</if>
<if test="dailyForwardMaxDemand != null">#{dailyForwardMaxDemand},</if>
<if test="siteId != null">#{siteId},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="siteId != null">#{siteId},</if> <if test="secondaryAbLineVoltage != null">#{secondaryAbLineVoltage},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if> <if test="secondaryAPhaseCurrent != null">#{secondaryAPhaseCurrent},</if>
<if test="secondaryAPhaseVoltage != null">#{secondaryAPhaseVoltage},</if>
<if test="secondaryAPowerFactor != null">#{secondaryAPowerFactor},</if>
<if test="secondaryAApparentPower != null">#{secondaryAApparentPower},</if>
<if test="secondaryAReactivePower != null">#{secondaryAReactivePower},</if>
<if test="secondaryAActivePower != null">#{secondaryAActivePower},</if>
<if test="secondaryBcLineVoltage != null">#{secondaryBcLineVoltage},</if>
<if test="secondaryBPhaseCurrent != null">#{secondaryBPhaseCurrent},</if>
<if test="secondaryBPhaseVoltage != null">#{secondaryBPhaseVoltage},</if>
<if test="secondaryBPowerFactor != null">#{secondaryBPowerFactor},</if>
<if test="secondaryBApparentPower != null">#{secondaryBApparentPower},</if>
<if test="secondaryBReactivePower != null">#{secondaryBReactivePower},</if>
<if test="secondaryBActivePower != null">#{secondaryBActivePower},</if>
<if test="secondaryCaLineVoltage != null">#{secondaryCaLineVoltage},</if>
<if test="secondaryCPhaseCurrent != null">#{secondaryCPhaseCurrent},</if>
<if test="secondaryCPhaseVoltage != null">#{secondaryCPhaseVoltage},</if>
<if test="secondaryCPowerFactor != null">#{secondaryCPowerFactor},</if>
<if test="secondaryCApparentPower != null">#{secondaryCApparentPower},</if>
<if test="secondaryCReactivePower != null">#{secondaryCReactivePower},</if>
<if test="secondaryCActivePower != null">#{secondaryCActivePower},</if>
<if test="secondaryGridFrequency != null">#{secondaryGridFrequency},</if>
<if test="secondaryReverseReactiveEnergy != null">#{secondaryReverseReactiveEnergy},</if>
<if test="secondaryNegativeActiveEnergy != null">#{secondaryNegativeActiveEnergy},</if>
<if test="secondaryTotalPowerFactor != null">#{secondaryTotalPowerFactor},</if>
<if test="secondaryTotalApparentPower != null">#{secondaryTotalApparentPower},</if>
<if test="secondaryTotalReactivePower != null">#{secondaryTotalReactivePower},</if>
<if test="secondaryPositiveReactiveEnergy != null">#{secondaryPositiveReactiveEnergy},</if>
<if test="secondaryPositiveActiveEnergy != null">#{secondaryPositiveActiveEnergy},</if>
<if test="secondaryTotalActivePower != null">#{secondaryTotalActivePower},</if>
<if test="reverseReactiveEnergyEqMinus != null">#{reverseReactiveEnergyEqMinus},</if>
<if test="reverseActiveEnergyEpMinus != null">#{reverseActiveEnergyEpMinus},</if>
<if test="positiveReactiveEnergyEqPlus != null">#{positiveReactiveEnergyEqPlus},</if>
<if test="positiveActiveEnergyEpPlus != null">#{positiveActiveEnergyEpPlus},</if>
</trim> </trim>
</insert> </insert>
@ -86,19 +434,106 @@
update ems_ammeter_data update ems_ammeter_data
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="dataUpdateTime != null">data_update_time = #{dataUpdateTime},</if> <if test="dataUpdateTime != null">data_update_time = #{dataUpdateTime},</if>
<if test="category != null">category = #{category},</if> <if test="currentCombActiveTotal != null">current_comb_active_total = #{currentCombActiveTotal},</if>
<if test="totalKwh != null">total_kwh = #{totalKwh},</if> <if test="currentCombActivePeak != null">current_comb_active_peak = #{currentCombActivePeak},</if>
<if test="sharpKwh != null">sharp_kwh = #{sharpKwh},</if> <if test="currentCombActiveHigh != null">current_comb_active_high = #{currentCombActiveHigh},</if>
<if test="peakKwh != null">peak_kwh = #{peakKwh},</if> <if test="currentCombActiveFlat != null">current_comb_active_flat = #{currentCombActiveFlat},</if>
<if test="flatKwh != null">flat_kwh = #{flatKwh},</if> <if test="currentCombActiveValley != null">current_comb_active_valley = #{currentCombActiveValley},</if>
<if test="valleyKwh != null">valley_kwh = #{valleyKwh},</if> <if test="currentForwardActiveTotal != null">current_forward_active_total = #{currentForwardActiveTotal},</if>
<if test="currentForwardActivePeak != null">current_forward_active_peak = #{currentForwardActivePeak},</if>
<if test="currentForwardActiveHigh != null">current_forward_active_high = #{currentForwardActiveHigh},</if>
<if test="currentForwardActiveFlat != null">current_forward_active_flat = #{currentForwardActiveFlat},</if>
<if test="currentForwardActiveValley != null">current_forward_active_valley = #{currentForwardActiveValley},</if>
<if test="currentReverseActiveTotal != null">current_reverse_active_total = #{currentReverseActiveTotal},</if>
<if test="currentReverseActivePeak != null">current_reverse_active_peak = #{currentReverseActivePeak},</if>
<if test="currentReverseActiveHigh != null">current_reverse_active_high = #{currentReverseActiveHigh},</if>
<if test="currentReverseActiveFlat != null">current_reverse_active_flat = #{currentReverseActiveFlat},</if>
<if test="currentReverseActiveValley != null">current_reverse_active_valley = #{currentReverseActiveValley},</if>
<if test="currentCombReactiveTotal != null">current_comb_reactive_total = #{currentCombReactiveTotal},</if>
<if test="currentCombReactivePeak != null">current_comb_reactive_peak = #{currentCombReactivePeak},</if>
<if test="currentCombReactiveHigh != null">current_comb_reactive_high = #{currentCombReactiveHigh},</if>
<if test="currentCombReactiveFlat != null">current_comb_reactive_flat = #{currentCombReactiveFlat},</if>
<if test="currentCombReactiveValley != null">current_comb_reactive_valley = #{currentCombReactiveValley},</if>
<if test="currentForwardReactiveTotal != null">current_forward_reactive_total = #{currentForwardReactiveTotal},</if>
<if test="currentForwardReactivePeak != null">current_forward_reactive_peak = #{currentForwardReactivePeak},</if>
<if test="currentForwardReactiveHigh != null">current_forward_reactive_high = #{currentForwardReactiveHigh},</if>
<if test="currentForwardReactiveFlat != null">current_forward_reactive_flat = #{currentForwardReactiveFlat},</if>
<if test="currentForwardReactiveValley != null">current_forward_reactive_valley = #{currentForwardReactiveValley},</if>
<if test="currentReverseReactiveTotal != null">current_reverse_reactive_total = #{currentReverseReactiveTotal},</if>
<if test="currentReverseReactivePeak != null">current_reverse_reactive_peak = #{currentReverseReactivePeak},</if>
<if test="currentReverseReactiveHigh != null">current_reverse_reactive_high = #{currentReverseReactiveHigh},</if>
<if test="currentReverseReactiveFlat != null">current_reverse_reactive_flat = #{currentReverseReactiveFlat},</if>
<if test="currentReverseReactiveValley != null">current_reverse_reactive_valley = #{currentReverseReactiveValley},</if>
<if test="phaseAVoltage != null">phase_a_voltage = #{phaseAVoltage},</if>
<if test="phaseBVoltage != null">phase_b_voltage = #{phaseBVoltage},</if>
<if test="phaseCVoltage != null">phase_c_voltage = #{phaseCVoltage},</if>
<if test="phaseACurrent != null">phase_a_current = #{phaseACurrent},</if>
<if test="phaseBCurrent != null">phase_b_current = #{phaseBCurrent},</if>
<if test="phaseCCurrent != null">phase_c_current = #{phaseCCurrent},</if>
<if test="frequency != null">frequency = #{frequency},</if>
<if test="abLineVoltage != null">ab_line_voltage = #{abLineVoltage},</if>
<if test="cbLineVoltage != null">cb_line_voltage = #{cbLineVoltage},</if>
<if test="acLineVoltage != null">ac_line_voltage = #{acLineVoltage},</if>
<if test="forwardAcMaxDemand != null">forward_ac_max_demand = #{forwardAcMaxDemand},</if>
<if test="reverseAcMaxDemand != null">reverse_ac_max_demand = #{reverseAcMaxDemand},</if>
<if test="phaseAActivePower != null">phase_a_active_power = #{phaseAActivePower},</if>
<if test="phaseBActivePower != null">phase_b_active_power = #{phaseBActivePower},</if>
<if test="phaseCActivePower != null">phase_c_active_power = #{phaseCActivePower},</if>
<if test="totalActivePower != null">total_active_power = #{totalActivePower},</if>
<if test="phaseAReactivePower != null">phase_a_reactive_power = #{phaseAReactivePower},</if>
<if test="phaseBReactivePower != null">phase_b_reactive_power = #{phaseBReactivePower},</if>
<if test="phaseCReactivePower != null">phase_c_reactive_power = #{phaseCReactivePower},</if>
<if test="totalReactivePower != null">total_reactive_power = #{totalReactivePower},</if>
<if test="phaseAApparentPower != null">phase_a_apparent_power = #{phaseAApparentPower},</if>
<if test="phaseBApparentPower != null">phase_b_apparent_power = #{phaseBApparentPower},</if>
<if test="phaseCApparentPower != null">phase_c_apparent_power = #{phaseCApparentPower},</if>
<if test="totalApparentPower != null">total_apparent_power = #{totalApparentPower},</if>
<if test="phaseAPowerFactor != null">phase_a_power_factor = #{phaseAPowerFactor},</if>
<if test="phaseBPowerFactor != null">phase_b_power_factor = #{phaseBPowerFactor},</if>
<if test="phaseCPowerFactor != null">phase_c_power_factor = #{phaseCPowerFactor},</if>
<if test="totalPowerFactor != null">total_power_factor = #{totalPowerFactor},</if>
<if test="dailyForwardMaxDemand != null">daily_forward_max_demand = #{dailyForwardMaxDemand},</if>
<if test="siteId != null">site_id = #{siteId},</if>
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="siteId != null">site_id = #{siteId},</if> <if test="secondaryAbLineVoltage != null">secondary_ab_line_voltage = #{secondaryAbLineVoltage},</if>
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if> <if test="secondaryAPhaseCurrent != null">secondary_a_phase_current = #{secondaryAPhaseCurrent},</if>
<if test="secondaryAPhaseVoltage != null">secondary_a_phase_voltage = #{secondaryAPhaseVoltage},</if>
<if test="secondaryAPowerFactor != null">secondary_a_power_factor = #{secondaryAPowerFactor},</if>
<if test="secondaryAApparentPower != null">secondary_a_apparent_power = #{secondaryAApparentPower},</if>
<if test="secondaryAReactivePower != null">secondary_a_reactive_power = #{secondaryAReactivePower},</if>
<if test="secondaryAActivePower != null">secondary_a_active_power = #{secondaryAActivePower},</if>
<if test="secondaryBcLineVoltage != null">secondary_bc_line_voltage = #{secondaryBcLineVoltage},</if>
<if test="secondaryBPhaseCurrent != null">secondary_b_phase_current = #{secondaryBPhaseCurrent},</if>
<if test="secondaryBPhaseVoltage != null">secondary_b_phase_voltage = #{secondaryBPhaseVoltage},</if>
<if test="secondaryBPowerFactor != null">secondary_b_power_factor = #{secondaryBPowerFactor},</if>
<if test="secondaryBApparentPower != null">secondary_b_apparent_power = #{secondaryBApparentPower},</if>
<if test="secondaryBReactivePower != null">secondary_b_reactive_power = #{secondaryBReactivePower},</if>
<if test="secondaryBActivePower != null">secondary_b_active_power = #{secondaryBActivePower},</if>
<if test="secondaryCaLineVoltage != null">secondary_ca_line_voltage = #{secondaryCaLineVoltage},</if>
<if test="secondaryCPhaseCurrent != null">secondary_c_phase_current = #{secondaryCPhaseCurrent},</if>
<if test="secondaryCPhaseVoltage != null">secondary_c_phase_voltage = #{secondaryCPhaseVoltage},</if>
<if test="secondaryCPowerFactor != null">secondary_c_power_factor = #{secondaryCPowerFactor},</if>
<if test="secondaryCApparentPower != null">secondary_c_apparent_power = #{secondaryCApparentPower},</if>
<if test="secondaryCReactivePower != null">secondary_c_reactive_power = #{secondaryCReactivePower},</if>
<if test="secondaryCActivePower != null">secondary_c_active_power = #{secondaryCActivePower},</if>
<if test="secondaryGridFrequency != null">secondary_grid_frequency = #{secondaryGridFrequency},</if>
<if test="secondaryReverseReactiveEnergy != null">secondary_reverse_reactive_energy = #{secondaryReverseReactiveEnergy},</if>
<if test="secondaryNegativeActiveEnergy != null">secondary_negative_active_energy = #{secondaryNegativeActiveEnergy},</if>
<if test="secondaryTotalPowerFactor != null">secondary_total_power_factor = #{secondaryTotalPowerFactor},</if>
<if test="secondaryTotalApparentPower != null">secondary_total_apparent_power = #{secondaryTotalApparentPower},</if>
<if test="secondaryTotalReactivePower != null">secondary_total_reactive_power = #{secondaryTotalReactivePower},</if>
<if test="secondaryPositiveReactiveEnergy != null">secondary_positive_reactive_energy = #{secondaryPositiveReactiveEnergy},</if>
<if test="secondaryPositiveActiveEnergy != null">secondary_positive_active_energy = #{secondaryPositiveActiveEnergy},</if>
<if test="secondaryTotalActivePower != null">secondary_total_active_power = #{secondaryTotalActivePower},</if>
<if test="reverseReactiveEnergyEqMinus != null">reverse_reactive_energy_eq_minus = #{reverseReactiveEnergyEqMinus},</if>
<if test="reverseActiveEnergyEpMinus != null">reverse_active_energy_ep_minus = #{reverseActiveEnergyEpMinus},</if>
<if test="positiveReactiveEnergyEqPlus != null">positive_reactive_energy_eq_plus = #{positiveReactiveEnergyEqPlus},</if>
<if test="positiveActiveEnergyEpPlus != null">positive_active_energy_ep_plus = #{positiveActiveEnergyEpPlus},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -114,24 +549,4 @@
</foreach> </foreach>
</delete> </delete>
<select id="getAmmeterDetailInfo" resultType="com.xzzn.ems.domain.vo.AmmeterDataDetailInfo">
SELECT t.category as category,
t.total_kwh as totalKwh,
t.sharp_kwh as sharpKwh,
t.flat_kwh as flatKwh,
t.peak_kwh as peakKwh,
t.device_id as deviceId,
t.valley_kwh as valleyKwh,
Max(t.data_update_time) as updateTime
FROM ems_ammeter_data t
INNER JOIN (
SELECT p.site_id, p.device_id,p.category,MAX(p.data_update_time) AS max_update_time
FROM ems_ammeter_data p
WHERE p.site_id = #{siteId} and p.device_id = #{deviceId}
GROUP BY p.site_id,p.device_id,p.category
) latest on t.device_id = latest.device_id and t.data_update_time = latest.max_update_time
WHERE t.site_id = #{siteId} and t.device_id = #{deviceId}
group by t.category,t.total_kwh,t.sharp_kwh,t.flat_kwh,t.peak_kwh,t.valley_kwh,t.device_id
order by updateTime desc
</select>
</mapper> </mapper>

View File

@ -309,33 +309,6 @@
</foreach> </foreach>
</delete> </delete>
<select id="getBMSBatteryCluster" parameterType="String" resultType="com.xzzn.ems.domain.vo.BMSBatteryClusterVo">
select td.device_name as deviceName, tmp.work_status as workStatus,
tmp.pcs_communication_status as pcsCommunicationStatus, tmp.ems_communication_status as emsCommunicationStatus,
tmp.cluster_voltage as clusterVoltage,tmp.chargeable_capacity as chargeableCapacity,
tmp.total_charged_capacity as totalChargedCapacity,
tmp.cluster_current as clusterCurrent,tmp.dischargeable_capacity as dischargeableCapacity,
tmp.total_discharged_capacity as totalDischargedCapacity,
tmp.soh as soh,tmp.average_temperature as averageTemperature,tmp.insulation_resistance as insulationResistance,
tmp.current_soc as currentSoc,tmp.site_id as siteId,tmp.device_id as deviceId,
tmp.avg_cell_voltage as avgVoltage,tmp.avg_cell_temp as avgTemp,tmp.avg_cell_temp as avgSoc,
tmp.max_cell_voltage as maxVoltage,tmp.max_cell_voltage_id as maxVoltageId,
tmp.min_cell_voltage as minVolatage,tmp.min_cell_voltage_id as minVoltageId,
tmp.max_cell_temp as maxTem,tmp.max_cell_temp_id as maxTempId,
tmp.min_cell_temp as minTemp,tmp.min_cell_temp_id as minTempId,
tmp.max_cell_soc as maxSoc,tmp.max_cell_soc_id as maxSocId,
tmp.min_cell_soc as minSoc,tmp.min_cell_soc_id as minSocId
from ems_battery_cluster tmp left join ems_devices_setting td on tmp.device_id = td.device_id and tmp.site_id = td.site_id
INNER JOIN (
SELECT p.site_id, p.device_id, MAX(p.update_time) AS max_update_time
FROM ems_battery_cluster p
WHERE p.site_id = #{siteId}
GROUP BY p.site_id,p.device_id
) latest on tmp.device_id = latest.device_id and tmp.update_time = latest.max_update_time
where tmp.site_id = #{siteId}
order by tmp.device_id
</select>
<select id="getBmsBatteryData" resultType="com.xzzn.ems.domain.vo.BMSBatteryDataList"> <select id="getBmsBatteryData" resultType="com.xzzn.ems.domain.vo.BMSBatteryDataList">
SELECT t.cluster_voltage as clusterVoltage,t.cluster_current as clusterCurrent, SELECT t.cluster_voltage as clusterVoltage,t.cluster_current as clusterCurrent,
t.current_soc as currentSoc,t.site_id as siteId,t.device_id as clusterId, t.current_soc as currentSoc,t.site_id as siteId,t.device_id as clusterId,

View File

@ -9,59 +9,53 @@
<result property="workStatus" column="work_status" /> <result property="workStatus" column="work_status" />
<result property="pcsCommunicationStatus" column="pcs_communication_status" /> <result property="pcsCommunicationStatus" column="pcs_communication_status" />
<result property="emsCommunicationStatus" column="ems_communication_status" /> <result property="emsCommunicationStatus" column="ems_communication_status" />
<result property="totalVoltage" column="total_voltage" /> <result property="operationStatus" column="operation_status" />
<result property="chargeableCapacity" column="chargeable_capacity" /> <result property="stackVoltage" column="stack_voltage" />
<result property="totalChargedCapacity" column="total_charged_capacity" /> <result property="stackCurrent" column="stack_current" />
<result property="totalCurrent" column="total_current" /> <result property="stackSoc" column="stack_soc" />
<result property="dischargeableCapacity" column="dischargeable_capacity" /> <result property="stackSoh" column="stack_soh" />
<result property="totalDischargedCapacity" column="total_discharged_capacity" /> <result property="maxCellVoltage" column="max_cell_voltage" />
<result property="soh" column="soh" /> <result property="maxVoltageGroupId" column="max_voltage_group_id" />
<result property="averageTemperature" column="average_temperature" /> <result property="maxVoltageCellId" column="max_voltage_cell_id" />
<result property="insulationResistance" column="insulation_resistance" /> <result property="minCellVoltage" column="min_cell_voltage" />
<result property="currentSoc" column="current_soc" /> <result property="minVoltageGroupId" column="min_voltage_group_id" />
<result property="createBy" column="create_by" /> <result property="minVoltageCellId" column="min_voltage_cell_id" />
<result property="createTime" column="create_time" /> <result property="maxCellTemp" column="max_cell_temp" />
<result property="updateBy" column="update_by" /> <result property="maxTempGroupId" column="max_temp_group_id" />
<result property="updateTime" column="update_time" /> <result property="maxTempCellId" column="max_temp_cell_id" />
<result property="remark" column="remark" /> <result property="minCellTemp" column="min_cell_temp" />
<result property="minTempGroupId" column="min_temp_group_id" />
<result property="minTempCellId" column="min_temp_cell_id" />
<result property="totalChargeCapacity" column="total_charge_capacity" />
<result property="totalDischargeCapacity" column="total_discharge_capacity" />
<result property="sessionChargeCapacity" column="session_charge_capacity" />
<result property="sessionDischargeCapacity" column="session_discharge_capacity" />
<result property="availableChargeCapacity" column="available_charge_capacity" />
<result property="availableDischargeCapacity" column="available_discharge_capacity" />
<result property="remainingDischargeTime" column="remaining_discharge_time" />
<result property="remainingChargeTime" column="remaining_charge_time" />
<result property="maxDischargePower" column="max_discharge_power" />
<result property="maxChargePower" column="max_charge_power" />
<result property="maxDischargeCurrent" column="max_discharge_current" />
<result property="maxChargeCurrent" column="max_charge_current" />
<result property="dailyDischargeCycles" column="daily_discharge_cycles" />
<result property="dailyChargeCycles" column="daily_charge_cycles" />
<result property="dailyDischargeCapacity" column="daily_discharge_capacity" />
<result property="dailyChargeCapacity" column="daily_charge_capacity" />
<result property="operatingTemp" column="operating_temp" />
<result property="bmsStatus" column="bms_status" />
<result property="bmsChargeStatus" column="bms_charge_status" />
<result property="stackInsulationResistance" column="stack_insulation_resistance" />
<result property="siteId" column="site_id" /> <result property="siteId" column="site_id" />
<result property="deviceId" column="device_id" /> <result property="deviceId" column="device_id" />
<result property="maxAllowedChargePower" column="max_allowed_charge_power" /> <result property="createTime" column="create_time" />
<result property="maxAllowedDischargePower" column="max_allowed_discharge_power" /> <result property="createBy" column="create_by" />
<result property="maxAllowedChargeVoltage" column="max_allowed_charge_voltage" /> <result property="updateTime" column="update_time" />
<result property="maxAllowedDischargeVoltage" column="max_allowed_discharge_voltage" /> <result property="updateBy" column="update_by" />
<result property="maxAllowedChargeCurrent" column="max_allowed_charge_current" />
<result property="maxAllowedDischargeCurrent" column="max_allowed_discharge_current" />
<result property="batteryPackVoltage" column="battery_pack_voltage" />
<result property="batteryPackCurrent" column="battery_pack_current" />
<result property="batteryPackTemp" column="battery_pack_temp" />
<result property="batteryPackSoc" column="battery_pack_soc" />
<result property="batteryPackSoh" column="battery_pack_soh" />
<result property="batteryPackInsulationResistance" column="battery_pack_insulation_resistance" />
<result property="avgCellVoltage" column="avg_cell_voltage" />
<result property="avgCellTemp" column="avg_cell_temp" />
<result property="maxCellVoltage" column="max_cell_voltage" />
<result property="maxCellVoltageId" column="max_cell_voltage_id" />
<result property="minCellVoltage" column="min_cell_voltage" />
<result property="minCellVoltageId" column="min_cell_voltage_id" />
<result property="maxCellTemp" column="max_cell_temp" />
<result property="maxCellTempId" column="max_cell_temp_id" />
<result property="minCellTemp" column="min_cell_temp" />
<result property="minCellTempId" column="min_cell_temp_id" />
<result property="maxCellSoc" column="max_cell_soc" />
<result property="maxCellSocId" column="max_cell_soc_id" />
<result property="minCellSoc" column="min_cell_soc" />
<result property="minCellSocId" column="min_cell_soc_id" />
<result property="maxCellSoh" column="max_cell_soh" />
<result property="maxCellSohId" column="max_cell_soh_id" />
<result property="minCellSoh" column="min_cell_soh" />
<result property="minCellSohId" column="min_cell_soh_id" />
<result property="totalChargeEnergy" column="total_charge_energy" />
<result property="totalDischargeEnergy" column="total_discharge_energy" />
</resultMap> </resultMap>
<sql id="selectEmsBatteryStackVo"> <sql id="selectEmsBatteryStackVo">
select id, work_status, pcs_communication_status, ems_communication_status, total_voltage, chargeable_capacity, total_charged_capacity, total_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id, max_allowed_charge_power, max_allowed_discharge_power, max_allowed_charge_voltage, max_allowed_discharge_voltage, max_allowed_charge_current, max_allowed_discharge_current, battery_pack_voltage, battery_pack_current, battery_pack_temp, battery_pack_soc, battery_pack_soh, battery_pack_insulation_resistance, avg_cell_voltage, avg_cell_temp, max_cell_voltage, max_cell_voltage_id, min_cell_voltage, min_cell_voltage_id, max_cell_temp, max_cell_temp_id, min_cell_temp, min_cell_temp_id, max_cell_soc, max_cell_soc_id, min_cell_soc, min_cell_soc_id, max_cell_soh, max_cell_soh_id, min_cell_soh, min_cell_soh_id, total_charge_energy, total_discharge_energy from ems_battery_stack select id, work_status, pcs_communication_status, ems_communication_status, operation_status, stack_voltage, stack_current, stack_soc, stack_soh, max_cell_voltage, max_voltage_group_id, max_voltage_cell_id, min_cell_voltage, min_voltage_group_id, min_voltage_cell_id, max_cell_temp, max_temp_group_id, max_temp_cell_id, min_cell_temp, min_temp_group_id, min_temp_cell_id, total_charge_capacity, total_discharge_capacity, session_charge_capacity, session_discharge_capacity, available_charge_capacity, available_discharge_capacity, remaining_discharge_time, remaining_charge_time, max_discharge_power, max_charge_power, max_discharge_current, max_charge_current, daily_discharge_cycles, daily_charge_cycles, daily_discharge_capacity, daily_charge_capacity, operating_temp, bms_status, bms_charge_status, stack_insulation_resistance, site_id, device_id, create_time, create_by, update_time, update_by from ems_battery_stack
</sql> </sql>
<select id="selectEmsBatteryStackList" parameterType="EmsBatteryStack" resultMap="EmsBatteryStackResult"> <select id="selectEmsBatteryStackList" parameterType="EmsBatteryStack" resultMap="EmsBatteryStackResult">
@ -70,50 +64,45 @@
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if> <if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
<if test="pcsCommunicationStatus != null and pcsCommunicationStatus != ''"> and pcs_communication_status = #{pcsCommunicationStatus}</if> <if test="pcsCommunicationStatus != null and pcsCommunicationStatus != ''"> and pcs_communication_status = #{pcsCommunicationStatus}</if>
<if test="emsCommunicationStatus != null and emsCommunicationStatus != ''"> and ems_communication_status = #{emsCommunicationStatus}</if> <if test="emsCommunicationStatus != null and emsCommunicationStatus != ''"> and ems_communication_status = #{emsCommunicationStatus}</if>
<if test="totalVoltage != null "> and total_voltage = #{totalVoltage}</if> <if test="operationStatus != null and operationStatus != ''"> and operation_status = #{operationStatus}</if>
<if test="chargeableCapacity != null "> and chargeable_capacity = #{chargeableCapacity}</if> <if test="stackVoltage != null "> and stack_voltage = #{stackVoltage}</if>
<if test="totalChargedCapacity != null "> and total_charged_capacity = #{totalChargedCapacity}</if> <if test="stackCurrent != null "> and stack_current = #{stackCurrent}</if>
<if test="totalCurrent != null "> and total_current = #{totalCurrent}</if> <if test="stackSoc != null "> and stack_soc = #{stackSoc}</if>
<if test="dischargeableCapacity != null "> and dischargeable_capacity = #{dischargeableCapacity}</if> <if test="stackSoh != null "> and stack_soh = #{stackSoh}</if>
<if test="totalDischargedCapacity != null "> and total_discharged_capacity = #{totalDischargedCapacity}</if> <if test="maxCellVoltage != null "> and max_cell_voltage = #{maxCellVoltage}</if>
<if test="soh != null "> and soh = #{soh}</if> <if test="maxVoltageGroupId != null "> and max_voltage_group_id = #{maxVoltageGroupId}</if>
<if test="averageTemperature != null "> and average_temperature = #{averageTemperature}</if> <if test="maxVoltageCellId != null "> and max_voltage_cell_id = #{maxVoltageCellId}</if>
<if test="insulationResistance != null "> and insulation_resistance = #{insulationResistance}</if> <if test="minCellVoltage != null "> and min_cell_voltage = #{minCellVoltage}</if>
<if test="currentSoc != null "> and current_soc = #{currentSoc}</if> <if test="minVoltageGroupId != null "> and min_voltage_group_id = #{minVoltageGroupId}</if>
<if test="minVoltageCellId != null "> and min_voltage_cell_id = #{minVoltageCellId}</if>
<if test="maxCellTemp != null "> and max_cell_temp = #{maxCellTemp}</if>
<if test="maxTempGroupId != null "> and max_temp_group_id = #{maxTempGroupId}</if>
<if test="maxTempCellId != null "> and max_temp_cell_id = #{maxTempCellId}</if>
<if test="minCellTemp != null "> and min_cell_temp = #{minCellTemp}</if>
<if test="minTempGroupId != null "> and min_temp_group_id = #{minTempGroupId}</if>
<if test="minTempCellId != null "> and min_temp_cell_id = #{minTempCellId}</if>
<if test="totalChargeCapacity != null "> and total_charge_capacity = #{totalChargeCapacity}</if>
<if test="totalDischargeCapacity != null "> and total_discharge_capacity = #{totalDischargeCapacity}</if>
<if test="sessionChargeCapacity != null "> and session_charge_capacity = #{sessionChargeCapacity}</if>
<if test="sessionDischargeCapacity != null "> and session_discharge_capacity = #{sessionDischargeCapacity}</if>
<if test="availableChargeCapacity != null "> and available_charge_capacity = #{availableChargeCapacity}</if>
<if test="availableDischargeCapacity != null "> and available_discharge_capacity = #{availableDischargeCapacity}</if>
<if test="remainingDischargeTime != null "> and remaining_discharge_time = #{remainingDischargeTime}</if>
<if test="remainingChargeTime != null "> and remaining_charge_time = #{remainingChargeTime}</if>
<if test="maxDischargePower != null "> and max_discharge_power = #{maxDischargePower}</if>
<if test="maxChargePower != null "> and max_charge_power = #{maxChargePower}</if>
<if test="maxDischargeCurrent != null "> and max_discharge_current = #{maxDischargeCurrent}</if>
<if test="maxChargeCurrent != null "> and max_charge_current = #{maxChargeCurrent}</if>
<if test="dailyDischargeCycles != null "> and daily_discharge_cycles = #{dailyDischargeCycles}</if>
<if test="dailyChargeCycles != null "> and daily_charge_cycles = #{dailyChargeCycles}</if>
<if test="dailyDischargeCapacity != null "> and daily_discharge_capacity = #{dailyDischargeCapacity}</if>
<if test="dailyChargeCapacity != null "> and daily_charge_capacity = #{dailyChargeCapacity}</if>
<if test="operatingTemp != null "> and operating_temp = #{operatingTemp}</if>
<if test="bmsStatus != null and bmsStatus != ''"> and bms_status = #{bmsStatus}</if>
<if test="bmsChargeStatus != null and bmsChargeStatus != ''"> and bms_charge_status = #{bmsChargeStatus}</if>
<if test="stackInsulationResistance != null "> and stack_insulation_resistance = #{stackInsulationResistance}</if>
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if> <if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if> <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="maxAllowedChargePower != null "> and max_allowed_charge_power = #{maxAllowedChargePower}</if>
<if test="maxAllowedDischargePower != null "> and max_allowed_discharge_power = #{maxAllowedDischargePower}</if>
<if test="maxAllowedChargeVoltage != null "> and max_allowed_charge_voltage = #{maxAllowedChargeVoltage}</if>
<if test="maxAllowedDischargeVoltage != null "> and max_allowed_discharge_voltage = #{maxAllowedDischargeVoltage}</if>
<if test="maxAllowedChargeCurrent != null "> and max_allowed_charge_current = #{maxAllowedChargeCurrent}</if>
<if test="maxAllowedDischargeCurrent != null "> and max_allowed_discharge_current = #{maxAllowedDischargeCurrent}</if>
<if test="batteryPackVoltage != null "> and battery_pack_voltage = #{batteryPackVoltage}</if>
<if test="batteryPackCurrent != null "> and battery_pack_current = #{batteryPackCurrent}</if>
<if test="batteryPackTemp != null "> and battery_pack_temp = #{batteryPackTemp}</if>
<if test="batteryPackSoc != null "> and battery_pack_soc = #{batteryPackSoc}</if>
<if test="batteryPackSoh != null "> and battery_pack_soh = #{batteryPackSoh}</if>
<if test="batteryPackInsulationResistance != null "> and battery_pack_insulation_resistance = #{batteryPackInsulationResistance}</if>
<if test="avgCellVoltage != null "> and avg_cell_voltage = #{avgCellVoltage}</if>
<if test="avgCellTemp != null "> and avg_cell_temp = #{avgCellTemp}</if>
<if test="maxCellVoltage != null "> and max_cell_voltage = #{maxCellVoltage}</if>
<if test="maxCellVoltageId != null "> and max_cell_voltage_id = #{maxCellVoltageId}</if>
<if test="minCellVoltage != null "> and min_cell_voltage = #{minCellVoltage}</if>
<if test="minCellVoltageId != null "> and min_cell_voltage_id = #{minCellVoltageId}</if>
<if test="maxCellTemp != null "> and max_cell_temp = #{maxCellTemp}</if>
<if test="maxCellTempId != null "> and max_cell_temp_id = #{maxCellTempId}</if>
<if test="minCellTemp != null "> and min_cell_temp = #{minCellTemp}</if>
<if test="minCellTempId != null "> and min_cell_temp_id = #{minCellTempId}</if>
<if test="maxCellSoc != null "> and max_cell_soc = #{maxCellSoc}</if>
<if test="maxCellSocId != null "> and max_cell_soc_id = #{maxCellSocId}</if>
<if test="minCellSoc != null "> and min_cell_soc = #{minCellSoc}</if>
<if test="minCellSocId != null "> and min_cell_soc_id = #{minCellSocId}</if>
<if test="maxCellSoh != null "> and max_cell_soh = #{maxCellSoh}</if>
<if test="maxCellSohId != null "> and max_cell_soh_id = #{maxCellSohId}</if>
<if test="minCellSoh != null "> and min_cell_soh = #{minCellSoh}</if>
<if test="minCellSohId != null "> and min_cell_soh_id = #{minCellSohId}</if>
<if test="totalChargeEnergy != null "> and total_charge_energy = #{totalChargeEnergy}</if>
<if test="totalDischargeEnergy != null "> and total_discharge_energy = #{totalDischargeEnergy}</if>
</where> </where>
</select> </select>
@ -128,109 +117,97 @@
<if test="workStatus != null">work_status,</if> <if test="workStatus != null">work_status,</if>
<if test="pcsCommunicationStatus != null">pcs_communication_status,</if> <if test="pcsCommunicationStatus != null">pcs_communication_status,</if>
<if test="emsCommunicationStatus != null">ems_communication_status,</if> <if test="emsCommunicationStatus != null">ems_communication_status,</if>
<if test="totalVoltage != null">total_voltage,</if> <if test="operationStatus != null">operation_status,</if>
<if test="chargeableCapacity != null">chargeable_capacity,</if> <if test="stackVoltage != null">stack_voltage,</if>
<if test="totalChargedCapacity != null">total_charged_capacity,</if> <if test="stackCurrent != null">stack_current,</if>
<if test="totalCurrent != null">total_current,</if> <if test="stackSoc != null">stack_soc,</if>
<if test="dischargeableCapacity != null">dischargeable_capacity,</if> <if test="stackSoh != null">stack_soh,</if>
<if test="totalDischargedCapacity != null">total_discharged_capacity,</if>
<if test="soh != null">soh,</if>
<if test="averageTemperature != null">average_temperature,</if>
<if test="insulationResistance != null">insulation_resistance,</if>
<if test="currentSoc != null">current_soc,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="siteId != null">site_id,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="maxAllowedChargePower != null">max_allowed_charge_power,</if>
<if test="maxAllowedDischargePower != null">max_allowed_discharge_power,</if>
<if test="maxAllowedChargeVoltage != null">max_allowed_charge_voltage,</if>
<if test="maxAllowedDischargeVoltage != null">max_allowed_discharge_voltage,</if>
<if test="maxAllowedChargeCurrent != null">max_allowed_charge_current,</if>
<if test="maxAllowedDischargeCurrent != null">max_allowed_discharge_current,</if>
<if test="batteryPackVoltage != null">battery_pack_voltage,</if>
<if test="batteryPackCurrent != null">battery_pack_current,</if>
<if test="batteryPackTemp != null">battery_pack_temp,</if>
<if test="batteryPackSoc != null">battery_pack_soc,</if>
<if test="batteryPackSoh != null">battery_pack_soh,</if>
<if test="batteryPackInsulationResistance != null">battery_pack_insulation_resistance,</if>
<if test="avgCellVoltage != null">avg_cell_voltage,</if>
<if test="avgCellTemp != null">avg_cell_temp,</if>
<if test="maxCellVoltage != null">max_cell_voltage,</if> <if test="maxCellVoltage != null">max_cell_voltage,</if>
<if test="maxCellVoltageId != null">max_cell_voltage_id,</if> <if test="maxVoltageGroupId != null">max_voltage_group_id,</if>
<if test="maxVoltageCellId != null">max_voltage_cell_id,</if>
<if test="minCellVoltage != null">min_cell_voltage,</if> <if test="minCellVoltage != null">min_cell_voltage,</if>
<if test="minCellVoltageId != null">min_cell_voltage_id,</if> <if test="minVoltageGroupId != null">min_voltage_group_id,</if>
<if test="minVoltageCellId != null">min_voltage_cell_id,</if>
<if test="maxCellTemp != null">max_cell_temp,</if> <if test="maxCellTemp != null">max_cell_temp,</if>
<if test="maxCellTempId != null">max_cell_temp_id,</if> <if test="maxTempGroupId != null">max_temp_group_id,</if>
<if test="maxTempCellId != null">max_temp_cell_id,</if>
<if test="minCellTemp != null">min_cell_temp,</if> <if test="minCellTemp != null">min_cell_temp,</if>
<if test="minCellTempId != null">min_cell_temp_id,</if> <if test="minTempGroupId != null">min_temp_group_id,</if>
<if test="maxCellSoc != null">max_cell_soc,</if> <if test="minTempCellId != null">min_temp_cell_id,</if>
<if test="maxCellSocId != null">max_cell_soc_id,</if> <if test="totalChargeCapacity != null">total_charge_capacity,</if>
<if test="minCellSoc != null">min_cell_soc,</if> <if test="totalDischargeCapacity != null">total_discharge_capacity,</if>
<if test="minCellSocId != null">min_cell_soc_id,</if> <if test="sessionChargeCapacity != null">session_charge_capacity,</if>
<if test="maxCellSoh != null">max_cell_soh,</if> <if test="sessionDischargeCapacity != null">session_discharge_capacity,</if>
<if test="maxCellSohId != null">max_cell_soh_id,</if> <if test="availableChargeCapacity != null">available_charge_capacity,</if>
<if test="minCellSoh != null">min_cell_soh,</if> <if test="availableDischargeCapacity != null">available_discharge_capacity,</if>
<if test="minCellSohId != null">min_cell_soh_id,</if> <if test="remainingDischargeTime != null">remaining_discharge_time,</if>
<if test="totalChargeEnergy != null">total_charge_energy,</if> <if test="remainingChargeTime != null">remaining_charge_time,</if>
<if test="totalDischargeEnergy != null">total_discharge_energy,</if> <if test="maxDischargePower != null">max_discharge_power,</if>
<if test="maxChargePower != null">max_charge_power,</if>
<if test="maxDischargeCurrent != null">max_discharge_current,</if>
<if test="maxChargeCurrent != null">max_charge_current,</if>
<if test="dailyDischargeCycles != null">daily_discharge_cycles,</if>
<if test="dailyChargeCycles != null">daily_charge_cycles,</if>
<if test="dailyDischargeCapacity != null">daily_discharge_capacity,</if>
<if test="dailyChargeCapacity != null">daily_charge_capacity,</if>
<if test="operatingTemp != null">operating_temp,</if>
<if test="bmsStatus != null">bms_status,</if>
<if test="bmsChargeStatus != null">bms_charge_status,</if>
<if test="stackInsulationResistance != null">stack_insulation_resistance,</if>
<if test="siteId != null and siteId != ''">site_id,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workStatus != null">#{workStatus},</if> <if test="workStatus != null">#{workStatus},</if>
<if test="pcsCommunicationStatus != null">#{pcsCommunicationStatus},</if> <if test="pcsCommunicationStatus != null">#{pcsCommunicationStatus},</if>
<if test="emsCommunicationStatus != null">#{emsCommunicationStatus},</if> <if test="emsCommunicationStatus != null">#{emsCommunicationStatus},</if>
<if test="totalVoltage != null">#{totalVoltage},</if> <if test="operationStatus != null">#{operationStatus},</if>
<if test="chargeableCapacity != null">#{chargeableCapacity},</if> <if test="stackVoltage != null">#{stackVoltage},</if>
<if test="totalChargedCapacity != null">#{totalChargedCapacity},</if> <if test="stackCurrent != null">#{stackCurrent},</if>
<if test="totalCurrent != null">#{totalCurrent},</if> <if test="stackSoc != null">#{stackSoc},</if>
<if test="dischargeableCapacity != null">#{dischargeableCapacity},</if> <if test="stackSoh != null">#{stackSoh},</if>
<if test="totalDischargedCapacity != null">#{totalDischargedCapacity},</if>
<if test="soh != null">#{soh},</if>
<if test="averageTemperature != null">#{averageTemperature},</if>
<if test="insulationResistance != null">#{insulationResistance},</if>
<if test="currentSoc != null">#{currentSoc},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="siteId != null">#{siteId},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="maxAllowedChargePower != null">#{maxAllowedChargePower},</if>
<if test="maxAllowedDischargePower != null">#{maxAllowedDischargePower},</if>
<if test="maxAllowedChargeVoltage != null">#{maxAllowedChargeVoltage},</if>
<if test="maxAllowedDischargeVoltage != null">#{maxAllowedDischargeVoltage},</if>
<if test="maxAllowedChargeCurrent != null">#{maxAllowedChargeCurrent},</if>
<if test="maxAllowedDischargeCurrent != null">#{maxAllowedDischargeCurrent},</if>
<if test="batteryPackVoltage != null">#{batteryPackVoltage},</if>
<if test="batteryPackCurrent != null">#{batteryPackCurrent},</if>
<if test="batteryPackTemp != null">#{batteryPackTemp},</if>
<if test="batteryPackSoc != null">#{batteryPackSoc},</if>
<if test="batteryPackSoh != null">#{batteryPackSoh},</if>
<if test="batteryPackInsulationResistance != null">#{batteryPackInsulationResistance},</if>
<if test="avgCellVoltage != null">#{avgCellVoltage},</if>
<if test="avgCellTemp != null">#{avgCellTemp},</if>
<if test="maxCellVoltage != null">#{maxCellVoltage},</if> <if test="maxCellVoltage != null">#{maxCellVoltage},</if>
<if test="maxCellVoltageId != null">#{maxCellVoltageId},</if> <if test="maxVoltageGroupId != null">#{maxVoltageGroupId},</if>
<if test="maxVoltageCellId != null">#{maxVoltageCellId},</if>
<if test="minCellVoltage != null">#{minCellVoltage},</if> <if test="minCellVoltage != null">#{minCellVoltage},</if>
<if test="minCellVoltageId != null">#{minCellVoltageId},</if> <if test="minVoltageGroupId != null">#{minVoltageGroupId},</if>
<if test="minVoltageCellId != null">#{minVoltageCellId},</if>
<if test="maxCellTemp != null">#{maxCellTemp},</if> <if test="maxCellTemp != null">#{maxCellTemp},</if>
<if test="maxCellTempId != null">#{maxCellTempId},</if> <if test="maxTempGroupId != null">#{maxTempGroupId},</if>
<if test="maxTempCellId != null">#{maxTempCellId},</if>
<if test="minCellTemp != null">#{minCellTemp},</if> <if test="minCellTemp != null">#{minCellTemp},</if>
<if test="minCellTempId != null">#{minCellTempId},</if> <if test="minTempGroupId != null">#{minTempGroupId},</if>
<if test="maxCellSoc != null">#{maxCellSoc},</if> <if test="minTempCellId != null">#{minTempCellId},</if>
<if test="maxCellSocId != null">#{maxCellSocId},</if> <if test="totalChargeCapacity != null">#{totalChargeCapacity},</if>
<if test="minCellSoc != null">#{minCellSoc},</if> <if test="totalDischargeCapacity != null">#{totalDischargeCapacity},</if>
<if test="minCellSocId != null">#{minCellSocId},</if> <if test="sessionChargeCapacity != null">#{sessionChargeCapacity},</if>
<if test="maxCellSoh != null">#{maxCellSoh},</if> <if test="sessionDischargeCapacity != null">#{sessionDischargeCapacity},</if>
<if test="maxCellSohId != null">#{maxCellSohId},</if> <if test="availableChargeCapacity != null">#{availableChargeCapacity},</if>
<if test="minCellSoh != null">#{minCellSoh},</if> <if test="availableDischargeCapacity != null">#{availableDischargeCapacity},</if>
<if test="minCellSohId != null">#{minCellSohId},</if> <if test="remainingDischargeTime != null">#{remainingDischargeTime},</if>
<if test="totalChargeEnergy != null">#{totalChargeEnergy},</if> <if test="remainingChargeTime != null">#{remainingChargeTime},</if>
<if test="totalDischargeEnergy != null">#{totalDischargeEnergy},</if> <if test="maxDischargePower != null">#{maxDischargePower},</if>
<if test="maxChargePower != null">#{maxChargePower},</if>
<if test="maxDischargeCurrent != null">#{maxDischargeCurrent},</if>
<if test="maxChargeCurrent != null">#{maxChargeCurrent},</if>
<if test="dailyDischargeCycles != null">#{dailyDischargeCycles},</if>
<if test="dailyChargeCycles != null">#{dailyChargeCycles},</if>
<if test="dailyDischargeCapacity != null">#{dailyDischargeCapacity},</if>
<if test="dailyChargeCapacity != null">#{dailyChargeCapacity},</if>
<if test="operatingTemp != null">#{operatingTemp},</if>
<if test="bmsStatus != null">#{bmsStatus},</if>
<if test="bmsChargeStatus != null">#{bmsChargeStatus},</if>
<if test="stackInsulationResistance != null">#{stackInsulationResistance},</if>
<if test="siteId != null and siteId != ''">#{siteId},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim> </trim>
</insert> </insert>
@ -240,55 +217,49 @@
<if test="workStatus != null">work_status = #{workStatus},</if> <if test="workStatus != null">work_status = #{workStatus},</if>
<if test="pcsCommunicationStatus != null">pcs_communication_status = #{pcsCommunicationStatus},</if> <if test="pcsCommunicationStatus != null">pcs_communication_status = #{pcsCommunicationStatus},</if>
<if test="emsCommunicationStatus != null">ems_communication_status = #{emsCommunicationStatus},</if> <if test="emsCommunicationStatus != null">ems_communication_status = #{emsCommunicationStatus},</if>
<if test="totalVoltage != null">total_voltage = #{totalVoltage},</if> <if test="operationStatus != null">operation_status = #{operationStatus},</if>
<if test="chargeableCapacity != null">chargeable_capacity = #{chargeableCapacity},</if> <if test="stackVoltage != null">stack_voltage = #{stackVoltage},</if>
<if test="totalChargedCapacity != null">total_charged_capacity = #{totalChargedCapacity},</if> <if test="stackCurrent != null">stack_current = #{stackCurrent},</if>
<if test="totalCurrent != null">total_current = #{totalCurrent},</if> <if test="stackSoc != null">stack_soc = #{stackSoc},</if>
<if test="dischargeableCapacity != null">dischargeable_capacity = #{dischargeableCapacity},</if> <if test="stackSoh != null">stack_soh = #{stackSoh},</if>
<if test="totalDischargedCapacity != null">total_discharged_capacity = #{totalDischargedCapacity},</if>
<if test="soh != null">soh = #{soh},</if>
<if test="averageTemperature != null">average_temperature = #{averageTemperature},</if>
<if test="insulationResistance != null">insulation_resistance = #{insulationResistance},</if>
<if test="currentSoc != null">current_soc = #{currentSoc},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="siteId != null">site_id = #{siteId},</if>
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="maxAllowedChargePower != null">max_allowed_charge_power = #{maxAllowedChargePower},</if>
<if test="maxAllowedDischargePower != null">max_allowed_discharge_power = #{maxAllowedDischargePower},</if>
<if test="maxAllowedChargeVoltage != null">max_allowed_charge_voltage = #{maxAllowedChargeVoltage},</if>
<if test="maxAllowedDischargeVoltage != null">max_allowed_discharge_voltage = #{maxAllowedDischargeVoltage},</if>
<if test="maxAllowedChargeCurrent != null">max_allowed_charge_current = #{maxAllowedChargeCurrent},</if>
<if test="maxAllowedDischargeCurrent != null">max_allowed_discharge_current = #{maxAllowedDischargeCurrent},</if>
<if test="batteryPackVoltage != null">battery_pack_voltage = #{batteryPackVoltage},</if>
<if test="batteryPackCurrent != null">battery_pack_current = #{batteryPackCurrent},</if>
<if test="batteryPackTemp != null">battery_pack_temp = #{batteryPackTemp},</if>
<if test="batteryPackSoc != null">battery_pack_soc = #{batteryPackSoc},</if>
<if test="batteryPackSoh != null">battery_pack_soh = #{batteryPackSoh},</if>
<if test="batteryPackInsulationResistance != null">battery_pack_insulation_resistance = #{batteryPackInsulationResistance},</if>
<if test="avgCellVoltage != null">avg_cell_voltage = #{avgCellVoltage},</if>
<if test="avgCellTemp != null">avg_cell_temp = #{avgCellTemp},</if>
<if test="maxCellVoltage != null">max_cell_voltage = #{maxCellVoltage},</if> <if test="maxCellVoltage != null">max_cell_voltage = #{maxCellVoltage},</if>
<if test="maxCellVoltageId != null">max_cell_voltage_id = #{maxCellVoltageId},</if> <if test="maxVoltageGroupId != null">max_voltage_group_id = #{maxVoltageGroupId},</if>
<if test="maxVoltageCellId != null">max_voltage_cell_id = #{maxVoltageCellId},</if>
<if test="minCellVoltage != null">min_cell_voltage = #{minCellVoltage},</if> <if test="minCellVoltage != null">min_cell_voltage = #{minCellVoltage},</if>
<if test="minCellVoltageId != null">min_cell_voltage_id = #{minCellVoltageId},</if> <if test="minVoltageGroupId != null">min_voltage_group_id = #{minVoltageGroupId},</if>
<if test="minVoltageCellId != null">min_voltage_cell_id = #{minVoltageCellId},</if>
<if test="maxCellTemp != null">max_cell_temp = #{maxCellTemp},</if> <if test="maxCellTemp != null">max_cell_temp = #{maxCellTemp},</if>
<if test="maxCellTempId != null">max_cell_temp_id = #{maxCellTempId},</if> <if test="maxTempGroupId != null">max_temp_group_id = #{maxTempGroupId},</if>
<if test="maxTempCellId != null">max_temp_cell_id = #{maxTempCellId},</if>
<if test="minCellTemp != null">min_cell_temp = #{minCellTemp},</if> <if test="minCellTemp != null">min_cell_temp = #{minCellTemp},</if>
<if test="minCellTempId != null">min_cell_temp_id = #{minCellTempId},</if> <if test="minTempGroupId != null">min_temp_group_id = #{minTempGroupId},</if>
<if test="maxCellSoc != null">max_cell_soc = #{maxCellSoc},</if> <if test="minTempCellId != null">min_temp_cell_id = #{minTempCellId},</if>
<if test="maxCellSocId != null">max_cell_soc_id = #{maxCellSocId},</if> <if test="totalChargeCapacity != null">total_charge_capacity = #{totalChargeCapacity},</if>
<if test="minCellSoc != null">min_cell_soc = #{minCellSoc},</if> <if test="totalDischargeCapacity != null">total_discharge_capacity = #{totalDischargeCapacity},</if>
<if test="minCellSocId != null">min_cell_soc_id = #{minCellSocId},</if> <if test="sessionChargeCapacity != null">session_charge_capacity = #{sessionChargeCapacity},</if>
<if test="maxCellSoh != null">max_cell_soh = #{maxCellSoh},</if> <if test="sessionDischargeCapacity != null">session_discharge_capacity = #{sessionDischargeCapacity},</if>
<if test="maxCellSohId != null">max_cell_soh_id = #{maxCellSohId},</if> <if test="availableChargeCapacity != null">available_charge_capacity = #{availableChargeCapacity},</if>
<if test="minCellSoh != null">min_cell_soh = #{minCellSoh},</if> <if test="availableDischargeCapacity != null">available_discharge_capacity = #{availableDischargeCapacity},</if>
<if test="minCellSohId != null">min_cell_soh_id = #{minCellSohId},</if> <if test="remainingDischargeTime != null">remaining_discharge_time = #{remainingDischargeTime},</if>
<if test="totalChargeEnergy != null">total_charge_energy = #{totalChargeEnergy},</if> <if test="remainingChargeTime != null">remaining_charge_time = #{remainingChargeTime},</if>
<if test="totalDischargeEnergy != null">total_discharge_energy = #{totalDischargeEnergy},</if> <if test="maxDischargePower != null">max_discharge_power = #{maxDischargePower},</if>
<if test="maxChargePower != null">max_charge_power = #{maxChargePower},</if>
<if test="maxDischargeCurrent != null">max_discharge_current = #{maxDischargeCurrent},</if>
<if test="maxChargeCurrent != null">max_charge_current = #{maxChargeCurrent},</if>
<if test="dailyDischargeCycles != null">daily_discharge_cycles = #{dailyDischargeCycles},</if>
<if test="dailyChargeCycles != null">daily_charge_cycles = #{dailyChargeCycles},</if>
<if test="dailyDischargeCapacity != null">daily_discharge_capacity = #{dailyDischargeCapacity},</if>
<if test="dailyChargeCapacity != null">daily_charge_capacity = #{dailyChargeCapacity},</if>
<if test="operatingTemp != null">operating_temp = #{operatingTemp},</if>
<if test="bmsStatus != null">bms_status = #{bmsStatus},</if>
<if test="bmsChargeStatus != null">bms_charge_status = #{bmsChargeStatus},</if>
<if test="stackInsulationResistance != null">stack_insulation_resistance = #{stackInsulationResistance},</if>
<if test="siteId != null and siteId != ''">site_id = #{siteId},</if>
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -303,25 +274,4 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectEmsBatteryStackBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.BMSOverViewVo">
SELECT td.device_name as deviceName,tmp.work_status as workStatus,
tmp.pcs_communication_status as pcsCommunicationStatus,tmp.ems_communication_status as emsCommunicationStatus,
tmp.total_voltage as totalVoltage,tmp.chargeable_capacity as chargeableCapacity,
tmp.total_charged_capacity as totalChargedCapacity,
tmp.total_current as totalCurrent,tmp.dischargeable_capacity as dischargeableCapacity,
tmp.total_discharged_capacity as totalDischargedCapacity,
tmp.soh as soh,tmp.average_temperature as averageTemperature,tmp.insulation_resistance as insulationResistance,
tmp.current_soc as currentSoc,tmp.site_id as siteId,tmp.device_id as deviceId
FROM ems_battery_stack tmp
left join ems_devices_setting td on tmp.device_id = td.device_id and tmp.site_id = td.site_id
INNER JOIN (
SELECT p.site_id, p.device_id, MAX(p.update_time) AS max_update_time
FROM ems_battery_stack p
WHERE p.site_id = #{siteId}
GROUP BY p.site_id,p.device_id
) latest on tmp.device_id = latest.device_id and tmp.update_time = latest.max_update_time
WHERE tmp.site_id = #{siteId}
order by tmp.device_id
</select>
</mapper> </mapper>

View File

@ -25,10 +25,11 @@
<result property="communicationStatus" column="communication_status" /> <result property="communicationStatus" column="communication_status" />
<result property="deviceId" column="device_id" /> <result property="deviceId" column="device_id" />
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="deviceCategory" column="device_category" />
</resultMap> </resultMap>
<sql id="selectEmsDevicesSettingVo"> <sql id="selectEmsDevicesSettingVo">
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id from ems_devices_setting select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id, device_category from ems_devices_setting
</sql> </sql>
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult"> <select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
@ -53,6 +54,7 @@
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if> <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if> <if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
</where> </where>
</select> </select>
@ -83,6 +85,7 @@
<if test="communicationStatus != null">communication_status,</if> <if test="communicationStatus != null">communication_status,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if> <if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="parentId != null">parent_id,</if> <if test="parentId != null">parent_id,</if>
<if test="deviceCategory != null">device_category,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null and deviceName != ''">#{deviceName},</if> <if test="deviceName != null and deviceName != ''">#{deviceName},</if>
@ -104,6 +107,7 @@
<if test="communicationStatus != null">#{communicationStatus},</if> <if test="communicationStatus != null">#{communicationStatus},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if> <if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="parentId != null">#{parentId},</if> <if test="parentId != null">#{parentId},</if>
<if test="deviceCategory != null">#{deviceCategory},</if>
</trim> </trim>
</insert> </insert>
@ -129,6 +133,7 @@
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if> <if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if> <if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="parentId != null">parent_id = #{parentId},</if> <if test="parentId != null">parent_id = #{parentId},</if>
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -150,8 +155,8 @@
select distinct eb.device_id from ems_battery_stack eb where eb.site_id = #{siteId}) select distinct eb.device_id from ems_battery_stack eb where eb.site_id = #{siteId})
</select> </select>
<select id="getAllClusterInfoByStackId" parameterType="String" resultType="java.util.Map"> <select id="getDeviceInfoByParentId" parameterType="String" resultType="java.util.Map">
select distinct t.device_id as id,t.device_name as deviceName from ems_devices_setting t where t.parent_id = #{stackDeviceId} select distinct t.device_id as id,t.device_name as deviceName from ems_devices_setting t where t.parent_id = #{parentId}
</select> </select>
<select id="getAllBatteryDeviceBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.EmsDevicesSetting"> <select id="getAllBatteryDeviceBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.EmsDevicesSetting">
@ -161,4 +166,23 @@
from ems_devices_setting t INNER JOIN ems_ammeter_data e on t.site_id = e.site_id and t.device_id = e.device_id from ems_devices_setting t INNER JOIN ems_ammeter_data e on t.site_id = e.site_id and t.device_id = e.device_id
where t.site_id = #{siteId} where t.site_id = #{siteId}
</select> </select>
<select id="getAllClusterInfoBySiteId" parameterType="String" resultType="java.util.Map">
select device_id as id,device_name as deviceName from ems_devices_setting
where device_id in (
select distinct eb.device_id from ems_battery_cluster eb where eb.site_id = #{siteId})
</select>
<select id="getDeviceInfosBySiteIdAndCategory" resultType="java.util.Map">
select DISTINCT device_id as id,
device_name as deviceName,
communication_status as communicationStatus
from ems_devices_setting where site_id = #{siteId} and device_category = #{deviceCategory}
</select>
<select id="getDeviceDetailInfo" parameterType="String" resultMap="EmsDevicesSettingResult">
<include refid="selectEmsDevicesSettingVo"/>
where device_id = #{deviceId}
limit 1
</select>
</mapper> </mapper>

View File

@ -372,16 +372,18 @@
order by tmp.device_id order by tmp.device_id
</select> </select>
<select id="getPcsDataByDate" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo"> <select id="getPcsDataByDay" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
select CONCAT(t.date_month,'/',t.date_day) as ammeterDate, select CONCAT(t.date_month,'/',t.date_day) as ammeterDate,
sum(t.daily_ac_charge_energy) as chargedCap, sum(t.total_ac_charge_energy) as chargedCap,
sum(t.daily_ac_discharge_energy) as disChargedCap sum(t.total_ac_discharge_energy) as disChargedCap
from ( SELECT p.site_id, p.device_id,p.date_month,p.date_day, MAX(p.data_update_time) AS max_update_time from ( SELECT p.site_id, p.device_id,p.date_month,p.date_day, MAX(p.data_update_time) AS max_update_time
FROM ems_pcs_data p FROM ems_pcs_data p
where p.site_id = #{siteId} where p.site_id = #{siteId}
<if test="startDate != null and endDate != null"> <if test="startDate != null">
and p.data_update_time &gt;= #{startDate} and p.data_update_time &gt;= #{startDate}
and p.data_update_time &lt; DATE_ADD(#{endDate}, INTERVAL 1 DAY) </if>
<if test="endDate != null">
and p.data_update_time &lt; #{endDate}
</if> </if>
GROUP BY p.site_id,p.device_id,p.date_month,p.date_day GROUP BY p.site_id,p.device_id,p.date_month,p.date_day
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id ) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
@ -390,6 +392,106 @@
and latest.date_month = t.date_month and latest.date_month = t.date_month
and latest.date_day = t.date_day and latest.date_day = t.date_day
group by ammeterDate group by ammeterDate
order by ammeterDate desc; order by ammeterDate desc
</select>
<select id="getStoragePowerList" resultType="com.xzzn.ems.domain.vo.EnergyStoragePowVo">
select t.site_id,
t.total_active_power as pcsTotalActPower,
t.total_reactive_power as pcsTotalReactivePower,
t.create_time as createDate
from ems_pcs_data t
inner join (select site_id,create_time,MIN(device_id) as device_id
from ems_pcs_data
where site_id = #{siteId}
AND create_time &gt;= Date(#{startDate})
AND create_time &lt;= #{endDate}
GROUP BY site_id,create_time
) temp on t.site_id = temp.site_id and t.create_time = temp.create_time and t.device_id = temp.device_id
</select>
<select id="getPcsAveTempList" resultType="com.xzzn.ems.domain.vo.PCSAveTempVo">
select t.site_id,
t.pcs_module_temperature as pcsTemp,
t.create_time as createDate
from ems_pcs_data t
inner join (select site_id,create_time,MIN(device_id) as device_id
from ems_pcs_data
where site_id = #{siteId}
AND create_time &gt;= Date(#{startDate})
AND create_time &lt;= #{endDate}
GROUP BY site_id,create_time
) temp on t.site_id = temp.site_id and t.create_time = temp.create_time and t.device_id = temp.device_id
</select>
<select id="getAveSocList" resultType="com.xzzn.ems.domain.vo.BatteryAveSOCVo">
select t.site_id,
t.battery_pack_soc as batterySOC,
t.create_time as createDate
from ems_battery_cluster t
inner join (select site_id,create_time,MIN(device_id) as device_id
from ems_battery_cluster
where site_id = #{siteId}
AND create_time &gt;= Date(#{startDate})
AND create_time &lt;= #{endDate}
GROUP BY site_id,create_time
) temp on t.site_id = temp.site_id and t.create_time = temp.create_time and t.device_id = temp.device_id
</select>
<select id="getBatteryAveTempList" resultType="com.xzzn.ems.domain.vo.BatteryAveTempVo">
select t.site_id,
t.avg_cell_temp as batteryTemp,
t.create_time as createDate
from ems_battery_cluster t
inner join (select site_id,create_time,MIN(device_id) as device_id
from ems_battery_cluster
where site_id = #{siteId}
AND create_time &gt;= Date(#{startDate})
AND create_time &lt;= #{endDate}
GROUP BY site_id,create_time
) temp on t.site_id = temp.site_id and t.create_time = temp.create_time and t.device_id = temp.device_id
</select>
<select id="getPcsDataByMonth" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
select t.date_month as ammeterDate,
sum(t.total_ac_charge_energy) as chargedCap,
sum(t.total_ac_discharge_energy) as disChargedCap
from ( SELECT p.site_id, p.device_id,p.date_month,MAX(p.data_update_time) AS max_update_time
FROM ems_pcs_data p
where p.site_id = #{siteId}
<if test="startDate != null">
and p.data_update_time &gt;= #{startDate}
</if>
<if test="endDate != null">
and p.data_update_time &lt; #{endDate}
</if>
GROUP BY p.site_id,p.device_id,p.date_month
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
AND latest.device_id = t.device_id
AND latest.max_update_time = t.data_update_time
and latest.date_month = t.date_month
group by ammeterDate
order by ammeterDate desc
</select>
<select id="getPcsDataByHour" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
select latest.dateHour as ammeterDate,
sum(t.total_ac_charge_energy) as chargedCap,
sum(t.total_ac_discharge_energy) as disChargedCap
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%H') AS dateHour,MAX(p.data_update_time) as max_update_time
FROM ems_pcs_data p
where p.site_id = #{siteId}
<if test="startDate != null">
and p.data_update_time &gt;= #{startDate}
</if>
<if test="endDate != null">
and p.data_update_time &lt; #{endDate}
</if>
GROUP BY p.site_id,p.device_id,dateHour
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
AND latest.device_id = t.device_id
AND latest.max_update_time = t.data_update_time
group by ammeterDate
order by ammeterDate desc
</select> </select>
</mapper> </mapper>

View File

@ -120,4 +120,27 @@
<include refid="selectEmsSiteSettingVo"/> <include refid="selectEmsSiteSettingVo"/>
where site_id = #{siteId} where site_id = #{siteId}
</select> </select>
<select id="getSiteInfoList" resultMap="EmsSiteSettingResult">
<include refid="selectEmsSiteSettingVo"/>
WHERE 1=1
<if test="siteName != null and siteName != ''">
AND site_name LIKE CONCAT('%', #{siteName}, '%')
</if>
<if test="startTime != null and startTime != null and endTime != null and endTime != ''">
AND running_time &gt;= STR_TO_DATE( #{startTime}, '%Y-%m-%d')
AND running_time &lt; DATE_ADD(STR_TO_DATE( #{endTime}, '%Y-%m-%d'), INTERVAL 1 DAY)
</if>
</select>
<select id="getAllSiteDeviceList" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteDeviceListVo">
select es.site_id as siteId,es.site_name as siteName,
ed.device_id as deviceId,ed.device_name as deviceName,
ed.device_type as deviceType,ed.communication_status as communicationStatus
from ems_site_setting es INNER JOIN ems_devices_setting ed on es.site_id = ed.site_id
where 1=1
<if test="siteId != null and siteId != ''">
and es.site_id = #{siteId}
</if>
</select>
</mapper> </mapper>