JobTaskMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.huaxu.zoniot.dao.JobTaskMapper">
  4. <resultMap id="BaseResultMap" type="com.huaxu.zoniot.entity.JobTask">
  5. <!--@mbg.generated-->
  6. <!--@Table sc_job_task-->
  7. <id column="task_id" jdbcType="INTEGER" property="taskId" />
  8. <result column="job_name" jdbcType="VARCHAR" property="jobName" />
  9. <result column="context" jdbcType="VARCHAR" property="context" />
  10. <result column="task_state" jdbcType="INTEGER" property="taskState" />
  11. <result column="remark" jdbcType="VARCHAR" property="remark" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="complete_time" jdbcType="TIMESTAMP" property="completeTime" />
  15. </resultMap>
  16. <sql id="Base_Column_List">
  17. <!--@mbg.generated-->
  18. task_id, job_name, context, task_state,remark, create_time, update_time, complete_time
  19. </sql>
  20. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  21. <!--@mbg.generated-->
  22. select
  23. <include refid="Base_Column_List" />
  24. from sc_job_task
  25. where task_id = #{taskId,jdbcType=INTEGER}
  26. </select>
  27. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  28. <!--@mbg.generated-->
  29. delete from sc_job_task
  30. where task_id = #{taskId,jdbcType=INTEGER}
  31. </delete>
  32. <insert id="insert" parameterType="com.huaxu.zoniot.entity.JobTask" useGeneratedKeys="true" keyProperty="taskId" keyColumn="task_id">
  33. <!--@mbg.generated-->
  34. insert into sc_job_task (task_id, job_name, context,
  35. task_state, remark,create_time, update_time,
  36. complete_time)
  37. values (#{taskId,jdbcType=INTEGER}, #{jobName,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR},
  38. #{taskState,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
  39. #{completeTime,jdbcType=TIMESTAMP})
  40. </insert>
  41. <insert id="insertSelective" parameterType="com.huaxu.zoniot.entity.JobTask">
  42. <!--@mbg.generated-->
  43. insert into sc_job_task
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="taskId != null">
  46. task_id,
  47. </if>
  48. <if test="jobName != null">
  49. job_name,
  50. </if>
  51. <if test="context != null">
  52. context,
  53. </if>
  54. <if test="taskState != null">
  55. task_state,
  56. </if>
  57. <if test="remark != null">
  58. remark,
  59. </if>
  60. <if test="createTime != null">
  61. create_time,
  62. </if>
  63. <if test="updateTime != null">
  64. update_time,
  65. </if>
  66. <if test="completeTime != null">
  67. complete_time,
  68. </if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="taskId != null">
  72. #{taskId,jdbcType=INTEGER},
  73. </if>
  74. <if test="jobName != null">
  75. #{jobName,jdbcType=VARCHAR},
  76. </if>
  77. <if test="context != null">
  78. #{context,jdbcType=VARCHAR},
  79. </if>
  80. <if test="taskState != null">
  81. #{taskState,jdbcType=INTEGER},
  82. </if>
  83. <if test="remark != null">
  84. #{remark,jdbcType=VARCHAR},
  85. </if>
  86. <if test="createTime != null">
  87. #{createTime,jdbcType=TIMESTAMP},
  88. </if>
  89. <if test="updateTime != null">
  90. #{updateTime,jdbcType=TIMESTAMP},
  91. </if>
  92. <if test="completeTime != null">
  93. #{completeTime,jdbcType=TIMESTAMP},
  94. </if>
  95. </trim>
  96. </insert>
  97. <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.zoniot.entity.JobTask">
  98. <!--@mbg.generated-->
  99. update sc_job_task
  100. <set>
  101. <if test="jobName != null">
  102. job_name = #{jobName,jdbcType=VARCHAR},
  103. </if>
  104. <if test="context != null">
  105. context = #{context,jdbcType=VARCHAR},
  106. </if>
  107. <if test="taskState != null">
  108. task_state = #{taskState,jdbcType=INTEGER},
  109. </if>
  110. <if test="remark != null">
  111. remark = #{remark,jdbcType=VARCHAR},
  112. </if>
  113. <if test="createTime != null">
  114. create_time = #{createTime,jdbcType=TIMESTAMP},
  115. </if>
  116. <if test="updateTime != null">
  117. update_time = #{updateTime,jdbcType=TIMESTAMP},
  118. </if>
  119. <if test="completeTime != null">
  120. complete_time = #{completeTime,jdbcType=TIMESTAMP},
  121. </if>
  122. </set>
  123. where task_id = #{taskId,jdbcType=INTEGER}
  124. </update>
  125. <update id="updateByPrimaryKey" parameterType="com.huaxu.zoniot.entity.JobTask">
  126. <!--@mbg.generated-->
  127. update sc_job_task
  128. set job_name = #{jobName,jdbcType=VARCHAR},
  129. context = #{context,jdbcType=VARCHAR},
  130. task_state = #{taskState,jdbcType=INTEGER},
  131. remark = #{remark,jdbcType=VARCHAR},
  132. create_time = #{createTime,jdbcType=TIMESTAMP},
  133. update_time = #{updateTime,jdbcType=TIMESTAMP},
  134. complete_time = #{completeTime,jdbcType=TIMESTAMP}
  135. where task_id = #{taskId,jdbcType=INTEGER}
  136. </update>
  137. <insert id="batchInsert" parameterType="map" useGeneratedKeys="true" keyProperty="taskId" keyColumn="task_id">
  138. <!--@mbg.generated-->
  139. insert into sc_job_task
  140. (task_id, job_name, context, task_state,remark, create_time, update_time, complete_time)
  141. values
  142. <foreach collection="list" item="item" separator=",">
  143. (#{item.taskId,jdbcType=INTEGER}, #{item.jobName,jdbcType=VARCHAR}, #{item.context,jdbcType=VARCHAR},
  144. #{item.taskState,jdbcType=INTEGER},#{item.remark,jdbcType=VARCHAR},
  145. #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
  146. #{item.completeTime,jdbcType=TIMESTAMP})
  147. </foreach>
  148. </insert>
  149. </mapper>