|
|
@ -66,30 +66,7 @@
|
|
|
|
where ersi.obj_id = #{objId}
|
|
|
|
where ersi.obj_id = #{objId}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEmsRecordLatestSteamInstantList"
|
|
|
|
|
|
|
|
parameterType="EmsRecordSteamInstant"
|
|
|
|
|
|
|
|
resultMap="EmsRecordSteamInstantResult">
|
|
|
|
|
|
|
|
<include refid="selectEmsRecordSteamInstantVo"/>
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="objId != null">and ersi.obj_id = #{objId}</if>
|
|
|
|
|
|
|
|
<if test="monitorCode != null and monitorCode != ''">and ersi.monitor_code = #{monitorCode}</if>
|
|
|
|
|
|
|
|
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
|
|
|
|
|
|
|
|
and ersi.collect_time between #{params.beginCollectTime} and #{params.endCollectTime}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="fluxFlow != null ">and ersi.flux_flow = #{fluxFlow}</if>
|
|
|
|
|
|
|
|
<if test="steamFlow != null ">and ersi.steam_flow = #{steamFlow}</if>
|
|
|
|
|
|
|
|
<if test="heatInstantValue != null ">and ersi.heat_instant_value = #{heatInstantValue}</if>
|
|
|
|
|
|
|
|
<if test="heatTotalValue != null ">and ersi.heat_total_value = #{heatTotalValue}</if>
|
|
|
|
|
|
|
|
<if test="temperature != null ">and ersi.temperature = #{temperature}</if>
|
|
|
|
|
|
|
|
<if test="press != null ">and ersi.press = #{press}</if>
|
|
|
|
|
|
|
|
<if test="density != null ">and ersi.density = #{density}</if>
|
|
|
|
|
|
|
|
<if test="differencePress != null ">and ersi.difference_press = #{differencePress}</if>
|
|
|
|
|
|
|
|
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
|
|
|
|
|
|
|
and ersi.record_time between #{params.beginRecordTime} and #{params.endRecordTime}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
order by ersi.obj_id desc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertEmsRecordSteamInstant" parameterType="EmsRecordSteamInstant" useGeneratedKeys="true"
|
|
|
|
<insert id="insertEmsRecordSteamInstant" parameterType="EmsRecordSteamInstant" useGeneratedKeys="true"
|
|
|
|
keyProperty="objId">
|
|
|
|
keyProperty="objId">
|
|
|
@ -176,4 +153,92 @@
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
order by ersi.record_time desc
|
|
|
|
order by ersi.record_time desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEmsRecordLatestSteamInstantListByMonitorCode"
|
|
|
|
|
|
|
|
parameterType="EmsRecordSteamInstant"
|
|
|
|
|
|
|
|
resultMap="EmsRecordSteamInstantResult">
|
|
|
|
|
|
|
|
<include refid="selectEmsRecordSteamInstantVo"/>
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="objId != null">and ersi.obj_id = #{objId}</if>
|
|
|
|
|
|
|
|
<if test="monitorCode != null and monitorCode != ''">and ersi.monitor_code = #{monitorCode}</if>
|
|
|
|
|
|
|
|
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
|
|
|
|
|
|
|
|
and ersi.collect_time between #{params.beginCollectTime} and #{params.endCollectTime}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="fluxFlow != null ">and ersi.flux_flow = #{fluxFlow}</if>
|
|
|
|
|
|
|
|
<if test="steamFlow != null ">and ersi.steam_flow = #{steamFlow}</if>
|
|
|
|
|
|
|
|
<if test="heatInstantValue != null ">and ersi.heat_instant_value = #{heatInstantValue}</if>
|
|
|
|
|
|
|
|
<if test="heatTotalValue != null ">and ersi.heat_total_value = #{heatTotalValue}</if>
|
|
|
|
|
|
|
|
<if test="temperature != null ">and ersi.temperature = #{temperature}</if>
|
|
|
|
|
|
|
|
<if test="press != null ">and ersi.press = #{press}</if>
|
|
|
|
|
|
|
|
<if test="density != null ">and ersi.density = #{density}</if>
|
|
|
|
|
|
|
|
<if test="differencePress != null ">and ersi.difference_press = #{differencePress}</if>
|
|
|
|
|
|
|
|
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
|
|
|
|
|
|
|
and ersi.record_time between #{params.beginRecordTime} and #{params.endRecordTime}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
order by ersi.obj_id desc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
|
|
|
<!– 查询每个设备的最新一条记录 –>
|
|
|
|
|
|
|
|
<select id="selectEmsRecordLatestSteamInstantList" parameterType="EmsRecordSteamInstant" resultMap="EmsRecordSteamInstantResult">
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
ersi.obj_id,
|
|
|
|
|
|
|
|
ersi.monitor_code,
|
|
|
|
|
|
|
|
ebmi.monitor_name,
|
|
|
|
|
|
|
|
ersi.collect_time,
|
|
|
|
|
|
|
|
ersi.flux_flow,
|
|
|
|
|
|
|
|
ersi.steam_flow,
|
|
|
|
|
|
|
|
ersi.heat_instant_value,
|
|
|
|
|
|
|
|
ersi.heat_total_value,
|
|
|
|
|
|
|
|
ersi.temperature,
|
|
|
|
|
|
|
|
ersi.press,
|
|
|
|
|
|
|
|
ersi.density,
|
|
|
|
|
|
|
|
ersi.difference_press,
|
|
|
|
|
|
|
|
ersi.record_time
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
ems_record_steam_instant ersi
|
|
|
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
|
|
|
ems_base_monitor_info ebmi ON ersi.monitor_code = ebmi.monitor_code
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
|
|
ersi.obj_id = (
|
|
|
|
|
|
|
|
SELECT MAX(obj_id)
|
|
|
|
|
|
|
|
FROM ems_record_steam_instant
|
|
|
|
|
|
|
|
WHERE monitor_code = ersi.monitor_code
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
ORDER BY ersi.monitor_code ASC
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 查询每个设备的最新一条记录 -->
|
|
|
|
|
|
|
|
<select id="selectEmsRecordLatestSteamInstantList" parameterType="EmsRecordSteamInstant" resultMap="EmsRecordSteamInstantResult">
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
ersi.obj_id,
|
|
|
|
|
|
|
|
ersi.monitor_code,
|
|
|
|
|
|
|
|
ebmi.monitor_name,
|
|
|
|
|
|
|
|
ersi.collect_time,
|
|
|
|
|
|
|
|
ersi.flux_flow,
|
|
|
|
|
|
|
|
ersi.steam_flow,
|
|
|
|
|
|
|
|
ersi.heat_instant_value,
|
|
|
|
|
|
|
|
ersi.heat_total_value,
|
|
|
|
|
|
|
|
ersi.temperature,
|
|
|
|
|
|
|
|
ersi.press,
|
|
|
|
|
|
|
|
ersi.density,
|
|
|
|
|
|
|
|
ersi.difference_press,
|
|
|
|
|
|
|
|
ersi.record_time
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
ems_record_steam_instant ersi
|
|
|
|
|
|
|
|
LEFT JOIN ems_base_monitor_info ebmi ON ersi.monitor_code = ebmi.monitor_code
|
|
|
|
|
|
|
|
INNER JOIN (
|
|
|
|
|
|
|
|
SELECT monitor_code, MAX(obj_id) AS max_obj_id
|
|
|
|
|
|
|
|
FROM ems_record_steam_instant
|
|
|
|
|
|
|
|
GROUP BY monitor_code
|
|
|
|
|
|
|
|
) ersi_max ON ersi.monitor_code = ersi_max.monitor_code AND ersi.obj_id = ersi_max.max_obj_id
|
|
|
|
|
|
|
|
ORDER BY ersi.monitor_code ASC;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|