anderx лет назад: 7
Родитель
Сommit
b026999f82

+ 4 - 0
src/main/java/com/goafanti/common/dao/JtMessageConsumerMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.JtMessageConsumer;
 import com.goafanti.common.model.JtMessageConsumerExample;
+import com.goafanti.message.bo.AppMessageBo;
+
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
@@ -74,4 +76,6 @@ public interface JtMessageConsumerMapper {
 	 * @mbggenerated  Wed Aug 29 09:46:33 CST 2018
 	 */
 	int updateByPrimaryKey(JtMessageConsumer record);
+
+	AppMessageBo selectById(String id);
 }

+ 6 - 0
src/main/java/com/goafanti/common/mapper/JtMessageConsumerMapper.xml

@@ -292,4 +292,10 @@
      (#{mc.id,jdbcType=VARCHAR}, #{mc.aid,jdbcType=VARCHAR}, #{mc.messageId,jdbcType=VARCHAR})
     </foreach>
   </insert>
+  <select id="selectById" resultType="com.goafanti.message.bo.AppMessageBo">
+  	select a.id ,b.title,b.body,b.create_time as createTime,a.is_read as isRead from jt_message_consumer a
+	left join jt_message_producer b on a.message_id=b.id
+	where a.delete_sign=0 and b.delete_sign=0 and  b.is_draft=0 and b.is_send=1
+	and a.id=#{id,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 1 - 1
src/main/java/com/goafanti/message/service/MessageService.java

@@ -163,7 +163,7 @@ public interface MessageService {
 	 */
 	JpushEasemobAccount selectSynAccByUid(String uid);
 	 Pagination<AppMessageBo> applistMessage(Integer pageNo, Integer pageSize);
-	 JtMessageConsumer updateAppReadMessage(String id);
+	 AppMessageBo updateAppReadMessage(String id);
 		
 	/**
 	 * 新增系统消息

+ 2 - 3
src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java

@@ -453,13 +453,12 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 	}
 
 	@Override
-	public JtMessageConsumer updateAppReadMessage(String id) {
+	public AppMessageBo updateAppReadMessage(String id) {
 		JtMessageConsumer mc=new JtMessageConsumer();
 		mc.setId(id);
 		mc.setIsRead(true);
 		jtMessageConsumerMapper.updateByPrimaryKeySelective(mc);
-		mc=jtMessageConsumerMapper.selectByPrimaryKey(id);
-		return mc;
+		return jtMessageConsumerMapper.selectById(id);
 	}
 
 	@Override