提交 8e2c74f9 作者: 张小凤

GambitDao(update)

上级 8d9f4a7e
...@@ -151,4 +151,6 @@ public interface GambitDao { ...@@ -151,4 +151,6 @@ public interface GambitDao {
List<MyFansDO> myFansLists(UserTopicDynamicsQO userTopicDynamicsQO); List<MyFansDO> myFansLists(UserTopicDynamicsQO userTopicDynamicsQO);
List<ForumAttentionDO> selectAttentionCount(Integer userAccountId, Integer userId); List<ForumAttentionDO> selectAttentionCount(Integer userAccountId, Integer userId);
void insertCount(Integer userAccountId);
} }
...@@ -442,11 +442,14 @@ public class GambitServiceImpl implements GambitService { ...@@ -442,11 +442,14 @@ public class GambitServiceImpl implements GambitService {
@Override @Override
public ResultBody userMessage(Integer userAccountId,Integer userId) { public ResultBody userMessage(Integer userAccountId,Integer userId) {
ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId); ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId);
if (forumCountDO==null){
gambitDao.insertCount(userAccountId);
forumCountDO= gambitDao.userMessage(userAccountId);
}
int i= gambitDao.selectCountAttentions(userAccountId,userId); int i= gambitDao.selectCountAttentions(userAccountId,userId);
int i1 = gambitDao.selectCountAttentionMutualAttention(userId, userAccountId); int i1 = gambitDao.selectCountAttentionMutualAttention(userId, userAccountId);
UserAccountMessageVo userAccountMessageVo = infoMessage(userAccountId); UserAccountMessageVo userAccountMessageVo = infoMessage(userAccountId);
forumCountDO.setUserAccountMessageVo(userAccountMessageVo); forumCountDO.setUserAccountMessageVo(userAccountMessageVo);
// int i = gambitDao.selectCountAttention(userId);
if (i!=0){ if (i!=0){
forumCountDO.setStatus(true); forumCountDO.setStatus(true);
} }
......
...@@ -208,6 +208,10 @@ ...@@ -208,6 +208,10 @@
select user_account_id,attention_user_account_id,mutual_attention from forum_attention where attention_user_account_id=#{userId} or user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} or user_account_id=#{userId} and mutual_attention=1 select user_account_id,attention_user_account_id,mutual_attention from forum_attention where attention_user_account_id=#{userId} or user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} or user_account_id=#{userId} and mutual_attention=1
</select> </select>
<insert id="insertCount">
insert into forum_count(user_account_id,create_time,update_time) values(#{userAccountId},now(),NOW())
</insert>
<select id="selectGambitAndDynamic" resultType="java.lang.Integer"> <select id="selectGambitAndDynamic" resultType="java.lang.Integer">
select count(*) from forum_dynamic_gambit where gambit_id=#{id} select count(*) from forum_dynamic_gambit where gambit_id=#{id}
</select> </select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论