change - add采集设备信息

main
yinq 6 months ago
parent 5a97dae043
commit fdbac98d84

@ -1,7 +1,7 @@
package com.os.ems.record.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -12,172 +12,77 @@ import com.os.common.core.domain.BaseEntity;
* ems_record_dnb_instant
*
* @author Yinq
* @date 2024-05-11
* @date 2024-05-21
*/
public class EmsRecordDnbInstant extends BaseEntity {
public class EmsRecordDnbInstant extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
*
*/
/** 主键标识 */
private Long objId;
/**
*
*/
/** 计量设备编号 */
@Excel(name = "计量设备编号")
private String monitorId;
/**
* Code
*/
@Excel(name = "计量设备名称")
private String monitorCode;
/**
*
*/
/** 计量设备名称 */
@Excel(name = "计量设备名称")
private String monitorName;
/**
*
*/
/** 采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date collectTime;
private String beginCollectTime;
private String endCollectTime;
/**
* A
*/
/** A项电压 */
@Excel(name = "A项电压")
private Long vA;
private BigDecimal vA;
/**
* B
*/
/** B项电压 */
@Excel(name = "B项电压")
private Long vB;
private BigDecimal vB;
/**
* C
*/
/** C项电压 */
@Excel(name = "C项电压")
private Long vC;
private BigDecimal vC;
/**
* A
*/
/** A项电流 */
@Excel(name = "A项电流")
private Long iA;
private BigDecimal iA;
/**
* B
*/
/** B项电流 */
@Excel(name = "B项电流")
private Long iB;
private BigDecimal iB;
/**
* C
*/
/** C项电流 */
@Excel(name = "C项电流")
private Long iC;
private BigDecimal iC;
/**
*
*/
/** 记录时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date recordTime;
private String beginRecordTime;
private String endRecordTime;
/**
*
*/
/** 功率因数 */
@Excel(name = "功率因数")
private Long glys;
private BigDecimal glys;
/**
*
*/
/** 正向有功 */
@Excel(name = "正向有功")
private Long zxyg;
private BigDecimal zxyg;
/**
*
*/
/** 有功功率 */
@Excel(name = "有功功率")
private Long activePower;
private BigDecimal activePower;
/**
*
*/
/** 无功功率 */
@Excel(name = "无功功率")
private Long reactivePower;
private BigDecimal reactivePower;
/**
* 0 1
*/
/** 采集方式0自动 1手动 */
@Excel(name = "采集方式", readConverterExp = "0=自动,1=手动")
private Long collectType;
//统计单元id
private String workUnitCode;
public String getBeginRecordTime() {
return beginRecordTime;
}
public String getMonitorCode() {
return monitorCode;
}
public void setMonitorCode(String monitorCode) {
this.monitorCode = monitorCode;
}
public void setBeginRecordTime(String beginRecordTime) {
this.beginRecordTime = beginRecordTime;
}
public String getEndRecordTime() {
return endRecordTime;
}
public void setEndRecordTime(String endRecordTime) {
this.endRecordTime = endRecordTime;
}
public String getBeginCollectTime() {
return beginCollectTime;
}
public void setBeginCollectTime(String beginCollectTime) {
this.beginCollectTime = beginCollectTime;
}
public String getEndCollectTime() {
return endCollectTime;
}
public void setEndCollectTime(String endCollectTime) {
this.endCollectTime = endCollectTime;
}
public String getWorkUnitCode() {
return workUnitCode;
}
public void setWorkUnitCode(String workUnitCode) {
this.workUnitCode = workUnitCode;
}
public String getMonitorName() {
return monitorName;
}
@ -186,131 +91,147 @@ public class EmsRecordDnbInstant extends BaseEntity {
this.monitorName = monitorName;
}
public void setObjId(Long objId) {
public void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId() {
public Long getObjId()
{
return objId;
}
public void setMonitorId(String monitorId) {
this.monitorId = monitorId;
public void setMonitorCode(String monitorCode)
{
this.monitorCode = monitorCode;
}
public String getMonitorId() {
return monitorId;
public String getMonitorCode()
{
return monitorCode;
}
public void setCollectTime(Date collectTime) {
public void setCollectTime(Date collectTime)
{
this.collectTime = collectTime;
}
public Date getCollectTime() {
public Date getCollectTime()
{
return collectTime;
}
public void setVA(Long vA) {
public void setVA(BigDecimal vA)
{
this.vA = vA;
}
public Long getVA() {
public BigDecimal getVA()
{
return vA;
}
public void setVB(Long vB) {
public void setVB(BigDecimal vB)
{
this.vB = vB;
}
public Long getVB() {
public BigDecimal getVB()
{
return vB;
}
public void setVC(Long vC) {
public void setVC(BigDecimal vC)
{
this.vC = vC;
}
public Long getVC() {
public BigDecimal getVC()
{
return vC;
}
public void setIA(Long iA) {
public void setIA(BigDecimal iA)
{
this.iA = iA;
}
public Long getIA() {
public BigDecimal getIA()
{
return iA;
}
public void setIB(Long iB) {
public void setIB(BigDecimal iB)
{
this.iB = iB;
}
public Long getIB() {
public BigDecimal getIB()
{
return iB;
}
public void setIC(Long iC) {
public void setIC(BigDecimal iC)
{
this.iC = iC;
}
public Long getIC() {
public BigDecimal getIC()
{
return iC;
}
public void setRecordTime(Date recordTime) {
public void setRecordTime(Date recordTime)
{
this.recordTime = recordTime;
}
public Date getRecordTime() {
public Date getRecordTime()
{
return recordTime;
}
public void setGlys(Long glys) {
public void setGlys(BigDecimal glys)
{
this.glys = glys;
}
public Long getGlys() {
public BigDecimal getGlys()
{
return glys;
}
public void setZxyg(Long zxyg) {
public void setZxyg(BigDecimal zxyg)
{
this.zxyg = zxyg;
}
public Long getZxyg() {
public BigDecimal getZxyg()
{
return zxyg;
}
public void setActivePower(Long activePower) {
public void setActivePower(BigDecimal activePower)
{
this.activePower = activePower;
}
public Long getActivePower() {
public BigDecimal getActivePower()
{
return activePower;
}
public void setReactivePower(Long reactivePower) {
public void setReactivePower(BigDecimal reactivePower)
{
this.reactivePower = reactivePower;
}
public Long getReactivePower() {
public BigDecimal getReactivePower()
{
return reactivePower;
}
public void setCollectType(Long collectType) {
public void setCollectType(Long collectType)
{
this.collectType = collectType;
}
public Long getCollectType() {
public Long getCollectType()
{
return collectType;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("monitorId", getMonitorId())
.append("monitorCode", getMonitorCode())
.append("collectTime", getCollectTime())
.append("vA", getVA())
.append("vB", getVB())

@ -1,5 +1,6 @@
package com.os.ems.record.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -22,39 +23,34 @@ public class EmsRecordWaterInstant extends BaseEntity
/** 计量设备编号 */
@Excel(name = "计量设备编号")
private String monitorId;
private String monitorCode;
/** 计量设备编号 */
@Excel(name = "计量设备名称")
private String monitorName;
private String monitorCode;
/** 采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date collectTime;
private String beginTime;
private String endTime;
/** 瞬时流量 */
@Excel(name = "瞬时流量")
private Long fluxFlow;
private BigDecimal fluxFlow;
/** 累计流量 */
@Excel(name = "累计流量")
private Long waterFlow;
private BigDecimal waterFlow;
/** 记录时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date recordTime;
private String beginRecordTime;
private String endRecordTime;
/** 采集方式0自动 1手动 */
@Excel(name = "采集方式", readConverterExp = "0=自动,1=手动")
private Long collectType;
public String getMonitorCode() {
return monitorCode;
}
@ -63,38 +59,6 @@ public class EmsRecordWaterInstant extends BaseEntity
this.monitorCode = monitorCode;
}
public String getBeginRecordTime() {
return beginRecordTime;
}
public void setBeginRecordTime(String beginRecordTime) {
this.beginRecordTime = beginRecordTime;
}
public String getEndRecordTime() {
return endRecordTime;
}
public void setEndRecordTime(String endRecordTime) {
this.endRecordTime = endRecordTime;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getMonitorName() {
return monitorName;
}
@ -112,15 +76,7 @@ public class EmsRecordWaterInstant extends BaseEntity
{
return objId;
}
public void setMonitorId(String monitorId)
{
this.monitorId = monitorId;
}
public String getMonitorId()
{
return monitorId;
}
public void setCollectTime(Date collectTime)
{
this.collectTime = collectTime;
@ -130,21 +86,21 @@ public class EmsRecordWaterInstant extends BaseEntity
{
return collectTime;
}
public void setFluxFlow(Long fluxFlow)
public void setFluxFlow(BigDecimal fluxFlow)
{
this.fluxFlow = fluxFlow;
}
public Long getFluxFlow()
public BigDecimal getFluxFlow()
{
return fluxFlow;
}
public void setWaterFlow(Long waterFlow)
public void setWaterFlow(BigDecimal waterFlow)
{
this.waterFlow = waterFlow;
}
public Long getWaterFlow()
public BigDecimal getWaterFlow()
{
return waterFlow;
}
@ -171,7 +127,7 @@ public class EmsRecordWaterInstant extends BaseEntity
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("monitorId", getMonitorId())
.append("monitorCode", getMonitorCode())
.append("collectTime", getCollectTime())
.append("fluxFlow", getFluxFlow())
.append("waterFlow", getWaterFlow())

@ -1,5 +1,6 @@
package com.os.ems.record.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +50,7 @@ public class EmsRecordDnbInstantServiceImpl implements IEmsRecordDnbInstantServi
*/
@Override
public int insertEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant) {
emsRecordDnbInstant.setRecordTime(new Date());
return emsRecordDnbInstantMapper.insertEmsRecordDnbInstant(emsRecordDnbInstant);
}

@ -1,5 +1,6 @@
package com.os.ems.record.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -52,6 +53,7 @@ public class EmsRecordWaterInstantServiceImpl implements IEmsRecordWaterInstantS
@Override
public int insertEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant)
{
emsRecordWaterInstant.setRecordTime(new Date());
return emsRecordWaterInstantMapper.insertEmsRecordWaterInstant(emsRecordWaterInstant);
}

@ -6,7 +6,6 @@
<resultMap type="EmsRecordDnbInstant" id="EmsRecordDnbInstantResult">
<result property="objId" column="obj_id"/>
<result property="monitorId" column="monitor_id"/>
<result property="monitorName" column="monitor_name"/>
<result property="monitorCode" column="monitor_code"/>
<result property="collectTime" column="collect_time"/>
@ -25,62 +24,61 @@
</resultMap>
<sql id="selectEmsRecordDnbInstantVo">
select RDI.obj_id,
RDI.monitor_id,
BMI.monitor_name,
BMI.monitor_code,
RDI.collect_time,
RDI.v_a,
RDI.v_b,
RDI.v_c,
RDI.i_a,
RDI.i_b,
RDI.i_c,
RDI.record_time,
RDI.glys,
RDI.zxyg,
RDI.active_power,
RDI.reactive_power,
RDI.collect_type
from ems_record_dnb_instant as RDI
left join ems_base_monitor_info as BMI
on RDI.monitor_id = BMI.obj_id
select rdi.obj_id,
bmi.monitor_name,
rdi.monitor_code,
rdi.collect_time,
rdi.v_a,
rdi.v_b,
rdi.v_c,
rdi.i_a,
rdi.i_b,
rdi.i_c,
rdi.record_time,
rdi.glys,
rdi.zxyg,
rdi.active_power,
rdi.reactive_power,
rdi.collect_type
from ems_record_dnb_instant rdi
left join ems_base_monitor_info bmi on rdi.monitor_code = bmi.monitor_code
</sql>
<select id="selectEmsRecordDnbInstantList" parameterType="EmsRecordDnbInstant"
resultMap="EmsRecordDnbInstantResult">
<include refid="selectEmsRecordDnbInstantVo"/>
<where>
<if test="objId != null and objId != ''">and RDI.obj_id = #{objId}</if>
<if test="monitorId != null and monitorId != ''">and RDI.monitor_id = #{monitorId}</if>
<if test="beginCollectTime != null ">and RDI.collect_time >= #{beginCollectTime}</if>
<if test="endCollectTime != null ">and #{endCollectTime} >= RDI.collect_time</if>
<if test="vA != null ">and RDI.v_a = #{vA}</if>
<if test="vB != null ">and RDI.v_b = #{vB}</if>
<if test="vC != null ">and RDI.v_c = #{vC}</if>
<if test="iA != null ">and RDI.i_a = #{iA}</if>
<if test="iB != null ">and RDI.i_b = #{iB}</if>
<if test="iC != null ">and RDI.i_c = #{iC}</if>
<if test="beginRecordTime != null ">and RDI.record_time >= #{beginRecordTime}</if>
<if test="endRecordTime != null ">and #{endRecordTime} >= RDI.record_time</if>
<if test="glys != null ">and RDI.glys = #{glys}</if>
<if test="zxyg != null ">and RDI.zxyg = #{zxyg}</if>
<if test="activePower != null ">and RDI.active_power = #{activePower}</if>
<if test="reactivePower != null ">and RDI.reactive_power = #{reactivePower}</if>
<if test="collectType != null ">and RDI.collect_type = #{collectType}</if>
<if test="objId != null and objId != ''">and rdi.obj_id = #{objId}</if>
<if test="monitorCode != null and monitorCode != ''">and rdi.monitor_code = #{monitorCode}</if>
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
and rdi.collect_time between #{params.beginCollectTime} and #{params.endCollectTime}</if>
<if test="vA != null ">and rdi.v_a = #{vA}</if>
<if test="vB != null ">and rdi.v_b = #{vB}</if>
<if test="vC != null ">and rdi.v_c = #{vC}</if>
<if test="iA != null ">and rdi.i_a = #{iA}</if>
<if test="iB != null ">and rdi.i_b = #{iB}</if>
<if test="iC != null ">and rdi.i_c = #{iC}</if>
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
and rdi.record_time between #{params.beginRecordTime} and #{params.endRecordTime}</if>
<if test="glys != null ">and rdi.glys = #{glys}</if>
<if test="zxyg != null ">and rdi.zxyg = #{zxyg}</if>
<if test="activePower != null ">and rdi.active_power = #{activePower}</if>
<if test="reactivePower != null ">and rdi.reactive_power = #{reactivePower}</if>
<if test="collectType != null ">and rdi.collect_type = #{collectType}</if>
</where>
order by rdi.collect_time desc
</select>
<select id="selectEmsRecordDnbInstantByObjId" parameterType="Long" resultMap="EmsRecordDnbInstantResult">
<include refid="selectEmsRecordDnbInstantVo"/>
where RDI.obj_id = #{objId}
where rdi.obj_id = #{objId}
</select>
<insert id="insertEmsRecordDnbInstant" parameterType="EmsRecordDnbInstant" useGeneratedKeys="true"
keyProperty="objId">
insert into ems_record_dnb_instant
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorId != null">monitor_id,</if>
<if test="monitorCode != null">monitor_code,</if>
<if test="collectTime != null">collect_time,</if>
<if test="vA != null">v_a,</if>
<if test="vB != null">v_b,</if>
@ -96,7 +94,7 @@
<if test="collectType != null">collect_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorId != null">#{monitorId},</if>
<if test="monitorCode != null">#{monitorCode},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="vA != null">#{vA},</if>
<if test="vB != null">#{vB},</if>
@ -116,7 +114,7 @@
<update id="updateEmsRecordDnbInstant" parameterType="EmsRecordDnbInstant">
update ems_record_dnb_instant
<trim prefix="SET" suffixOverrides=",">
<if test="monitorId != null">monitor_id = #{monitorId},</if>
<if test="monitorCode != null">monitor_code = #{monitorCode},</if>
<if test="collectTime != null">collect_time = #{collectTime},</if>
<if test="vA != null">v_a = #{vA},</if>
<if test="vB != null">v_b = #{vB},</if>

@ -6,7 +6,6 @@
<resultMap type="EmsRecordWaterInstant" id="EmsRecordWaterInstantResult">
<result property="objId" column="obj_id"/>
<result property="monitorId" column="monitor_id"/>
<result property="monitorCode" column="monitor_code"/>
<result property="monitorName" column="monitor_name"/>
<result property="collectTime" column="collect_time"/>
@ -18,16 +17,15 @@
<sql id="selectEmsRecordWaterInstantVo">
select RWI.obj_id,
RWI.monitor_id,
RWI.collect_time,
RWI.flux_flow,
RWI.water_flow,
RWI.record_time,
RWI.collect_type,
BMI.monitor_name,
BMI.monitor_code
RWI.monitor_code,
RWI.collect_time,
RWI.flux_flow,
RWI.water_flow,
RWI.record_time,
RWI.collect_type,
BMI.monitor_name
from ems_record_water_instant RWI
left join ems_base_monitor_info BMI on RWI.monitor_id = BMI.obj_id
left join ems_base_monitor_info BMI on RWI.monitor_code = BMI.monitor_code
</sql>
<select id="selectEmsRecordWaterInstantList" parameterType="EmsRecordWaterInstant"
@ -35,15 +33,16 @@
<include refid="selectEmsRecordWaterInstantVo"/>
<where>
<if test="objId != null and objId != ''">and RWI.obj_id = #{objId}</if>
<if test="monitorId != null and monitorId != ''">and RWI.monitor_id = #{monitorId}</if>
<if test="beginTime !=null" > and RWI.collect_time>=#{beginTime}</if>
<if test="endTime !=null" > and #{endTime} >= RWI.collect_time</if>
<if test="monitorCode != null and monitorCode != ''">and RWI.monitor_code = #{monitorCode}</if>
<if test="fluxFlow != null ">and RWI.flux_flow = #{fluxFlow}</if>
<if test="waterFlow != null ">and RWI.water_flow = #{waterFlow}</if>
<if test="beginRecordTime != null ">and RWI.record_time >= #{beginRecordTime}</if>
<if test="endRecordTime != null ">and #{endRecordTime} >= RWI.record_time</if>
<if test="collectType != null ">and RWI.collect_type = #{collectType}</if>
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
and RWI.collect_time between #{params.beginCollectTime} and #{params.endCollectTime}</if>
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
and RWI.record_time between #{params.beginRecordTime} and #{params.endRecordTime}</if>
</where>
order by RWI.collect_time desc
</select>
<select id="selectEmsRecordWaterInstantByObjId" parameterType="Long" resultMap="EmsRecordWaterInstantResult">
@ -55,7 +54,7 @@
keyProperty="objId">
insert into ems_record_water_instant
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorId != null">monitor_id,</if>
<if test="monitorCode != null">monitor_code,</if>
<if test="collectTime != null">collect_time,</if>
<if test="fluxFlow != null">flux_flow,</if>
<if test="waterFlow != null">water_flow,</if>
@ -63,7 +62,7 @@
<if test="collectType != null">collect_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorId != null">#{monitorId},</if>
<if test="monitorCode != null">#{monitorCode},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="fluxFlow != null">#{fluxFlow},</if>
<if test="waterFlow != null">#{waterFlow},</if>
@ -75,7 +74,7 @@
<update id="updateEmsRecordWaterInstant" parameterType="EmsRecordWaterInstant">
update ems_record_water_instant
<trim prefix="SET" suffixOverrides=",">
<if test="monitorId != null">monitor_id = #{monitorId},</if>
<if test="monitorCode != null">monitor_code = #{monitorCode},</if>
<if test="collectTime != null">collect_time = #{collectTime},</if>
<if test="fluxFlow != null">flux_flow = #{fluxFlow},</if>
<if test="waterFlow != null">water_flow = #{waterFlow},</if>

Loading…
Cancel
Save