SysJobLogMapper.xml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.quartz.mapper.SysJobLogMapper">
  6. <resultMap type="SysJobLog" id="SysJobLogResult">
  7. <id property="jobLogId" column="job_log_id" />
  8. <result property="jobName" column="job_name" />
  9. <result property="jobGroup" column="job_group" />
  10. <result property="invokeTarget" column="invoke_target" />
  11. <result property="jobMessage" column="job_message" />
  12. <result property="status" column="status" />
  13. <result property="exceptionInfo" column="exception_info" />
  14. <result property="createTime" column="create_time" />
  15. </resultMap>
  16. <sql id="selectJobLogVo">
  17. select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time
  18. from sys_job_log
  19. </sql>
  20. <select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult">
  21. <include refid="selectJobLogVo"/>
  22. <where>
  23. <if test="jobName != null and jobName != ''">
  24. AND job_name like concat('%', #{jobName}, '%')
  25. </if>
  26. <if test="jobGroup != null and jobGroup != ''">
  27. AND job_group = #{jobGroup}
  28. </if>
  29. <if test="status != null and status != ''">
  30. AND status = #{status}
  31. </if>
  32. <if test="invokeTarget != null and invokeTarget != ''">
  33. AND invoke_target like concat('%', #{invokeTarget}, '%')
  34. </if>
  35. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  36. and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  37. </if>
  38. <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
  39. and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  40. </if>
  41. </where>
  42. order by create_time desc
  43. </select>
  44. <select id="selectJobLogAll" resultMap="SysJobLogResult">
  45. <include refid="selectJobLogVo"/>
  46. </select>
  47. <select id="selectJobLogById" parameterType="Long" resultMap="SysJobLogResult">
  48. <include refid="selectJobLogVo"/>
  49. where job_log_id = #{jobLogId}
  50. </select>
  51. <delete id="deleteJobLogById" parameterType="Long">
  52. delete from sys_job_log where job_log_id = #{jobLogId}
  53. </delete>
  54. <delete id="deleteJobLogByIds" parameterType="Long">
  55. delete from sys_job_log where job_log_id in
  56. <foreach collection="array" item="jobLogId" open="(" separator="," close=")">
  57. #{jobLogId}
  58. </foreach>
  59. </delete>
  60. <update id="cleanJobLog">
  61. truncate table sys_job_log
  62. </update>
  63. <insert id="insertJobLog" parameterType="SysJobLog">
  64. insert into sys_job_log(
  65. <if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
  66. <if test="jobName != null and jobName != ''">job_name,</if>
  67. <if test="jobGroup != null and jobGroup != ''">job_group,</if>
  68. <if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
  69. <if test="jobMessage != null and jobMessage != ''">job_message,</if>
  70. <if test="status != null and status != ''">status,</if>
  71. <if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
  72. create_time
  73. )values(
  74. <if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
  75. <if test="jobName != null and jobName != ''">#{jobName},</if>
  76. <if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
  77. <if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
  78. <if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
  79. <if test="status != null and status != ''">#{status},</if>
  80. <if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
  81. sysdate()
  82. )
  83. </insert>
  84. </mapper>