TaskSoptMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.goafanti.common.dao.TaskSoptMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TaskSopt">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tid" jdbcType="INTEGER" property="tid" />
  7. <result column="type" jdbcType="INTEGER" property="type" />
  8. <result column="status" jdbcType="INTEGER" property="status" />
  9. <result column="reason" jdbcType="VARCHAR" property="reason" />
  10. <result column="create_by" jdbcType="VARCHAR" property="createBy" />
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  12. <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
  13. </resultMap>
  14. <sql id="Base_Column_List">
  15. id, tid, `type`, `status`, reason, create_by, create_time, annex_url
  16. </sql>
  17. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  18. select
  19. <include refid="Base_Column_List" />
  20. from task_sopt
  21. where id = #{id,jdbcType=BIGINT}
  22. </select>
  23. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  24. delete from task_sopt
  25. where id = #{id,jdbcType=BIGINT}
  26. </delete>
  27. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskSopt" useGeneratedKeys="true">
  28. insert into task_sopt (tid, `type`, `status`,
  29. reason, create_by, create_time,
  30. annex_url)
  31. values (#{tid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
  32. #{reason,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  33. #{annexUrl,jdbcType=VARCHAR})
  34. </insert>
  35. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskSopt" useGeneratedKeys="true">
  36. insert into task_sopt
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="tid != null">
  39. tid,
  40. </if>
  41. <if test="type != null">
  42. `type`,
  43. </if>
  44. <if test="status != null">
  45. `status`,
  46. </if>
  47. <if test="reason != null">
  48. reason,
  49. </if>
  50. <if test="createBy != null">
  51. create_by,
  52. </if>
  53. <if test="createTime != null">
  54. create_time,
  55. </if>
  56. <if test="annexUrl != null">
  57. annex_url,
  58. </if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="tid != null">
  62. #{tid,jdbcType=INTEGER},
  63. </if>
  64. <if test="type != null">
  65. #{type,jdbcType=INTEGER},
  66. </if>
  67. <if test="status != null">
  68. #{status,jdbcType=INTEGER},
  69. </if>
  70. <if test="reason != null">
  71. #{reason,jdbcType=VARCHAR},
  72. </if>
  73. <if test="createBy != null">
  74. #{createBy,jdbcType=VARCHAR},
  75. </if>
  76. <if test="createTime != null">
  77. #{createTime,jdbcType=TIMESTAMP},
  78. </if>
  79. <if test="annexUrl != null">
  80. #{annexUrl,jdbcType=VARCHAR},
  81. </if>
  82. </trim>
  83. </insert>
  84. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TaskSopt">
  85. update task_sopt
  86. <set>
  87. <if test="tid != null">
  88. tid = #{tid,jdbcType=INTEGER},
  89. </if>
  90. <if test="type != null">
  91. `type` = #{type,jdbcType=INTEGER},
  92. </if>
  93. <if test="status != null">
  94. `status` = #{status,jdbcType=INTEGER},
  95. </if>
  96. <if test="reason != null">
  97. reason = #{reason,jdbcType=VARCHAR},
  98. </if>
  99. <if test="createBy != null">
  100. create_by = #{createBy,jdbcType=VARCHAR},
  101. </if>
  102. <if test="createTime != null">
  103. create_time = #{createTime,jdbcType=TIMESTAMP},
  104. </if>
  105. <if test="annexUrl != null">
  106. annex_url = #{annexUrl,jdbcType=VARCHAR},
  107. </if>
  108. </set>
  109. where id = #{id,jdbcType=BIGINT}
  110. </update>
  111. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TaskSopt">
  112. update task_sopt
  113. set tid = #{tid,jdbcType=INTEGER},
  114. `type` = #{type,jdbcType=INTEGER},
  115. `status` = #{status,jdbcType=INTEGER},
  116. reason = #{reason,jdbcType=VARCHAR},
  117. create_by = #{createBy,jdbcType=VARCHAR},
  118. create_time = #{createTime,jdbcType=TIMESTAMP},
  119. annex_url = #{annexUrl,jdbcType=VARCHAR}
  120. where id = #{id,jdbcType=BIGINT}
  121. </update>
  122. <insert id="insertList">
  123. insert into task_sopt (`type`, `status`,tid,reason,
  124. create_by, create_time)
  125. values
  126. <foreach item="item" collection="list" separator="," index="">
  127. (#{item.type,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER},#{item.tid,jdbcType=INTEGER},#{item.reason,jdbcType=VARCHAR},
  128. #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP})
  129. </foreach>
  130. </insert>
  131. <select id="selectByTid" resultMap="BaseResultMap">
  132. select
  133. <include refid="Base_Column_List" />
  134. from task_sopt
  135. where tid = #{tid} and status in (0,2)
  136. </select>
  137. </mapper>