CouponShopPoolDetailV1ServiceDaoImplMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="couponShopPoolDetailV1ServiceDaoImpl">
  6. <!-- 保存商家赠送记录信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCouponShopPoolDetailInfo" parameterType="Map">
  8. insert into coupon_shop_pool_detail(
  9. coupon_name,actual_price,validity_day,detail_id,send_count,user_name,sp_id,user_id,pool_id,tel,shop_id,order_id
  10. ) values (
  11. #{couponName},#{actualPrice},#{validityDay},#{detailId},#{sendCount},#{userName},#{spId},#{userId},
  12. #{poolId},#{tel},#{shopId},#{orderId}
  13. )
  14. </insert>
  15. <!-- 查询商家赠送记录信息 add by wuxw 2018-07-03 -->
  16. <select id="getCouponShopPoolDetailInfo" parameterType="Map" resultType="Map">
  17. select t.coupon_name,t.coupon_name couponName,t.actual_price,t.actual_price
  18. actualPrice,t.validity_day,t.validity_day validityDay,t.detail_id,t.detail_id detailId,t.status_cd,t.status_cd
  19. statusCd,t.send_count,t.send_count sendCount,t.user_name,t.user_name userName,t.sp_id,t.sp_id
  20. spId,t.user_id,t.user_id userId,t.pool_id,t.pool_id poolId,t.tel,t.shop_id,t.shop_id shopId,t.order_id orderId
  21. from coupon_shop_pool_detail t
  22. where 1 =1
  23. <if test="couponName !=null and couponName != ''">
  24. and t.coupon_name= #{couponName}
  25. </if>
  26. <if test="actualPrice !=null and actualPrice != ''">
  27. and t.actual_price= #{actualPrice}
  28. </if>
  29. <if test="validityDay !=null and validityDay != ''">
  30. and t.validity_day= #{validityDay}
  31. </if>
  32. <if test="detailId !=null and detailId != ''">
  33. and t.detail_id= #{detailId}
  34. </if>
  35. <if test="orderId !=null and orderId != ''">
  36. and t.order_id= #{orderId}
  37. </if>
  38. <if test="statusCd !=null and statusCd != ''">
  39. and t.status_cd= #{statusCd}
  40. </if>
  41. <if test="sendCount !=null and sendCount != ''">
  42. and t.send_count= #{sendCount}
  43. </if>
  44. <if test="userName !=null and userName != ''">
  45. and t.user_name= #{userName}
  46. </if>
  47. <if test="spId !=null and spId != ''">
  48. and t.sp_id= #{spId}
  49. </if>
  50. <if test="userId !=null and userId != ''">
  51. and t.user_id= #{userId}
  52. </if>
  53. <if test="poolId !=null and poolId != ''">
  54. and t.pool_id= #{poolId}
  55. </if>
  56. <if test="tel !=null and tel != ''">
  57. and t.tel= #{tel}
  58. </if>
  59. <if test="shopId !=null and shopId != ''">
  60. and t.shop_id= #{shopId}
  61. </if>
  62. order by t.create_time desc
  63. <if test="page != -1 and page != null ">
  64. limit #{page}, #{row}
  65. </if>
  66. </select>
  67. <!-- 修改商家赠送记录信息 add by wuxw 2018-07-03 -->
  68. <update id="updateCouponShopPoolDetailInfo" parameterType="Map">
  69. update coupon_shop_pool_detail t set t.status_cd = #{statusCd}
  70. <if test="newBId != null and newBId != ''">
  71. ,t.b_id = #{newBId}
  72. </if>
  73. <if test="couponName !=null and couponName != ''">
  74. , t.coupon_name= #{couponName}
  75. </if>
  76. <if test="actualPrice !=null and actualPrice != ''">
  77. , t.actual_price= #{actualPrice}
  78. </if>
  79. <if test="validityDay !=null and validityDay != ''">
  80. , t.validity_day= #{validityDay}
  81. </if>
  82. <if test="sendCount !=null and sendCount != ''">
  83. , t.send_count= #{sendCount}
  84. </if>
  85. <if test="userName !=null and userName != ''">
  86. , t.user_name= #{userName}
  87. </if>
  88. <if test="spId !=null and spId != ''">
  89. , t.sp_id= #{spId}
  90. </if>
  91. <if test="orderId !=null and orderId != ''">
  92. , t.order_id= #{orderId}
  93. </if>
  94. <if test="userId !=null and userId != ''">
  95. , t.user_id= #{userId}
  96. </if>
  97. <if test="poolId !=null and poolId != ''">
  98. , t.pool_id= #{poolId}
  99. </if>
  100. <if test="tel !=null and tel != ''">
  101. , t.tel= #{tel}
  102. </if>
  103. <if test="shopId !=null and shopId != ''">
  104. , t.shop_id= #{shopId}
  105. </if>
  106. where 1=1
  107. <if test="detailId !=null and detailId != ''">
  108. and t.detail_id= #{detailId}
  109. </if>
  110. </update>
  111. <!-- 查询商家赠送记录数量 add by wuxw 2018-07-03 -->
  112. <select id="queryCouponShopPoolDetailsCount" parameterType="Map" resultType="Map">
  113. select count(1) count
  114. from coupon_shop_pool_detail t
  115. where 1 =1
  116. <if test="couponName !=null and couponName != ''">
  117. and t.coupon_name= #{couponName}
  118. </if>
  119. <if test="actualPrice !=null and actualPrice != ''">
  120. and t.actual_price= #{actualPrice}
  121. </if>
  122. <if test="orderId !=null and orderId != ''">
  123. and t.order_id= #{orderId}
  124. </if>
  125. <if test="validityDay !=null and validityDay != ''">
  126. and t.validity_day= #{validityDay}
  127. </if>
  128. <if test="detailId !=null and detailId != ''">
  129. and t.detail_id= #{detailId}
  130. </if>
  131. <if test="statusCd !=null and statusCd != ''">
  132. and t.status_cd= #{statusCd}
  133. </if>
  134. <if test="sendCount !=null and sendCount != ''">
  135. and t.send_count= #{sendCount}
  136. </if>
  137. <if test="userName !=null and userName != ''">
  138. and t.user_name= #{userName}
  139. </if>
  140. <if test="spId !=null and spId != ''">
  141. and t.sp_id= #{spId}
  142. </if>
  143. <if test="userId !=null and userId != ''">
  144. and t.user_id= #{userId}
  145. </if>
  146. <if test="poolId !=null and poolId != ''">
  147. and t.pool_id= #{poolId}
  148. </if>
  149. <if test="tel !=null and tel != ''">
  150. and t.tel= #{tel}
  151. </if>
  152. <if test="shopId !=null and shopId != ''">
  153. and t.shop_id= #{shopId}
  154. </if>
  155. </select>
  156. </mapper>