CouponPropertyPoolDetailV1ServiceDaoImplMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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="couponPropertyPoolDetailV1ServiceDaoImpl">
  6. <!-- 保存赠送明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCouponPropertyPoolDetailInfo" parameterType="Map">
  8. insert into coupon_property_pool_detail(
  9. coupon_name,detail_id,cpp_id,tel,community_id,send_count,user_name,value,user_id
  10. ) values (
  11. #{couponName},#{detailId},#{cppId},#{tel},#{communityId},#{sendCount},#{userName},#{value},#{userId}
  12. )
  13. </insert>
  14. <!-- 查询赠送明细信息 add by wuxw 2018-07-03 -->
  15. <select id="getCouponPropertyPoolDetailInfo" parameterType="Map" resultType="Map">
  16. select t.coupon_name,t.coupon_name couponName,t.detail_id,t.detail_id detailId,t.cpp_id,t.cpp_id
  17. cppId,t.tel,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.send_count,t.send_count
  18. sendCount,t.user_name,t.user_name userName,t.value,t.user_id,t.user_id userId,t.create_time createTime
  19. from coupon_property_pool_detail t
  20. where 1 =1
  21. <if test="couponName !=null and couponName != ''">
  22. and t.coupon_name= #{couponName}
  23. </if>
  24. <if test="detailId !=null and detailId != ''">
  25. and t.detail_id= #{detailId}
  26. </if>
  27. <if test="cppId !=null and cppId != ''">
  28. and t.cpp_id= #{cppId}
  29. </if>
  30. <if test="tel !=null and tel != ''">
  31. and t.tel= #{tel}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="communityId !=null and communityId != ''">
  37. and t.community_id= #{communityId}
  38. </if>
  39. <if test="sendCount !=null and sendCount != ''">
  40. and t.send_count= #{sendCount}
  41. </if>
  42. <if test="userName !=null and userName != ''">
  43. and t.user_name= #{userName}
  44. </if>
  45. <if test="value !=null and value != ''">
  46. and t.value= #{value}
  47. </if>
  48. <if test="couponUserId !=null and couponUserId != ''">
  49. and t.user_id= #{couponUserId}
  50. </if>
  51. order by t.create_time desc
  52. <if test="page != -1 and page != null ">
  53. limit #{page}, #{row}
  54. </if>
  55. </select>
  56. <!-- 修改赠送明细信息 add by wuxw 2018-07-03 -->
  57. <update id="updateCouponPropertyPoolDetailInfo" parameterType="Map">
  58. update coupon_property_pool_detail t set t.status_cd = #{statusCd}
  59. <if test="newBId != null and newBId != ''">
  60. ,t.b_id = #{newBId}
  61. </if>
  62. <if test="couponName !=null and couponName != ''">
  63. , t.coupon_name= #{couponName}
  64. </if>
  65. <if test="cppId !=null and cppId != ''">
  66. , t.cpp_id= #{cppId}
  67. </if>
  68. <if test="tel !=null and tel != ''">
  69. , t.tel= #{tel}
  70. </if>
  71. <if test="communityId !=null and communityId != ''">
  72. , t.community_id= #{communityId}
  73. </if>
  74. <if test="sendCount !=null and sendCount != ''">
  75. , t.send_count= #{sendCount}
  76. </if>
  77. <if test="userName !=null and userName != ''">
  78. , t.user_name= #{userName}
  79. </if>
  80. <if test="value !=null and value != ''">
  81. , t.value= #{value}
  82. </if>
  83. <if test="userId !=null and userId != ''">
  84. , t.user_id= #{userId}
  85. </if>
  86. where 1=1
  87. <if test="detailId !=null and detailId != ''">
  88. and t.detail_id= #{detailId}
  89. </if>
  90. </update>
  91. <!-- 查询赠送明细数量 add by wuxw 2018-07-03 -->
  92. <select id="queryCouponPropertyPoolDetailsCount" parameterType="Map" resultType="Map">
  93. select count(1) count
  94. from coupon_property_pool_detail t
  95. where 1 =1
  96. <if test="couponName !=null and couponName != ''">
  97. and t.coupon_name= #{couponName}
  98. </if>
  99. <if test="detailId !=null and detailId != ''">
  100. and t.detail_id= #{detailId}
  101. </if>
  102. <if test="cppId !=null and cppId != ''">
  103. and t.cpp_id= #{cppId}
  104. </if>
  105. <if test="tel !=null and tel != ''">
  106. and t.tel= #{tel}
  107. </if>
  108. <if test="statusCd !=null and statusCd != ''">
  109. and t.status_cd= #{statusCd}
  110. </if>
  111. <if test="communityId !=null and communityId != ''">
  112. and t.community_id= #{communityId}
  113. </if>
  114. <if test="sendCount !=null and sendCount != ''">
  115. and t.send_count= #{sendCount}
  116. </if>
  117. <if test="userName !=null and userName != ''">
  118. and t.user_name= #{userName}
  119. </if>
  120. <if test="value !=null and value != ''">
  121. and t.value= #{value}
  122. </if>
  123. <if test="couponUserId !=null and couponUserId != ''">
  124. and t.user_id= #{couponUserId}
  125. </if>
  126. </select>
  127. </mapper>