XxlJobInfoMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.xxl.job.admin.dao.XxlJobInfoDao">
  5. <resultMap id="XxlJobInfo" type="com.xxl.job.admin.core.model.XxlJobInfo" >
  6. <result column="id" property="id" />
  7. <result column="job_group" property="jobGroup" />
  8. <result column="job_cron" property="jobCron" />
  9. <result column="job_desc" property="jobDesc" />
  10. <result column="add_time" property="addTime" />
  11. <result column="update_time" property="updateTime" />
  12. <result column="author" property="author" />
  13. <result column="alarm_email" property="alarmEmail" />
  14. <result column="executor_route_strategy" property="executorRouteStrategy" />
  15. <result column="executor_handler" property="executorHandler" />
  16. <result column="executor_param" property="executorParam" />
  17. <result column="executor_block_strategy" property="executorBlockStrategy" />
  18. <result column="executor_fail_strategy" property="executorFailStrategy" />
  19. <result column="glue_type" property="glueType" />
  20. <result column="glue_source" property="glueSource" />
  21. <result column="glue_remark" property="glueRemark" />
  22. <result column="glue_updatetime" property="glueUpdatetime" />
  23. <result column="child_jobid" property="childJobId" />
  24. </resultMap>
  25. <sql id="Base_Column_List">
  26. t.id,
  27. t.job_group,
  28. t.job_cron,
  29. t.job_desc,
  30. t.add_time,
  31. t.update_time,
  32. t.author,
  33. t.alarm_email,
  34. t.executor_route_strategy,
  35. t.executor_handler,
  36. t.executor_param,
  37. t.executor_block_strategy,
  38. t.executor_fail_strategy,
  39. t.glue_type,
  40. t.glue_source,
  41. t.glue_remark,
  42. t.glue_updatetime,
  43. t.child_jobid
  44. </sql>
  45. <select id="pageList" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  46. SELECT <include refid="Base_Column_List" />
  47. FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
  48. <trim prefix="WHERE" prefixOverrides="AND | OR" >
  49. <if test="jobGroup gt 0">
  50. AND t.job_group = #{jobGroup}
  51. </if>
  52. <if test="jobDesc != null and jobDesc != ''">
  53. AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
  54. </if>
  55. <if test="executorHandler != null and executorHandler != ''">
  56. AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%')
  57. </if>
  58. </trim>
  59. ORDER BY id DESC
  60. LIMIT #{offset}, #{pagesize}
  61. </select>
  62. <select id="pageListCount" parameterType="java.util.HashMap" resultType="int">
  63. SELECT count(1)
  64. FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
  65. <trim prefix="WHERE" prefixOverrides="AND | OR" >
  66. <if test="jobGroup gt 0">
  67. AND t.job_group = #{jobGroup}
  68. </if>
  69. <if test="jobDesc != null and jobDesc != ''">
  70. AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
  71. </if>
  72. <if test="executorHandler != null and executorHandler != ''">
  73. AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%')
  74. </if>
  75. </trim>
  76. </select>
  77. <insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" useGeneratedKeys="true" keyProperty="id" >
  78. INSERT INTO XXL_JOB_QRTZ_TRIGGER_INFO (
  79. job_group,
  80. job_cron,
  81. job_desc,
  82. add_time,
  83. update_time,
  84. author,
  85. alarm_email,
  86. executor_route_strategy,
  87. executor_handler,
  88. executor_param,
  89. executor_block_strategy,
  90. executor_fail_strategy,
  91. glue_type,
  92. glue_source,
  93. glue_remark,
  94. glue_updatetime,
  95. child_jobid
  96. ) VALUES (
  97. #{jobGroup},
  98. #{jobCron},
  99. #{jobDesc},
  100. NOW(),
  101. NOW(),
  102. #{author},
  103. #{alarmEmail},
  104. #{executorRouteStrategy},
  105. #{executorHandler},
  106. #{executorParam},
  107. #{executorBlockStrategy},
  108. #{executorFailStrategy},
  109. #{glueType},
  110. #{glueSource},
  111. #{glueRemark},
  112. NOW(),
  113. #{childJobId}
  114. );
  115. <!--<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
  116. SELECT LAST_INSERT_ID()
  117. /*SELECT @@IDENTITY AS id*/
  118. </selectKey>-->
  119. </insert>
  120. <select id="loadById" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  121. SELECT <include refid="Base_Column_List" />
  122. FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
  123. WHERE t.id = #{id}
  124. </select>
  125. <update id="update" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" >
  126. UPDATE XXL_JOB_QRTZ_TRIGGER_INFO
  127. SET
  128. job_cron = #{jobCron},
  129. job_desc = #{jobDesc},
  130. update_time = NOW(),
  131. author = #{author},
  132. alarm_email = #{alarmEmail},
  133. executor_route_strategy = #{executorRouteStrategy},
  134. executor_handler = #{executorHandler},
  135. executor_param = #{executorParam},
  136. executor_block_strategy = #{executorBlockStrategy},
  137. executor_fail_strategy = #{executorFailStrategy},
  138. glue_type = #{glueType},
  139. glue_source = #{glueSource},
  140. glue_remark = #{glueRemark},
  141. glue_updatetime = #{glueUpdatetime},
  142. child_jobid = #{childJobId}
  143. WHERE id = #{id}
  144. </update>
  145. <delete id="delete" parameterType="java.util.HashMap">
  146. DELETE
  147. FROM XXL_JOB_QRTZ_TRIGGER_INFO
  148. WHERE id = #{id}
  149. </delete>
  150. <select id="getJobsByGroup" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  151. SELECT <include refid="Base_Column_List" />
  152. FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
  153. WHERE t.job_group = #{jobGroup}
  154. </select>
  155. <select id="findAllCount" resultType="int">
  156. SELECT count(1)
  157. FROM XXL_JOB_QRTZ_TRIGGER_INFO
  158. </select>
  159. </mapper>