From 418a8806dba90a2463f194da759ed6338018d7d2 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期一, 28 八月 2023 16:02:28 +0800
Subject: [PATCH] 增加实时报警聚合接口all

---
 ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
index f535c75..f002cdf 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
@@ -6,6 +6,7 @@
 
     <resultMap type="ArdAppTask" id="ArdAppTaskResult">
         <result property="id" column="id"/>
+        <result property="type" column="type"/>
         <result property="name" column="name"/>
         <result property="text" column="text"/>
         <result property="voice" column="voice"/>
@@ -28,10 +29,10 @@
         <!--                    resultMap="ArdAppTaskDetailResult"/>-->
     </resultMap>
     <resultMap id="ArdAppTaskSub1Result" type="ArdAppTask" extends="ArdAppTaskResult">
-                <collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List"
-                            resultMap="ArdAppTaskPicResult"/>
-                <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List"
-                            resultMap="ArdAppTaskDetailResult"/>
+        <collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List"
+                    resultMap="ArdAppTaskPicResult"/>
+        <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List"
+                    resultMap="ArdAppTaskDetailResult"/>
     </resultMap>
     <resultMap type="ArdAppTaskDetail" id="ArdAppTaskDetailResult">
         <result property="id" column="sub1_id"/>
@@ -58,6 +59,7 @@
 
     <sql id="selectArdAppTaskVo">
         select c.id,
+               c.type,
                c.name,
                c.text,
                c.voice,
@@ -73,6 +75,7 @@
     </sql>
     <sql id="selectArdAppTaskDto">
         select a.id,
+               a.type,
                a.name,
                a.text,
                a.voice,
@@ -108,6 +111,7 @@
     <select id="selectArdAppTaskList" parameterType="ArdAppTask" resultMap="ArdAppTaskResult">
         <include refid="selectArdAppTaskVo"/>
         <where>
+            <if test="type != null  and type != ''">and c.type = #{type}</if>
             <if test="name != null  and name != ''">and c.name like '%'||#{name}||'%'</if>
             <if test="text != null  and text != ''">and c.text = #{text}</if>
             <if test="voice != null  and voice != ''">and c.voice = #{voice}</if>
@@ -158,21 +162,29 @@
             </if>
         </where>
     </select>
-
+    <select id="selectArdAppTaskDetailListByTaskId" resultType="ArdAppTaskDetail">
+        select * from ard_app_task_detail where task_id=#{taskId}
+    </select>
     <select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSub1Result">
         <include refid="selectArdAppTaskDto"/>
         where a.id = #{id}
     </select>
 
     <select id="selectArdAppTaskDetailListByIdAndUserId" resultType="ArdAppTaskDetail">
-        select * from ard_app_task_detail d
-        where d.task_id = #{id} and d.user_id = #{detailUserId}
+        select *
+        from ard_app_task_detail d
+        where d.task_id = #{id}
+          and d.user_id = #{detailUserId}
     </select>
     <select id="selectArdAppTaskPicListById" resultType="ArdAppTaskPic">
-        select * from ard_app_task_pic d where d.task_id = #{id}
+        select *
+        from ard_app_task_pic d
+        where d.task_id = #{id}
     </select>
     <select id="selectArdAppTaskDetailUserIdsByTaskId" parameterType="String" resultType="java.lang.String">
-        select DISTINCT(user_id) from ard_app_task_detail where task_id=#{taskId}
+        select DISTINCT(user_id)
+        from ard_app_task_detail
+        where task_id = #{taskId}
     </select>
 
 
@@ -180,6 +192,7 @@
         insert into ard_app_task
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
+            <if test="type != null">type,</if>
             <if test="name != null">name,</if>
             <if test="text != null">text,</if>
             <if test="voice != null">voice,</if>
@@ -192,6 +205,7 @@
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
+            <if test="type != null">#{type},</if>
             <if test="name != null">#{name},</if>
             <if test="text != null">#{text},</if>
             <if test="voice != null">#{voice},</if>
@@ -207,6 +221,7 @@
     <update id="updateArdAppTask" parameterType="ArdAppTask">
         update ard_app_task
         <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">type = #{type},</if>
             <if test="name != null">name = #{name},</if>
             <if test="text != null">text = #{text},</if>
             <if test="voice != null">voice = #{voice},</if>
@@ -331,7 +346,7 @@
         from ard_app_task_detail c
         where c.id = #{id}
     </select>
-    <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSubResult">
+    <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSub1Result">
         <include refid="selectArdAppTaskDto"/>
         where c.user_id = #{userId} AND c.view_flag is null
         order by create_time desc limit 1

--
Gitblit v1.9.3