<?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.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper">

    <select id="selectDataByequipmentIndexNameAndtimeAndEquipmentNumber" resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData">
        SELECT
            `value_f` AS valueF,
            created_time
        FROM
            iot_data.indicator_data
        WHERE
            id =#{id} AND ts >= #{startTime} AND ts &lt;= #{endTime}
            <if test="gatewayIds != null and gatewayIds.size() > 0">
                AND GATEWAY_ID IN
                <foreach collection="gatewayIds" item="item" open="(" separator="," close=")">
                    ${item}
                </foreach>
            </if>
    </select>
</mapper>
