提交 bddaef59 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 d8bb90f9
...@@ -10,38 +10,39 @@ import com.zrqx.core.model.talk.Talk; ...@@ -10,38 +10,39 @@ import com.zrqx.core.model.talk.Talk;
import com.zrqx.core.vo.talk.StatisticVO; import com.zrqx.core.vo.talk.StatisticVO;
public interface FgTalkMapper extends BaseMapper<Talk> { public interface FgTalkMapper extends BaseMapper<Talk> {
/** /**
* 根据关键词获取帖子列表 * 根据关键词获取帖子列表
*
* @param keyword * @param keyword
* @return * @return
* @author xjg * @author xjg
* @date 2019年1月16日 下午3:48:01 * @date 2019年1月16日 下午3:48:01
*/ */
@Select("<script>" + "select * from talk where status = 1 and talkType = 0" @Select("<script>"
+ " <if test = '" + NOTBLANK + "(keyword)' >" + " select * from talk where status = 1 and talkType = 0"
+ " and theme like concat('%',#{keyword},'%') " + " </if>" + " <if test = '" + NOTBLANK + "(keyword)' >"
+ " order by replyDate " + "</script>") + " and theme like concat('%',#{keyword},'%') "
List<Talk> selectByKeywords(@Param("keyword") String keyword); + " </if>"
+ " order by replyDate "
+ "</script>")
List<Talk> selectByKeywords(@Param("keyword")String keyword);
/** /**
* 浏览记录 * 浏览记录
*
* @param memberId * @param memberId
* @return * @return
* @author xjg * @author xjg
* @date 2019年1月18日 上午11:06:27 * @date 2019年1月18日 上午11:06:27
*/ */
@Select("<script>" @Select("<script>"
+ " select t.* from talk t left join record r on t.id = r.talkid where r.memberid = #{memberId}" + " select t.* from talk t left join record r on t.id = r.talkid where r.memberid = #{memberId}"
+ " order by r.createTime desc" + "</script>") + " order by r.createTime desc"
List<Talk> selectRecord(@Param("memberId") Integer memberId); + "</script>")
List<Talk> selectRecord(@Param("memberId")Integer memberId);
/** /**
* 统计信息 * 统计信息
*
* @param memberId * @param memberId
* @return * @return
* @author xjg * @author xjg
...@@ -49,12 +50,12 @@ public interface FgTalkMapper extends BaseMapper<Talk> { ...@@ -49,12 +50,12 @@ public interface FgTalkMapper extends BaseMapper<Talk> {
*/ */
@Select("<script>" @Select("<script>"
+ " SELECT COUNT(id)AS publishNum,SUM(replyNum)as replyNum,SUM(praiseNum)as praiseNum " + " SELECT COUNT(id)AS publishNum,SUM(replyNum)as replyNum,SUM(praiseNum)as praiseNum "
+ " FROM talk WHERE authorId = #{memberId} " + "</script>") + " FROM talk WHERE authorId = #{memberId} "
StatisticVO selectstatistics(@Param("memberId") Integer memberId); + "</script>")
StatisticVO selectstatistics(@Param("memberId")Integer memberId);
/** /**
* 获取当前用户的关注用户的所有帖子 * 获取当前用户的关注用户的所有帖子
*
* @param id * @param id
* @return * @return
* @author xjg * @author xjg
...@@ -63,12 +64,12 @@ public interface FgTalkMapper extends BaseMapper<Talk> { ...@@ -63,12 +64,12 @@ public interface FgTalkMapper extends BaseMapper<Talk> {
@Select("<script>" @Select("<script>"
+ " select t.* from attention a left join talk t on a.attentionId = t.authorId " + " select t.* from attention a left join talk t on a.attentionId = t.authorId "
+ " where t.status=1 and t.talkType=0 and a.memberId = #{id} " + " where t.status=1 and t.talkType=0 and a.memberId = #{id} "
+ " order by publishDate desc" + "</script>") + " order by publishDate desc"
List<Talk> selectNotification(@Param("id") Integer id); + "</script>")
List<Talk> selectNotification(@Param("id")Integer id);
/** /**
* 根据用户获取该用户回复过的帖子 * 根据用户获取该用户回复过的帖子
*
* @param m * @param m
* @return * @return
* @author xjg * @author xjg
...@@ -77,12 +78,13 @@ public interface FgTalkMapper extends BaseMapper<Talk> { ...@@ -77,12 +78,13 @@ public interface FgTalkMapper extends BaseMapper<Talk> {
@Select("<script>" @Select("<script>"
+ " select t.* from reply r left join talk t on r.toReplyerId = t.authorId " + " select t.* from reply r left join talk t on r.toReplyerId = t.authorId "
+ " where t.status=1 and t.talkType=0 and r.replyerId = #{id} " + " where t.status=1 and t.talkType=0 and r.replyerId = #{id} "
+ " group by t.id " + " order by publishDate desc" + "</script>") + " group by t.id "
List<Talk> selectReply(@Param("id") Integer id); + " order by publishDate desc"
+ "</script>")
List<Talk> selectReply(@Param("id")Integer id);
/** /**
* 根据用户获取未读信息数量 * 根据用户获取未读信息数量
*
* @param id * @param id
* @return * @return
* @author xjg * @author xjg
...@@ -90,15 +92,14 @@ public interface FgTalkMapper extends BaseMapper<Talk> { ...@@ -90,15 +92,14 @@ public interface FgTalkMapper extends BaseMapper<Talk> {
*/ */
@Select("<script>" @Select("<script>"
+ " SELECT COUNT(t.id) FROM talk t " + " SELECT COUNT(t.id) FROM talk t "
+ " LEFT JOIN attention a ON a.attentionId = t.authorId " + " LEFT JOIN attention a ON a.attentionId = t.authorId "
+ " LEFT JOIN record r ON t.id = r.talkid " + " LEFT JOIN record r ON t.id = r.talkid "
+ " WHERE t.status=1 AND t.talkType=0 AND t.authorId = #{id} AND r.id IS NULL" + " WHERE t.status=1 AND t.talkType=0 AND t.authorId = #{id} AND r.id IS NULL"
+ "</script>") + "</script>")
Integer selectNotificationCount(@Param("id") Integer id); Integer selectNotificationCount(@Param("id")Integer id);
/** /**
* 根据用户获取收藏列表 * 根据用户获取收藏列表
*
* @param id * @param id
* @return * @return
* @author xjg * @author xjg
...@@ -107,8 +108,8 @@ public interface FgTalkMapper extends BaseMapper<Talk> { ...@@ -107,8 +108,8 @@ public interface FgTalkMapper extends BaseMapper<Talk> {
@Select("<script>" @Select("<script>"
+ " select t.* from collection c left join talk t on c.memberId = t.authorId " + " select t.* from collection c left join talk t on c.memberId = t.authorId "
+ " where t.status=1 and t.talkType=0 and c.memberId = #{id} " + " where t.status=1 and t.talkType=0 and c.memberId = #{id} "
+ " group by t.id order by c.createTime desc " + " group by t.id order by c.createTime desc"
+ "</script>") + "</script>")
List<Talk> selectCollection(@Param("id") Integer id); List<Talk> selectCollection(@Param("id")Integer id);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论