|
|
|
@ -24,6 +24,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="routModel" column="rout_model" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap type="RecordBusbarTemp" id="BusbarTempResult">
|
|
|
|
|
<result property="objId" column="objId" />
|
|
|
|
|
<result property="busbarCode" column="busbar_code" />
|
|
|
|
|
<result property="cabinetCode" column="cabinet_code" />
|
|
|
|
|
<result property="tempMax" column="temp_max" />
|
|
|
|
|
<result property="tempMin" column="temp_min" />
|
|
|
|
|
<result property="tempAvg" column="temp_avg" />
|
|
|
|
|
<result property="tempDiff" column="temp_diff" />
|
|
|
|
|
<result property="isAlarm" column="is_alarm" />
|
|
|
|
|
<result property="filePath" column="file_path" />
|
|
|
|
|
<result property="isFlag" column="is_flag" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="createdBy" column="created_by" />
|
|
|
|
|
<result property="createdTime" column="created_time" />
|
|
|
|
|
<result property="updatedBy" column="updated_by" />
|
|
|
|
|
<result property="updatedTime" column="updated_time" />
|
|
|
|
|
<result property="recordTime" column="record_time" />
|
|
|
|
|
<result property="routModel" column="rout_model" />
|
|
|
|
|
<result property="cabinetAlias" column="cabinet_alias" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectRecordBusbarTempVo">
|
|
|
|
|
select objId,
|
|
|
|
|
busbar_code,
|
|
|
|
@ -145,4 +166,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
#{objId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="boardTempList" parameterType="RecordBusbarTemp" resultMap="BusbarTempResult">
|
|
|
|
|
<!-- 查询每个设备的最新一条记录 -->
|
|
|
|
|
select
|
|
|
|
|
rbt.objId,
|
|
|
|
|
rbt.cabinet_code,
|
|
|
|
|
rbt.busbar_code,
|
|
|
|
|
rbt.temp_max,
|
|
|
|
|
rbt.temp_min,
|
|
|
|
|
rbt.temp_avg,
|
|
|
|
|
rbt.temp_diff,
|
|
|
|
|
rbt.record_time,
|
|
|
|
|
bci.cabinet_alias
|
|
|
|
|
from record_busbar_temp rbt
|
|
|
|
|
left join base_cabinet_info bci on rbt.cabinet_code = bci.cabinet_code
|
|
|
|
|
INNER JOIN (
|
|
|
|
|
select cabinet_code, MAX(objId) as objId
|
|
|
|
|
from record_busbar_temp
|
|
|
|
|
group by cabinet_code
|
|
|
|
|
) rbt_max on rbt_max.cabinet_code = rbt.cabinet_code and rbt_max.objId = rbt.objId
|
|
|
|
|
ORDER BY rbt.cabinet_code asc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|