GoodsTypeDOMapper.xml 8.0 KB

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