FloorAttrServiceDaoImplMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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="floorAttrServiceDaoImpl">
  6. <!-- 保存考勤班组属性信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessFloorAttrInfo" parameterType="Map">
  8. insert into business_floor_attr(
  9. floor_id,attr_id,operate,spec_cd,community_id,b_id,value
  10. ) values (
  11. #{floorId},#{attrId},#{operate},#{specCd},#{communityId},#{bId},#{value}
  12. )
  13. </insert>
  14. <!--保存楼栋属性-->
  15. <insert id="saveFloorAttr" parameterType="Map">
  16. insert into f_floor_attr(
  17. floor_id,attr_id,spec_cd,community_id,b_id,value
  18. ) values (
  19. #{floorId},#{attrId},#{specCd},#{communityId},'-1',#{value}
  20. )
  21. </insert>
  22. <!-- 查询考勤班组属性信息(Business) add by wuxw 2018-07-03 -->
  23. <select id="getBusinessFloorAttrInfo" parameterType="Map" resultType="Map">
  24. select t.floor_id,t.floor_id floorId,t.attr_id,t.attr_id attrId,t.operate,t.spec_cd,t.spec_cd
  25. specCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value
  26. from business_floor_attr t
  27. where 1 =1
  28. <if test="floorId !=null and floorId != ''">
  29. and t.floor_id= #{floorId}
  30. </if>
  31. <if test="attrId !=null and attrId != ''">
  32. and t.attr_id= #{attrId}
  33. </if>
  34. <if test="operate !=null and operate != ''">
  35. and t.operate= #{operate}
  36. </if>
  37. <if test="specCd !=null and specCd != ''">
  38. and t.spec_cd= #{specCd}
  39. </if>
  40. <if test="communityId !=null and communityId != ''">
  41. and t.community_id= #{communityId}
  42. </if>
  43. <if test="bId !=null and bId != ''">
  44. and t.b_id= #{bId}
  45. </if>
  46. <if test="value !=null and value != ''">
  47. and t.value= #{value}
  48. </if>
  49. </select>
  50. <!-- 保存考勤班组属性信息至 instance表中 add by wuxw 2018-07-03 -->
  51. <insert id="saveFloorAttrInfoInstance" parameterType="Map">
  52. insert into f_floor_attr(
  53. floor_id,attr_id,spec_cd,status_cd,community_id,b_id,value
  54. ) select t.floor_id,t.attr_id,t.spec_cd,'0',t.community_id,t.b_id,t.value from business_floor_attr t where 1=1
  55. <if test="floorId !=null and floorId != ''">
  56. and t.floor_id= #{floorId}
  57. </if>
  58. <if test="attrId !=null and attrId != ''">
  59. and t.attr_id= #{attrId}
  60. </if>
  61. and t.operate= 'ADD'
  62. <if test="specCd !=null and specCd != ''">
  63. and t.spec_cd= #{specCd}
  64. </if>
  65. <if test="communityId !=null and communityId != ''">
  66. and t.community_id= #{communityId}
  67. </if>
  68. <if test="bId !=null and bId != ''">
  69. and t.b_id= #{bId}
  70. </if>
  71. <if test="value !=null and value != ''">
  72. and t.value= #{value}
  73. </if>
  74. </insert>
  75. <!-- 查询考勤班组属性信息 add by wuxw 2018-07-03 -->
  76. <select id="getFloorAttrInfo" parameterType="Map" resultType="Map">
  77. select t.floor_id,t.floor_id floorId,t.attr_id,t.attr_id attrId,t.spec_cd,t.spec_cd
  78. specCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value,
  79. s.spec_name specName,
  80. v.value_name valueName,
  81. s.list_show listShow
  82. from f_floor_attr t
  83. left join attr_spec s on t.spec_cd = s.spec_cd and s.status_cd = '0' and t.spec_cd = s.spec_cd and s.table_name = 'building_room_attr'
  84. left join attr_value v on t.`value` = v.`value` and s.spec_id = v.spec_id and v.status_cd = '0'
  85. where
  86. 1=1
  87. <if test="floorIds !=null and floorIds != ''">
  88. and t.floor_id in
  89. <foreach collection="floorIds" item="item" index="index" open="(" close=")" separator=",">
  90. #{item}
  91. </foreach>
  92. </if>
  93. <if test="floorId !=null and floorId != ''">
  94. and t.floor_id= #{floorId}
  95. </if>
  96. <if test="attrId !=null and attrId != ''">
  97. and t.attr_id= #{attrId}
  98. </if>
  99. <if test="specCd !=null and specCd != ''">
  100. and t.spec_cd= #{specCd}
  101. </if>
  102. <if test="statusCd !=null and statusCd != ''">
  103. and t.status_cd= #{statusCd}
  104. </if>
  105. <if test="communityId !=null and communityId != ''">
  106. and t.community_id= #{communityId}
  107. </if>
  108. <if test="bId !=null and bId != ''">
  109. and t.b_id= #{bId}
  110. </if>
  111. <if test="value !=null and value != ''">
  112. and t.value= #{value}
  113. </if>
  114. order by t.create_time desc
  115. <if test="page != -1 and page != null ">
  116. limit #{page}, #{row}
  117. </if>
  118. </select>
  119. <!-- 修改考勤班组属性信息 add by wuxw 2018-07-03 -->
  120. <update id="updateFloorAttrInfoInstance" parameterType="Map">
  121. update f_floor_attr t set t.status_cd = #{statusCd}
  122. <if test="newBId != null and newBId != ''">
  123. ,t.b_id = #{newBId}
  124. </if>
  125. <if test="floorId !=null and floorId != ''">
  126. , t.floor_id= #{floorId}
  127. </if>
  128. <if test="specCd !=null and specCd != ''">
  129. , t.spec_cd= #{specCd}
  130. </if>
  131. <if test="communityId !=null and communityId != ''">
  132. , t.community_id= #{communityId}
  133. </if>
  134. <if test="value !=null and value != ''">
  135. , t.value= #{value}
  136. </if>
  137. where 1=1
  138. <if test="attrId !=null and attrId != ''">
  139. and t.attr_id= #{attrId}
  140. </if>
  141. <if test="bId !=null and bId != ''">
  142. and t.b_id= #{bId}
  143. </if>
  144. </update>
  145. <!-- 查询考勤班组属性数量 add by wuxw 2018-07-03 -->
  146. <select id="queryFloorAttrsCount" parameterType="Map" resultType="Map">
  147. select count(1) count
  148. from f_floor_attr t
  149. where 1 =1
  150. <if test="floorId !=null and floorId != ''">
  151. and t.floor_id= #{floorId}
  152. </if>
  153. <if test="attrId !=null and attrId != ''">
  154. and t.attr_id= #{attrId}
  155. </if>
  156. <if test="specCd !=null and specCd != ''">
  157. and t.spec_cd= #{specCd}
  158. </if>
  159. <if test="statusCd !=null and statusCd != ''">
  160. and t.status_cd= #{statusCd}
  161. </if>
  162. <if test="communityId !=null and communityId != ''">
  163. and t.community_id= #{communityId}
  164. </if>
  165. <if test="bId !=null and bId != ''">
  166. and t.b_id= #{bId}
  167. </if>
  168. <if test="value !=null and value != ''">
  169. and t.value= #{value}
  170. </if>
  171. </select>
  172. </mapper>