<?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="testButtonDataflow">

  <!--
    버튼 제어용 관계도 목록 조회
    Node.js getAllRelationshipsForButtonControl 와 동일 쿼리:
      SELECT diagram_id, diagram_name, relationships
      FROM dataflow_diagrams
      WHERE company_code = $1
      ORDER BY UPDATED_DATE DESC
  -->
  <select id="selectDiagramsForRelationships" parameterType="map" resultType="map">
    SELECT
        DIAGRAM_ID
        , DIAGRAM_NAME
        , RELATIONSHIPS
    FROM DATAFLOW_DIAGRAMS
    WHERE 1=1
    <include refid="common.companyCodeFilter"/>
    ORDER BY UPDATED_DATE DESC
  </select>

</mapper>
