Skip to content

Commit 72493f8

Browse files
committed
fix(system/notice): 修复非管理员用户查询个人已读公告时出现重复数据的问题
Closes #174
1 parent dcc28bc commit 72493f8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

continew-system/src/main/resources/mapper/NoticeMapper.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
t1.publish_time,
1919
t1.is_top,
2020
t1.status,
21-
t1.create_user,
22-
t2.read_time IS NOT NULL AS isRead
21+
t1.create_user
22+
<if test="query.userId != null">
23+
,t2.read_time IS NOT NULL AS isRead
24+
</if>
2325
FROM sys_notice AS t1
24-
LEFT JOIN sys_notice_log AS t2 ON t2.notice_id = t1.id
26+
<if test="query.userId != null">
27+
LEFT JOIN sys_notice_log AS t2 ON t2.notice_id = t1.id AND t2.user_id = #{query.userId}
28+
</if>
2529
<where>
2630
<if test="query.userId != null">
2731
<choose>

0 commit comments

Comments
 (0)