<?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.huimv.acquisition.mapper.EartagDataDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.huimv.acquisition.entity.EartagDataEntity" id="eartagDataMap">
        <result property="id" column="id"/>
        <result property="deviceCode" column="device_code"/>
        <result property="eartagNo" column="eartag_no"/>
        <result property="time" column="time"/>
        <result property="dayAge" column="day_age"/>
        <result property="dayAge2" column="day_age2"/>
        <result property="earTemp" column="ear_temp"/>
        <result property="exercise" column="exercise"/>
        <result property="pigpen" column="pigpen"/>
        <result property="envTemp" column="env_temp"/>
        <result property="bat" column="bat"/>
        <result property="rssi" column="rssi"/>
        <result property="head" column="head"/>
        <result property="command" column="command"/>
        <result property="version" column="version"/>
        <result property="frameSerialNo" column="frame_serial_no"/>
        <result property="rebootTimes" column="reboot_times"/>
        <result property="prepareField" column="prepare_field"/>
        <result property="chk" column="chk"/>
        <result property="tail" column="tail"/>
    </resultMap>

    <select id="page" resultType="com.huimv.acquisition.entity.EartagDataEntity">
        SELECT * FROM eartag_data ed1 JOIN (SELECT MAX(id) id FROM eartag_data ed2 ${ew.customSqlSegment}) b ON ed1.id = b.id
    </select>








</mapper>