GoodsPictureDOMapper.xml 9.3 KB

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