From 4a2deb11b819dd78a8c75e244ef67ec2e48cf5f5 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 14 四月 2025 21:03:28 +0800
Subject: [PATCH] 重构轮灌组修改接口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml |  118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 118 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml
index 8dedb69..9e2323e 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml
@@ -170,4 +170,122 @@
       `state` = #{state,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇宸℃鍛橀棶棰樹笂鎶ユ暟閲�-->
+  <select id="getIssueReportsCount" resultType="java.lang.Long">
+    SELECT COUNT(*) AS recordCount
+    FROM ope_issue_report rpt
+        LEFT JOIN ba_user us ON us.id = rpt.inspector_id
+        LEFT JOIN ope_report_reply rpy ON rpy.report_id = rpt.id
+    <where>
+      AND rpt.state != 3
+
+      <if test="inspectorId != null">
+        AND rpt.inspector_id = #{inspectorId}
+      </if>
+
+      <if test="inspectorName != null and inspectorName != ''">
+        AND us.name like CONCAT('%', #{inspectorName}, '%')
+      </if>
+
+      <if test="content != null and content != ''">
+        AND rpt.content like CONCAT('%', #{content}, '%')
+      </if>
+
+      <if test="timeStart != null and timeStop != null ">
+        AND rpt.report_time BETWEEN #{timeStart} AND #{timeStop}
+      </if>
+
+      <if test="state != null">
+        AND rpt.state = #{state}
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇宸℃鍛橀棶棰樹笂鎶�-->
+  <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voOp.VoIssueReport_temp">
+    SELECT
+        rpt.id AS issueReportId,
+        us.name AS inspectorName,
+        rpt.phone,
+        rpt.report_time AS reportTime,
+        rpt.content,
+        rpt.images,
+        rpt.audios,
+        rpt.videos,
+        rpy.reply_time AS replyTime,
+        rpy.reply_content AS replyContent,
+        rpy.replier_id AS replyPersonId,
+        rpt.state AS stateId,
+        CASE
+            WHEN rpt.state = 1 THEN '鏈彈鐞�'
+            WHEN rpt.state = 2 THEN '宸插彈鐞�'
+        END AS state
+    FROM ope_issue_report rpt
+        LEFT JOIN ba_user us ON us.id = rpt.inspector_id
+        LEFT JOIN ope_report_reply rpy ON rpy.report_id = rpt.id
+    <where>
+      AND rpt.state != 3
+
+      <if test="inspectorId != null">
+        AND rpt.inspector_id = #{inspectorId}
+      </if>
+
+      <if test="inspectorName != null and inspectorName != ''">
+        AND us.name like CONCAT('%', #{inspectorName}, '%')
+      </if>
+
+      <if test="content != null and content != ''">
+        AND rpt.content like CONCAT('%', #{content}, '%')
+      </if>
+
+      <if test="timeStart != null and timeStop != null ">
+        AND rpt.report_time BETWEEN #{timeStart} AND #{timeStop}
+      </if>
+
+      <if test="state != null">
+        AND rpt.state = #{state}
+      </if>
+    </where>
+    ORDER BY rpt.report_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>
+
+  <!--鏍规嵁涓婃姤ID鍙婂贰妫�鍛業D鑾峰彇鏈垹闄ょ殑涓婃姤锛屽垹闄や笂鎶ュ垽鏂娇鐢�-->
+  <select id="getReport" resultType="com.dy.pipIrrGlobal.pojoOp.OpeIssueReport">
+    SELECT * FROM ope_issue_report WHERE state != 3 AND id = #{issueReportId} AND inspector_id = #{inspectorId}
+  </select>
+
+  <!--閫昏緫鍒犻櫎涓�涓啘鎴烽棶棰樹笂鎶�-->
+  <update id="deleteIssueReport">
+    UPDATE ope_issue_report SET state = 3 WHERE id = #{issueReportId}
+  </update>
+  <!--鏍规嵁闂涓婃姤璁板綍涓婚敭鑾峰彇鑾峰彇宸℃鍛橀棶棰樹笂鎶ヨ褰曡鍥惧璞�-->
+  <select id="getIssueReportById" resultType="com.dy.pipIrrGlobal.voOp.VoIssueReport_temp">
+    SELECT
+      rpt.id AS issueReportId,
+      us.name AS inspectorName,
+      rpt.phone,
+      rpt.report_time AS reportTime,
+      rpt.content,
+      rpt.images,
+      rpt.audios,
+      rpt.videos,
+      rpy.reply_time AS replyTime,
+      rpy.reply_content AS replyContent,
+      rpy.replier_id AS replyPersonId,
+      rpt.state AS stateId,
+      CASE
+        WHEN rpt.state = 1 THEN '鏈彈鐞�'
+        WHEN rpt.state = 2 THEN '宸插彈鐞�'
+        END AS state
+    FROM ope_issue_report rpt
+           LEFT JOIN ba_user us ON us.id = rpt.inspector_id
+           LEFT JOIN ope_report_reply rpy ON rpy.report_id = rpt.id
+    where rpt.state != 3 AND rpt.id = #{issueReportId}
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0