liurunyu
2024-07-15 5e2faddb34e79918b73dc75aca8f63048dd4526d
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -358,7 +358,7 @@
    WHERE id NOT IN(SELECT intakeId FROM pr_controller) AND deleted = 0
  </select>
  <!--获取取水口数量(在线和不在先)-->
  <!--获取取水口数量(在线和不在先) 废弃-->
  <select id="getOnLineIntakesCount" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
@@ -382,7 +382,7 @@
    </where>
  </select>
  <!--获取取水口列表(在线和不在先)-->
  <!--获取取水口列表(在线和不在先) 废弃-->
  <select id="getOnLineIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake">
    SELECT
      con.intakeId,
@@ -413,6 +413,31 @@
    </if>
  </select>
  <!--根据取水口编号获取取水口对象-->
  <select id="getIntakeByName" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake">
    SELECT
      con.intakeId,
      con.rtuAddr,
      inta.name AS intakeNum,
      rtus.isOnLine
    FROM pr_controller con
      INNER JOIN pr_intake inta ON con.intakeId = inta.id
      left JOIN JSON_TABLE(
        #{onLineMap},
        '$[*]' COLUMNS(
        rtuAddr VARCHAR(20) PATH '$.rtuAddr',
        isOnLine BOOLEAN PATH '$.isOnLine'
        )
      ) rtus ON con.rtuAddr = rtus.rtuAddr
    <where>
      <if test="intakeNum != null and intakeNum != ''">
        AND LOWER(inta.name) = #{intakeNum}
      </if>
    </where>
    LIMIT 0,1
  </select>
  <!--根据操作员获取常用取水口-->
  <select id="getUsedIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake">
    SELECT