OmsCartItemMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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.yonge.cooleshow.mbg.mapper.OmsCartItemMapper">
  4. <resultMap id="BaseResultMap" type="com.yonge.cooleshow.mbg.model.OmsCartItem">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="product_id" jdbcType="BIGINT" property="productId" />
  7. <result column="product_sku_id" jdbcType="BIGINT" property="productSkuId" />
  8. <result column="member_id" jdbcType="BIGINT" property="memberId" />
  9. <result column="quantity" jdbcType="INTEGER" property="quantity" />
  10. <result column="price" jdbcType="DECIMAL" property="price" />
  11. <result column="product_pic" jdbcType="VARCHAR" property="productPic" />
  12. <result column="product_name" jdbcType="VARCHAR" property="productName" />
  13. <result column="product_sub_title" jdbcType="VARCHAR" property="productSubTitle" />
  14. <result column="product_sku_code" jdbcType="VARCHAR" property="productSkuCode" />
  15. <result column="member_nickname" jdbcType="VARCHAR" property="memberNickname" />
  16. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  17. <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
  18. <result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
  19. <result column="product_category_id" jdbcType="BIGINT" property="productCategoryId" />
  20. <result column="product_brand" jdbcType="VARCHAR" property="productBrand" />
  21. <result column="product_sn" jdbcType="VARCHAR" property="productSn" />
  22. <result column="product_attr" jdbcType="VARCHAR" property="productAttr" />
  23. <result column="hidden_" jdbcType="VARCHAR" property="hidden" />
  24. <result column="promoter_id" property="promoterId" />
  25. </resultMap>
  26. <sql id="Example_Where_Clause">
  27. <where>
  28. <foreach collection="oredCriteria" item="criteria" separator="or">
  29. <if test="criteria.valid">
  30. <trim prefix="(" prefixOverrides="and" suffix=")">
  31. <foreach collection="criteria.criteria" item="criterion">
  32. <choose>
  33. <when test="criterion.noValue">
  34. and ${criterion.condition}
  35. </when>
  36. <when test="criterion.singleValue">
  37. and ${criterion.condition} #{criterion.value}
  38. </when>
  39. <when test="criterion.betweenValue">
  40. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  41. </when>
  42. <when test="criterion.listValue">
  43. and ${criterion.condition}
  44. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  45. #{listItem}
  46. </foreach>
  47. </when>
  48. </choose>
  49. </foreach>
  50. </trim>
  51. </if>
  52. </foreach>
  53. </where>
  54. </sql>
  55. <sql id="Update_By_Example_Where_Clause">
  56. <where>
  57. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  58. <if test="criteria.valid">
  59. <trim prefix="(" prefixOverrides="and" suffix=")">
  60. <foreach collection="criteria.criteria" item="criterion">
  61. <choose>
  62. <when test="criterion.noValue">
  63. and ${criterion.condition}
  64. </when>
  65. <when test="criterion.singleValue">
  66. and ${criterion.condition} #{criterion.value}
  67. </when>
  68. <when test="criterion.betweenValue">
  69. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  70. </when>
  71. <when test="criterion.listValue">
  72. and ${criterion.condition}
  73. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  74. #{listItem}
  75. </foreach>
  76. </when>
  77. </choose>
  78. </foreach>
  79. </trim>
  80. </if>
  81. </foreach>
  82. </where>
  83. </sql>
  84. <sql id="Base_Column_List">
  85. id, product_id, product_sku_id, member_id, quantity, price, product_pic, product_name,
  86. product_sub_title, product_sku_code, member_nickname, create_date, modify_date, delete_status,
  87. product_category_id, product_brand, product_sn, product_attr,hidden_,promoter_id
  88. </sql>
  89. <select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItemExample" resultMap="BaseResultMap">
  90. select
  91. <if test="distinct">
  92. distinct
  93. </if>
  94. <include refid="Base_Column_List" />
  95. from oms_cart_item
  96. <if test="_parameter != null">
  97. <include refid="Example_Where_Clause" />
  98. </if>
  99. <if test="orderByClause != null">
  100. order by ${orderByClause}
  101. </if>
  102. </select>
  103. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  104. select
  105. <include refid="Base_Column_List" />
  106. from oms_cart_item
  107. where id = #{id,jdbcType=BIGINT}
  108. </select>
  109. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  110. delete from oms_cart_item
  111. where id = #{id,jdbcType=BIGINT}
  112. </delete>
  113. <delete id="deleteByExample" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItemExample">
  114. delete from oms_cart_item
  115. <if test="_parameter != null">
  116. <include refid="Example_Where_Clause" />
  117. </if>
  118. </delete>
  119. <insert id="insert" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItem">
  120. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  121. SELECT LAST_INSERT_ID()
  122. </selectKey>
  123. insert into oms_cart_item (product_id, product_sku_id, member_id,
  124. quantity, price, product_pic,
  125. product_name, product_sub_title, product_sku_code,
  126. member_nickname, create_date, modify_date,
  127. delete_status, product_category_id, product_brand,
  128. product_sn, product_attr,hidden_,promoter_id)
  129. values (#{productId,jdbcType=BIGINT}, #{productSkuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
  130. #{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{productPic,jdbcType=VARCHAR},
  131. #{productName,jdbcType=VARCHAR}, #{productSubTitle,jdbcType=VARCHAR}, #{productSkuCode,jdbcType=VARCHAR},
  132. #{memberNickname,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP},
  133. #{deleteStatus,jdbcType=INTEGER}, #{productCategoryId,jdbcType=BIGINT}, #{productBrand,jdbcType=VARCHAR},
  134. #{productSn,jdbcType=VARCHAR}, #{productAttr,jdbcType=VARCHAR},#{hidden},#{promoterId})
  135. </insert>
  136. <insert id="insertSelective" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItem">
  137. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  138. SELECT LAST_INSERT_ID()
  139. </selectKey>
  140. insert into oms_cart_item
  141. <trim prefix="(" suffix=")" suffixOverrides=",">
  142. <if test="productId != null">
  143. product_id,
  144. </if>
  145. <if test="productSkuId != null">
  146. product_sku_id,
  147. </if>
  148. <if test="memberId != null">
  149. member_id,
  150. </if>
  151. <if test="quantity != null">
  152. quantity,
  153. </if>
  154. <if test="price != null">
  155. price,
  156. </if>
  157. <if test="productPic != null">
  158. product_pic,
  159. </if>
  160. <if test="productName != null">
  161. product_name,
  162. </if>
  163. <if test="productSubTitle != null">
  164. product_sub_title,
  165. </if>
  166. <if test="productSkuCode != null">
  167. product_sku_code,
  168. </if>
  169. <if test="memberNickname != null">
  170. member_nickname,
  171. </if>
  172. <if test="createDate != null">
  173. create_date,
  174. </if>
  175. <if test="modifyDate != null">
  176. modify_date,
  177. </if>
  178. <if test="deleteStatus != null">
  179. delete_status,
  180. </if>
  181. <if test="productCategoryId != null">
  182. product_category_id,
  183. </if>
  184. <if test="productBrand != null">
  185. product_brand,
  186. </if>
  187. <if test="productSn != null">
  188. product_sn,
  189. </if>
  190. <if test="productAttr != null">
  191. product_attr,
  192. </if>
  193. <if test="hidden != null">
  194. hidden_,
  195. </if>
  196. <if test="promoterId != null">
  197. promoter_id,
  198. </if>
  199. </trim>
  200. <trim prefix="values (" suffix=")" suffixOverrides=",">
  201. <if test="productId != null">
  202. #{productId,jdbcType=BIGINT},
  203. </if>
  204. <if test="productSkuId != null">
  205. #{productSkuId,jdbcType=BIGINT},
  206. </if>
  207. <if test="memberId != null">
  208. #{memberId,jdbcType=BIGINT},
  209. </if>
  210. <if test="quantity != null">
  211. #{quantity,jdbcType=INTEGER},
  212. </if>
  213. <if test="price != null">
  214. #{price,jdbcType=DECIMAL},
  215. </if>
  216. <if test="productPic != null">
  217. #{productPic,jdbcType=VARCHAR},
  218. </if>
  219. <if test="productName != null">
  220. #{productName,jdbcType=VARCHAR},
  221. </if>
  222. <if test="productSubTitle != null">
  223. #{productSubTitle,jdbcType=VARCHAR},
  224. </if>
  225. <if test="productSkuCode != null">
  226. #{productSkuCode,jdbcType=VARCHAR},
  227. </if>
  228. <if test="memberNickname != null">
  229. #{memberNickname,jdbcType=VARCHAR},
  230. </if>
  231. <if test="createDate != null">
  232. #{createDate,jdbcType=TIMESTAMP},
  233. </if>
  234. <if test="modifyDate != null">
  235. #{modifyDate,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="deleteStatus != null">
  238. #{deleteStatus,jdbcType=INTEGER},
  239. </if>
  240. <if test="productCategoryId != null">
  241. #{productCategoryId,jdbcType=BIGINT},
  242. </if>
  243. <if test="productBrand != null">
  244. #{productBrand,jdbcType=VARCHAR},
  245. </if>
  246. <if test="productSn != null">
  247. #{productSn,jdbcType=VARCHAR},
  248. </if>
  249. <if test="productAttr != null">
  250. #{productAttr,jdbcType=VARCHAR},
  251. </if>
  252. <if test="hidden != null">
  253. #{hidden},
  254. </if>
  255. <if test="promoterId != null">
  256. #{promoterId},
  257. </if>
  258. </trim>
  259. </insert>
  260. <select id="countByExample" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItemExample" resultType="java.lang.Long">
  261. select count(*) from oms_cart_item
  262. <if test="_parameter != null">
  263. <include refid="Example_Where_Clause" />
  264. </if>
  265. </select>
  266. <update id="updateByExampleSelective" parameterType="map">
  267. update oms_cart_item
  268. <set>
  269. <if test="record.id != null">
  270. id = #{record.id,jdbcType=BIGINT},
  271. </if>
  272. <if test="record.productId != null">
  273. product_id = #{record.productId,jdbcType=BIGINT},
  274. </if>
  275. <if test="record.productSkuId != null">
  276. product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
  277. </if>
  278. <if test="record.memberId != null">
  279. member_id = #{record.memberId,jdbcType=BIGINT},
  280. </if>
  281. <if test="record.quantity != null">
  282. quantity = #{record.quantity,jdbcType=INTEGER},
  283. </if>
  284. <if test="record.price != null">
  285. price = #{record.price,jdbcType=DECIMAL},
  286. </if>
  287. <if test="record.productPic != null">
  288. product_pic = #{record.productPic,jdbcType=VARCHAR},
  289. </if>
  290. <if test="record.productName != null">
  291. product_name = #{record.productName,jdbcType=VARCHAR},
  292. </if>
  293. <if test="record.productSubTitle != null">
  294. product_sub_title = #{record.productSubTitle,jdbcType=VARCHAR},
  295. </if>
  296. <if test="record.productSkuCode != null">
  297. product_sku_code = #{record.productSkuCode,jdbcType=VARCHAR},
  298. </if>
  299. <if test="record.memberNickname != null">
  300. member_nickname = #{record.memberNickname,jdbcType=VARCHAR},
  301. </if>
  302. <if test="record.createDate != null">
  303. create_date = #{record.createDate,jdbcType=TIMESTAMP},
  304. </if>
  305. <if test="record.modifyDate != null">
  306. modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="record.deleteStatus != null">
  309. delete_status = #{record.deleteStatus,jdbcType=INTEGER},
  310. </if>
  311. <if test="record.productCategoryId != null">
  312. product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
  313. </if>
  314. <if test="record.productBrand != null">
  315. product_brand = #{record.productBrand,jdbcType=VARCHAR},
  316. </if>
  317. <if test="record.productSn != null">
  318. product_sn = #{record.productSn,jdbcType=VARCHAR},
  319. </if>
  320. <if test="record.productAttr != null">
  321. product_attr = #{record.productAttr,jdbcType=VARCHAR},
  322. </if>
  323. <if test="record.hidden != null">
  324. hidden_ = #{record.hidden},
  325. </if>
  326. <if test="record.promoterId != null">
  327. promoter_id = #{record.promoterId},
  328. </if>
  329. </set>
  330. <if test="_parameter != null">
  331. <include refid="Update_By_Example_Where_Clause" />
  332. </if>
  333. </update>
  334. <update id="updateByExample" parameterType="map">
  335. update oms_cart_item
  336. set id = #{record.id,jdbcType=BIGINT},
  337. product_id = #{record.productId,jdbcType=BIGINT},
  338. product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
  339. member_id = #{record.memberId,jdbcType=BIGINT},
  340. quantity = #{record.quantity,jdbcType=INTEGER},
  341. price = #{record.price,jdbcType=DECIMAL},
  342. product_pic = #{record.productPic,jdbcType=VARCHAR},
  343. product_name = #{record.productName,jdbcType=VARCHAR},
  344. product_sub_title = #{record.productSubTitle,jdbcType=VARCHAR},
  345. product_sku_code = #{record.productSkuCode,jdbcType=VARCHAR},
  346. member_nickname = #{record.memberNickname,jdbcType=VARCHAR},
  347. create_date = #{record.createDate,jdbcType=TIMESTAMP},
  348. modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
  349. delete_status = #{record.deleteStatus,jdbcType=INTEGER},
  350. product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
  351. product_brand = #{record.productBrand,jdbcType=VARCHAR},
  352. product_sn = #{record.productSn,jdbcType=VARCHAR},
  353. product_attr = #{record.productAttr,jdbcType=VARCHAR},
  354. promoter_id = #{record.promoterId},
  355. hidden_ = #{record.hidden}
  356. <if test="_parameter != null">
  357. <include refid="Update_By_Example_Where_Clause" />
  358. </if>
  359. </update>
  360. <update id="updateByPrimaryKeySelective" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItem">
  361. update oms_cart_item
  362. <set>
  363. <if test="productId != null">
  364. product_id = #{productId,jdbcType=BIGINT},
  365. </if>
  366. <if test="productSkuId != null">
  367. product_sku_id = #{productSkuId,jdbcType=BIGINT},
  368. </if>
  369. <if test="memberId != null">
  370. member_id = #{memberId,jdbcType=BIGINT},
  371. </if>
  372. <if test="quantity != null">
  373. quantity = #{quantity,jdbcType=INTEGER},
  374. </if>
  375. <if test="price != null">
  376. price = #{price,jdbcType=DECIMAL},
  377. </if>
  378. <if test="productPic != null">
  379. product_pic = #{productPic,jdbcType=VARCHAR},
  380. </if>
  381. <if test="productName != null">
  382. product_name = #{productName,jdbcType=VARCHAR},
  383. </if>
  384. <if test="productSubTitle != null">
  385. product_sub_title = #{productSubTitle,jdbcType=VARCHAR},
  386. </if>
  387. <if test="productSkuCode != null">
  388. product_sku_code = #{productSkuCode,jdbcType=VARCHAR},
  389. </if>
  390. <if test="memberNickname != null">
  391. member_nickname = #{memberNickname,jdbcType=VARCHAR},
  392. </if>
  393. <if test="createDate != null">
  394. create_date = #{createDate,jdbcType=TIMESTAMP},
  395. </if>
  396. <if test="modifyDate != null">
  397. modify_date = #{modifyDate,jdbcType=TIMESTAMP},
  398. </if>
  399. <if test="deleteStatus != null">
  400. delete_status = #{deleteStatus,jdbcType=INTEGER},
  401. </if>
  402. <if test="productCategoryId != null">
  403. product_category_id = #{productCategoryId,jdbcType=BIGINT},
  404. </if>
  405. <if test="productBrand != null">
  406. product_brand = #{productBrand,jdbcType=VARCHAR},
  407. </if>
  408. <if test="productSn != null">
  409. product_sn = #{productSn,jdbcType=VARCHAR},
  410. </if>
  411. <if test="productAttr != null">
  412. product_attr = #{productAttr,jdbcType=VARCHAR},
  413. </if>
  414. <if test="hidden != null">
  415. hidden_ = #{hidden},
  416. </if>
  417. <if test="promoterId != null">
  418. promoter_id = #{promoterId},
  419. </if>
  420. </set>
  421. where id = #{id,jdbcType=BIGINT}
  422. </update>
  423. <update id="updateByPrimaryKey" parameterType="com.yonge.cooleshow.mbg.model.OmsCartItem">
  424. update oms_cart_item
  425. set product_id = #{productId,jdbcType=BIGINT},
  426. product_sku_id = #{productSkuId,jdbcType=BIGINT},
  427. member_id = #{memberId,jdbcType=BIGINT},
  428. quantity = #{quantity,jdbcType=INTEGER},
  429. price = #{price,jdbcType=DECIMAL},
  430. product_pic = #{productPic,jdbcType=VARCHAR},
  431. product_name = #{productName,jdbcType=VARCHAR},
  432. product_sub_title = #{productSubTitle,jdbcType=VARCHAR},
  433. product_sku_code = #{productSkuCode,jdbcType=VARCHAR},
  434. member_nickname = #{memberNickname,jdbcType=VARCHAR},
  435. create_date = #{createDate,jdbcType=TIMESTAMP},
  436. modify_date = #{modifyDate,jdbcType=TIMESTAMP},
  437. delete_status = #{deleteStatus,jdbcType=INTEGER},
  438. product_category_id = #{productCategoryId,jdbcType=BIGINT},
  439. product_brand = #{productBrand,jdbcType=VARCHAR},
  440. product_sn = #{productSn,jdbcType=VARCHAR},
  441. product_attr = #{productAttr,jdbcType=VARCHAR},
  442. promoter_id = #{promoterId},
  443. hidden_ = #{hidden}
  444. where id = #{id,jdbcType=BIGINT}
  445. </update>
  446. </mapper>