Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xylt
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
xylt
Commits
bce891b1
提交
bce891b1
authored
1月 28, 2019
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
e0125915
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
29 行增加
和
32 行删除
+29
-32
FgTalkMapper.java
...k/src/main/java/com/zrqx/talk/fg/mapper/FgTalkMapper.java
+29
-32
没有找到文件。
com.zrqx.talk/src/main/java/com/zrqx/talk/fg/mapper/FgTalkMapper.java
浏览文件 @
bce891b1
...
...
@@ -10,39 +10,38 @@ 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
...
...
@@ -50,12 +49,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
...
...
@@ -64,12 +63,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
...
...
@@ -78,13 +77,12 @@ 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
...
...
@@ -92,14 +90,15 @@ 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
...
...
@@ -108,9 +107,7 @@ 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"
+
"</script>"
)
List
<
Talk
>
selectCollection
(
@Param
(
"id"
)
Integer
id
);
+
" group by t.id "
+
" order by c.createTime desc"
+
"</script>"
)
List
<
Talk
>
selectCollection
(
@Param
(
"id"
)
Integer
id
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论