<?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.advance.eventSource.mapper.RmpEventAdvanceMapper">

  <select id="queryLineIdbyPointId" resultType="string" parameterType="string">
    select pid from pq_line where id = #{pointId}
  </select>


  <select id="queryCodebyGuid" resultType="java.lang.Integer" parameterType="java.lang.String">
    select triphase from sys_dict_data where id = #{guid}
  </select>

  <select id="getLogic" resultType="EntityLogic">
    SELECT
      a.tp_index tPIndex,
      b.logic_before nodeBefore,
      b.logic_next nodeNext,
      d.Algo_Describe type
    FROM
      pqs_tflgploy ploy,
      pqs_tflgployass a,
      pqs_tflgass b,
      pqs_transformer c,
      sys_dict_data d
    WHERE
      ploy.TP_Index = a.TP_Index
      and a.tf_index = b.tf_index
      AND b.tf_index = c.tf_index
      and c.Wiring = d.id
      and ploy.Status = 1
  </select>

</mapper>
