feat(record): 添加母线别名字段并更新相关查询

- 在 RecordBusbarAlarm 模型中添加 busbarAlias 字段
- 更新 RecordBusbarAlarmMapper.xml,加入母线别名的查询和映射
- 优化查询条件,使用 base_alarm_info 和 base_busbar_info 表进行联合查询
IOT
zch 1 month ago
parent 5e011096f3
commit 7f13a635aa

@ -69,6 +69,8 @@ public class RecordBusbarAlarm extends BaseEntity
private String alarmContent; private String alarmContent;
private String busbarAlias;
public void setObjId(Long objId) public void setObjId(Long objId)
{ {
this.objId = objId; this.objId = objId;
@ -186,6 +188,14 @@ public class RecordBusbarAlarm extends BaseEntity
this.alarmContent = alarmContent; this.alarmContent = alarmContent;
} }
public String getBusbarAlias() {
return busbarAlias;
}
public void setBusbarAlias(String busbarAlias) {
this.busbarAlias = busbarAlias;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -202,6 +212,7 @@ public class RecordBusbarAlarm extends BaseEntity
.append("isFlag", getIsFlag()) .append("isFlag", getIsFlag())
.append("recordTime", getRecordTime()) .append("recordTime", getRecordTime())
.append("alarmContent", getAlarmContent()) .append("alarmContent", getAlarmContent())
.append("busbarAlias", getBusbarAlias())
.toString(); .toString();
} }
} }

@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="isFlag" column="is_flag" /> <result property="isFlag" column="is_flag" />
<result property="recordTime" column="record_time" /> <result property="recordTime" column="record_time" />
<result property="alarmContent" column="alarm_content" /> <result property="alarmContent" column="alarm_content" />
<result property="busbarAlias" column="busbar_alias" />
</resultMap> </resultMap>
<resultMap type="RecordBusbarAlarmCountResult" id="RecordBusbarAlarmCountResult"> <resultMap type="RecordBusbarAlarmCountResult" id="RecordBusbarAlarmCountResult">
@ -33,9 +34,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rba.temp_min, rba.temp_avg, rba.temp_diff, rba.file_path, rba.temp_min, rba.temp_avg, rba.temp_diff, rba.file_path,
rba.alarm_type, rba.alarm_value, rba.alarm_type, rba.alarm_value,
rba.is_flag, rba.record_time, rba.is_flag, rba.record_time,
bai.alarm_content bai.alarm_content,
bbi.busbar_alias
from record_busbar_alarm rba from record_busbar_alarm rba
LEFT JOIN base_alarm_info bai ON rba.busbar_code = bai.busbar_code LEFT JOIN base_alarm_info bai ON rba.busbar_code = bai.busbar_code
left join base_busbar_info bbi on rba.busbar_code = bbi.busbar_code
</sql> </sql>
<select id="selectRecordBusbarAlarmList" parameterType="RecordBusbarAlarm" resultMap="RecordBusbarAlarmResult"> <select id="selectRecordBusbarAlarmList" parameterType="RecordBusbarAlarm" resultMap="RecordBusbarAlarmResult">
@ -53,8 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="alarmValue != null "> and rba.alarm_value = #{alarmValue}</if> <if test="alarmValue != null "> and rba.alarm_value = #{alarmValue}</if>
<if test="isFlag != null "> and rba.is_flag = #{isFlag}</if> <if test="isFlag != null "> and rba.is_flag = #{isFlag}</if>
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''"> and rba.record_time between #{params.beginRecordTime} and #{params.endRecordTime}</if> <if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''"> and rba.record_time between #{params.beginRecordTime} and #{params.endRecordTime}</if>
<if test="alarmContent != null "> and rba.alarm_content = #{alarmContent}</if>
<if test="alarmContent != null "> and bai.alarm_content = #{alarmContent}</if>
<if test="busbarAlias != null "> and bbi.busbar_alias = #{busbarAlias}</if>
</where> </where>
</select> </select>

Loading…
Cancel
Save