SysJobLogMapper.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. </select>
  43. <select id="selectJobLogAll" resultMap="SysJobLogResult">
  44. <include refid="selectJobLogVo"/>
  45. </select>
  46. <select id="selectJobLogById" parameterType="Long" resultMap="SysJobLogResult">
  47. <include refid="selectJobLogVo"/>
  48. where job_log_id = #{jobLogId}
  49. </select>
  50. <delete id="deleteJobLogById" parameterType="Long">
  51. delete from sys_job_log where job_log_id = #{jobLogId}
  52. </delete>
  53. <delete id="deleteJobLogByIds" parameterType="Long">
  54. delete from sys_job_log where job_log_id in
  55. <foreach collection="array" item="jobLogId" open="(" separator="," close=")">
  56. #{jobLogId}
  57. </foreach>
  58. </delete>
  59. <update id="cleanJobLog">
  60. truncate table sys_job_log
  61. </update>
  62. <insert id="insertJobLog" parameterType="SysJobLog">
  63. insert into sys_job_log(
  64. <if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
  65. <if test="jobName != null and jobName != ''">job_name,</if>
  66. <if test="jobGroup != null and jobGroup != ''">job_group,</if>
  67. <if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
  68. <if test="jobMessage != null and jobMessage != ''">job_message,</if>
  69. <if test="status != null and status != ''">status,</if>
  70. <if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
  71. create_time
  72. )values(
  73. <if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
  74. <if test="jobName != null and jobName != ''">#{jobName},</if>
  75. <if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
  76. <if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
  77. <if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
  78. <if test="status != null and status != ''">#{status},</if>
  79. <if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
  80. sysdate()
  81. )
  82. </insert>
  83. </mapper>