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
                         s.setChecked(1);
713
                         s.setChecked(1);
714
                         s.setCheckid(0);
714
                         s.setCheckid(0);
715
                         s.setChecktime(N_Utils.getSecondTimestamp());
715
                         s.setChecktime(N_Utils.getSecondTimestamp());
716
-                        studentScantronList.add(s);
717
                     }
716
                     }
718
                 }
717
                 }
718
+                studentScantronList.add(s);
719
 
719
 
720
                 userscore = ArithUtil.add(userscore, userScore);
720
                 userscore = ArithUtil.add(userscore, userScore);
721
             }
721
             }

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

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

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

467
 
467
 
468
     <!--批量保存课堂-->
468
     <!--批量保存课堂-->
469
     <insert id="batchSave">
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
         ,directortype,classnum,endtime,createid,createtime,schoolid)
471
         ,directortype,classnum,endtime,createid,createtime,schoolid)
472
         values
472
         values
473
         <foreach collection="rooms" item="r" separator=",">
473
         <foreach collection="rooms" item="r" separator=",">

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

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

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

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

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

3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperScantronMapper">
3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperScantronMapper">
4
     <!--保存答题卡题型下试题-->
4
     <!--保存答题卡题型下试题-->
5
     <insert id="batchSave">
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
         ,createid,createtime,schoolid,psanswer)
7
         ,createid,createtime,schoolid,psanswer)
8
         values
8
         values
9
         <foreach collection="list" item="r" index="index" separator=",">
9
         <foreach collection="list" item="r" index="index" separator=",">

Loading…
Cancel
Save