CommentPictureDOMapper.xml 8.8 KB

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