OwnerV1ServiceDaoImplMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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="ownerV1ServiceDaoImpl">
  6. <!-- 保存业主信息信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOwnerInfo" parameterType="Map">
  8. insert into building_owner(
  9. id_card,sex,link,owner_type_cd,remark,owner_id,user_id,name,state,community_id,age,member_id
  10. ) values (
  11. #{idCard},#{sex},#{link},#{ownerTypeCd},#{remark},#{ownerId},#{userId},#{name},#{state},#{communityId},#{age},#{memberId}
  12. )
  13. </insert>
  14. <!-- 查询业主信息信息 add by wuxw 2018-07-03 -->
  15. <select id="getOwnerInfo" parameterType="Map" resultType="Map">
  16. select t.id_card,t.id_card idCard,t.sex,t.link,t.owner_type_cd,t.owner_type_cd
  17. ownerTypeCd,t.remark,t.status_cd,t.status_cd statusCd,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id
  18. userId,t.name,t.state,t.community_id,t.community_id communityId,t.age,t.member_id,t.member_id memberId
  19. from building_owner t
  20. where 1 =1
  21. <if test="idCard !=null and idCard != ''">
  22. and t.id_card= #{idCard}
  23. </if>
  24. <if test="sex !=null and sex != ''">
  25. and t.sex= #{sex}
  26. </if>
  27. <if test="link !=null and link != ''">
  28. and t.link= #{link}
  29. </if>
  30. <if test="ownerTypeCd !=null and ownerTypeCd != ''">
  31. and t.owner_type_cd= #{ownerTypeCd}
  32. </if>
  33. <if test="remark !=null and remark != ''">
  34. and t.remark= #{remark}
  35. </if>
  36. <if test="statusCd !=null and statusCd != ''">
  37. and t.status_cd= #{statusCd}
  38. </if>
  39. <if test="ownerId !=null and ownerId != ''">
  40. and t.owner_id= #{ownerId}
  41. </if>
  42. <if test="userId !=null and userId != ''">
  43. and t.user_id= #{userId}
  44. </if>
  45. <if test="name !=null and name != ''">
  46. and t.name= #{name}
  47. </if>
  48. <if test="state !=null and state != ''">
  49. and t.state= #{state}
  50. </if>
  51. <if test="communityId !=null and communityId != ''">
  52. and t.community_id= #{communityId}
  53. </if>
  54. <if test="age !=null and age != ''">
  55. and t.age= #{age}
  56. </if>
  57. <if test="memberId !=null and memberId != ''">
  58. and t.member_id= #{memberId}
  59. </if>
  60. order by t.create_time desc
  61. <if test="page != -1 and page != null ">
  62. limit #{page}, #{row}
  63. </if>
  64. </select>
  65. <!-- 修改业主信息信息 add by wuxw 2018-07-03 -->
  66. <update id="updateOwnerInfo" parameterType="Map">
  67. update building_owner t set t.status_cd = #{statusCd}
  68. <if test="newBId != null and newBId != ''">
  69. ,t.b_id = #{newBId}
  70. </if>
  71. <if test="idCard !=null and idCard != ''">
  72. , t.id_card= #{idCard}
  73. </if>
  74. <if test="sex !=null and sex != ''">
  75. , t.sex= #{sex}
  76. </if>
  77. <if test="link !=null and link != ''">
  78. , t.link= #{link}
  79. </if>
  80. <if test="ownerTypeCd !=null and ownerTypeCd != ''">
  81. , t.owner_type_cd= #{ownerTypeCd}
  82. </if>
  83. <if test="remark !=null and remark != ''">
  84. , t.remark= #{remark}
  85. </if>
  86. <if test="ownerId !=null and ownerId != ''">
  87. , t.owner_id= #{ownerId}
  88. </if>
  89. <if test="userId !=null and userId != ''">
  90. , t.user_id= #{userId}
  91. </if>
  92. <if test="name !=null and name != ''">
  93. , t.name= #{name}
  94. </if>
  95. <if test="state !=null and state != ''">
  96. , t.state= #{state}
  97. </if>
  98. <if test="communityId !=null and communityId != ''">
  99. , t.community_id= #{communityId}
  100. </if>
  101. <if test="age !=null and age != ''">
  102. , t.age= #{age}
  103. </if>
  104. where 1=1
  105. <if test="memberId !=null and memberId != ''">
  106. and t.member_id= #{memberId}
  107. </if>
  108. </update>
  109. <!-- 查询业主信息数量 add by wuxw 2018-07-03 -->
  110. <select id="queryOwnersCount" parameterType="Map" resultType="Map">
  111. select count(1) count
  112. from building_owner t
  113. where 1 =1
  114. <if test="idCard !=null and idCard != ''">
  115. and t.id_card= #{idCard}
  116. </if>
  117. <if test="sex !=null and sex != ''">
  118. and t.sex= #{sex}
  119. </if>
  120. <if test="link !=null and link != ''">
  121. and t.link= #{link}
  122. </if>
  123. <if test="ownerTypeCd !=null and ownerTypeCd != ''">
  124. and t.owner_type_cd= #{ownerTypeCd}
  125. </if>
  126. <if test="remark !=null and remark != ''">
  127. and t.remark= #{remark}
  128. </if>
  129. <if test="statusCd !=null and statusCd != ''">
  130. and t.status_cd= #{statusCd}
  131. </if>
  132. <if test="ownerId !=null and ownerId != ''">
  133. and t.owner_id= #{ownerId}
  134. </if>
  135. <if test="userId !=null and userId != ''">
  136. and t.user_id= #{userId}
  137. </if>
  138. <if test="name !=null and name != ''">
  139. and t.name= #{name}
  140. </if>
  141. <if test="state !=null and state != ''">
  142. and t.state= #{state}
  143. </if>
  144. <if test="communityId !=null and communityId != ''">
  145. and t.community_id= #{communityId}
  146. </if>
  147. <if test="age !=null and age != ''">
  148. and t.age= #{age}
  149. </if>
  150. <if test="memberId !=null and memberId != ''">
  151. and t.member_id= #{memberId}
  152. </if>
  153. </select>
  154. </mapper>