|
@@ -186,8 +186,8 @@
|
186
|
186
|
ORDER BY triggerDay
|
187
|
187
|
</select>
|
188
|
188
|
|
189
|
|
- <delete id="clearLog" >
|
190
|
|
- delete from xxl_job_log
|
|
189
|
+ <select id="findClearLogIds" resultType="long" >
|
|
190
|
+ SELECT id FROM xxl_job_log
|
191
|
191
|
<trim prefix="WHERE" prefixOverrides="AND | OR" >
|
192
|
192
|
<if test="jobGroup gt 0">
|
193
|
193
|
AND job_group = #{jobGroup}
|
|
@@ -200,22 +200,32 @@
|
200
|
200
|
</if>
|
201
|
201
|
<if test="clearBeforeNum gt 0">
|
202
|
202
|
AND id NOT in(
|
203
|
|
- SELECT id FROM(
|
204
|
|
- SELECT id FROM xxl_job_log AS t
|
205
|
|
- <trim prefix="WHERE" prefixOverrides="AND | OR" >
|
206
|
|
- <if test="jobGroup gt 0">
|
207
|
|
- AND t.job_group = #{jobGroup}
|
208
|
|
- </if>
|
209
|
|
- <if test="jobId gt 0">
|
210
|
|
- AND t.job_id = #{jobId}
|
211
|
|
- </if>
|
212
|
|
- </trim>
|
213
|
|
- ORDER BY t.trigger_time desc
|
214
|
|
- LIMIT 0, #{clearBeforeNum}
|
215
|
|
- ) t1
|
|
203
|
+ SELECT id FROM(
|
|
204
|
+ SELECT id FROM xxl_job_log AS t
|
|
205
|
+ <trim prefix="WHERE" prefixOverrides="AND | OR" >
|
|
206
|
+ <if test="jobGroup gt 0">
|
|
207
|
+ AND t.job_group = #{jobGroup}
|
|
208
|
+ </if>
|
|
209
|
+ <if test="jobId gt 0">
|
|
210
|
+ AND t.job_id = #{jobId}
|
|
211
|
+ </if>
|
|
212
|
+ </trim>
|
|
213
|
+ ORDER BY t.trigger_time desc
|
|
214
|
+ LIMIT 0, #{clearBeforeNum}
|
|
215
|
+ ) t1
|
216
|
216
|
)
|
217
|
217
|
</if>
|
218
|
218
|
</trim>
|
|
219
|
+ order by id asc
|
|
220
|
+ LIMIT #{pagesize}
|
|
221
|
+ </select>
|
|
222
|
+
|
|
223
|
+ <delete id="clearLog" >
|
|
224
|
+ delete from xxl_job_log
|
|
225
|
+ WHERE id in
|
|
226
|
+ <foreach collection="logIds" item="item" open="(" close=")" separator="," >
|
|
227
|
+ #{item}
|
|
228
|
+ </foreach>
|
219
|
229
|
</delete>
|
220
|
230
|
|
221
|
231
|
<select id="findFailJobLogIds" resultType="long" >
|