WechatSubscribeV1ServiceDaoImplMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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="wechatSubscribeV1ServiceDaoImpl">
  6. <!-- 保存微信关注信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveWechatSubscribeInfo" parameterType="Map">
  8. insert into wechat_subscribe(
  9. sub_id,open_id,app_id,nickname,headimgurl,user_id,open_type
  10. ) values (
  11. #{subId},#{openId},#{appId},#{nickname},#{headimgurl},#{userId},#{openType}
  12. )
  13. </insert>
  14. <insert id="saveWechatSubscribeInfos" parameterType="Map">
  15. insert into wechat_subscribe(
  16. sub_id,open_id,app_id,nickname,headimgurl,user_id,open_type
  17. ) values
  18. <foreach collection="wechatSubscribes" item="item" separator=",">
  19. (#{item.subId},#{item.openId},#{item.appId},#{item.nickname},#{item.headimgurl},#{item.userId},#{item.openType})
  20. </foreach>
  21. </insert>
  22. <insert id="insertFees" parameterType="Map">
  23. insert into pay_fee (amount,status_cd,income_obj_id,fee_type_cd,start_time,end_time,community_id,b_id,fee_id,
  24. user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type,batch_id)
  25. VALUES
  26. <foreach collection="payFeePos" item="item" separator=",">
  27. (#{item.amount},'0',#{item.incomeObjId},#{item.feeTypeCd},#{item.startTime},#{item.endTime},#{item.communityId},
  28. '-1',#{item.feeId},#{item.userId},#{item.payerObjId},#{item.feeFlag},#{item.state},#{item.configId},#{item.payerObjType},#{item.batchId})
  29. </foreach>
  30. </insert>
  31. <!-- 查询微信关注信息 add by wuxw 2018-07-03 -->
  32. <select id="getWechatSubscribeInfo" parameterType="Map" resultType="Map">
  33. select t.sub_id,t.sub_id subId,t.open_id,t.open_id openId,t.app_id,t.app_id
  34. appId,t.nickname,t.headimgurl,t.status_cd,t.status_cd statusCd,t.user_id,t.user_id
  35. userId,t.open_type,t.open_type openType
  36. from wechat_subscribe t
  37. where 1 =1
  38. <if test="subId !=null and subId != ''">
  39. and t.sub_id= #{subId}
  40. </if>
  41. <if test="openId !=null and openId != ''">
  42. and t.open_id= #{openId}
  43. </if>
  44. <if test="appId !=null and appId != ''">
  45. and t.app_id= #{appId}
  46. </if>
  47. <if test="nickname !=null and nickname != ''">
  48. and t.nickname= #{nickname}
  49. </if>
  50. <if test="headimgurl !=null and headimgurl != ''">
  51. and t.headimgurl= #{headimgurl}
  52. </if>
  53. <if test="statusCd !=null and statusCd != ''">
  54. and t.status_cd= #{statusCd}
  55. </if>
  56. <if test="userId !=null and userId != ''">
  57. and t.user_id= #{userId}
  58. </if>
  59. <if test="openType !=null and openType != ''">
  60. and t.open_type= #{openType}
  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="updateWechatSubscribeInfo" parameterType="Map">
  69. update wechat_subscribe t set t.status_cd = #{statusCd}
  70. <if test="newBId != null and newBId != ''">
  71. ,t.b_id = #{newBId}
  72. </if>
  73. <if test="openId !=null and openId != ''">
  74. , t.open_id= #{openId}
  75. </if>
  76. <if test="nickname !=null and nickname != ''">
  77. , t.nickname= #{nickname}
  78. </if>
  79. <if test="headimgurl !=null and headimgurl != ''">
  80. , t.headimgurl= #{headimgurl}
  81. </if>
  82. <if test="userId !=null and userId != ''">
  83. , t.user_id= #{userId}
  84. </if>
  85. <if test="openType !=null and openType != ''">
  86. , t.open_type= #{openType}
  87. </if>
  88. where 1=1
  89. <if test="subId !=null and subId != ''">
  90. and t.sub_id= #{subId}
  91. </if>
  92. <if test="appId !=null and appId != ''">
  93. and t.app_id= #{appId}
  94. </if>
  95. </update>
  96. <!-- 查询微信关注数量 add by wuxw 2018-07-03 -->
  97. <select id="queryWechatSubscribesCount" parameterType="Map" resultType="Map">
  98. select count(1) count
  99. from wechat_subscribe t
  100. where 1 =1
  101. <if test="subId !=null and subId != ''">
  102. and t.sub_id= #{subId}
  103. </if>
  104. <if test="openId !=null and openId != ''">
  105. and t.open_id= #{openId}
  106. </if>
  107. <if test="appId !=null and appId != ''">
  108. and t.app_id= #{appId}
  109. </if>
  110. <if test="nickname !=null and nickname != ''">
  111. and t.nickname= #{nickname}
  112. </if>
  113. <if test="headimgurl !=null and headimgurl != ''">
  114. and t.headimgurl= #{headimgurl}
  115. </if>
  116. <if test="statusCd !=null and statusCd != ''">
  117. and t.status_cd= #{statusCd}
  118. </if>
  119. <if test="userId !=null and userId != ''">
  120. and t.user_id= #{userId}
  121. </if>
  122. <if test="openType !=null and openType != ''">
  123. and t.open_type= #{openType}
  124. </if>
  125. </select>
  126. </mapper>