修改已读状态功能

This commit is contained in:
HaoWang 2023-11-09 13:59:42 +08:00
parent d3812c786b
commit 91c6525ca7
3 changed files with 5 additions and 5 deletions

View File

@ -76,7 +76,7 @@ public interface ChatRecordMapper {
*/ */
int deleteChatRecordByIds(Long[] ids); int deleteChatRecordByIds(Long[] ids);
Integer updateReadStatus(MarkReadDto markReadDto); Integer updateReadStatus(ChatRecord chatRecord);
int deleteMegs(@Param("ids") List<Long> ids); int deleteMegs(@Param("ids") List<Long> ids);

View File

@ -125,7 +125,7 @@ public class ChatRecordServiceImpl implements IChatRecordService {
//更新已读时间 //更新已读时间
chatRecord.setReadTime(DateUtils.getNowDate()); chatRecord.setReadTime(DateUtils.getNowDate());
chatRecord.setReadStatus("1"); chatRecord.setReadStatus("1");
return chatRecordMapper.updateChatRecord(chatRecord); return chatRecordMapper.updateReadStatus(chatRecord);
} }
/** /**

View File

@ -372,17 +372,17 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="updateReadStatus" parameterType="com.xinelu.manage.dto.chatrecord.MarkReadDto"> <update id="updateReadStatus" parameterType="ChatRecord">
update chat_record update chat_record
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="readStatus != null and readStatus != ''"> <if test="readStatus != null and readStatus != ''">
read_status = =#{readStatus}, read_status = #{readStatus},
</if> </if>
<if test="readTime != null"> <if test="readTime != null">
read_time = #{readTime}, read_time = #{readTime},
</if> </if>
</trim> </trim>
where del_flag = 0 and read_status = '0' and recipient_id = #{recipientId} where del_flag = 0 and read_status = '0' and consultation_id = #{consultationId} and recipient_id = #{recipientId}
</update> </update>
<!-- 更新通知 --> <!-- 更新通知 -->