<?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.device.pq.mapper.SubstationMapper">
<select id="getSubstationData" resultType="com.njcn.device.pq.pojo.vo.SubstationDetailVO">
    SELECT
        line.id id,
        line.NAME srbName,
        sub.Lng coordY,
        sub.Lat coordX,
        "blue" color,
        dic.name scale
    FROM
        pq_line line,
        pq_substation sub,
        sys_dict_data dic
    WHERE
        line.Id = sub.Id
    and
        sub.scale = dic.id
    AND
        sub.Id IN
    <foreach collection="id" item="item" open="(" close=")" separator=",">
        #{item}
    </foreach>
</select>

    <select id="getSubstationById" resultType="com.njcn.device.pq.pojo.dto.SubstationDTO">
        SELECT
            line.id ,
            line.NAME ,
            line.sort ,
            sub.scale scale,
            sub.Lng Lng,
            sub.Lat Lat
        FROM
            pq_line line,
            pq_substation sub
        WHERE
            line.Id = sub.Id
        AND
            sub.Id IN
        <foreach collection="id" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>

    <select id="test" resultType="Substation">
        SELECT
        line.id ,
        line.NAME scale,
        sub.Lng Lng,
        sub.Lat Lat
        FROM
        pq_line line,
        pq_substation sub
        WHERE
        line.Id = sub.Id

    </select>
</mapper>
