<?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.harmonic.mapper.OnlineRateDataMapper">

    <select id="getOnlineRateData" resultType="OnlineRateVO">
        SELECT
            A.Id,
            A.Pid,
            A.Pids,
            A.Name,
            A.State,
            A.Sort,
            A.Level,
            B.`IP` networkParam,
            B.`Update_Time` time,
            D.`Name` factoryName,
            A.`Name` deviceName
        FROM
            pq_line A,
            pq_device B,
            sys_dict_data D
        WHERE
        A.Id IN
        <foreach item="item" collection="list" separator="," open="(" close=")">
            #{item}
        </foreach>
        AND A.Id = B.Id
        AND B.Manufacturer = D.Id
    </select>

    <select id="getLineInfoByList" resultType="OnlineRateVO">
        SELECT
            A.Id,
            A.Pid,
            A.Pids,
            A.Name,
            A.Sort,
            A.Level level
        FROM
            pq_line A
        WHERE
            A.Id IN
            <foreach item="item" collection="list" separator="," open="(" close=")">
                #{item}
            </foreach>
    </select>

<!--    <select id="getSubstationInfoByList" resultType="OnlineRateVO">-->
<!--        SELECT-->
<!--            A.Id,-->
<!--            A.Pid,-->
<!--            A.Pids,-->
<!--            A.`Name` name,-->
<!--            A.Sort,-->
<!--            A.`Level` level,-->
<!--        FROM-->
<!--            pq_line A,-->
<!--            pq_line A1,-->
<!--            pq_substation B,-->
<!--            sys_dict_data C-->
<!--        WHERE-->
<!--            A.Pid = A1.Id-->
<!--            AND A1.Id = B.Id-->
<!--            AND B.Id IN-->
<!--            <foreach item="item" collection="list" separator="," open="(" close=")">-->
<!--                #{item}-->
<!--            </foreach>-->
<!--            AND B.Scale = C.Id-->
<!--    </select>-->

</mapper>
