Digital Office Automation System Backend
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

XxlJobInfoMapper.xml 8.5KB

il y a 1 jour
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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_desc" property="jobDesc" />
  9. <result column="add_time" property="addTime" />
  10. <result column="update_time" property="updateTime" />
  11. <result column="author" property="author" />
  12. <result column="alarm_email" property="alarmEmail" />
  13. <result column="schedule_type" property="scheduleType" />
  14. <result column="schedule_conf" property="scheduleConf" />
  15. <result column="misfire_strategy" property="misfireStrategy" />
  16. <result column="executor_route_strategy" property="executorRouteStrategy" />
  17. <result column="executor_handler" property="executorHandler" />
  18. <result column="executor_param" property="executorParam" />
  19. <result column="executor_block_strategy" property="executorBlockStrategy" />
  20. <result column="executor_timeout" property="executorTimeout" />
  21. <result column="executor_fail_retry_count" property="executorFailRetryCount" />
  22. <result column="glue_type" property="glueType" />
  23. <result column="glue_source" property="glueSource" />
  24. <result column="glue_remark" property="glueRemark" />
  25. <result column="glue_updatetime" property="glueUpdatetime" />
  26. <result column="child_jobid" property="childJobId" />
  27. <result column="trigger_status" property="triggerStatus" />
  28. <result column="trigger_last_time" property="triggerLastTime" />
  29. <result column="trigger_next_time" property="triggerNextTime" />
  30. </resultMap>
  31. <sql id="Base_Column_List">
  32. t.id,
  33. t.job_group,
  34. t.job_desc,
  35. t.add_time,
  36. t.update_time,
  37. t.author,
  38. t.alarm_email,
  39. t.schedule_type,
  40. t.schedule_conf,
  41. t.misfire_strategy,
  42. t.executor_route_strategy,
  43. t.executor_handler,
  44. t.executor_param,
  45. t.executor_block_strategy,
  46. t.executor_timeout,
  47. t.executor_fail_retry_count,
  48. t.glue_type,
  49. t.glue_source,
  50. t.glue_remark,
  51. t.glue_updatetime,
  52. t.child_jobid,
  53. t.trigger_status,
  54. t.trigger_last_time,
  55. t.trigger_next_time
  56. </sql>
  57. <select id="pageList" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  58. SELECT <include refid="Base_Column_List" />
  59. FROM xxl_job_info AS t
  60. <trim prefix="WHERE" prefixOverrides="AND | OR" >
  61. <if test="jobGroup gt 0">
  62. AND t.job_group = #{jobGroup}
  63. </if>
  64. <if test="triggerStatus gte 0">
  65. AND t.trigger_status = #{triggerStatus}
  66. </if>
  67. <if test="jobDesc != null and jobDesc != ''">
  68. AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
  69. </if>
  70. <if test="executorHandler != null and executorHandler != ''">
  71. AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%')
  72. </if>
  73. <if test="author != null and author != ''">
  74. AND t.author like CONCAT(CONCAT('%', #{author}), '%')
  75. </if>
  76. </trim>
  77. ORDER BY id DESC
  78. LIMIT #{offset}, #{pagesize}
  79. </select>
  80. <select id="pageListCount" parameterType="java.util.HashMap" resultType="int">
  81. SELECT count(1)
  82. FROM xxl_job_info AS t
  83. <trim prefix="WHERE" prefixOverrides="AND | OR" >
  84. <if test="jobGroup gt 0">
  85. AND t.job_group = #{jobGroup}
  86. </if>
  87. <if test="triggerStatus gte 0">
  88. AND t.trigger_status = #{triggerStatus}
  89. </if>
  90. <if test="jobDesc != null and jobDesc != ''">
  91. AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
  92. </if>
  93. <if test="executorHandler != null and executorHandler != ''">
  94. AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%')
  95. </if>
  96. <if test="author != null and author != ''">
  97. AND t.author like CONCAT(CONCAT('%', #{author}), '%')
  98. </if>
  99. </trim>
  100. </select>
  101. <insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" useGeneratedKeys="true" keyProperty="id" >
  102. INSERT INTO xxl_job_info (
  103. job_group,
  104. job_desc,
  105. add_time,
  106. update_time,
  107. author,
  108. alarm_email,
  109. schedule_type,
  110. schedule_conf,
  111. misfire_strategy,
  112. executor_route_strategy,
  113. executor_handler,
  114. executor_param,
  115. executor_block_strategy,
  116. executor_timeout,
  117. executor_fail_retry_count,
  118. glue_type,
  119. glue_source,
  120. glue_remark,
  121. glue_updatetime,
  122. child_jobid,
  123. trigger_status,
  124. trigger_last_time,
  125. trigger_next_time
  126. ) VALUES (
  127. #{jobGroup},
  128. #{jobDesc},
  129. #{addTime},
  130. #{updateTime},
  131. #{author},
  132. #{alarmEmail},
  133. #{scheduleType},
  134. #{scheduleConf},
  135. #{misfireStrategy},
  136. #{executorRouteStrategy},
  137. #{executorHandler},
  138. #{executorParam},
  139. #{executorBlockStrategy},
  140. #{executorTimeout},
  141. #{executorFailRetryCount},
  142. #{glueType},
  143. #{glueSource},
  144. #{glueRemark},
  145. #{glueUpdatetime},
  146. #{childJobId},
  147. #{triggerStatus},
  148. #{triggerLastTime},
  149. #{triggerNextTime}
  150. );
  151. <!--<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
  152. SELECT LAST_INSERT_ID()
  153. /*SELECT @@IDENTITY AS id*/
  154. </selectKey>-->
  155. </insert>
  156. <select id="loadById" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  157. SELECT <include refid="Base_Column_List" />
  158. FROM xxl_job_info AS t
  159. WHERE t.id = #{id}
  160. </select>
  161. <update id="update" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" >
  162. UPDATE xxl_job_info
  163. SET
  164. job_group = #{jobGroup},
  165. job_desc = #{jobDesc},
  166. update_time = #{updateTime},
  167. author = #{author},
  168. alarm_email = #{alarmEmail},
  169. schedule_type = #{scheduleType},
  170. schedule_conf = #{scheduleConf},
  171. misfire_strategy = #{misfireStrategy},
  172. executor_route_strategy = #{executorRouteStrategy},
  173. executor_handler = #{executorHandler},
  174. executor_param = #{executorParam},
  175. executor_block_strategy = #{executorBlockStrategy},
  176. executor_timeout = ${executorTimeout},
  177. executor_fail_retry_count = ${executorFailRetryCount},
  178. glue_type = #{glueType},
  179. glue_source = #{glueSource},
  180. glue_remark = #{glueRemark},
  181. glue_updatetime = #{glueUpdatetime},
  182. child_jobid = #{childJobId},
  183. trigger_status = #{triggerStatus},
  184. trigger_last_time = #{triggerLastTime},
  185. trigger_next_time = #{triggerNextTime}
  186. WHERE id = #{id}
  187. </update>
  188. <delete id="delete" parameterType="java.util.HashMap">
  189. DELETE
  190. FROM xxl_job_info
  191. WHERE id = #{id}
  192. </delete>
  193. <select id="getJobsByGroup" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  194. SELECT <include refid="Base_Column_List" />
  195. FROM xxl_job_info AS t
  196. WHERE t.job_group = #{jobGroup}
  197. </select>
  198. <select id="findAllCount" resultType="int">
  199. SELECT count(1)
  200. FROM xxl_job_info
  201. </select>
  202. <select id="scheduleJobQuery" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
  203. SELECT <include refid="Base_Column_List" />
  204. FROM xxl_job_info AS t
  205. WHERE t.trigger_status = 1
  206. and t.trigger_next_time <![CDATA[ <= ]]> #{maxNextTime}
  207. ORDER BY id ASC
  208. LIMIT #{pagesize}
  209. </select>
  210. <update id="scheduleUpdate" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" >
  211. UPDATE xxl_job_info
  212. SET
  213. trigger_last_time = #{triggerLastTime},
  214. trigger_next_time = #{triggerNextTime},
  215. trigger_status = #{triggerStatus}
  216. WHERE id = #{id}
  217. </update>
  218. </mapper>