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,4 +39,7 @@ public interface TeacherSubjectbookMapper extends TkMapper<TTeacherSubjectbook>
39 39
 
40 40
     //获取教师权限教材科目下所有教材列表
41 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,7 +29,6 @@ public class TTeacherSubjectbook extends BaseBean {
29 29
     //学校id
30 30
     private Integer schoolid;
31 31
 
32
-    @Transient
33 32
     //科目id
34 33
     private String subjectid;
35 34
 

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

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

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

@@ -97,4 +97,9 @@
97 97
         group by sb.lsbid
98 98
         ORDER BY sb.level ASC,s.subjectorder ASC,v.versionorder,sb.lsborder
99 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 105
 </mapper>

Loading…
Cancel
Save