<?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.csdevice.mapper.AppLineTopologyDiagramMapper">
  <resultMap id="BaseResultMap" type="com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO">
    <!--@mbg.generated-->
    <!--@Table app_line_topology_diagram-->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="line_id" jdbcType="VARCHAR" property="lineId" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="create_by" jdbcType="CHAR" property="createBy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_by" jdbcType="CHAR" property="updateBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, line_id, `status`, create_by, create_time, update_by, update_time
  </sql>

  <select id="queryByTopoId" resultType="com.njcn.csdevice.pojo.vo.AppLineTopologyDiagramVO">
    select a.*,b.position linePostion  from cs_line_topology_diagram a LEFT JOIN cs_line  b on a.line_id=b.line_id where  a.status="1" and b.status="1" and a.id=#{id}
  </select>

  <select id="queryByLineIds" resultType="com.njcn.csdevice.pojo.vo.AppLineTopologyDiagramVO">
    select a.*,b.position linePostion,b.name name  from cs_line_topology_diagram a LEFT JOIN cs_line  b on a.line_id=b.line_id where
    a.status="1" and b.status="1" and
    a.line_id in
    <foreach collection='lineIds' item='item' index="index" open='(' separator=',' close=')'>
      #{item}
    </foreach>
  </select>
</mapper>