<?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.njcn.event.mapper.majornetwork.RStatOnlinerateDMapper">
    <select id="getOnlineRateByDevIds" resultType="com.njcn.event.pojo.po.PqsOnlinerate">
        select
        dev_index AS devId,
        online_min AS onlinemin,
        offline_min AS offlinemin
        from r_stat_onlinerate_d
        <where>
            <if test="list.size > 0">
                AND dev_index IN
                <foreach collection='list' item='item' index="index" open='(' separator=',' close=')'>
                    #{item}
                </foreach>
            </if>
            <if test="startTime != null and startTime !=''">
                AND  time_id >= #{startTime}
            </if>
            <if test="endTime != null and endTime != ''">
                AND  time_id &lt;= #{endTime}
            </if>
        </where>
    </select>
</mapper>
