<?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.prepare.harmonic.mapper.mysql.day.RStatDataPltDMapper">

    <select id="getBenchmarkLevel" resultType="com.njcn.harmonic.pojo.po.day.RStatDataPltDPO">
        select
            `time`,
            line_id,
            max(plt) plt
        from
            r_stat_data_plt_d
        where
            `time` between #{startTime} and #{endTime}
            and value_type = 'MAX'
            and phasic_type in ('A','B','C')
            <if test="list != null and list.size() > 0">
                and line_id in
                <foreach collection="list" item="item" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
        group by `time`,line_id
    </select>

</mapper>