<?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.LogManageMapper">

    <select id="getDeviceLogData" resultType="DeviceLogVO">
        SELECT
        A.`Name` name,
        B.`Name` type,
        C.`Name` updateBy
        FROM
        pq_line A,
        sys_dict_data B,
        sys_user C
        WHERE
        A.Id = #{lineIds}
        AND B.Id = #{terminalTypes}
        AND C.Id = #{updateBys}
    </select>
<!--        SELECT-->
<!--        A.`Name` name,-->
<!--        B.`Name` type,-->
<!--        C.`Name` updateBy-->
<!--        FROM-->
<!--        pq_line A,-->
<!--        sys_dict_data B,-->
<!--        sys_user C-->
<!--        WHERE A.Id IN-->
<!--        <foreach collection="lineIds" item="item" open="(" close=")" separator=",">-->
<!--            #{item}-->
<!--        </foreach>-->
<!--        AND B.Id IN-->
<!--        <foreach collection="terminalTypes" item="item" open="(" close=")" separator=",">-->
<!--            #{item}-->
<!--        </foreach>-->
<!--        AND C.Id IN-->
<!--        <foreach collection="updateBys" item="item" open="(" close=")" separator=",">-->
<!--            #{item}-->
<!--        </foreach>-->

    <select id="getEventLogData" resultType="EventLogVO">
        SELECT
        A.`Name` line,
        A3.`Name` substation,
        A4.`Name` powerCompany
        FROM
        pq_line A,
        pq_line A1,
        pq_line A2,
        pq_line A3,
        pq_line A4
        WHERE
        A.Id = #{lineId}
        AND A.Pid = A1.Id
        AND A1.Pid = A2.Id
        AND A2.Pid = A3.Id
        AND A3.Pid = A4.Id
    </select>


</mapper>