提交 8419a84d 作者: 张小凤

GambitDao.xml(update)

上级 23cb6542
......@@ -128,6 +128,8 @@ public interface GambitDao {
int selectCountAttentions(Integer userAccountId,Integer userId);
int selectCountAttentionMutualAttention(Integer userAccountId,Integer userId);
int selectGambitAndDynamic(Integer id);
Integer selectStatus(Integer id, Integer userId);
......
package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -31,6 +32,8 @@ public class MyAttentionDO implements Serializable {
@ApiModelProperty(value = "用户信息")
private ForumCountDO countDO;
private UserAccountVO userAccountVO;
......
package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -31,6 +32,8 @@ public class MyFansDO implements Serializable {
@ApiModelProperty(value = "用户信息")
private ForumCountDO countDO;
private UserAccountVO userAccountVO;
......
......@@ -286,6 +286,11 @@ public class GambitServiceImpl implements GambitService {
userTopicDynamicsQO.buildCurrentPage();
int count = gambitDao.myInterestListCount(userTopicDynamicsQO);
List<MyAttentionDO> myAttentionDOS = gambitDao.myInterestList(userTopicDynamicsQO);
for (MyAttentionDO myAttentionDO : myAttentionDOS) {
Integer userAccountId = myAttentionDO.getUserAccountId();
UserAccountVO info = info(userAccountId);
myAttentionDO.setUserAccountVO(info);
}
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,myAttentionDOS);
}
......@@ -295,6 +300,11 @@ public class GambitServiceImpl implements GambitService {
userTopicDynamicsQO.buildCurrentPage();
int count = gambitDao.myFansListCount(userTopicDynamicsQO);
List<MyFansDO> myAttentionDOS = gambitDao.myFansList(userTopicDynamicsQO);
for (MyFansDO myAttentionDO : myAttentionDOS) {
Integer userAccountId = myAttentionDO.getUserAccountId();
UserAccountVO info = info(userAccountId);
myAttentionDO.setUserAccountVO(info);
}
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,myAttentionDOS);
}
......@@ -303,12 +313,16 @@ public class GambitServiceImpl implements GambitService {
public ResultBody userMessage(Integer userAccountId,Integer userId) {
ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId);
int i= gambitDao.selectCountAttentions(userAccountId,userId);
int i1 = gambitDao.selectCountAttentionMutualAttention(userId, userAccountId);
UserAccountMessageVo userAccountMessageVo = infoMessage(userAccountId);
forumCountDO.setUserAccountMessageVo(userAccountMessageVo);
// int i = gambitDao.selectCountAttention(userId);
if (i!=0){
forumCountDO.setStatus(true);
}
if (i1!=0){
forumCountDO.setStatus(true);
}
return ResultBody.success(forumCountDO);
}
......
......@@ -70,7 +70,7 @@
<resultMap id="myInterestListMap" type="com.mmc.csf.release.entity.forum.MyAttentionDO">
<result property="id" column="id"/>
<result property="userAccountId" column="attention_user_account_id" />
<result property="userAccountId" column="user_account_id" />
<result property="mutualAttention" column="mutual_attention"/>
<collection property="dynamicCount" ofType="java.lang.Integer"
select="selectCountUser" column="{userAccountId=user_account_id}">
......@@ -197,6 +197,10 @@
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId}
</select>
<select id="selectCountAttentionMutualAttention" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="selectGambitAndDynamic" resultType="java.lang.Integer">
select count(*) from forum_dynamic_gambit where gambit_id=#{id}
</select>
......@@ -652,7 +656,10 @@
</select>
<select id="myInterestList" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id from forum_attention where attention_user_account_id=#{userAccountId}
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myFansListCount" resultType="java.lang.Integer">
......@@ -660,7 +667,7 @@
</select>
<select id="myFansList" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where user_account_id=#{userAccountId}
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论