Browse Source

教师设置教材时科目

tags/正式版本
王宁 2 years ago
parent
commit
a792ba9372

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/subjectbook/TeacherSubjectbookMapper.java View File

39
 
39
 
40
     //获取教师权限教材科目下所有教材列表
40
     //获取教师权限教材科目下所有教材列表
41
     List<TeacherSubjectbookVo> listSubjectLsb(@Param("teacherid") Integer teacherid);
41
     List<TeacherSubjectbookVo> listSubjectLsb(@Param("teacherid") Integer teacherid);
42
+
43
+    //根据教材id获取科目id
44
+    String getSubjectidByLsbid(@Param("lsbid") String lsbid);
42
 }
45
 }

+ 0
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/model/subjectbook/TTeacherSubjectbook.java View File

29
     //学校id
29
     //学校id
30
     private Integer schoolid;
30
     private Integer schoolid;
31
 
31
 
32
-    @Transient
33
     //科目id
32
     //科目id
34
     private String subjectid;
33
     private String subjectid;
35
 
34
 

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/subjectbook/TeacherSubjectbookService.java View File

38
         TTeacherSubjectbook sb = getObjByLsbIdTeacherId(model.getLsbid(), model.getTeacherid());
38
         TTeacherSubjectbook sb = getObjByLsbIdTeacherId(model.getLsbid(), model.getTeacherid());
39
         Integer tbid = sb == null ? null : sb.getTbid();
39
         Integer tbid = sb == null ? null : sb.getTbid();
40
         if (sb == null) {
40
         if (sb == null) {
41
+            //根据教材id获取科目id
42
+            String subjectid = teacherSubjectbookMapper.getSubjectidByLsbid(model.getLsbid());
43
+            model.setSubjectid(subjectid);
41
             model.setSelected(1);
44
             model.setSelected(1);
42
             model.setCreatetime(N_Utils.getSecondTimestamp());
45
             model.setCreatetime(N_Utils.getSecondTimestamp());
43
             teacherSubjectbookMapper.insertUseGeneratedKeys(model);
46
             teacherSubjectbookMapper.insertUseGeneratedKeys(model);

+ 5
- 0
sstudy/src/main/resources/mapper/subjectbook/TeacherSubjectBookMapper.xml View File

97
         group by sb.lsbid
97
         group by sb.lsbid
98
         ORDER BY sb.level ASC,s.subjectorder ASC,v.versionorder,sb.lsborder
98
         ORDER BY sb.level ASC,s.subjectorder ASC,v.versionorder,sb.lsborder
99
     </select>
99
     </select>
100
+
101
+    <!--根据教材id获取科目id-->
102
+    <select id="getSubjectidByLsbid" resultType="java.lang.String">
103
+        select subjectid from t_subject_book where lsbid=#{lsbid}
104
+    </select>
100
 </mapper>
105
 </mapper>

Loading…
Cancel
Save