StoreOrderCartServiceDaoImplMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="storeOrderCartServiceDaoImpl">
  6. <!-- 保存订单购物车信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveStoreOrderCartInfo" parameterType="Map">
  8. insert into store_order_cart(
  9. value_id,product_id,order_id,cart_id,remark,store_id,cart_num,price,pay_price,person_id,state,freight_price
  10. ) values (
  11. #{valueId},#{productId},#{orderId},#{cartId},#{remark},#{storeId},#{cartNum},#{price},#{payPrice},#{personId},#{state},#{freightPrice}
  12. )
  13. </insert>
  14. <!-- 查询订单购物车信息 add by wuxw 2018-07-03 -->
  15. <select id="getStoreOrderCartInfo" parameterType="Map" resultType="Map">
  16. select t.value_id,t.value_id valueId,t.product_id,t.product_id productId,t.order_id,t.order_id
  17. orderId,t.cart_id,t.cart_id cartId,t.remark,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id
  18. storeId,t.cart_num,t.cart_num cartNum,t.price,t.pay_price,t.pay_price payPrice,t.person_id,t.person_id
  19. personId,t.state,t.freight_price,t.freight_price freightPrice,p.prod_name prodName,so.person_name personName,
  20. td.name stateName,t.create_time createTime,psv.spec_id specId,so.total_price totalPrice
  21. from store_order_cart t
  22. left join store_order so on t.order_id = so.order_id
  23. left join t_dict td on t.state = td.status_cd and td.table_name = 'store_order_cart' and td.table_columns = 'state'
  24. left join product p on t.product_id = p.product_id and p.status_cd = '0' and p.store_id = t.store_id
  25. left join product_spec_value psv on p.product_id = psv.product_id and psv.store_id = p.store_id and t.value_id = psv.value_id and psv.status_cd = '0'
  26. where 1 =1
  27. <if test="valueId !=null and valueId != ''">
  28. and t.value_id= #{valueId}
  29. </if>
  30. <if test="productId !=null and productId != ''">
  31. and t.product_id= #{productId}
  32. </if>
  33. <if test="orderId !=null and orderId != ''">
  34. and t.order_id= #{orderId}
  35. </if>
  36. <if test="cartId !=null and cartId != ''">
  37. and t.cart_id= #{cartId}
  38. </if>
  39. <if test="remark !=null and remark != ''">
  40. and t.remark= #{remark}
  41. </if>
  42. <if test="statusCd !=null and statusCd != ''">
  43. and t.status_cd= #{statusCd}
  44. </if>
  45. <if test="storeId !=null and storeId != ''">
  46. and t.store_id= #{storeId}
  47. </if>
  48. <if test="cartNum !=null and cartNum != ''">
  49. and t.cart_num= #{cartNum}
  50. </if>
  51. <if test="price !=null and price != ''">
  52. and t.price= #{price}
  53. </if>
  54. <if test="payPrice !=null and payPrice != ''">
  55. and t.pay_price= #{payPrice}
  56. </if>
  57. <if test="personId !=null and personId != ''">
  58. and t.person_id= #{personId}
  59. </if>
  60. <if test="state !=null and state != ''">
  61. and t.state= #{state}
  62. </if>
  63. <if test="freightPrice !=null and freightPrice != ''">
  64. and t.freight_price= #{freightPrice}
  65. </if>
  66. order by t.create_time desc
  67. <if test="page != -1 and page != null ">
  68. limit #{page}, #{row}
  69. </if>
  70. </select>
  71. <!-- 修改订单购物车信息 add by wuxw 2018-07-03 -->
  72. <update id="updateStoreOrderCartInfo" parameterType="Map">
  73. update store_order_cart t set t.status_cd = #{statusCd}
  74. <if test="valueId !=null and valueId != ''">
  75. , t.value_id= #{valueId}
  76. </if>
  77. <if test="productId !=null and productId != ''">
  78. , t.product_id= #{productId}
  79. </if>
  80. <if test="remark !=null and remark != ''">
  81. , t.remark= #{remark}
  82. </if>
  83. <if test="storeId !=null and storeId != ''">
  84. , t.store_id= #{storeId}
  85. </if>
  86. <if test="cartNum !=null and cartNum != ''">
  87. , t.cart_num= #{cartNum}
  88. </if>
  89. <if test="price !=null and price != ''">
  90. , t.price= #{price}
  91. </if>
  92. <if test="payPrice !=null and payPrice != ''">
  93. , t.pay_price= #{payPrice}
  94. </if>
  95. <if test="personId !=null and personId != ''">
  96. , t.person_id= #{personId}
  97. </if>
  98. <if test="state !=null and state != ''">
  99. , t.state= #{state}
  100. </if>
  101. <if test="freightPrice !=null and freightPrice != ''">
  102. , t.freight_price= #{freightPrice}
  103. </if>
  104. where 1=1
  105. <if test="cartId !=null and cartId != ''">
  106. and t.cart_id= #{cartId}
  107. </if>
  108. <if test="orderId !=null and orderId != ''">
  109. and t.order_id= #{orderId}
  110. </if>
  111. </update>
  112. <!-- 查询订单购物车数量 add by wuxw 2018-07-03 -->
  113. <select id="queryStoreOrderCartsCount" parameterType="Map" resultType="Map">
  114. select count(1) count
  115. from store_order_cart t
  116. where 1 =1
  117. <if test="valueId !=null and valueId != ''">
  118. and t.value_id= #{valueId}
  119. </if>
  120. <if test="productId !=null and productId != ''">
  121. and t.product_id= #{productId}
  122. </if>
  123. <if test="orderId !=null and orderId != ''">
  124. and t.order_id= #{orderId}
  125. </if>
  126. <if test="cartId !=null and cartId != ''">
  127. and t.cart_id= #{cartId}
  128. </if>
  129. <if test="remark !=null and remark != ''">
  130. and t.remark= #{remark}
  131. </if>
  132. <if test="statusCd !=null and statusCd != ''">
  133. and t.status_cd= #{statusCd}
  134. </if>
  135. <if test="storeId !=null and storeId != ''">
  136. and t.store_id= #{storeId}
  137. </if>
  138. <if test="cartNum !=null and cartNum != ''">
  139. and t.cart_num= #{cartNum}
  140. </if>
  141. <if test="price !=null and price != ''">
  142. and t.price= #{price}
  143. </if>
  144. <if test="payPrice !=null and payPrice != ''">
  145. and t.pay_price= #{payPrice}
  146. </if>
  147. <if test="personId !=null and personId != ''">
  148. and t.person_id= #{personId}
  149. </if>
  150. <if test="state !=null and state != ''">
  151. and t.state= #{state}
  152. </if>
  153. <if test="freightPrice !=null and freightPrice != ''">
  154. and t.freight_price= #{freightPrice}
  155. </if>
  156. </select>
  157. </mapper>