CommunityLocationAttrServiceDaoImplMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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="communityLocationAttrServiceDaoImpl">
  6. <!-- 保存位置属性信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessCommunityLocationAttrInfo" parameterType="Map">
  8. insert into business_community_location_attr(
  9. attr_id,operate,create_time,location_id,spec_cd,community_id,b_id,value
  10. ) values (
  11. #{attrId},#{operate},#{createTime},#{locationId},#{specCd},#{communityId},#{bId},#{value}
  12. )
  13. </insert>
  14. <insert id="saveCommunityLocationAttr" parameterType="Map">
  15. insert into community_location_attr(
  16. attr_id,location_id,spec_cd,community_id,b_id,value
  17. ) values (
  18. #{attrId},#{locationId},#{specCd},#{communityId},'-1',#{value}
  19. )
  20. </insert>
  21. <!-- 查询位置属性信息(Business) add by wuxw 2018-07-03 -->
  22. <select id="getBusinessCommunityLocationAttrInfo" parameterType="Map" resultType="Map">
  23. select t.attr_id,t.attr_id attrId,t.operate,t.create_time,t.create_time createTime,t.location_id,t.location_id
  24. locationId,t.spec_cd,t.spec_cd specCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value
  25. from business_community_location_attr t
  26. where 1 =1
  27. <if test="attrId !=null and attrId != ''">
  28. and t.attr_id= #{attrId}
  29. </if>
  30. <if test="operate !=null and operate != ''">
  31. and t.operate= #{operate}
  32. </if>
  33. <if test="createTime !=null and createTime != ''">
  34. and t.create_time= #{createTime}
  35. </if>
  36. <if test="locationId !=null and locationId != ''">
  37. and t.location_id= #{locationId}
  38. </if>
  39. <if test="specCd !=null and specCd != ''">
  40. and t.spec_cd= #{specCd}
  41. </if>
  42. <if test="communityId !=null and communityId != ''">
  43. and t.community_id= #{communityId}
  44. </if>
  45. <if test="bId !=null and bId != ''">
  46. and t.b_id= #{bId}
  47. </if>
  48. <if test="value !=null and value != ''">
  49. and t.value= #{value}
  50. </if>
  51. </select>
  52. <!-- 保存位置属性信息至 instance表中 add by wuxw 2018-07-03 -->
  53. <insert id="saveCommunityLocationAttrInfoInstance" parameterType="Map">
  54. insert into community_location_attr(
  55. attr_id,create_time,location_id,spec_cd,status_cd,community_id,b_id,value
  56. ) select t.attr_id,t.create_time,t.location_id,t.spec_cd,'0',t.community_id,t.b_id,t.value from
  57. business_community_location_attr t where 1=1
  58. <if test="attrId !=null and attrId != ''">
  59. and t.attr_id= #{attrId}
  60. </if>
  61. and t.operate= 'ADD'
  62. <if test="createTime !=null and createTime != ''">
  63. and t.create_time= #{createTime}
  64. </if>
  65. <if test="locationId !=null and locationId != ''">
  66. and t.location_id= #{locationId}
  67. </if>
  68. <if test="specCd !=null and specCd != ''">
  69. and t.spec_cd= #{specCd}
  70. </if>
  71. <if test="communityId !=null and communityId != ''">
  72. and t.community_id= #{communityId}
  73. </if>
  74. <if test="bId !=null and bId != ''">
  75. and t.b_id= #{bId}
  76. </if>
  77. <if test="value !=null and value != ''">
  78. and t.value= #{value}
  79. </if>
  80. </insert>
  81. <!-- 查询位置属性信息 add by wuxw 2018-07-03 -->
  82. <select id="getCommunityLocationAttrInfo" parameterType="Map" resultType="Map">
  83. select t.attr_id,t.attr_id attrId,t.create_time,t.create_time createTime,t.location_id,t.location_id
  84. locationId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
  85. communityId,t.b_id,t.b_id bId,t.value
  86. from community_location_attr t
  87. where 1 =1
  88. <if test="attrId !=null and attrId != ''">
  89. and t.attr_id= #{attrId}
  90. </if>
  91. <if test="createTime !=null and createTime != ''">
  92. and t.create_time= #{createTime}
  93. </if>
  94. <if test="locationId !=null and locationId != ''">
  95. and t.location_id= #{locationId}
  96. </if>
  97. <if test="specCd !=null and specCd != ''">
  98. and t.spec_cd= #{specCd}
  99. </if>
  100. <if test="statusCd !=null and statusCd != ''">
  101. and t.status_cd= #{statusCd}
  102. </if>
  103. <if test="communityId !=null and communityId != ''">
  104. and t.community_id= #{communityId}
  105. </if>
  106. <if test="bId !=null and bId != ''">
  107. and t.b_id= #{bId}
  108. </if>
  109. <if test="value !=null and value != ''">
  110. and t.value= #{value}
  111. </if>
  112. order by t.create_time desc
  113. <if test="page != -1 and page != null ">
  114. limit #{page}, #{row}
  115. </if>
  116. </select>
  117. <!-- 修改位置属性信息 add by wuxw 2018-07-03 -->
  118. <update id="updateCommunityLocationAttrInfoInstance" parameterType="Map">
  119. update community_location_attr t set t.status_cd = #{statusCd}
  120. <if test="newBId != null and newBId != ''">
  121. ,t.b_id = #{newBId}
  122. </if>
  123. <if test="createTime !=null and createTime != ''">
  124. , t.create_time= #{createTime}
  125. </if>
  126. <if test="locationId !=null and locationId != ''">
  127. , t.location_id= #{locationId}
  128. </if>
  129. <if test="specCd !=null and specCd != ''">
  130. , t.spec_cd= #{specCd}
  131. </if>
  132. <if test="communityId !=null and communityId != ''">
  133. , t.community_id= #{communityId}
  134. </if>
  135. <if test="value !=null and value != ''">
  136. , t.value= #{value}
  137. </if>
  138. where 1=1
  139. <if test="attrId !=null and attrId != ''">
  140. and t.attr_id= #{attrId}
  141. </if>
  142. <if test="bId !=null and bId != ''">
  143. and t.b_id= #{bId}
  144. </if>
  145. </update>
  146. <!-- 查询位置属性数量 add by wuxw 2018-07-03 -->
  147. <select id="queryCommunityLocationAttrsCount" parameterType="Map" resultType="Map">
  148. select count(1) count
  149. from community_location_attr t
  150. where 1 =1
  151. <if test="attrId !=null and attrId != ''">
  152. and t.attr_id= #{attrId}
  153. </if>
  154. <if test="createTime !=null and createTime != ''">
  155. and t.create_time= #{createTime}
  156. </if>
  157. <if test="locationId !=null and locationId != ''">
  158. and t.location_id= #{locationId}
  159. </if>
  160. <if test="specCd !=null and specCd != ''">
  161. and t.spec_cd= #{specCd}
  162. </if>
  163. <if test="statusCd !=null and statusCd != ''">
  164. and t.status_cd= #{statusCd}
  165. </if>
  166. <if test="communityId !=null and communityId != ''">
  167. and t.community_id= #{communityId}
  168. </if>
  169. <if test="bId !=null and bId != ''">
  170. and t.b_id= #{bId}
  171. </if>
  172. <if test="value !=null and value != ''">
  173. and t.value= #{value}
  174. </if>
  175. </select>
  176. </mapper>