PictureDOMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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.PictureDOMapper" >
  4. <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.PictureDO" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="pic_name" jdbcType="VARCHAR" javaType="java.lang.String" />
  8. <arg column="pic_url" jdbcType="VARCHAR" javaType="java.lang.String" />
  9. <arg column="type" jdbcType="INTEGER" javaType="java.lang.Integer" />
  10. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  11. <arg column="update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  12. <arg column="is_delete" jdbcType="CHAR" javaType="java.lang.String" />
  13. </constructor>
  14. </resultMap>
  15. <resultMap id="ResultMapWithBLOBs" type="com.cdu.lys.graduation.repository.entity.PictureDO" >
  16. <constructor >
  17. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  18. <arg column="pic_name" jdbcType="VARCHAR" javaType="java.lang.String" />
  19. <arg column="pic_url" jdbcType="VARCHAR" javaType="java.lang.String" />
  20. <arg column="type" jdbcType="INTEGER" javaType="java.lang.Integer" />
  21. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  22. <arg column="update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  23. <arg column="is_delete" jdbcType="CHAR" javaType="java.lang.String" />
  24. <arg column="base64_data" jdbcType="LONGVARBINARY" javaType="_byte[]" />
  25. </constructor>
  26. </resultMap>
  27. <sql id="Example_Where_Clause" >
  28. <where >
  29. <foreach collection="oredCriteria" item="criteria" separator="or" >
  30. <if test="criteria.valid" >
  31. <trim prefix="(" suffix=")" prefixOverrides="and" >
  32. <foreach collection="criteria.criteria" item="criterion" >
  33. <choose >
  34. <when test="criterion.noValue" >
  35. and ${criterion.condition}
  36. </when>
  37. <when test="criterion.singleValue" >
  38. and ${criterion.condition} #{criterion.value}
  39. </when>
  40. <when test="criterion.betweenValue" >
  41. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  42. </when>
  43. <when test="criterion.listValue" >
  44. and ${criterion.condition}
  45. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  46. #{listItem}
  47. </foreach>
  48. </when>
  49. </choose>
  50. </foreach>
  51. </trim>
  52. </if>
  53. </foreach>
  54. </where>
  55. </sql>
  56. <sql id="Update_By_Example_Where_Clause" >
  57. <where >
  58. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  59. <if test="criteria.valid" >
  60. <trim prefix="(" suffix=")" prefixOverrides="and" >
  61. <foreach collection="criteria.criteria" item="criterion" >
  62. <choose >
  63. <when test="criterion.noValue" >
  64. and ${criterion.condition}
  65. </when>
  66. <when test="criterion.singleValue" >
  67. and ${criterion.condition} #{criterion.value}
  68. </when>
  69. <when test="criterion.betweenValue" >
  70. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  71. </when>
  72. <when test="criterion.listValue" >
  73. and ${criterion.condition}
  74. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  75. #{listItem}
  76. </foreach>
  77. </when>
  78. </choose>
  79. </foreach>
  80. </trim>
  81. </if>
  82. </foreach>
  83. </where>
  84. </sql>
  85. <sql id="Base_Column_List" >
  86. id, pic_name, pic_url, type, create_time, update_time, is_delete
  87. </sql>
  88. <sql id="Blob_Column_List" >
  89. base64_data
  90. </sql>
  91. <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.cdu.lys.graduation.repository.entity.PictureDOExample" >
  92. select
  93. <if test="distinct" >
  94. distinct
  95. </if>
  96. 'true' as QUERYID,
  97. <include refid="Base_Column_List" />
  98. ,
  99. <include refid="Blob_Column_List" />
  100. from tb_picture
  101. <if test="_parameter != null" >
  102. <include refid="Example_Where_Clause" />
  103. </if>
  104. <if test="orderByClause != null" >
  105. order by ${orderByClause}
  106. </if>
  107. </select>
  108. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.PictureDOExample" >
  109. select
  110. <if test="distinct" >
  111. distinct
  112. </if>
  113. 'true' as QUERYID,
  114. <include refid="Base_Column_List" />
  115. from tb_picture
  116. <if test="_parameter != null" >
  117. <include refid="Example_Where_Clause" />
  118. </if>
  119. <if test="orderByClause != null" >
  120. order by ${orderByClause}
  121. </if>
  122. </select>
  123. <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
  124. select
  125. <include refid="Base_Column_List" />
  126. ,
  127. <include refid="Blob_Column_List" />
  128. from tb_picture
  129. where id = #{id,jdbcType=INTEGER}
  130. </select>
  131. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  132. delete from tb_picture
  133. where id = #{id,jdbcType=INTEGER}
  134. </delete>
  135. <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.PictureDOExample" >
  136. delete from tb_picture
  137. <if test="_parameter != null" >
  138. <include refid="Example_Where_Clause" />
  139. </if>
  140. </delete>
  141. <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.PictureDO" >
  142. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  143. SELECT LAST_INSERT_ID()
  144. </selectKey>
  145. insert into tb_picture (pic_name, pic_url, type,
  146. create_time, update_time, is_delete,
  147. base64_data)
  148. values (#{picName,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  149. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=CHAR},
  150. #{base64Data,jdbcType=LONGVARBINARY})
  151. </insert>
  152. <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.PictureDO" >
  153. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  154. SELECT LAST_INSERT_ID()
  155. </selectKey>
  156. insert into tb_picture
  157. <trim prefix="(" suffix=")" suffixOverrides="," >
  158. <if test="picName != null" >
  159. pic_name,
  160. </if>
  161. <if test="picUrl != null" >
  162. pic_url,
  163. </if>
  164. <if test="type != null" >
  165. type,
  166. </if>
  167. <if test="createTime != null" >
  168. create_time,
  169. </if>
  170. <if test="updateTime != null" >
  171. update_time,
  172. </if>
  173. <if test="isDelete != null" >
  174. is_delete,
  175. </if>
  176. <if test="base64Data != null" >
  177. base64_data,
  178. </if>
  179. </trim>
  180. <trim prefix="values (" suffix=")" suffixOverrides="," >
  181. <if test="picName != null" >
  182. #{picName,jdbcType=VARCHAR},
  183. </if>
  184. <if test="picUrl != null" >
  185. #{picUrl,jdbcType=VARCHAR},
  186. </if>
  187. <if test="type != null" >
  188. #{type,jdbcType=INTEGER},
  189. </if>
  190. <if test="createTime != null" >
  191. #{createTime,jdbcType=TIMESTAMP},
  192. </if>
  193. <if test="updateTime != null" >
  194. #{updateTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="isDelete != null" >
  197. #{isDelete,jdbcType=CHAR},
  198. </if>
  199. <if test="base64Data != null" >
  200. #{base64Data,jdbcType=LONGVARBINARY},
  201. </if>
  202. </trim>
  203. </insert>
  204. <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.PictureDOExample" resultType="java.lang.Integer" >
  205. select count(*) from tb_picture
  206. <if test="_parameter != null" >
  207. <include refid="Example_Where_Clause" />
  208. </if>
  209. </select>
  210. <update id="updateByExampleSelective" parameterType="map" >
  211. update tb_picture
  212. <set >
  213. <if test="record.id != null" >
  214. id = #{record.id,jdbcType=INTEGER},
  215. </if>
  216. <if test="record.picName != null" >
  217. pic_name = #{record.picName,jdbcType=VARCHAR},
  218. </if>
  219. <if test="record.picUrl != null" >
  220. pic_url = #{record.picUrl,jdbcType=VARCHAR},
  221. </if>
  222. <if test="record.type != null" >
  223. type = #{record.type,jdbcType=INTEGER},
  224. </if>
  225. <if test="record.createTime != null" >
  226. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  227. </if>
  228. <if test="record.updateTime != null" >
  229. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  230. </if>
  231. <if test="record.isDelete != null" >
  232. is_delete = #{record.isDelete,jdbcType=CHAR},
  233. </if>
  234. <if test="record.base64Data != null" >
  235. base64_data = #{record.base64Data,jdbcType=LONGVARBINARY},
  236. </if>
  237. </set>
  238. <if test="_parameter != null" >
  239. <include refid="Update_By_Example_Where_Clause" />
  240. </if>
  241. </update>
  242. <update id="updateByExampleWithBLOBs" parameterType="map" >
  243. update tb_picture
  244. set id = #{record.id,jdbcType=INTEGER},
  245. pic_name = #{record.picName,jdbcType=VARCHAR},
  246. pic_url = #{record.picUrl,jdbcType=VARCHAR},
  247. type = #{record.type,jdbcType=INTEGER},
  248. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  249. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  250. is_delete = #{record.isDelete,jdbcType=CHAR},
  251. base64_data = #{record.base64Data,jdbcType=LONGVARBINARY}
  252. <if test="_parameter != null" >
  253. <include refid="Update_By_Example_Where_Clause" />
  254. </if>
  255. </update>
  256. <update id="updateByExample" parameterType="map" >
  257. update tb_picture
  258. set id = #{record.id,jdbcType=INTEGER},
  259. pic_name = #{record.picName,jdbcType=VARCHAR},
  260. pic_url = #{record.picUrl,jdbcType=VARCHAR},
  261. type = #{record.type,jdbcType=INTEGER},
  262. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  263. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  264. is_delete = #{record.isDelete,jdbcType=CHAR}
  265. <if test="_parameter != null" >
  266. <include refid="Update_By_Example_Where_Clause" />
  267. </if>
  268. </update>
  269. <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.PictureDO" >
  270. update tb_picture
  271. <set >
  272. <if test="picName != null" >
  273. pic_name = #{picName,jdbcType=VARCHAR},
  274. </if>
  275. <if test="picUrl != null" >
  276. pic_url = #{picUrl,jdbcType=VARCHAR},
  277. </if>
  278. <if test="type != null" >
  279. type = #{type,jdbcType=INTEGER},
  280. </if>
  281. <if test="createTime != null" >
  282. create_time = #{createTime,jdbcType=TIMESTAMP},
  283. </if>
  284. <if test="updateTime != null" >
  285. update_time = #{updateTime,jdbcType=TIMESTAMP},
  286. </if>
  287. <if test="isDelete != null" >
  288. is_delete = #{isDelete,jdbcType=CHAR},
  289. </if>
  290. <if test="base64Data != null" >
  291. base64_data = #{base64Data,jdbcType=LONGVARBINARY},
  292. </if>
  293. </set>
  294. where id = #{id,jdbcType=INTEGER}
  295. </update>
  296. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.cdu.lys.graduation.repository.entity.PictureDO" >
  297. update tb_picture
  298. set pic_name = #{picName,jdbcType=VARCHAR},
  299. pic_url = #{picUrl,jdbcType=VARCHAR},
  300. type = #{type,jdbcType=INTEGER},
  301. create_time = #{createTime,jdbcType=TIMESTAMP},
  302. update_time = #{updateTime,jdbcType=TIMESTAMP},
  303. is_delete = #{isDelete,jdbcType=CHAR},
  304. base64_data = #{base64Data,jdbcType=LONGVARBINARY}
  305. where id = #{id,jdbcType=INTEGER}
  306. </update>
  307. <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.PictureDO" >
  308. update tb_picture
  309. set pic_name = #{picName,jdbcType=VARCHAR},
  310. pic_url = #{picUrl,jdbcType=VARCHAR},
  311. type = #{type,jdbcType=INTEGER},
  312. create_time = #{createTime,jdbcType=TIMESTAMP},
  313. update_time = #{updateTime,jdbcType=TIMESTAMP},
  314. is_delete = #{isDelete,jdbcType=CHAR}
  315. where id = #{id,jdbcType=INTEGER}
  316. </update>
  317. </mapper>