feat: 题目详情 上一题/下一题功能
This commit is contained in:
@@ -90,5 +90,10 @@ public interface SubjectInfoDao {
|
||||
@Param("pageSize") Integer pageSize);
|
||||
|
||||
List<SubjectInfo> getContributeCount();
|
||||
|
||||
Long querySubjectIdCursor(@Param("subjectId") Long subjectId,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("labelId") Long labelId,
|
||||
@Param("cursor") int cursor);
|
||||
}
|
||||
|
||||
|
@@ -50,4 +50,7 @@ public interface SubjectInfoService {
|
||||
List<SubjectInfo> queryPage(SubjectInfo subjectInfo, Long categoryId, Long labelId, int start, Integer pageSize);
|
||||
|
||||
List<SubjectInfo> getContributeCount();
|
||||
|
||||
Long querySubjectIdCursor(Long subjectId, Long categoryId, Long labelId, int cursor);
|
||||
|
||||
}
|
||||
|
@@ -81,4 +81,9 @@ public class SubjectInfoServiceImpl implements SubjectInfoService {
|
||||
public List<SubjectInfo> getContributeCount() {
|
||||
return this.subjectInfoDao.getContributeCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long querySubjectIdCursor(Long subjectId, Long categoryId, Long labelId, int cursor) {
|
||||
return this.subjectInfoDao.querySubjectIdCursor(subjectId, categoryId, labelId, cursor);
|
||||
}
|
||||
}
|
||||
|
@@ -140,6 +140,23 @@
|
||||
and a.subject_type = #{subjectInfo.subjectType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="querySubjectIdCursor" resultType="java.lang.Long">
|
||||
select a.id
|
||||
from subject_info a,
|
||||
subject_mapping b
|
||||
where a.id = b.subject_id
|
||||
and b.category_id = #{categoryId}
|
||||
and b.label_id = #{labelId}
|
||||
<if test="cursor !=null and cursor == 1">
|
||||
and a.id > #{subjectId}
|
||||
</if>
|
||||
<if test="cursor !=null and cursor == 0">
|
||||
and a.id < #{subjectId}
|
||||
</if>
|
||||
limit 0,1
|
||||
</select>
|
||||
|
||||
<select id="queryPage" resultMap="SubjectInfoMap">
|
||||
select a.id,
|
||||
a.subject_name,
|
||||
|
Reference in New Issue
Block a user