This commit is contained in:
2023-03-03 14:25:57 +08:00
parent 9cf0f7c697
commit df8cf3a560
4 changed files with 21 additions and 3 deletions

View File

@@ -80,6 +80,7 @@ public interface MessageListMapper extends BaseMapper<MessageList> {
Integer fetchByReceiverSid(String receiverSid);
int selectUnReadCount(@Param("msgTypeSid") String msgTypeSid, @Param("userSid") String userSid);
int selectUnReadCount1(@Param("msgTypeSid") String msgTypeSid, @Param("userSid") String userSid);
AppLastMsgVo selectLastMsg(@Param("userSid") String userSid, @Param("msgTypeSid") String msgTypeSid);

View File

@@ -165,6 +165,19 @@
AND mt.sid = #{msgTypeSid}
</if>
</select>
<select id="selectUnReadCount1" resultType="int">
SELECT COUNT(1)
FROM message_list ml
LEFT JOIN message m ON ml.msgSid = m.sid
LEFT JOIN message_type mt ON m.msgTypeSid = mt.sid
WHERE mt.identifier = '0003'
AND ml.state = '0'
AND ml.receiverSid = #{userSid}
<if test="msgTypeSid != null and msgTypeSid != ''">
AND mt.sid = #{msgTypeSid}
</if>
</select>
<!--查询最近消息-->
<select id="selectLastMsg" resultType="com.yxt.messagecenter.api.messagelist.app.AppLastMsgVo">
SELECT DATE_FORMAT(ml.createTime, '%Y-%m-%d') as sendTime,
@@ -222,11 +235,11 @@
m.msgTitle,
m.msgContent,
ml.state,
DATE_FORMAT(ml.createTime, '%Y-%m-%d %H:%i') as sendTime,
DATE_FORMAT(ml.createTime, '%Y-%m-%d %H:%m:%s') as sendTime,
m.msgTargetUri as moduleAction,
m.senderName,
m.msgSource,
DATE_FORMAT(ml.modifyTime, '%Y-%m-%d %H:%i') as redTime
DATE_FORMAT(ml.modifyTime, '%Y-%m-%d %H:%m:%s') as redTime
FROM message_list ml
LEFT JOIN message m ON ml.msgSid = m.sid
<where>

View File

@@ -192,7 +192,7 @@ public class MessageListRest implements MessageListFeign {
@Override
public ResultBean<Integer> selectUnReadCount(String msgTypeSid, String userSid) {
return new ResultBean<Integer>().success().setData(messageListService.selectUnReadCount(msgTypeSid, userSid));
return new ResultBean<Integer>().success().setData(messageListService.selectUnReadCount1(msgTypeSid, userSid));
}
@Override

View File

@@ -250,6 +250,10 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
return baseMapper.selectUnReadCount(msgTypeSid, userSid);
}
public Integer selectUnReadCount1(String msgTypeSid, String userSid) {
return baseMapper.selectUnReadCount1(msgTypeSid, userSid);
}
/**
* 手机端查询消息主页面
*