<?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="org.springblade.modules.business.data.mapper.RtuDataGroundHistoreMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="rtuGroundDataResultMap" type="org.springblade.modules.business.data.entity.RtuDataGroundStoreEntity">
        <result column="rtu_code" property="rtuCode"/>
        <result column="tm" property="tm"/>
        <result column="vtavslm" property="vtavslm"/>
        <result column="srlslm" property="srlslm"/>
        <result column="slm10" property="slm10"/>
        <result column="slm20" property="slm20"/>
        <result column="slm30" property="slm30"/>
        <result column="slm40" property="slm40"/>
        <result column="slm50" property="slm50"/>
        <result column="slm40" property="slm40"/>
        <result column="slm60" property="slm60"/>
        <result column="slm80" property="slm80"/>
        <result column="slm100" property="slm100"/>
        <result column="up_time" property="upTime"/>
        <result column="from_time" property="fromTime"/>
    </resultMap>


    <resultMap id="rtuGroundDataVOResultMap" type="org.springblade.modules.business.data.vo.RtuDataGroundStoreVO">
        <result column="rtu_code" property="rtuCode"/>
        <result column="tm" property="tm"/>
        <result column="vtavslm" property="vtavslm"/>
        <result column="srlslm" property="srlslm"/>
        <result column="rtu_name" property="rtuName"/>
        <result column="slm10" property="slm10"/>
        <result column="slm20" property="slm20"/>
        <result column="slm30" property="slm30"/>
        <result column="slm40" property="slm40"/>
        <result column="slm50" property="slm50"/>
        <result column="slm60" property="slm60"/>
        <result column="slm80" property="slm80"/>
        <result column="slm100" property="slm100"/>
        <result column="ad_city" property="adCity"/>
        <result column="ad_dist" property="adDist"/>
        <result column="up_time" property="upTime"/>
        <result column="from_time" property="fromTime"/>
    </resultMap>


    <select id="selectPage" resultMap="rtuGroundDataResultMap">
        SELECT
        n.*
        FROM
        data_att_st_somo n
        WHERE
        n.is_deleted = 0
        <if test="groundDTO.rtuCode!=null">
            and n.rtu_code = #{groundDTO.rtuCode}
        </if>
        ORDER BY n.tm DESC
    </select>
</mapper>
