CommunityMemberV1ServiceDaoImplMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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="communityMemberV1ServiceDaoImpl">
  6. <!-- 保存小区成员信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCommunityMemberInfo" parameterType="Map">
  8. insert into s_community_member(
  9. member_type_cd,start_time,end_time,community_id,community_member_id,member_id,audit_status_cd
  10. ) values (
  11. #{memberTypeCd},#{startTime},#{endTime},#{communityId},#{communityMemberId},#{memberId},#{auditStatusCd}
  12. )
  13. </insert>
  14. <!-- 查询小区成员信息 add by wuxw 2018-07-03 -->
  15. <select id="getCommunityMemberInfo" parameterType="Map" resultType="Map">
  16. select t.member_type_cd,t.member_type_cd memberTypeCd,t.status_cd,t.status_cd statusCd,t.start_time,t.start_time
  17. startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
  18. communityId,t.community_member_id,t.community_member_id communityMemberId,t.member_id,t.member_id memberId,t.audit_status_cd auditStatusCd
  19. from s_community_member t
  20. where 1 =1
  21. <if test="memberTypeCd !=null and memberTypeCd != ''">
  22. and t.member_type_cd= #{memberTypeCd}
  23. </if>
  24. <if test="statusCd !=null and statusCd != ''">
  25. and t.status_cd= #{statusCd}
  26. </if>
  27. <if test="startTime !=null and startTime != ''">
  28. and t.start_time= #{startTime}
  29. </if>
  30. <if test="endTime !=null and endTime != ''">
  31. and t.end_time= #{endTime}
  32. </if>
  33. <if test="communityId !=null and communityId != ''">
  34. and t.community_id= #{communityId}
  35. </if>
  36. <if test="communityMemberId !=null and communityMemberId != ''">
  37. and t.community_member_id= #{communityMemberId}
  38. </if>
  39. <if test="auditStatusCd !=null and auditStatusCd != ''">
  40. and t.audit_status_cd= #{auditStatusCd}
  41. </if>
  42. <if test="memberId !=null and memberId != ''">
  43. and t.member_id= #{memberId}
  44. </if>
  45. order by t.create_time desc
  46. <if test="page != -1 and page != null ">
  47. limit #{page}, #{row}
  48. </if>
  49. </select>
  50. <!-- 修改小区成员信息 add by wuxw 2018-07-03 -->
  51. <update id="updateCommunityMemberInfo" parameterType="Map">
  52. update s_community_member t set t.status_cd = #{statusCd}
  53. <if test="newBId != null and newBId != ''">
  54. ,t.b_id = #{newBId}
  55. </if>
  56. <if test="memberTypeCd !=null and memberTypeCd != ''">
  57. , t.member_type_cd= #{memberTypeCd}
  58. </if>
  59. <if test="startTime !=null and startTime != ''">
  60. , t.start_time= #{startTime}
  61. </if>
  62. <if test="endTime !=null and endTime != ''">
  63. , t.end_time= #{endTime}
  64. </if>
  65. <if test="communityMemberId !=null and communityMemberId != ''">
  66. , t.community_member_id= #{communityMemberId}
  67. </if>
  68. <if test="auditStatusCd !=null and auditStatusCd != ''">
  69. , t.audit_status_cd= #{auditStatusCd}
  70. </if>
  71. where 1=1
  72. <if test="memberId !=null and memberId != ''">
  73. and t.member_id= #{memberId}
  74. </if>
  75. <if test="communityId !=null and communityId != ''">
  76. and t.community_id= #{communityId}
  77. </if>
  78. </update>
  79. <!-- 查询小区成员数量 add by wuxw 2018-07-03 -->
  80. <select id="queryCommunityMembersCount" parameterType="Map" resultType="Map">
  81. select count(1) count
  82. from s_community_member t
  83. where 1 =1
  84. <if test="memberTypeCd !=null and memberTypeCd != ''">
  85. and t.member_type_cd= #{memberTypeCd}
  86. </if>
  87. <if test="statusCd !=null and statusCd != ''">
  88. and t.status_cd= #{statusCd}
  89. </if>
  90. <if test="startTime !=null and startTime != ''">
  91. and t.start_time= #{startTime}
  92. </if>
  93. <if test="endTime !=null and endTime != ''">
  94. and t.end_time= #{endTime}
  95. </if>
  96. <if test="communityId !=null and communityId != ''">
  97. and t.community_id= #{communityId}
  98. </if>
  99. <if test="communityMemberId !=null and communityMemberId != ''">
  100. and t.community_member_id= #{communityMemberId}
  101. </if>
  102. <if test="auditStatusCd !=null and auditStatusCd != ''">
  103. and t.audit_status_cd= #{auditStatusCd}
  104. </if>
  105. <if test="memberId !=null and memberId != ''">
  106. and t.member_id= #{memberId}
  107. </if>
  108. </select>
  109. </mapper>