Administrator
2024-07-03 7f5b61a32aa6687eac4cebb4705ced19145dd692
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml
@@ -246,8 +246,29 @@
      LIMIT 0,1
  </select>
  <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand">
  <!--根据指定条件获取命令日志历史记录总数-->
  <select id="getCommandHistoriesCount" resultType="java.lang.Long">
    SELECT
      COUNT(*) AS recordCount
    FROM rm_command_history his
      INNER JOIN pr_intake inta ON inta.id = his.intake_id
      LEFT JOIN se_client cli ON cli.id = his.operator
      LEFT JOIN ba_user  user ON user.id = his.operator
    <where>
      <if test = "commandName != null and commandName !=''">
        AND his.command_name LIKE CONCAT('%',#{commandName},'%')
      </if>
      <if test = "result != null">
        AND his.result = #{result}
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND his.send_time BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取命令日志历史记录-->
  <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand">
    SELECT
      his.id,
      his.command_name AS commandName,
@@ -263,10 +284,27 @@
      his.result_text,
      IFNULL(cli.name, user.name) AS userName
    FROM rm_command_history his
           INNER JOIN pr_intake inta ON inta.id = his.intake_id
           LEFT JOIN se_client cli ON cli.id = his.operator
           LEFT JOIN ba_user  user ON user.id = his.operator
    WHERE his.command_name LIKE '%关阀%' AND his.result =1 AND his.send_time BETWEEN '2024-06-01 00:00:00' AND '2024-07-31 23:59:59'
     INNER JOIN pr_intake inta ON inta.id = his.intake_id
     LEFT JOIN se_client cli ON cli.id = his.operator
     LEFT JOIN ba_user  user ON user.id = his.operator
    <where>
      <if test = "commandName != null and commandName !=''">
        AND his.command_name LIKE CONCAT('%',#{commandName},'%')
      </if>
      <if test = "result != null">
        AND his.result = #{result}
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND his.send_time BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY his.send_time DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>