UmsRollBuyDao.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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.hwrj.cloud.admin.dao.UmsRollBuyDao">
  4. <resultMap id="BaseResultMap" type="com.hwrj.cloud.admin.model.UmsRollBuy">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="member_id" jdbcType="BIGINT" property="memberId" />
  7. <result column="member_name" jdbcType="VARCHAR" property="memberName" />
  8. <result column="money" jdbcType="DECIMAL" property="money" />
  9. <result column="product_id" jdbcType="BIGINT" property="productId" />
  10. <result column="product_name" jdbcType="VARCHAR" property="productName" />
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  12. <result column="comp_name" jdbcType="VARCHAR" property="compName" />
  13. <result column="comp_id" jdbcType="BIGINT" property="compId" />
  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="(" prefixOverrides="and" suffix=")">
  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 close=")" collection="criterion.value" item="listItem" open="(" 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="(" prefixOverrides="and" suffix=")">
  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 close=")" collection="criterion.value" item="listItem" open="(" 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, member_id, member_name, money, product_id, product_name, create_time, comp_name,
  75. comp_id
  76. </sql>
  77. <select id="selectByExample" parameterType="com.hwrj.cloud.admin.model.UmsRollBuyExample" resultMap="BaseResultMap">
  78. select
  79. <if test="distinct">
  80. distinct
  81. </if>
  82. <include refid="Base_Column_List" />
  83. from ums_roll_buy
  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" parameterType="java.lang.Long" resultMap="BaseResultMap">
  92. select
  93. <include refid="Base_Column_List" />
  94. from ums_roll_buy
  95. where id = #{id,jdbcType=BIGINT}
  96. </select>
  97. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  98. delete from ums_roll_buy
  99. where id = #{id,jdbcType=BIGINT}
  100. </delete>
  101. <delete id="deleteByExample" parameterType="com.hwrj.cloud.admin.model.UmsRollBuyExample">
  102. delete from ums_roll_buy
  103. <if test="_parameter != null">
  104. <include refid="Example_Where_Clause" />
  105. </if>
  106. </delete>
  107. <insert id="insert" parameterType="com.hwrj.cloud.admin.model.UmsRollBuy">
  108. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  109. SELECT LAST_INSERT_ID()
  110. </selectKey>
  111. insert into ums_roll_buy (member_id, member_name, money,
  112. product_id, product_name, create_time,
  113. comp_name, comp_id)
  114. values (#{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR}, #{money,jdbcType=DECIMAL},
  115. #{productId,jdbcType=BIGINT}, #{productName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  116. #{compName,jdbcType=VARCHAR}, #{compId,jdbcType=BIGINT})
  117. </insert>
  118. <insert id="insertSelective" parameterType="com.hwrj.cloud.admin.model.UmsRollBuy">
  119. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  120. SELECT LAST_INSERT_ID()
  121. </selectKey>
  122. insert into ums_roll_buy
  123. <trim prefix="(" suffix=")" suffixOverrides=",">
  124. <if test="memberId != null">
  125. member_id,
  126. </if>
  127. <if test="memberName != null">
  128. member_name,
  129. </if>
  130. <if test="money != null">
  131. money,
  132. </if>
  133. <if test="productId != null">
  134. product_id,
  135. </if>
  136. <if test="productName != null">
  137. product_name,
  138. </if>
  139. <if test="createTime != null">
  140. create_time,
  141. </if>
  142. <if test="compName != null">
  143. comp_name,
  144. </if>
  145. <if test="compId != null">
  146. comp_id,
  147. </if>
  148. </trim>
  149. <trim prefix="values (" suffix=")" suffixOverrides=",">
  150. <if test="memberId != null">
  151. #{memberId,jdbcType=BIGINT},
  152. </if>
  153. <if test="memberName != null">
  154. #{memberName,jdbcType=VARCHAR},
  155. </if>
  156. <if test="money != null">
  157. #{money,jdbcType=DECIMAL},
  158. </if>
  159. <if test="productId != null">
  160. #{productId,jdbcType=BIGINT},
  161. </if>
  162. <if test="productName != null">
  163. #{productName,jdbcType=VARCHAR},
  164. </if>
  165. <if test="createTime != null">
  166. #{createTime,jdbcType=TIMESTAMP},
  167. </if>
  168. <if test="compName != null">
  169. #{compName,jdbcType=VARCHAR},
  170. </if>
  171. <if test="compId != null">
  172. #{compId,jdbcType=BIGINT},
  173. </if>
  174. </trim>
  175. </insert>
  176. <select id="countByExample" parameterType="com.hwrj.cloud.admin.model.UmsRollBuyExample" resultType="java.lang.Long">
  177. select count(*) from ums_roll_buy
  178. <if test="_parameter != null">
  179. <include refid="Example_Where_Clause" />
  180. </if>
  181. </select>
  182. <update id="updateByExampleSelective" parameterType="map">
  183. update ums_roll_buy
  184. <set>
  185. <if test="record.id != null">
  186. id = #{record.id,jdbcType=BIGINT},
  187. </if>
  188. <if test="record.memberId != null">
  189. member_id = #{record.memberId,jdbcType=BIGINT},
  190. </if>
  191. <if test="record.memberName != null">
  192. member_name = #{record.memberName,jdbcType=VARCHAR},
  193. </if>
  194. <if test="record.money != null">
  195. money = #{record.money,jdbcType=DECIMAL},
  196. </if>
  197. <if test="record.productId != null">
  198. product_id = #{record.productId,jdbcType=BIGINT},
  199. </if>
  200. <if test="record.productName != null">
  201. product_name = #{record.productName,jdbcType=VARCHAR},
  202. </if>
  203. <if test="record.createTime != null">
  204. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  205. </if>
  206. <if test="record.compName != null">
  207. comp_name = #{record.compName,jdbcType=VARCHAR},
  208. </if>
  209. <if test="record.compId != null">
  210. comp_id = #{record.compId,jdbcType=BIGINT},
  211. </if>
  212. </set>
  213. <if test="_parameter != null">
  214. <include refid="Update_By_Example_Where_Clause" />
  215. </if>
  216. </update>
  217. <update id="updateByExample" parameterType="map">
  218. update ums_roll_buy
  219. set id = #{record.id,jdbcType=BIGINT},
  220. member_id = #{record.memberId,jdbcType=BIGINT},
  221. member_name = #{record.memberName,jdbcType=VARCHAR},
  222. money = #{record.money,jdbcType=DECIMAL},
  223. product_id = #{record.productId,jdbcType=BIGINT},
  224. product_name = #{record.productName,jdbcType=VARCHAR},
  225. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  226. comp_name = #{record.compName,jdbcType=VARCHAR},
  227. comp_id = #{record.compId,jdbcType=BIGINT}
  228. <if test="_parameter != null">
  229. <include refid="Update_By_Example_Where_Clause" />
  230. </if>
  231. </update>
  232. <update id="updateByPrimaryKeySelective" parameterType="com.hwrj.cloud.admin.model.UmsRollBuy">
  233. update ums_roll_buy
  234. <set>
  235. <if test="memberId != null">
  236. member_id = #{memberId,jdbcType=BIGINT},
  237. </if>
  238. <if test="memberName != null">
  239. member_name = #{memberName,jdbcType=VARCHAR},
  240. </if>
  241. <if test="money != null">
  242. money = #{money,jdbcType=DECIMAL},
  243. </if>
  244. <if test="productId != null">
  245. product_id = #{productId,jdbcType=BIGINT},
  246. </if>
  247. <if test="productName != null">
  248. product_name = #{productName,jdbcType=VARCHAR},
  249. </if>
  250. <if test="createTime != null">
  251. create_time = #{createTime,jdbcType=TIMESTAMP},
  252. </if>
  253. <if test="compName != null">
  254. comp_name = #{compName,jdbcType=VARCHAR},
  255. </if>
  256. <if test="compId != null">
  257. comp_id = #{compId,jdbcType=BIGINT},
  258. </if>
  259. </set>
  260. where id = #{id,jdbcType=BIGINT}
  261. </update>
  262. <update id="updateByPrimaryKey" parameterType="com.hwrj.cloud.admin.model.UmsRollBuy">
  263. update ums_roll_buy
  264. set member_id = #{memberId,jdbcType=BIGINT},
  265. member_name = #{memberName,jdbcType=VARCHAR},
  266. money = #{money,jdbcType=DECIMAL},
  267. product_id = #{productId,jdbcType=BIGINT},
  268. product_name = #{productName,jdbcType=VARCHAR},
  269. create_time = #{createTime,jdbcType=TIMESTAMP},
  270. comp_name = #{compName,jdbcType=VARCHAR},
  271. comp_id = #{compId,jdbcType=BIGINT}
  272. where id = #{id,jdbcType=BIGINT}
  273. </update>
  274. <insert id="insertList" parameterType="com.hwrj.cloud.admin.model.UmsRollBuy">
  275. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  276. SELECT LAST_INSERT_ID()
  277. </selectKey>
  278. insert into ums_roll_buy (member_id, member_name, money,
  279. product_id, product_name, create_time,
  280. comp_name, comp_id)
  281. values
  282. <foreach collection="list" item="item" separator=",">
  283. (#{item.memberId,jdbcType=BIGINT}, #{item.memberName,jdbcType=VARCHAR}, #{item.money,jdbcType=DECIMAL},
  284. #{item.productId,jdbcType=BIGINT}, #{item.productName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
  285. #{item.compName,jdbcType=VARCHAR}, #{item.compId,jdbcType=BIGINT})
  286. </foreach>
  287. </insert>
  288. </mapper>