OwnerAppUserV1ServiceDaoImplMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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="ownerAppUserV1ServiceDaoImpl">
  6. <!-- 保存业主绑定信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOwnerAppUserInfo" parameterType="Map">
  8. insert into owner_app_user(
  9. id_card,open_id,link,remark,user_id,app_type,app_user_name,nickname,headimgurl,community_name,state,app_user_id,
  10. community_id,app_type_cd,member_id,room_id,room_name,owner_type_cd
  11. ) values (
  12. #{idCard},#{openId},#{link},#{remark},#{userId},#{appType},#{appUserName},#{nickname},#{headimgurl},#{communityName},#{state},#{appUserId},
  13. #{communityId},#{appTypeCd},#{memberId},#{roomId},#{roomName},#{ownerTypeCd}
  14. )
  15. </insert>
  16. <!-- 查询业主绑定信息 add by wuxw 2018-07-03 -->
  17. <select id="getOwnerAppUserInfo" parameterType="Map" resultType="Map">
  18. select t.id_card,t.id_card idCard,t.open_id,t.open_id openId,t.link,t.remark,t.status_cd,t.status_cd
  19. statusCd,t.user_id,t.user_id userId,t.app_type,t.app_type appType,t.app_user_name,t.app_user_name
  20. appUserName,t.nickname,t.headimgurl,t.community_name,t.community_name
  21. communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
  22. communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.member_id,t.member_id memberId,
  23. t.room_id roomId,t.room_name roomName,t.owner_type_cd ownerTypeCd
  24. from owner_app_user t
  25. where 1 =1
  26. <if test="idCard !=null and idCard != ''">
  27. and t.id_card= #{idCard}
  28. </if>
  29. <if test="openId !=null and openId != ''">
  30. and t.open_id= #{openId}
  31. </if>
  32. <if test="link !=null and link != ''">
  33. and t.link= #{link}
  34. </if>
  35. <if test="remark !=null and remark != ''">
  36. and t.remark= #{remark}
  37. </if>
  38. <if test="statusCd !=null and statusCd != ''">
  39. and t.status_cd= #{statusCd}
  40. </if>
  41. <if test="appType !=null and appType != ''">
  42. and t.app_type= #{appType}
  43. </if>
  44. <if test="appUserName !=null and appUserName != ''">
  45. and t.app_user_name= #{appUserName}
  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="communityName !=null and communityName != ''">
  54. and t.community_name= #{communityName}
  55. </if>
  56. <if test="state !=null and state != ''">
  57. and t.state= #{state}
  58. </if>
  59. <if test="appUserId !=null and appUserId != ''">
  60. and t.app_user_id= #{appUserId}
  61. </if>
  62. <if test="communityId !=null and communityId != ''">
  63. and t.community_id= #{communityId}
  64. </if>
  65. <if test="appTypeCd !=null and appTypeCd != ''">
  66. and t.app_type_cd= #{appTypeCd}
  67. </if>
  68. <if test="memberId !=null and memberId != ''">
  69. and t.member_id= #{memberId}
  70. </if>
  71. <if test="userId !=null and userId != ''">
  72. and t.user_id= #{userId}
  73. </if>
  74. order by t.create_time desc
  75. <if test="page != -1 and page != null ">
  76. limit #{page}, #{row}
  77. </if>
  78. </select>
  79. <!-- 修改业主绑定信息 add by wuxw 2018-07-03 -->
  80. <update id="updateOwnerAppUserInfo" parameterType="Map">
  81. update owner_app_user t set t.status_cd = #{statusCd}
  82. <if test="newBId != null and newBId != ''">
  83. ,t.b_id = #{newBId}
  84. </if>
  85. <if test="idCard !=null and idCard != ''">
  86. , t.id_card= #{idCard}
  87. </if>
  88. <if test="openId !=null and openId != ''">
  89. , t.open_id= #{openId}
  90. </if>
  91. <if test="link !=null and link != ''">
  92. , t.link= #{link}
  93. </if>
  94. <if test="remark !=null and remark != ''">
  95. , t.remark= #{remark}
  96. </if>
  97. <if test="userId !=null and userId != ''">
  98. , t.user_id= #{userId}
  99. </if>
  100. <if test="appType !=null and appType != ''">
  101. , t.app_type= #{appType}
  102. </if>
  103. <if test="appUserName !=null and appUserName != ''">
  104. , t.app_user_name= #{appUserName}
  105. </if>
  106. <if test="nickname !=null and nickname != ''">
  107. , t.nickname= #{nickname}
  108. </if>
  109. <if test="headimgurl !=null and headimgurl != ''">
  110. , t.headimgurl= #{headimgurl}
  111. </if>
  112. <if test="communityName !=null and communityName != ''">
  113. , t.community_name= #{communityName}
  114. </if>
  115. <if test="state !=null and state != ''">
  116. , t.state= #{state}
  117. </if>
  118. <if test="communityId !=null and communityId != ''">
  119. , t.community_id= #{communityId}
  120. </if>
  121. <if test="appTypeCd !=null and appTypeCd != ''">
  122. , t.app_type_cd= #{appTypeCd}
  123. </if>
  124. <if test="memberId !=null and memberId != ''">
  125. , t.member_id= #{memberId}
  126. </if>
  127. <if test="roomId !=null and roomId != ''">
  128. , t.room_id= #{roomId}
  129. </if>
  130. <if test="roomName !=null and roomName != ''">
  131. , t.room_name= #{roomName}
  132. </if>
  133. <if test="ownerTypeCd !=null and ownerTypeCd != ''">
  134. , t.owner_type_cd= #{ownerTypeCd}
  135. </if>
  136. where 1=1
  137. <if test="appUserId !=null and appUserId != ''">
  138. and t.app_user_id= #{appUserId}
  139. </if>
  140. </update>
  141. <!-- 查询业主绑定数量 add by wuxw 2018-07-03 -->
  142. <select id="queryOwnerAppUsersCount" parameterType="Map" resultType="Map">
  143. select count(1) count
  144. from owner_app_user t
  145. where 1 =1
  146. <if test="idCard !=null and idCard != ''">
  147. and t.id_card= #{idCard}
  148. </if>
  149. <if test="openId !=null and openId != ''">
  150. and t.open_id= #{openId}
  151. </if>
  152. <if test="link !=null and link != ''">
  153. and t.link= #{link}
  154. </if>
  155. <if test="remark !=null and remark != ''">
  156. and t.remark= #{remark}
  157. </if>
  158. <if test="statusCd !=null and statusCd != ''">
  159. and t.status_cd= #{statusCd}
  160. </if>
  161. <if test="appType !=null and appType != ''">
  162. and t.app_type= #{appType}
  163. </if>
  164. <if test="appUserName !=null and appUserName != ''">
  165. and t.app_user_name= #{appUserName}
  166. </if>
  167. <if test="nickname !=null and nickname != ''">
  168. and t.nickname= #{nickname}
  169. </if>
  170. <if test="headimgurl !=null and headimgurl != ''">
  171. and t.headimgurl= #{headimgurl}
  172. </if>
  173. <if test="communityName !=null and communityName != ''">
  174. and t.community_name= #{communityName}
  175. </if>
  176. <if test="state !=null and state != ''">
  177. and t.state= #{state}
  178. </if>
  179. <if test="appUserId !=null and appUserId != ''">
  180. and t.app_user_id= #{appUserId}
  181. </if>
  182. <if test="communityId !=null and communityId != ''">
  183. and t.community_id= #{communityId}
  184. </if>
  185. <if test="appTypeCd !=null and appTypeCd != ''">
  186. and t.app_type_cd= #{appTypeCd}
  187. </if>
  188. <if test="memberId !=null and memberId != ''">
  189. and t.member_id= #{memberId}
  190. </if>
  191. <if test="userId !=null and userId != ''">
  192. and t.user_id= #{userId}
  193. </if>
  194. </select>
  195. </mapper>