Quellcode durchsuchen

批量更新sql

ywx
雍文秀 vor 4 Wochen
Ursprung
Commit
def4be5315

+ 4
- 4
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml Datei anzeigen

@@ -20,13 +20,13 @@
20 20
         update ms_paper_check_teacher_task
21 21
         <trim prefix="set" suffixOverrides=",">
22 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 25
                 </foreach>
26 26
             </trim>
27 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 30
                 </foreach>
31 31
             </trim>
32 32
         </trim>

+ 10
- 10
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml Datei anzeigen

@@ -141,31 +141,31 @@
141 141
     <update id="checkByMptqidAndStudentId">
142 142
         update ms_paper_student_question set checked=#{block.checked}
143 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 146
             </foreach>
147 147
         </trim>
148 148
         <if test="block.firstcime!=null and block.firstcime!=0">
149 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 152
                </foreach>
153 153
             </trim>
154 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 157
                 </foreach>
158 158
             </trim>
159 159
         </if>
160 160
         <if test="block.secondctime!=null and block.secondctime!=0">
161 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 164
                 </foreach>
165 165
             </trim>
166 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 169
                 </foreach>
170 170
             </trim>
171 171
         </if>

Laden…
Abbrechen
Speichern