GoodsOptionItemDOMapper.xml 9.5 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.GoodsOptionItemDOMapper" >
  4. <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.GoodsOptionItemDO" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="option_item" jdbcType="VARCHAR" javaType="java.lang.String" />
  8. <arg column="option_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  9. <arg column="extra_price" jdbcType="DOUBLE" javaType="java.lang.Double" />
  10. <arg column="is_delete" jdbcType="CHAR" javaType="java.lang.String" />
  11. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  12. <arg column="update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  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, option_item, option_id, extra_price, is_delete, create_time, update_time
  75. </sql>
  76. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.GoodsOptionItemDOExample" >
  77. select
  78. <if test="distinct" >
  79. distinct
  80. </if>
  81. 'true' as QUERYID,
  82. <include refid="Base_Column_List" />
  83. from tb_goods_option_item
  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_option_item
  95. where id = #{id,jdbcType=INTEGER}
  96. </select>
  97. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  98. delete from tb_goods_option_item
  99. where id = #{id,jdbcType=INTEGER}
  100. </delete>
  101. <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.GoodsOptionItemDOExample" >
  102. delete from tb_goods_option_item
  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.GoodsOptionItemDO" >
  108. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  109. SELECT LAST_INSERT_ID()
  110. </selectKey>
  111. insert into tb_goods_option_item (option_item, option_id, extra_price,
  112. is_delete, create_time, update_time
  113. )
  114. values (#{optionItem,jdbcType=VARCHAR}, #{optionId,jdbcType=INTEGER}, #{extraPrice,jdbcType=DOUBLE},
  115. #{isDelete,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
  116. )
  117. </insert>
  118. <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.GoodsOptionItemDO" >
  119. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  120. SELECT LAST_INSERT_ID()
  121. </selectKey>
  122. insert into tb_goods_option_item
  123. <trim prefix="(" suffix=")" suffixOverrides="," >
  124. <if test="optionItem != null" >
  125. option_item,
  126. </if>
  127. <if test="optionId != null" >
  128. option_id,
  129. </if>
  130. <if test="extraPrice != null" >
  131. extra_price,
  132. </if>
  133. <if test="isDelete != null" >
  134. is_delete,
  135. </if>
  136. <if test="createTime != null" >
  137. create_time,
  138. </if>
  139. <if test="updateTime != null" >
  140. update_time,
  141. </if>
  142. </trim>
  143. <trim prefix="values (" suffix=")" suffixOverrides="," >
  144. <if test="optionItem != null" >
  145. #{optionItem,jdbcType=VARCHAR},
  146. </if>
  147. <if test="optionId != null" >
  148. #{optionId,jdbcType=INTEGER},
  149. </if>
  150. <if test="extraPrice != null" >
  151. #{extraPrice,jdbcType=DOUBLE},
  152. </if>
  153. <if test="isDelete != null" >
  154. #{isDelete,jdbcType=CHAR},
  155. </if>
  156. <if test="createTime != null" >
  157. #{createTime,jdbcType=TIMESTAMP},
  158. </if>
  159. <if test="updateTime != null" >
  160. #{updateTime,jdbcType=TIMESTAMP},
  161. </if>
  162. </trim>
  163. </insert>
  164. <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.GoodsOptionItemDOExample" resultType="java.lang.Integer" >
  165. select count(*) from tb_goods_option_item
  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_option_item
  172. <set >
  173. <if test="record.id != null" >
  174. id = #{record.id,jdbcType=INTEGER},
  175. </if>
  176. <if test="record.optionItem != null" >
  177. option_item = #{record.optionItem,jdbcType=VARCHAR},
  178. </if>
  179. <if test="record.optionId != null" >
  180. option_id = #{record.optionId,jdbcType=INTEGER},
  181. </if>
  182. <if test="record.extraPrice != null" >
  183. extra_price = #{record.extraPrice,jdbcType=DOUBLE},
  184. </if>
  185. <if test="record.isDelete != null" >
  186. is_delete = #{record.isDelete,jdbcType=CHAR},
  187. </if>
  188. <if test="record.createTime != null" >
  189. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="record.updateTime != null" >
  192. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  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_option_item
  201. set id = #{record.id,jdbcType=INTEGER},
  202. option_item = #{record.optionItem,jdbcType=VARCHAR},
  203. option_id = #{record.optionId,jdbcType=INTEGER},
  204. extra_price = #{record.extraPrice,jdbcType=DOUBLE},
  205. is_delete = #{record.isDelete,jdbcType=CHAR},
  206. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  207. update_time = #{record.updateTime,jdbcType=TIMESTAMP}
  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.GoodsOptionItemDO" >
  213. update tb_goods_option_item
  214. <set >
  215. <if test="optionItem != null" >
  216. option_item = #{optionItem,jdbcType=VARCHAR},
  217. </if>
  218. <if test="optionId != null" >
  219. option_id = #{optionId,jdbcType=INTEGER},
  220. </if>
  221. <if test="extraPrice != null" >
  222. extra_price = #{extraPrice,jdbcType=DOUBLE},
  223. </if>
  224. <if test="isDelete != null" >
  225. is_delete = #{isDelete,jdbcType=CHAR},
  226. </if>
  227. <if test="createTime != null" >
  228. create_time = #{createTime,jdbcType=TIMESTAMP},
  229. </if>
  230. <if test="updateTime != null" >
  231. update_time = #{updateTime,jdbcType=TIMESTAMP},
  232. </if>
  233. </set>
  234. where id = #{id,jdbcType=INTEGER}
  235. </update>
  236. <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.GoodsOptionItemDO" >
  237. update tb_goods_option_item
  238. set option_item = #{optionItem,jdbcType=VARCHAR},
  239. option_id = #{optionId,jdbcType=INTEGER},
  240. extra_price = #{extraPrice,jdbcType=DOUBLE},
  241. is_delete = #{isDelete,jdbcType=CHAR},
  242. create_time = #{createTime,jdbcType=TIMESTAMP},
  243. update_time = #{updateTime,jdbcType=TIMESTAMP}
  244. where id = #{id,jdbcType=INTEGER}
  245. </update>
  246. </mapper>