Browse Source

批量保存课堂数据主键冲突

tags/正式3.3.0
雍文秀 2 years ago
parent
commit
ac316a89a3

+ 1
- 1
sclass/src/main/java/com/xhkjedu/sclass/service/classroom/ClassroomService.java View File

@@ -713,9 +713,9 @@ public class ClassroomService {
713 713
                         s.setChecked(1);
714 714
                         s.setCheckid(0);
715 715
                         s.setChecktime(N_Utils.getSecondTimestamp());
716
-                        studentScantronList.add(s);
717 716
                     }
718 717
                 }
718
+                studentScantronList.add(s);
719 719
 
720 720
                 userscore = ArithUtil.add(userscore, userScore);
721 721
             }

+ 2
- 2
sclass/src/main/resources/mapper/classroom/ClassroomAskteacherMapper.xml View File

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomAskteacherMapper">
4 4
     <!--保存教师互动信息-->
5 5
     <insert id="save">
6
-        insert into t_classroom_askteacher
6
+        insert ignore into t_classroom_askteacher
7 7
         (asktid,roomid,asktype,paperid,asknum,teacherpic,radionum,radioanswer,createtime,schoolid)
8 8
         values
9 9
         (#{r.asktid},#{r.roomid},#{r.asktype},#{r.paperid},#{r.asknum},#{r.teacherpic}
@@ -11,7 +11,7 @@
11 11
     </insert>
12 12
     <!--批量保存教师互动信息-->
13 13
     <delete id="batchSave">
14
-        insert into t_classroom_askteacher
14
+        insert ignore into t_classroom_askteacher
15 15
         (asktid,roomid,asktype,paperid,asknum,teacherpic,radionum,radioanswer,createtime,schoolid)
16 16
         values
17 17
         <foreach collection="teachers" item="r" separator=",">

+ 1
- 1
sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml View File

@@ -467,7 +467,7 @@
467 467
 
468 468
     <!--批量保存课堂-->
469 469
     <insert id="batchSave">
470
-        insert into t_classroom(roomid,roomname,classid,roomstate,lsbid,teacherid,directorid
470
+        insert ignore into t_classroom(roomid,roomname,classid,roomstate,lsbid,teacherid,directorid
471 471
         ,directortype,classnum,endtime,createid,createtime,schoolid)
472 472
         values
473 473
         <foreach collection="rooms" item="r" separator=",">

+ 1
- 1
sclass/src/main/resources/mapper/classroom/ClassroomPaperMapper.xml View File

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperMapper">
4 4
     <!--批量保存堂测信息-->
5 5
     <delete id="batchSave">
6
-        insert into t_classroom_paper
6
+        insert ignore into t_classroom_paper
7 7
         (paperid,papername,papernum,paperscore,subjectid,lsbid,directorid,createid,createtime,schoolid)
8 8
         values
9 9
         <foreach collection="papers" item="p" separator=",">

+ 1
- 1
sclass/src/main/resources/mapper/classroom/ClassroomPaperQtypeMapper.xml View File

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperQtypeMapper">
4 4
     <!--保存答题卡题型-->
5 5
     <insert id="batchSave">
6
-        insert into
6
+        insert ignore into
7 7
         t_classroom_paper_qtype(pqtypeid,paperid,ctype,ctypename,pqorder,pqscore,pqnum,createid,createtime,schoolid)
8 8
         values
9 9
         <foreach collection="list" item="r" index="index" separator=",">

+ 1
- 1
sclass/src/main/resources/mapper/classroom/ClassroomPaperScantronMapper.xml View File

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperScantronMapper">
4 4
     <!--保存答题卡题型下试题-->
5 5
     <insert id="batchSave">
6
-        insert into t_classroom_paper_scantron(pscaid,paperid,pqtypeid,ctype,ctypename,psorder,psscore
6
+        insert ignore into t_classroom_paper_scantron(pscaid,paperid,pqtypeid,ctype,ctypename,psorder,psscore
7 7
         ,createid,createtime,schoolid,psanswer)
8 8
         values
9 9
         <foreach collection="list" item="r" index="index" separator=",">

Loading…
Cancel
Save