Browse Source

资源管理-校本题库管理

tags/正式3.14.1
王宁 3 months ago
parent
commit
985e697ce1

+ 10
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/controller/question/QuestionController.java View File

@@ -68,6 +68,16 @@ public class QuestionController {
68 68
         Integer page = tQuestion.getPage();
69 69
         Integer pageSize = tQuestion.getPageSize();
70 70
         N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1});
71
+        //获取所选章节信息
72
+        if(N_Utils.isNotEmpty(tQuestion.getDirectorid()) && !"0".equals(tQuestion.getDirectorid())){
73
+            TDirector director = directorService.getDirectorById(tQuestion.getDirectorid());
74
+            tQuestion.setDirectorLeaf(director.getLeaf());
75
+            //leaf 是否是叶子节点0不是1是
76
+            if(director.getLeaf() == 0){
77
+                //说明不是叶子节点,需要获取其子章节所有信息
78
+                tQuestion.setDirectorall(director.getDirectorall());
79
+            }
80
+        }
71 81
         PageHelper.startPage(page, pageSize);
72 82
         List<Map<String, Object>> list = tQuestionService.findAll(tQuestion);
73 83
         PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));

+ 4
- 1
sstudy/src/main/resources/mapper/question/QuestionMapper.xml View File

@@ -172,9 +172,12 @@
172 172
         <if test="question.lsbid!=null and question.lsbid!='0'.toString() and question.lsbid!=''">
173 173
             and qd.lsbid=#{question.lsbid}
174 174
         </if>
175
-        <if test="question.directorid!=null and question.directorid!='0'.toString() and question.directorid!=''">
175
+        <if test="question.directorid!=null and question.directorid!='0'.toString() and question.directorid!='' and question.directorLeaf==1">
176 176
             and qd.directorid=#{question.directorid}
177 177
         </if>
178
+        <if test="question.directorid!=null and question.directorid!='0'.toString() and question.directorid!='' and question.directorLeaf==0">
179
+            and d.directorall like concat('%',#{question.directorall},'%')
180
+        </if>
178 181
         <if test="question.hashear!=null and question.hashear == 1">
179 182
             and q.hashear=1
180 183
         </if>

Loading…
Cancel
Save