CouponShopPoolV1ServiceDaoImplMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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="couponShopPoolV1ServiceDaoImpl">
  6. <!-- 保存商家优惠券池信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCouponShopPoolInfo" parameterType="Map">
  8. insert into coupon_shop_pool(
  9. coupon_name,actual_price,validity_day,pool_id,shop_id,stock,sp_id
  10. ) values (
  11. #{couponName},#{actualPrice},#{validityDay},#{poolId},#{shopId},#{stock},#{spId}
  12. )
  13. </insert>
  14. <!-- 查询商家优惠券池信息 add by wuxw 2018-07-03 -->
  15. <select id="getCouponShopPoolInfo" parameterType="Map" resultType="Map">
  16. select t.coupon_name,t.coupon_name couponName,t.actual_price,t.actual_price
  17. actualPrice,t.validity_day,t.validity_day validityDay,t.pool_id,t.pool_id poolId,t.status_cd,t.status_cd
  18. statusCd,t.shop_id,t.shop_id shopId,t.stock,t.sp_id,t.sp_id spId
  19. from coupon_shop_pool t
  20. where 1 =1
  21. <if test="couponName !=null and couponName != ''">
  22. and t.coupon_name= #{couponName}
  23. </if>
  24. <if test="actualPrice !=null and actualPrice != ''">
  25. and t.actual_price= #{actualPrice}
  26. </if>
  27. <if test="validityDay !=null and validityDay != ''">
  28. and t.validity_day= #{validityDay}
  29. </if>
  30. <if test="poolId !=null and poolId != ''">
  31. and t.pool_id= #{poolId}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="shopId !=null and shopId != ''">
  37. and t.shop_id= #{shopId}
  38. </if>
  39. <if test="stock !=null and stock != ''">
  40. and t.stock= #{stock}
  41. </if>
  42. <if test="spId !=null and spId != ''">
  43. and t.sp_id= #{spId}
  44. </if>
  45. order by t.create_time desc
  46. <if test="page != -1 and page != null ">
  47. limit #{page}, #{row}
  48. </if>
  49. </select>
  50. <!-- 修改商家优惠券池信息 add by wuxw 2018-07-03 -->
  51. <update id="updateCouponShopPoolInfo" parameterType="Map">
  52. update coupon_shop_pool t set t.status_cd = #{statusCd}
  53. <if test="newBId != null and newBId != ''">
  54. ,t.b_id = #{newBId}
  55. </if>
  56. <if test="couponName !=null and couponName != ''">
  57. , t.coupon_name= #{couponName}
  58. </if>
  59. <if test="actualPrice !=null and actualPrice != ''">
  60. , t.actual_price= #{actualPrice}
  61. </if>
  62. <if test="validityDay !=null and validityDay != ''">
  63. , t.validity_day= #{validityDay}
  64. </if>
  65. <if test="poolId !=null and poolId != ''">
  66. , t.pool_id= #{poolId}
  67. </if>
  68. <if test="shopId !=null and shopId != ''">
  69. , t.shop_id= #{shopId}
  70. </if>
  71. <if test="stock !=null and stock != ''">
  72. , t.stock= #{stock}
  73. </if>
  74. where 1=1
  75. <if test="spId !=null and spId != ''">
  76. and t.sp_id= #{spId}
  77. </if>
  78. </update>
  79. <!-- 查询商家优惠券池数量 add by wuxw 2018-07-03 -->
  80. <select id="queryCouponShopPoolsCount" parameterType="Map" resultType="Map">
  81. select count(1) count
  82. from coupon_shop_pool t
  83. where 1 =1
  84. <if test="couponName !=null and couponName != ''">
  85. and t.coupon_name= #{couponName}
  86. </if>
  87. <if test="actualPrice !=null and actualPrice != ''">
  88. and t.actual_price= #{actualPrice}
  89. </if>
  90. <if test="validityDay !=null and validityDay != ''">
  91. and t.validity_day= #{validityDay}
  92. </if>
  93. <if test="poolId !=null and poolId != ''">
  94. and t.pool_id= #{poolId}
  95. </if>
  96. <if test="statusCd !=null and statusCd != ''">
  97. and t.status_cd= #{statusCd}
  98. </if>
  99. <if test="shopId !=null and shopId != ''">
  100. and t.shop_id= #{shopId}
  101. </if>
  102. <if test="stock !=null and stock != ''">
  103. and t.stock= #{stock}
  104. </if>
  105. <if test="spId !=null and spId != ''">
  106. and t.sp_id= #{spId}
  107. </if>
  108. </select>
  109. </mapper>