change - add采集设备信息

boardTest
yinq 1 year ago
parent 5a97dae043
commit fdbac98d84

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

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

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

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

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

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

Loading…
Cancel
Save