HomeMapper.java
6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
package com.sinocontact.app.dao;
import com.sinocontact.app.entity.Chapter;
import com.sinocontact.app.entity.Comment;
import com.sinocontact.app.entity.Novel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 公共dao
* @author caoMingYang
* @since 2019/4/25 16:13
*/
@Mapper
public interface HomeMapper {
/**
* 通过id获取小说信息
* @param novelId 小说id
* @return novel
* @throws Exception
* @author caoMingYang
* @since 2019/4/25 16:18
*/
Novel getNovelById(@Param("novelId")Integer novelId) throws Exception;
/**
* 添加点击
* @param novelId 小说id
* @return 影响行数
* @throws Exception
* @author caoMingYang
* @since 2019/4/26 0:14
*/
Integer addClick(@Param("novelId")Integer novelId,
@Param("novelClick")Integer novelClick) throws Exception;
/**
* 获取点击数量
* @param novelId 小说id
* @return 点击数量
* @throws Exception
* @author caoMingYang
* @since 2019/4/26 0:23
*/
Integer getNovelClick(@Param("novelId")Integer novelId) throws Exception;
/**
* 通过小说id获得最新的五条章节信息
* @param novelId 小说id
* @return chapterList
* @throws Exception 异常
* @author caoMingYang
* @since 2019/4/27 12:28
*/
List<Chapter> queryFiveChapter(@Param("novelId")Integer novelId)throws Exception;
/**
* 通过小说id获取用户评论
* @param novelId 小说id
* @return commentList
* @throws Exception
* @author caoMingYang
* @since 2019/4/27 17:38
*/
List<Comment> getNovelComment(@Param("novelId")Integer novelId)throws Exception;
/**
* 通过小说id获取小说所有章节
* @param novelId 小说 id
* @return chapterList
* @throws Exception
* @author caoMingYang
* @since 2019/4/27 22:33
*/
List<Chapter> queryChapterList(@Param("novelId")Integer novelId)throws Exception;
/**
* 通过用户id获取用户当前推荐次数
* @param userId 用户id
* @return 推荐次数
* @throws Exception
* @author caoMingYang
* @since 2019/5/3 9:48
*/
Integer queryRecommendNumById(@Param("userId")Integer userId)throws Exception;
/**
* 通过小说id更新小说推荐数
* @param novelId 小说id
* @return 影响行数
* @author caoMingYang
* @since 2019/4/28 20:37
*/
Integer updateRecommendById(@Param("novelId")Integer novelId);
/**
* 通过id更新用户每日推荐次数
* @param userId 用户id
* @author caoMingYang
* @since 2019/4/28 20:45
*/
Integer updateUserRecommendNum(@Param("userId")Integer userId);
/**
* 通过小说id和用户id判断小说是否在用户书架中
* @param novelId 小说id
* @param userId 用户id
* @throws Exception
* @author caoMingYang
* @since 2019/4/30 20:19
*/
Integer checkBookCase(@Param("novelId")Integer novelId,
@Param("userId")Integer userId,
@Param("chapterId")Integer chapterId)throws Exception;
/**
* 添加小说到用户书架
* @param novelId 小说id
* @param userId 用户id
* @param chapterId 章节id
* @throws Exception
* @author caoMingYang
* @since 2019/4/30 20:19
*/
Integer addBookCase(@Param("novelId")Integer novelId,
@Param("userId")Integer userId,
@Param(value = "chapterId")Integer chapterId)throws Exception;
/**
* 更新用户书架信息
* @param novelId 小说id
* @param userId 用户id
* @param chapterId 章节id
* @throws Exception
* @author caoMingYang
* @since 2019/5/1 8:23
*/
Integer updateBookCase(@Param("novelId")Integer novelId,
@Param("userId")Integer userId,
@Param("chapterId")Integer chapterId) throws Exception;
/**
* 通过id获取小说章节信息
* @param novelId 小说id
* @param chapterId 章节id
* @return chapter
* @throws Exception
* @author caoMingYang
* @since 2019/5/11 13:25
*/
Chapter getChapterInfo(@Param("novelId")Integer novelId,
@Param("chapterId")Integer chapterId) throws Exception;
/**
* 通过id获取小说章节信息
* @param novelId 小说id
* @param chapterId 章节id
* @return chapter
* @throws Exception
* @author caoMingYang
* @since 2019/5/11 13:25
*/
Chapter previousChapter(@Param("novelId")Integer novelId,
@Param("chapterId")Integer chapterId) throws Exception;
/**
* 获取是否存在上一章
* @param novelId 小说id
* @param chapterId 章节id
* @return 0 不存在
* @throws Exception
* @author caoMingYang
* @since 2019/5/11 19:00
*/
Integer previousChapterCount(@Param("novelId")Integer novelId,
@Param("chapterId")Integer chapterId)throws Exception;
/**
* 通过id获取小说章节信息
* @param novelId 小说id
* @param chapterId 章节id
* @return chapter
* @throws Exception
* @author caoMingYang
* @since 2019/5/11 13:25
*/
Chapter nextChapter(@Param("novelId")Integer novelId,
@Param("chapterId")Integer chapterId) throws Exception;
/**
* 是否存在下一章
* @param novelId 小说id
* @param chapterId 章节id
* @return 0 不存在
* @throws Exception
* @author caoMingYang
* @since 2019/5/11 13:25
*/
Integer nextChapterCount(@Param("novelId")Integer novelId,
@Param("chapterId")Integer chapterId) throws Exception;
/**
* 更新用户每日推荐次数
* @author caoMingYang
* @since 2019/5/18 0:23
*/
Integer updateRecommendTimes()throws Exception;
Integer saveComment(@Param("novelId")Integer novelId,
@Param("userId")Integer userId,
@Param("comment")String comment) throws Exception;
}