From e7ebe2512258e91e6003467b2f613f8188db6f5d Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期一, 31 七月 2023 10:28:45 +0800
Subject: [PATCH] 修复单兵端 - 下发给我的任务列表分页问题

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

diff --git a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
index 5d13a83..36de4bf 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
@@ -131,6 +131,8 @@
             <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
                 and a.create_time &lt;= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
             </if>
+            <!-- 鏁版嵁鑼冨洿杩囨护 -->
+            ${params.dataScope}
         </where>
     </select>
     <select id="selectArdAppTaskListWithDetailById" parameterType="ArdAppTask" resultMap="ArdAppTaskSubResult">
@@ -263,10 +265,19 @@
             <if test="text != null">text = #{text},</if>
             <if test="voice != null">voice = #{voice},</if>
             <if test="viewTime != null">view_time = #{viewTime},</if>
+            <if test="viewFlag != null">view_flag = #{viewFlag},</if>
             <if test="viewPosition != null">view_position = #{viewPosition},</if>
             <if test="clockInTime != null">clock_in_time = #{clockInTime},</if>
+            <if test="taskId != null">task_id = #{taskId},</if>
         </trim>
         where id = #{id}
+    </update>
+    <update id="updateArdAppTaskDetailByTaskId" parameterType="ArdAppTaskDetail">
+        update ard_app_task_detail
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="viewFlag != null">view_flag = #{viewFlag},</if>
+        </trim>
+        where task_id = #{taskId}
     </update>
     <update id="updateArdAppTaskDetailView" parameterType="ArdAppTaskDetail">
         update ard_app_task_detail
@@ -307,4 +318,13 @@
         where c.user_id = #{userId} AND c.view_flag is null
         order by create_time desc limit 1
     </select>
+    <select id="selectUnreadArdAppTaskCount" resultType="Integer">
+        SELECT COUNT( A.ID )
+        FROM ard_app_task
+        A LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID
+        WHERE
+            C.view_time IS NULL
+          AND  C.view_flag = '1'
+          AND C.user_id = #{userId}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3