0918优化-单站监控-实时运行曲线图pcs分开显示
This commit is contained in:
@ -12,7 +12,7 @@ import com.xzzn.common.annotation.Excel;
|
||||
* PCS数据对象 ems_pcs_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-07
|
||||
* @date 2025-09-25
|
||||
*/
|
||||
public class EmsPcsData extends BaseEntity
|
||||
{
|
||||
@ -206,6 +206,34 @@ public class EmsPcsData extends BaseEntity
|
||||
@Excel(name = "电网频率")
|
||||
private BigDecimal dwFrequency;
|
||||
|
||||
/** 单元1U相IGBT温度 */
|
||||
@Excel(name = "单元1U相IGBT温度")
|
||||
private BigDecimal uTemperature;
|
||||
|
||||
/** 单元1V相IGBT温度 */
|
||||
@Excel(name = "单元1V相IGBT温度")
|
||||
private BigDecimal vTemperature;
|
||||
|
||||
/** 单元1W相IGBT温度 */
|
||||
@Excel(name = "单元1W相IGBT温度")
|
||||
private BigDecimal wTemperature;
|
||||
|
||||
/** 1#模块IGBT最高温 */
|
||||
@Excel(name = "1#模块IGBT最高温")
|
||||
private BigDecimal module1Temp;
|
||||
|
||||
/** 2#模块IGBT最高温 */
|
||||
@Excel(name = "2#模块IGBT最高温")
|
||||
private BigDecimal module2Temp;
|
||||
|
||||
/** 3#模块IGBT最高温 */
|
||||
@Excel(name = "3#模块IGBT最高温")
|
||||
private BigDecimal module3Temp;
|
||||
|
||||
/** 4#模块IGBT最高温 */
|
||||
@Excel(name = "4#模块IGBT最高温")
|
||||
private BigDecimal module4Temp;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -676,6 +704,76 @@ public class EmsPcsData extends BaseEntity
|
||||
return dwFrequency;
|
||||
}
|
||||
|
||||
public void setuTemperature(BigDecimal uTemperature)
|
||||
{
|
||||
this.uTemperature = uTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getuTemperature()
|
||||
{
|
||||
return uTemperature;
|
||||
}
|
||||
|
||||
public void setvTemperature(BigDecimal vTemperature)
|
||||
{
|
||||
this.vTemperature = vTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getvTemperature()
|
||||
{
|
||||
return vTemperature;
|
||||
}
|
||||
|
||||
public void setwTemperature(BigDecimal wTemperature)
|
||||
{
|
||||
this.wTemperature = wTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getwTemperature()
|
||||
{
|
||||
return wTemperature;
|
||||
}
|
||||
|
||||
public void setModule1Temp(BigDecimal module1Temp)
|
||||
{
|
||||
this.module1Temp = module1Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule1Temp()
|
||||
{
|
||||
return module1Temp;
|
||||
}
|
||||
|
||||
public void setModule2Temp(BigDecimal module2Temp)
|
||||
{
|
||||
this.module2Temp = module2Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule2Temp()
|
||||
{
|
||||
return module2Temp;
|
||||
}
|
||||
|
||||
public void setModule3Temp(BigDecimal module3Temp)
|
||||
{
|
||||
this.module3Temp = module3Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule3Temp()
|
||||
{
|
||||
return module3Temp;
|
||||
}
|
||||
|
||||
public void setModule4Temp(BigDecimal module4Temp)
|
||||
{
|
||||
this.module4Temp = module4Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule4Temp()
|
||||
{
|
||||
return module4Temp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -731,6 +829,13 @@ public class EmsPcsData extends BaseEntity
|
||||
.append("sysVCurrent", getSysVCurrent())
|
||||
.append("sysWCurrent", getSysWCurrent())
|
||||
.append("dwFrequency", getDwFrequency())
|
||||
.append("uTemperature", getuTemperature())
|
||||
.append("vTemperature", getvTemperature())
|
||||
.append("wTemperature", getwTemperature())
|
||||
.append("module1Temp", getModule1Temp())
|
||||
.append("module2Temp", getModule2Temp())
|
||||
.append("module3Temp", getModule3Temp())
|
||||
.append("module4Temp", getModule4Temp())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实时运行-PCS最高温度list
|
||||
*
|
||||
*/
|
||||
public class PcsMaxTempList {
|
||||
|
||||
private String deviceId;
|
||||
// 最高温度数据
|
||||
private List<PcsMaxTempVo> maxTempVoList;
|
||||
|
||||
public List<PcsMaxTempVo> getMaxTempVoList() {
|
||||
return maxTempVoList;
|
||||
}
|
||||
|
||||
public void setMaxTempVoList(List<PcsMaxTempVo> maxTempVoList) {
|
||||
this.maxTempVoList = maxTempVoList;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
}
|
||||
@ -1,29 +1,37 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实时运行-堆平均温度数据
|
||||
* 实时运行-PCS最高温度
|
||||
*
|
||||
*/
|
||||
public class StackAveTempVo {
|
||||
public class PcsMaxTempVo {
|
||||
/**
|
||||
* 数据时间
|
||||
*/
|
||||
private Date createDate;
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 实时温度
|
||||
*/
|
||||
private BigDecimal temp;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
public Date getCreateDate() {
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ public class SiteMonitorRuningInfoVo {
|
||||
/**
|
||||
* PCS最高温度
|
||||
*/
|
||||
private List<StackAveTempVo> stackAveTempList;
|
||||
private List<PcsMaxTempList> pcsMaxTempList;
|
||||
|
||||
/**
|
||||
* 平均soclist
|
||||
@ -35,12 +35,12 @@ public class SiteMonitorRuningInfoVo {
|
||||
this.pcsPowerList = pcsPowerList;
|
||||
}
|
||||
|
||||
public List<StackAveTempVo> getStackAveTempList() {
|
||||
return stackAveTempList;
|
||||
public List<PcsMaxTempList> getPcsMaxTempList() {
|
||||
return pcsMaxTempList;
|
||||
}
|
||||
|
||||
public void setStackAveTempList(List<StackAveTempVo> stackAveTempList) {
|
||||
this.stackAveTempList = stackAveTempList;
|
||||
public void setPcsMaxTempList(List<PcsMaxTempList> pcsMaxTempList) {
|
||||
this.pcsMaxTempList = pcsMaxTempList;
|
||||
}
|
||||
|
||||
public List<BatteryAveSOCVo> getBatteryAveSOCList() {
|
||||
|
||||
@ -62,15 +62,6 @@ public interface EmsBatteryStackMapper
|
||||
*/
|
||||
public int deleteEmsBatteryStackByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取实时运行-堆平均温度
|
||||
* @param siteId
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
public List<StackAveTempVo> getStackAveTempList(@Param("siteId")String siteId, @Param("startDate") Date startDate, @Param("endDate")Date endDate);
|
||||
|
||||
/**
|
||||
* 堆曲线数据-按小时区分
|
||||
* @param requestVo
|
||||
|
||||
@ -127,4 +127,9 @@ public interface EmsPcsDataMapper
|
||||
public List<PcsStatisListVo> getPcsActivePowerByHour(DateSearchRequest requestVo);
|
||||
|
||||
public List<PcsStatisListVo> getPcsActivePowerByMonth(DateSearchRequest requestVo);
|
||||
|
||||
// 实时运行-fx-pcs最高温度
|
||||
public List<PcsMaxTempVo> getFXMaxTemp(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
|
||||
// 实时运行-dds-pcs最高温度
|
||||
public List<PcsMaxTempVo> getDDSMaxTemp(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public interface ISingleSiteService
|
||||
|
||||
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
||||
|
||||
public SiteMonitorRuningInfoVo getRunningGraphStackTemp(String siteId);
|
||||
public SiteMonitorRuningInfoVo getRunningGraphPcsMaxTemp(String siteId);
|
||||
|
||||
public SiteMonitorRuningInfoVo getRunningGraphBatterySoc(String siteId);
|
||||
|
||||
|
||||
@ -598,6 +598,12 @@ public class DDSDataProcessServiceImpl extends AbstractBatteryDataProcessor impl
|
||||
pcsData.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("ZLZGL")));
|
||||
pcsData.setTotalPowerFactor(new BigDecimal(0));
|
||||
|
||||
// 模块温度
|
||||
pcsData.setModule1Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD1")));
|
||||
pcsData.setModule2Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD2")));
|
||||
pcsData.setModule3Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD3")));
|
||||
pcsData.setModule4Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD4")));
|
||||
|
||||
// 系统管理字段
|
||||
pcsData.setCreateBy("system");
|
||||
pcsData.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -439,6 +439,11 @@ public class FXXDataProcessServiceImpl extends AbstractBatteryDataProcessor impl
|
||||
// pcsData.setDcVoltage(StringUtils.getBigDecimal(obj.get("ChargeableCapacity")));
|
||||
// pcsData.setDcCurrent(StringUtils.getBigDecimal(obj.get("ChargeableCapacity")));
|
||||
|
||||
// 三相温度
|
||||
pcsData.setuTemperature(StringUtils.getBigDecimal(obj.get("DY1UXIGBTWD")));
|
||||
pcsData.setvTemperature(StringUtils.getBigDecimal(obj.get("DY1VXIGBTWD")));
|
||||
pcsData.setwTemperature(StringUtils.getBigDecimal(obj.get("DY1WXIGBTWD")));
|
||||
|
||||
// 系统管理字段
|
||||
pcsData.setCreateBy("system");
|
||||
pcsData.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -167,17 +167,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
List<PcsPowerList> pcsPowerList = new ArrayList<>();
|
||||
List<EnergyStoragePowVo> energyStoragePowList = emsPcsDataMapper.getStoragePowerList(siteId, yesterday, today);
|
||||
|
||||
// 生成时间列表(每分钟一个)
|
||||
List<LocalDateTime> targetMinutes = new ArrayList<>(60);
|
||||
LocalDateTime startDate = DateUtils.toLocalDateTime(yesterday).truncatedTo(ChronoUnit.DAYS);
|
||||
LocalDateTime endDate = DateUtils.toLocalDateTime(today);
|
||||
while (startDate.isBefore(endDate)) {
|
||||
targetMinutes.add(startDate);
|
||||
startDate = startDate.plusMinutes(1); // 递增1分钟
|
||||
}
|
||||
|
||||
// 数据格式转换
|
||||
if (!CollectionUtils.isEmpty(energyStoragePowList) && !CollectionUtils.isEmpty(targetMinutes)) {
|
||||
// List<EnergyStoragePowVo> -> 按pcs的deviceId分组转成List<PcsPowerList>
|
||||
if (!CollectionUtils.isEmpty(energyStoragePowList)) {
|
||||
Map<String, List<EnergyStoragePowVo>> dataMap = energyStoragePowList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
EnergyStoragePowVo::getDeviceId,
|
||||
@ -191,6 +182,14 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return pcdData;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 生成时间列表(每分钟一个)
|
||||
List<LocalDateTime> targetMinutes = new ArrayList<>(60);
|
||||
LocalDateTime startDate = DateUtils.toLocalDateTime(yesterday).truncatedTo(ChronoUnit.DAYS);
|
||||
LocalDateTime endDate = DateUtils.toLocalDateTime(today);
|
||||
while (startDate.isBefore(endDate)) {
|
||||
targetMinutes.add(startDate);
|
||||
startDate = startDate.plusMinutes(1); // 递增1分钟
|
||||
}
|
||||
// 根据时间列表填充数据
|
||||
pcsPowerList = fullFillData(pcsPowerList,targetMinutes);
|
||||
}
|
||||
@ -249,21 +248,102 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
// 获取单站监控实时运行-stack平均温度
|
||||
// 20250811 按小时
|
||||
// 获取单站监控实时运行-pcs最高温度
|
||||
@Override
|
||||
public SiteMonitorRuningInfoVo getRunningGraphStackTemp(String siteId) {
|
||||
public SiteMonitorRuningInfoVo getRunningGraphPcsMaxTemp(String siteId) {
|
||||
SiteMonitorRuningInfoVo siteMonitorRuningInfoVo = new SiteMonitorRuningInfoVo();
|
||||
if (!StringUtils.isEmpty(siteId)) {
|
||||
// 时间暂定今日+昨日
|
||||
Date today = new Date();
|
||||
Date yesterday = DateUtils.addDays(today, -1);
|
||||
//pcs平均温度list
|
||||
List<StackAveTempVo> stackAveTempVos = emsBatteryStackMapper.getStackAveTempList(siteId, yesterday, today);
|
||||
siteMonitorRuningInfoVo.setStackAveTempList(stackAveTempVos);
|
||||
List<PcsMaxTempList> pcsMaxTempList = new ArrayList<>();
|
||||
// 时间暂定今日+昨日
|
||||
Date today = new Date();
|
||||
Date yesterday = DateUtils.addDays(today, -1);
|
||||
//PCS最高温度list
|
||||
List<PcsMaxTempVo> pcsMaxTempVos = new ArrayList<>();
|
||||
if (SiteEnum.FX.getCode().equals(siteId)) {
|
||||
pcsMaxTempVos = emsPcsDataMapper.getFXMaxTemp(siteId, yesterday, today);
|
||||
} else if (SiteEnum.DDS.getCode().equals(siteId)) {
|
||||
pcsMaxTempVos = emsPcsDataMapper.getDDSMaxTemp(siteId, yesterday, today);
|
||||
}
|
||||
|
||||
// List<PcsMaxTempVo> -> 按pcs的deviceId分组转成List<PcsMaxTempList>
|
||||
if (!CollectionUtils.isEmpty(pcsMaxTempVos)) {
|
||||
Map<String, List<PcsMaxTempVo>> dataMap = pcsMaxTempVos.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
PcsMaxTempVo::getDeviceId,
|
||||
Collectors.toList()));
|
||||
|
||||
pcsMaxTempList = dataMap.entrySet().stream()
|
||||
.map(entry -> {
|
||||
PcsMaxTempList pcdData = new PcsMaxTempList();
|
||||
pcdData.setDeviceId(entry.getKey());
|
||||
pcdData.setMaxTempVoList(entry.getValue());
|
||||
return pcdData;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 生成时间列表(每小时一个)
|
||||
List<LocalDateTime> targetHours = new ArrayList<>(60);
|
||||
LocalDateTime startDate = DateUtils.toLocalDateTime(yesterday).truncatedTo(ChronoUnit.DAYS);
|
||||
LocalDateTime endDate = DateUtils.toLocalDateTime(today);
|
||||
while (startDate.isBefore(endDate)) {
|
||||
targetHours.add(startDate);
|
||||
startDate = startDate.plusHours(1); // 递增1小时
|
||||
}
|
||||
// 根据时间列表填充数据
|
||||
pcsMaxTempList = fullFillMaxTempData(pcsMaxTempList,targetHours);
|
||||
}
|
||||
|
||||
siteMonitorRuningInfoVo.setPcsMaxTempList(pcsMaxTempList);
|
||||
return siteMonitorRuningInfoVo;
|
||||
}
|
||||
private List<PcsMaxTempList> fullFillMaxTempData(List<PcsMaxTempList> pcsMaxTempList, List<LocalDateTime> targetHours) {
|
||||
List<PcsMaxTempList> resultList = new ArrayList<>();
|
||||
|
||||
for (PcsMaxTempList pcsMaxTemp : pcsMaxTempList) {
|
||||
PcsMaxTempList pcsTemp = new PcsMaxTempList();
|
||||
List<PcsMaxTempVo> resultVos = new ArrayList<>();
|
||||
Map<String, PcsMaxTempVo> dataMap = new HashMap<>();
|
||||
|
||||
String deviceId = pcsMaxTemp.getDeviceId();
|
||||
List<PcsMaxTempVo> pcsMaxTempVos = pcsMaxTemp.getMaxTempVoList();
|
||||
if (CollectionUtils.isEmpty(pcsMaxTempVos)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 将数据转Map便于后续根据时间获取
|
||||
dataMap = pcsMaxTempVos.stream().collect(
|
||||
Collectors.toMap(
|
||||
data -> data.getCreateDate(),
|
||||
data -> data,
|
||||
(existing, replacement) -> replacement
|
||||
));
|
||||
|
||||
PcsMaxTempVo lastData = null;
|
||||
List<PcsMaxTempVo> resultTempList = new ArrayList<>();
|
||||
// 遍历时间填充数据
|
||||
for (LocalDateTime targetHour : targetHours) {
|
||||
String currentDate = DateUtils.convertToString(targetHour);
|
||||
PcsMaxTempVo currentData = dataMap.get(currentDate);
|
||||
if (currentData == null && lastData != null) {
|
||||
BigDecimal temp = lastData.getTemp();
|
||||
currentData = new PcsMaxTempVo();
|
||||
currentData.setTemp(temp);
|
||||
currentData.setDeviceId(deviceId);
|
||||
} else if (currentData == null && lastData == null){
|
||||
// 开头无数据,所有字段设为null
|
||||
currentData = new PcsMaxTempVo();
|
||||
currentData.setDeviceId(deviceId);
|
||||
}
|
||||
lastData = currentData;
|
||||
currentData.setCreateDate(currentDate.substring(11));
|
||||
resultTempList.add(currentData);
|
||||
|
||||
}
|
||||
pcsTemp.setDeviceId(deviceId);
|
||||
pcsTemp.setMaxTempVoList(resultTempList);
|
||||
resultList.add(pcsTemp);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
// 获取单站监控实时运行-平均soc
|
||||
@Override
|
||||
public SiteMonitorRuningInfoVo getRunningGraphBatterySoc(String siteId) {
|
||||
|
||||
@ -57,10 +57,17 @@
|
||||
<result property="sysVCurrent" column="sys_v_current" />
|
||||
<result property="sysWCurrent" column="sys_w_current" />
|
||||
<result property="dwFrequency" column="dw_frequency" />
|
||||
<result property="uTemperature" column="u_temperature" />
|
||||
<result property="vTemperature" column="v_temperature" />
|
||||
<result property="wTemperature" column="w_temperature" />
|
||||
<result property="module1Temp" column="module1_temp" />
|
||||
<result property="module2Temp" column="module2_temp" />
|
||||
<result property="module3Temp" column="module3_temp" />
|
||||
<result property="module4Temp" column="module4_temp" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsPcsDataVo">
|
||||
select id, data_update_time, work_status, grid_status, device_status, control_mode, total_active_power, daily_ac_charge_energy, a_phase_voltage, a_phase_current, total_reactive_power, daily_ac_discharge_energy, b_phase_voltage, b_phase_current, total_apparent_power, pcs_module_temperature, c_phase_voltage, c_phase_current, total_power_factor, pcs_environment_temperature, ac_frequency, branch_status, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id, date_month, date_day, total_ac_charge_energy, total_ac_discharge_energy, ac_charge_active_power, ac_capacitive_reactive_power, ac_discharge_active_power, ac_inductive_reactive_power, max_capacitive_power_capacity, max_inductive_power_capacity, max_charge_power_capacity, max_discharge_power_capacity, ac_switch_status, dc_switch_status, remote_control_status, sys_u_current, sys_v_current, sys_w_current, dw_frequency from ems_pcs_data
|
||||
select id, data_update_time, work_status, grid_status, device_status, control_mode, total_active_power, daily_ac_charge_energy, a_phase_voltage, a_phase_current, total_reactive_power, daily_ac_discharge_energy, b_phase_voltage, b_phase_current, total_apparent_power, pcs_module_temperature, c_phase_voltage, c_phase_current, total_power_factor, pcs_environment_temperature, ac_frequency, branch_status, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id, date_month, date_day, total_ac_charge_energy, total_ac_discharge_energy, ac_charge_active_power, ac_capacitive_reactive_power, ac_discharge_active_power, ac_inductive_reactive_power, max_capacitive_power_capacity, max_inductive_power_capacity, max_charge_power_capacity, max_discharge_power_capacity, ac_switch_status, dc_switch_status, remote_control_status, sys_u_current, sys_v_current, sys_w_current, dw_frequency, u_temperature, v_temperature, w_temperature, module1_temp, module2_temp, module3_temp, module4_temp from ems_pcs_data
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsPcsDataList" parameterType="EmsPcsData" resultMap="EmsPcsDataResult">
|
||||
@ -112,6 +119,13 @@
|
||||
<if test="sysVCurrent != null "> and sys_v_current = #{sysVCurrent}</if>
|
||||
<if test="sysWCurrent != null "> and sys_w_current = #{sysWCurrent}</if>
|
||||
<if test="dwFrequency != null "> and dw_frequency = #{dwFrequency}</if>
|
||||
<if test="uTemperature != null "> and u_temperature = #{uTemperature}</if>
|
||||
<if test="vTemperature != null "> and v_temperature = #{vTemperature}</if>
|
||||
<if test="wTemperature != null "> and w_temperature = #{wTemperature}</if>
|
||||
<if test="module1Temp != null "> and module1_temp = #{module1Temp}</if>
|
||||
<if test="module2Temp != null "> and module2_temp = #{module2Temp}</if>
|
||||
<if test="module3Temp != null "> and module3_temp = #{module3Temp}</if>
|
||||
<if test="module4Temp != null "> and module4_temp = #{module4Temp}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -174,6 +188,13 @@
|
||||
<if test="sysVCurrent != null">sys_v_current,</if>
|
||||
<if test="sysWCurrent != null">sys_w_current,</if>
|
||||
<if test="dwFrequency != null">dw_frequency,</if>
|
||||
<if test="uTemperature != null">u_temperature,</if>
|
||||
<if test="vTemperature != null">v_temperature,</if>
|
||||
<if test="wTemperature != null">w_temperature,</if>
|
||||
<if test="module1Temp != null">module1_temp,</if>
|
||||
<if test="module2Temp != null">module2_temp,</if>
|
||||
<if test="module3Temp != null">module3_temp,</if>
|
||||
<if test="module4Temp != null">module4_temp,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataUpdateTime != null">#{dataUpdateTime},</if>
|
||||
@ -227,6 +248,13 @@
|
||||
<if test="sysVCurrent != null">#{sysVCurrent},</if>
|
||||
<if test="sysWCurrent != null">#{sysWCurrent},</if>
|
||||
<if test="dwFrequency != null">#{dwFrequency},</if>
|
||||
<if test="uTemperature != null">#{uTemperature},</if>
|
||||
<if test="vTemperature != null">#{vTemperature},</if>
|
||||
<if test="wTemperature != null">#{wTemperature},</if>
|
||||
<if test="module1Temp != null">#{module1Temp},</if>
|
||||
<if test="module2Temp != null">#{module2Temp},</if>
|
||||
<if test="module3Temp != null">#{module3Temp},</if>
|
||||
<if test="module4Temp != null">#{module4Temp},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -284,6 +312,13 @@
|
||||
<if test="sysVCurrent != null">sys_v_current = #{sysVCurrent},</if>
|
||||
<if test="sysWCurrent != null">sys_w_current = #{sysWCurrent},</if>
|
||||
<if test="dwFrequency != null">dw_frequency = #{dwFrequency},</if>
|
||||
<if test="uTemperature != null">u_temperature = #{uTemperature},</if>
|
||||
<if test="vTemperature != null">v_temperature = #{vTemperature},</if>
|
||||
<if test="wTemperature != null">w_temperature = #{wTemperature},</if>
|
||||
<if test="module1Temp != null">module1_temp = #{module1Temp},</if>
|
||||
<if test="module2Temp != null">module2_temp = #{module2Temp},</if>
|
||||
<if test="module3Temp != null">module3_temp = #{module3Temp},</if>
|
||||
<if test="module4Temp != null">module4_temp = #{module4Temp},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -539,4 +574,43 @@
|
||||
AND latest.max_update_time = t.data_update_time
|
||||
order by statisDate desc
|
||||
</select>
|
||||
|
||||
<select id="getFXMaxTemp" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.PcsMaxTempVo">
|
||||
SELECT t.site_id,t.device_id as deviceId,
|
||||
GREATEST(
|
||||
COALESCE(t.u_temperature, -999),
|
||||
COALESCE(t.v_temperature, -999),
|
||||
COALESCE(t.w_temperature, -999)
|
||||
) AS temp,
|
||||
latest.dateHour as createDate
|
||||
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%Y-%m-%d %H:00:00') AS dateHour,MAX(p.data_update_time) as max_update_time
|
||||
FROM ems_pcs_data p
|
||||
<include refid="statisCommonFilter"/>
|
||||
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 deviceId,createDate,temp
|
||||
order by createDate desc
|
||||
</select>
|
||||
|
||||
<select id="getDDSMaxTemp" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.PcsMaxTempVo">
|
||||
SELECT t.site_id,t.device_id as deviceId,
|
||||
GREATEST(
|
||||
COALESCE(t.module1_temp, -999),
|
||||
COALESCE(t.module2_temp, -999),
|
||||
COALESCE(t.module3_temp, -999),
|
||||
COALESCE(t.module4_temp, -999)
|
||||
) AS temp,
|
||||
latest.dateHour as createDate
|
||||
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%Y-%m-%d %H:00:00') AS dateHour,MAX(p.data_update_time) as max_update_time
|
||||
FROM ems_pcs_data p
|
||||
<include refid="statisCommonFilter"/>
|
||||
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 deviceId,createDate,temp
|
||||
order by createDate desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user