ReplyStaffMapper.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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.tzld.longarticle.recommend.server.mapper.growth.ReplyStaffMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.longarticle.recommend.server.repository.model.ReplyStaff">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="user_id" jdbcType="VARCHAR" property="userId" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
  9. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  10. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  11. </resultMap>
  12. <sql id="Example_Where_Clause">
  13. <where>
  14. <foreach collection="oredCriteria" item="criteria" separator="or">
  15. <if test="criteria.valid">
  16. <trim prefix="(" prefixOverrides="and" suffix=")">
  17. <foreach collection="criteria.criteria" item="criterion">
  18. <choose>
  19. <when test="criterion.noValue">
  20. and ${criterion.condition}
  21. </when>
  22. <when test="criterion.singleValue">
  23. and ${criterion.condition} #{criterion.value}
  24. </when>
  25. <when test="criterion.betweenValue">
  26. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  27. </when>
  28. <when test="criterion.listValue">
  29. and ${criterion.condition}
  30. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  31. #{listItem}
  32. </foreach>
  33. </when>
  34. </choose>
  35. </foreach>
  36. </trim>
  37. </if>
  38. </foreach>
  39. </where>
  40. </sql>
  41. <sql id="Update_By_Example_Where_Clause">
  42. <where>
  43. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  44. <if test="criteria.valid">
  45. <trim prefix="(" prefixOverrides="and" suffix=")">
  46. <foreach collection="criteria.criteria" item="criterion">
  47. <choose>
  48. <when test="criterion.noValue">
  49. and ${criterion.condition}
  50. </when>
  51. <when test="criterion.singleValue">
  52. and ${criterion.condition} #{criterion.value}
  53. </when>
  54. <when test="criterion.betweenValue">
  55. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  56. </when>
  57. <when test="criterion.listValue">
  58. and ${criterion.condition}
  59. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  60. #{listItem}
  61. </foreach>
  62. </when>
  63. </choose>
  64. </foreach>
  65. </trim>
  66. </if>
  67. </foreach>
  68. </where>
  69. </sql>
  70. <sql id="Base_Column_List">
  71. id, user_id, name, is_delete, create_time, update_time
  72. </sql>
  73. <select id="selectByExample" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaffExample" resultMap="BaseResultMap">
  74. select
  75. <if test="distinct">
  76. distinct
  77. </if>
  78. <include refid="Base_Column_List" />
  79. from reply_staff
  80. <if test="_parameter != null">
  81. <include refid="Example_Where_Clause" />
  82. </if>
  83. <if test="orderByClause != null">
  84. order by ${orderByClause}
  85. </if>
  86. </select>
  87. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  88. select
  89. <include refid="Base_Column_List" />
  90. from reply_staff
  91. where id = #{id,jdbcType=BIGINT}
  92. </select>
  93. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  94. delete from reply_staff
  95. where id = #{id,jdbcType=BIGINT}
  96. </delete>
  97. <delete id="deleteByExample" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaffExample">
  98. delete from reply_staff
  99. <if test="_parameter != null">
  100. <include refid="Example_Where_Clause" />
  101. </if>
  102. </delete>
  103. <insert id="insert" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaff">
  104. insert into reply_staff (id, user_id, name,
  105. is_delete, create_time, update_time
  106. )
  107. values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
  108. #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
  109. )
  110. </insert>
  111. <insert id="insertSelective" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaff">
  112. insert into reply_staff
  113. <trim prefix="(" suffix=")" suffixOverrides=",">
  114. <if test="id != null">
  115. id,
  116. </if>
  117. <if test="userId != null">
  118. user_id,
  119. </if>
  120. <if test="name != null">
  121. name,
  122. </if>
  123. <if test="isDelete != null">
  124. is_delete,
  125. </if>
  126. <if test="createTime != null">
  127. create_time,
  128. </if>
  129. <if test="updateTime != null">
  130. update_time,
  131. </if>
  132. </trim>
  133. <trim prefix="values (" suffix=")" suffixOverrides=",">
  134. <if test="id != null">
  135. #{id,jdbcType=BIGINT},
  136. </if>
  137. <if test="userId != null">
  138. #{userId,jdbcType=VARCHAR},
  139. </if>
  140. <if test="name != null">
  141. #{name,jdbcType=VARCHAR},
  142. </if>
  143. <if test="isDelete != null">
  144. #{isDelete,jdbcType=INTEGER},
  145. </if>
  146. <if test="createTime != null">
  147. #{createTime,jdbcType=TIMESTAMP},
  148. </if>
  149. <if test="updateTime != null">
  150. #{updateTime,jdbcType=TIMESTAMP},
  151. </if>
  152. </trim>
  153. </insert>
  154. <select id="countByExample" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaffExample" resultType="java.lang.Long">
  155. select count(*) from reply_staff
  156. <if test="_parameter != null">
  157. <include refid="Example_Where_Clause" />
  158. </if>
  159. </select>
  160. <update id="updateByExampleSelective" parameterType="map">
  161. update reply_staff
  162. <set>
  163. <if test="row.id != null">
  164. id = #{row.id,jdbcType=BIGINT},
  165. </if>
  166. <if test="row.userId != null">
  167. user_id = #{row.userId,jdbcType=VARCHAR},
  168. </if>
  169. <if test="row.name != null">
  170. name = #{row.name,jdbcType=VARCHAR},
  171. </if>
  172. <if test="row.isDelete != null">
  173. is_delete = #{row.isDelete,jdbcType=INTEGER},
  174. </if>
  175. <if test="row.createTime != null">
  176. create_time = #{row.createTime,jdbcType=TIMESTAMP},
  177. </if>
  178. <if test="row.updateTime != null">
  179. update_time = #{row.updateTime,jdbcType=TIMESTAMP},
  180. </if>
  181. </set>
  182. <if test="example != null">
  183. <include refid="Update_By_Example_Where_Clause" />
  184. </if>
  185. </update>
  186. <update id="updateByExample" parameterType="map">
  187. update reply_staff
  188. set id = #{row.id,jdbcType=BIGINT},
  189. user_id = #{row.userId,jdbcType=VARCHAR},
  190. name = #{row.name,jdbcType=VARCHAR},
  191. is_delete = #{row.isDelete,jdbcType=INTEGER},
  192. create_time = #{row.createTime,jdbcType=TIMESTAMP},
  193. update_time = #{row.updateTime,jdbcType=TIMESTAMP}
  194. <if test="example != null">
  195. <include refid="Update_By_Example_Where_Clause" />
  196. </if>
  197. </update>
  198. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaff">
  199. update reply_staff
  200. <set>
  201. <if test="userId != null">
  202. user_id = #{userId,jdbcType=VARCHAR},
  203. </if>
  204. <if test="name != null">
  205. name = #{name,jdbcType=VARCHAR},
  206. </if>
  207. <if test="isDelete != null">
  208. is_delete = #{isDelete,jdbcType=INTEGER},
  209. </if>
  210. <if test="createTime != null">
  211. create_time = #{createTime,jdbcType=TIMESTAMP},
  212. </if>
  213. <if test="updateTime != null">
  214. update_time = #{updateTime,jdbcType=TIMESTAMP},
  215. </if>
  216. </set>
  217. where id = #{id,jdbcType=BIGINT}
  218. </update>
  219. <update id="updateByPrimaryKey" parameterType="com.tzld.longarticle.recommend.server.repository.model.ReplyStaff">
  220. update reply_staff
  221. set user_id = #{userId,jdbcType=VARCHAR},
  222. name = #{name,jdbcType=VARCHAR},
  223. is_delete = #{isDelete,jdbcType=INTEGER},
  224. create_time = #{createTime,jdbcType=TIMESTAMP},
  225. update_time = #{updateTime,jdbcType=TIMESTAMP}
  226. where id = #{id,jdbcType=BIGINT}
  227. </update>
  228. </mapper>