CommunityPublicityV1ServiceDaoImplMapper.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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="communityPublicityV1ServiceDaoImpl">
  6. <!-- 保存小区公示信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCommunityPublicityInfo" parameterType="Map">
  8. insert into community_publicity(
  9. create_user_id,pub_id,context,collect_count,pub_type,like_count,create_user_name,title,community_id,read_count,header_img
  10. ) values (
  11. #{createUserId},#{pubId},#{context},#{collectCount},#{pubType},#{likeCount},#{createUserName},#{title},#{communityId},#{readCount},#{headerImg}
  12. )
  13. </insert>
  14. <!-- 查询小区公示信息 add by wuxw 2018-07-03 -->
  15. <select id="getCommunityPublicityInfo" parameterType="Map" resultType="Map">
  16. select t.create_user_id,t.create_user_id createUserId,t.pub_id,t.pub_id
  17. pubId,t.context,t.collect_count,t.collect_count collectCount,t.pub_type,t.pub_type
  18. pubType,t.like_count,t.like_count likeCount,t.create_user_name,t.create_user_name
  19. createUserName,t.status_cd,t.status_cd statusCd,t.title,t.community_id,t.community_id
  20. communityId,t.read_count,t.read_count readCount,t.header_img,t.header_img headerImg,
  21. t.create_time createTime,td.`name` pubTypeName
  22. from community_publicity t
  23. left join t_dict td on t.pub_type = td.status_cd and td.table_name = 'community_publicity' and td.table_columns = 'pub_type'
  24. where 1 =1
  25. <if test="createUserId !=null and createUserId != ''">
  26. and t.create_user_id= #{createUserId}
  27. </if>
  28. <if test="pubId !=null and pubId != ''">
  29. and t.pub_id= #{pubId}
  30. </if>
  31. <if test="context !=null and context != ''">
  32. and t.context= #{context}
  33. </if>
  34. <if test="collectCount !=null and collectCount != ''">
  35. and t.collect_count= #{collectCount}
  36. </if>
  37. <if test="pubType !=null and pubType != ''">
  38. and t.pub_type= #{pubType}
  39. </if>
  40. <if test="likeCount !=null and likeCount != ''">
  41. and t.like_count= #{likeCount}
  42. </if>
  43. <if test="createUserName !=null and createUserName != ''">
  44. and t.create_user_name= #{createUserName}
  45. </if>
  46. <if test="statusCd !=null and statusCd != ''">
  47. and t.status_cd= #{statusCd}
  48. </if>
  49. <if test="title !=null and title != ''">
  50. and t.title= #{title}
  51. </if>
  52. <if test="communityId !=null and communityId != ''">
  53. and t.community_id= #{communityId}
  54. </if>
  55. <if test="readCount !=null and readCount != ''">
  56. and t.read_count= #{readCount}
  57. </if>
  58. <if test="headerImg !=null and headerImg != ''">
  59. and t.header_img= #{headerImg}
  60. </if>
  61. order by t.create_time desc
  62. <if test="page != -1 and page != null ">
  63. limit #{page}, #{row}
  64. </if>
  65. </select>
  66. <!-- 修改小区公示信息 add by wuxw 2018-07-03 -->
  67. <update id="updateCommunityPublicityInfo" parameterType="Map">
  68. update community_publicity t set t.status_cd = #{statusCd}
  69. <if test="newBId != null and newBId != ''">
  70. ,t.b_id = #{newBId}
  71. </if>
  72. <if test="createUserId !=null and createUserId != ''">
  73. , t.create_user_id= #{createUserId}
  74. </if>
  75. <if test="context !=null and context != ''">
  76. , t.context= #{context}
  77. </if>
  78. <if test="collectCount !=null and collectCount != ''">
  79. , t.collect_count= #{collectCount}
  80. </if>
  81. <if test="pubType !=null and pubType != ''">
  82. , t.pub_type= #{pubType}
  83. </if>
  84. <if test="likeCount !=null and likeCount != ''">
  85. , t.like_count= #{likeCount}
  86. </if>
  87. <if test="createUserName !=null and createUserName != ''">
  88. , t.create_user_name= #{createUserName}
  89. </if>
  90. <if test="title !=null and title != ''">
  91. , t.title= #{title}
  92. </if>
  93. <if test="communityId !=null and communityId != ''">
  94. , t.community_id= #{communityId}
  95. </if>
  96. <if test="readCount !=null and readCount != ''">
  97. , t.read_count= #{readCount}
  98. </if>
  99. <if test="headerImg !=null and headerImg != ''">
  100. , t.header_img= #{headerImg}
  101. </if>
  102. where 1=1
  103. <if test="pubId !=null and pubId != ''">
  104. and t.pub_id= #{pubId}
  105. </if>
  106. </update>
  107. <!-- 查询小区公示数量 add by wuxw 2018-07-03 -->
  108. <select id="queryCommunityPublicitysCount" parameterType="Map" resultType="Map">
  109. select count(1) count
  110. from community_publicity t
  111. where 1 =1
  112. <if test="createUserId !=null and createUserId != ''">
  113. and t.create_user_id= #{createUserId}
  114. </if>
  115. <if test="pubId !=null and pubId != ''">
  116. and t.pub_id= #{pubId}
  117. </if>
  118. <if test="context !=null and context != ''">
  119. and t.context= #{context}
  120. </if>
  121. <if test="collectCount !=null and collectCount != ''">
  122. and t.collect_count= #{collectCount}
  123. </if>
  124. <if test="pubType !=null and pubType != ''">
  125. and t.pub_type= #{pubType}
  126. </if>
  127. <if test="likeCount !=null and likeCount != ''">
  128. and t.like_count= #{likeCount}
  129. </if>
  130. <if test="createUserName !=null and createUserName != ''">
  131. and t.create_user_name= #{createUserName}
  132. </if>
  133. <if test="statusCd !=null and statusCd != ''">
  134. and t.status_cd= #{statusCd}
  135. </if>
  136. <if test="title !=null and title != ''">
  137. and t.title= #{title}
  138. </if>
  139. <if test="communityId !=null and communityId != ''">
  140. and t.community_id= #{communityId}
  141. </if>
  142. <if test="readCount !=null and readCount != ''">
  143. and t.read_count= #{readCount}
  144. </if>
  145. <if test="headerImg !=null and headerImg != ''">
  146. and t.header_img= #{headerImg}
  147. </if>
  148. </select>
  149. </mapper>