<?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.lutao.cloud.oil.mapper.AtmosphereMonitorInfoMapper">

  <resultMap id="atmosphereMonitorInfoMap" type="com.lutao.entity.AtmosphereMonitorInfo">
                  <id property="id" column="id"/>
                        <result property="nameWaters" column="name_waters"/>
                        <result property="forecastEfficiency" column="forecast_efficiency"/>
                        <result property="pfId" column="pf_id"/>
                        <result property="appId" column="app_id"/>
                        <result property="platformCode" column="platform_code"/>
                        <result property="platformName" column="platform_name"/>
                        <result property="platformId" column="platform_id"/>
                        <result property="windSpeed" column="wind_speed"/>
                        <result property="windDirection" column="wind_direction"/>
                        <result property="gustiness" column="gustiness"/>
                        <result property="pressure" column="pressure"/>
                        <result property="waveHeight" column="wave_height"/>
                        <result property="maxWaveHeight" column="max_wave_height"/>
                        <result property="waveDirection" column="wave_direction"/>
                        <result property="period" column="period"/>
                        <result property="temp" column="temp"/>
                        <result property="lowTemp" column="low_temp"/>
                        <result property="highTemp" column="high_temp"/>
                        <result property="sd" column="sd"/>
                        <result property="wse" column="wse"/>
                        <result property="flowVelocity" column="flow_velocity"/>
                        <result property="flowDirection" column="flow_direction"/>
                        <result property="visibility" column="visibility"/>
                        <result property="weatherType" column="weather_type"/>
                        <result property="extremeWeatherType" column="extreme_weather_type"/>
                        <result property="detectionTime" column="detection_time"/>
            </resultMap>
      <select id="selectNewRecore" resultType="com.lutao.entity.AtmosphereMonitorInfo">
            SELECT
                  *
            FROM
                  atmosphere_monitor_info a
            WHERE
                        #{size} > ( SELECT count(*) FROM atmosphere_monitor_info b
                                    WHERE b.platform_code = a.platform_code AND b.id &lt; a.id )
            ORDER BY
                  a.platform_code,
                  a.id DESC
      </select>
</mapper>
