From 1f19230e00b543b58f03853df1a38ebd8b508e55 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 21 二月 2025 16:55:01 +0800
Subject: [PATCH] 发布灌溉计划并生成开阀计划

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeIssueReportMapper.xml |  120 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 106 insertions(+), 14 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeIssueReportMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeIssueReportMapper.xml
index fb51563..79c4fe8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeIssueReportMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeIssueReportMapper.xml
@@ -6,9 +6,9 @@
     <!--@Table se_issue_report-->
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="content" jdbcType="VARCHAR" property="content" />
-    <result column="images" jdbcType="VARCHAR" property="images" />
-    <result column="audios" jdbcType="VARCHAR" property="audios" />
-    <result column="videos" jdbcType="VARCHAR" property="videos" />
+    <result column="images" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="images" />
+    <result column="audios" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="audios" />
+    <result column="videos" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="videos" />
     <result column="lng" jdbcType="DECIMAL" property="lng" />
     <result column="lat" jdbcType="DECIMAL" property="lat" />
     <result column="client_id" jdbcType="BIGINT" property="clientId" />
@@ -38,8 +38,8 @@
       audios, videos, lng, 
       lat, client_id, report_time, 
       phone, `state`)
-    values (#{id,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, #{images,jdbcType=VARCHAR}, 
-      #{audios,jdbcType=VARCHAR}, #{videos,jdbcType=VARCHAR}, #{lng,jdbcType=DECIMAL}, 
+    values (#{id,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
+      #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{lng,jdbcType=DECIMAL},
       #{lat,jdbcType=DECIMAL}, #{clientId,jdbcType=BIGINT}, #{reportTime,jdbcType=TIMESTAMP}, 
       #{phone,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT})
   </insert>
@@ -89,13 +89,13 @@
         #{content,jdbcType=VARCHAR},
       </if>
       <if test="images != null">
-        #{images,jdbcType=VARCHAR},
+        #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       </if>
       <if test="audios != null">
-        #{audios,jdbcType=VARCHAR},
+        #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       </if>
       <if test="videos != null">
-        #{videos,jdbcType=VARCHAR},
+        #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       </if>
       <if test="lng != null">
         #{lng,jdbcType=DECIMAL},
@@ -125,13 +125,13 @@
         content = #{content,jdbcType=VARCHAR},
       </if>
       <if test="images != null">
-        images = #{images,jdbcType=VARCHAR},
+        images = #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       </if>
       <if test="audios != null">
-        audios = #{audios,jdbcType=VARCHAR},
+        audios = #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       </if>
       <if test="videos != null">
-        videos = #{videos,jdbcType=VARCHAR},
+        videos = #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       </if>
       <if test="lng != null">
         lng = #{lng,jdbcType=DECIMAL},
@@ -158,9 +158,9 @@
     <!--@mbg.generated-->
     update se_issue_report
     set content = #{content,jdbcType=VARCHAR},
-      images = #{images,jdbcType=VARCHAR},
-      audios = #{audios,jdbcType=VARCHAR},
-      videos = #{videos,jdbcType=VARCHAR},
+      images = #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
+      audios = #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
+      videos = #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
       lng = #{lng,jdbcType=DECIMAL},
       lat = #{lat,jdbcType=DECIMAL},
       client_id = #{clientId,jdbcType=BIGINT},
@@ -169,4 +169,96 @@
       `state` = #{state,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛闂涓婃姤鏁伴噺-->
+  <select id="getIssueReportsCount" resultType="java.lang.Long">
+    SELECT COUNT(*) AS recordCount
+    FROM se_issue_report rpt
+        LEFT JOIN se_client cli ON cli.id = rpt.client_id
+        LEFT JOIN se_report_reply rpy ON rpy.report_id = rpt.id
+    <where>
+      AND rpt.state != 3
+
+      <if test="clientId != null">
+        AND rpt.client_id = #{clientId}
+      </if>
+
+      <if test="clientName != null and clientName != ''">
+        AND cli.name like CONCAT('%', #{clientName}, '%')
+      </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.voSe.VoIssueReport_temp" >
+    SELECT
+        rpt.id AS issueReportId,
+        cli.name AS clientName,
+        rpt.phone,
+        rpt.report_time AS reportTime,
+        rpt.content,
+        rpt.images,
+        rpt.audios,
+        rpt.videos,
+        rpy.reply_time AS replyTime,
+        rpt.state AS stateId,
+        CASE
+            WHEN rpt.state = 1 THEN '鏈彈鐞�'
+            WHEN rpt.state = 2 THEN '宸插彈鐞�'
+        END AS state
+    FROM se_issue_report rpt
+        LEFT JOIN se_client cli ON cli.id = rpt.client_id
+        LEFT JOIN se_report_reply rpy ON rpy.report_id = rpt.id
+    <where>
+      AND rpt.state != 3
+
+      <if test="clientId != null">
+        AND rpt.client_id = #{clientId}
+      </if>
+
+      <if test="clientName != null and clientName != ''">
+        AND cli.name like CONCAT('%', #{clientName}, '%')
+      </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.pojoSe.SeIssueReport">
+    SELECT * FROM se_issue_report WHERE state != 3 AND id = #{issueReportId} AND client_id = #{clientId}
+  </select>
+
+  <!--閫昏緫鍒犻櫎涓�涓啘鎴烽棶棰樹笂鎶�-->
+  <update id="deleteIssueReport">
+    UPDATE se_issue_report SET state = 3 WHERE id = #{issueReportId}
+  </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0