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

--no commit message

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