<?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.TerminalHeartbeatLogMapper">

    <select id="terminalHeartbeatLogList" resultType="com.ozs.entity.TerminalHeartbeatLog">
      SELECT camera_code, channel
FROM (
    SELECT DISTINCT camera_code, channel
    FROM (
        SELECT camera_code, channel, CREATE_TIME
        FROM terminal_heartbeat_log
        ORDER BY CREATE_TIME DESC
    ) AS sorted_data
) AS distinct_data
LIMIT 4;
    </select>
</mapper>
