<?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.product.terminal.device.mapper.PqSubstationMapper">
  <resultMap id="BaseResultMap" type="com.njcn.product.terminal.oracleDevice.pojo.po.PqSubstation">
    <!--@mbg.generated-->
    <!--@Table PQ_SUBSTATION-->
    <id column="SUB_INDEX" jdbcType="DECIMAL" property="subIndex" />
    <result column="GD_INDEX" jdbcType="DECIMAL" property="gdIndex" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="SCALE" jdbcType="VARCHAR" property="scale" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    SUB_INDEX, GD_INDEX, "NAME", "SCALE"
  </sql>

  <select id="queryListByIds" resultType="com.njcn.product.terminal.oracleDevice.pojo.dto.SubstationDTO">
    select
    PQ_SUBSTATION.sub_index stationId,
    PQ_SUBSTATION.name stationName,
    PQ_GDINFORMATION.Name gdName,
    PQS_MAP.LATITUDE LATITUDE,
    PQS_MAP.LONGITUDE LONGITUDE
    from
    PQ_SUBSTATION left join
    PQS_MAP on    PQ_SUBSTATION.SUB_INDEX =PQS_MAP.SUB_INDEX
    left join
    PQ_GDINFORMATION on     PQ_SUBSTATION.GD_INDEX =PQ_GDINFORMATION.GD_INDEX

    where
    PQS_MAP.state=1
    and PQ_SUBSTATION.SUB_INDEX in
    <foreach collection="ids" item="item" open="(" close=")" separator=",">
      #{item}
    </foreach>
  </select>
</mapper>