Browse Source

批量更新sql

ywx
雍文秀 4 weeks ago
parent
commit
def4be5315

+ 4
- 4
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml View File

20
         update ms_paper_check_teacher_task
20
         update ms_paper_check_teacher_task
21
         <trim prefix="set" suffixOverrides=",">
21
         <trim prefix="set" suffixOverrides=",">
22
             <trim prefix="teacherid = case mpcttid" suffix="end,">
22
             <trim prefix="teacherid = case mpcttid" suffix="end,">
23
-                <foreach collection="tasks" item="item" separator="when">
24
-                    ${item.mpcttid} then ${item.teacherid}
23
+                <foreach collection="tasks" item="item" separator=" ">
24
+                    when #{item.mpcttid} then #{item.teacherid}
25
                 </foreach>
25
                 </foreach>
26
             </trim>
26
             </trim>
27
             <trim prefix="taskorder = case mpcttid" suffix="end,">
27
             <trim prefix="taskorder = case mpcttid" suffix="end,">
28
-                <foreach collection="tasks" item="item" separator="when">
29
-                    ${item.mpcttid} then ${item.taskorder}
28
+                <foreach collection="tasks" item="item" separator=" ">
29
+                    when #{item.mpcttid} then #{item.taskorder}
30
                 </foreach>
30
                 </foreach>
31
             </trim>
31
             </trim>
32
         </trim>
32
         </trim>

+ 10
- 10
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml View File

141
     <update id="checkByMptqidAndStudentId">
141
     <update id="checkByMptqidAndStudentId">
142
         update ms_paper_student_question set checked=#{block.checked}
142
         update ms_paper_student_question set checked=#{block.checked}
143
         <trim prefix="stuscore = case mptqid" suffix="end,">
143
         <trim prefix="stuscore = case mptqid" suffix="end,">
144
-            <foreach collection="list" item="q" separator="when">
145
-                #{q.mptqid} then ifnull(#{q.stuscore},stuscore)
144
+            <foreach collection="list" item="q" separator=" ">
145
+                when #{q.mptqid} then ifnull(#{q.stuscore},stuscore)
146
             </foreach>
146
             </foreach>
147
         </trim>
147
         </trim>
148
         <if test="block.firstcime!=null and block.firstcime!=0">
148
         <if test="block.firstcime!=null and block.firstcime!=0">
149
             <trim prefix="firstccore = case mptqid" suffix="end,">
149
             <trim prefix="firstccore = case mptqid" suffix="end,">
150
-               <foreach collection="list" item="q" separator="when">
151
-                   #{q.mptqid} then #{q.firstccore}
150
+               <foreach collection="list" item="q" separator=" ">
151
+                   when #{q.mptqid} then #{q.firstccore}
152
                </foreach>
152
                </foreach>
153
             </trim>
153
             </trim>
154
             <trim prefix="firstcime = case mptqid" suffix="end,">
154
             <trim prefix="firstcime = case mptqid" suffix="end,">
155
-                <foreach collection="list" item="q" separator="when">
156
-                    #{q.mptqid} then #{q.firstcime}
155
+                <foreach collection="list" item="q" separator=" ">
156
+                    when #{q.mptqid} then #{q.firstcime}
157
                 </foreach>
157
                 </foreach>
158
             </trim>
158
             </trim>
159
         </if>
159
         </if>
160
         <if test="block.secondctime!=null and block.secondctime!=0">
160
         <if test="block.secondctime!=null and block.secondctime!=0">
161
             <trim prefix="secondcscore = case mptqid" suffix="end,">
161
             <trim prefix="secondcscore = case mptqid" suffix="end,">
162
-                <foreach collection="list" item="q" separator="when">
163
-                    #{q.mptqid} then #{q.secondcscore}
162
+                <foreach collection="list" item="q" separator=" ">
163
+                    when #{q.mptqid} then #{q.secondcscore}
164
                 </foreach>
164
                 </foreach>
165
             </trim>
165
             </trim>
166
             <trim prefix="secondctime = case mptqid" suffix="end,">
166
             <trim prefix="secondctime = case mptqid" suffix="end,">
167
-                <foreach collection="list" item="q" separator="when">
168
-                    #{q.mptqid} then #{q.secondctime}
167
+                <foreach collection="list" item="q" separator=" ">
168
+                    when #{q.mptqid} then #{q.secondctime}
169
                 </foreach>
169
                 </foreach>
170
             </trim>
170
             </trim>
171
         </if>
171
         </if>

Loading…
Cancel
Save