<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ozs.mapper.MsgHeartbeatAlarmMessageMapper">
    <select id="selectBaseLineManagement" resultType="com.ozs.entity.MsgHeartbeatAlarmMessage" parameterType="java.lang.String">
        SELECT /*+ GROUP_OPT_FLAG(1)*/ id, alarm_id, terminal_code, train_num, create_time FROM
      msg_heartbeat_alarm_message
        <where>
            <if test="alarmId != null and alarmId != ''">
                and alarm_id = #{alarmId}
            </if>
        </where>
        GROUP BY alarm_id, terminal_code, train_num order by create_time asc
    </select>
</mapper>
