IntegralGiftDetailV1ServiceDaoImplMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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="integralGiftDetailV1ServiceDaoImpl">
  6. <!-- 保存积分赠送信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveIntegralGiftDetailInfo" parameterType="Map">
  8. insert into integral_gift_detail(
  9. config_name,create_user_id,quantity,detail_id,user_name,config_id,rule_name,tel,community_id,rule_id
  10. ) values (
  11. #{configName},#{createUserId},#{quantity},#{detailId},#{userName},#{configId},#{ruleName},#{tel},#{communityId},#{ruleId}
  12. )
  13. </insert>
  14. <!-- 查询积分赠送信息 add by wuxw 2018-07-03 -->
  15. <select id="getIntegralGiftDetailInfo" parameterType="Map" resultType="Map">
  16. select t.config_name,t.config_name configName,t.create_user_id,t.create_user_id
  17. createUserId,t.quantity,t.detail_id,t.detail_id detailId,t.status_cd,t.status_cd
  18. statusCd,t.user_name,t.user_name userName,t.config_id,t.config_id
  19. configId,t.rule_name,t.rule_name
  20. ruleName,t.tel,t.community_id,t.community_id communityId,t.rule_id,t.rule_id ruleId,t.create_time createTime
  21. from integral_gift_detail t
  22. where 1 =1
  23. <if test="configName !=null and configName != ''">
  24. and t.config_name= #{configName}
  25. </if>
  26. <if test="createUserId !=null and createUserId != ''">
  27. and t.create_user_id= #{createUserId}
  28. </if>
  29. <if test="quantity !=null and quantity != ''">
  30. and t.quantity= #{quantity}
  31. </if>
  32. <if test="detailId !=null and detailId != ''">
  33. and t.detail_id= #{detailId}
  34. </if>
  35. <if test="statusCd !=null and statusCd != ''">
  36. and t.status_cd= #{statusCd}
  37. </if>
  38. <if test="userNameLike !=null and userNameLike != ''">
  39. and t.user_name concat('%', #{userNameLike},'%')
  40. </if>
  41. <if test="configId !=null and configId != ''">
  42. and t.config_id= #{configId}
  43. </if>
  44. <if test="ruleName !=null and ruleName != ''">
  45. and t.rule_name= #{ruleName}
  46. </if>
  47. <if test="tel !=null and tel != ''">
  48. and t.tel= #{tel}
  49. </if>
  50. <if test="communityId !=null and communityId != ''">
  51. and t.community_id= #{communityId}
  52. </if>
  53. <if test="ruleId !=null and ruleId != ''">
  54. and t.rule_id= #{ruleId}
  55. </if>
  56. order by t.create_time desc
  57. <if test="page != -1 and page != null ">
  58. limit #{page}, #{row}
  59. </if>
  60. </select>
  61. <!-- 修改积分赠送信息 add by wuxw 2018-07-03 -->
  62. <update id="updateIntegralGiftDetailInfo" parameterType="Map">
  63. update integral_gift_detail t set t.status_cd = #{statusCd}
  64. <if test="newBId != null and newBId != ''">
  65. ,t.b_id = #{newBId}
  66. </if>
  67. <if test="configName !=null and configName != ''">
  68. , t.config_name= #{configName}
  69. </if>
  70. <if test="createUserId !=null and createUserId != ''">
  71. , t.create_user_id= #{createUserId}
  72. </if>
  73. <if test="quantity !=null and quantity != ''">
  74. , t.quantity= #{quantity}
  75. </if>
  76. <if test="userName !=null and userName != ''">
  77. , t.user_name= #{userName}
  78. </if>
  79. <if test="configId !=null and configId != ''">
  80. , t.config_id= #{configId}
  81. </if>
  82. <if test="ruleName !=null and ruleName != ''">
  83. , t.rule_name= #{ruleName}
  84. </if>
  85. <if test="tel !=null and tel != ''">
  86. , t.tel= #{tel}
  87. </if>
  88. <if test="communityId !=null and communityId != ''">
  89. , t.community_id= #{communityId}
  90. </if>
  91. <if test="ruleId !=null and ruleId != ''">
  92. , t.rule_id= #{ruleId}
  93. </if>
  94. where 1=1
  95. <if test="detailId !=null and detailId != ''">
  96. and t.detail_id= #{detailId}
  97. </if>
  98. </update>
  99. <!-- 查询积分赠送数量 add by wuxw 2018-07-03 -->
  100. <select id="queryIntegralGiftDetailsCount" parameterType="Map" resultType="Map">
  101. select count(1) count
  102. from integral_gift_detail t
  103. where 1 =1
  104. <if test="configName !=null and configName != ''">
  105. and t.config_name= #{configName}
  106. </if>
  107. <if test="createUserId !=null and createUserId != ''">
  108. and t.create_user_id= #{createUserId}
  109. </if>
  110. <if test="quantity !=null and quantity != ''">
  111. and t.quantity= #{quantity}
  112. </if>
  113. <if test="detailId !=null and detailId != ''">
  114. and t.detail_id= #{detailId}
  115. </if>
  116. <if test="statusCd !=null and statusCd != ''">
  117. and t.status_cd= #{statusCd}
  118. </if>
  119. <if test="userNameLike !=null and userNameLike != ''">
  120. and t.user_name concat('%', #{userNameLike},'%')
  121. </if>
  122. <if test="configId !=null and configId != ''">
  123. and t.config_id= #{configId}
  124. </if>
  125. <if test="ruleName !=null and ruleName != ''">
  126. and t.rule_name= #{ruleName}
  127. </if>
  128. <if test="tel !=null and tel != ''">
  129. and t.tel= #{tel}
  130. </if>
  131. <if test="communityId !=null and communityId != ''">
  132. and t.community_id= #{communityId}
  133. </if>
  134. <if test="ruleId !=null and ruleId != ''">
  135. and t.rule_id= #{ruleId}
  136. </if>
  137. </select>
  138. </mapper>