FloorAttrServiceDaoImplMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. <!-- 查询考勤班组属性信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessFloorAttrInfo" parameterType="Map" resultType="Map">
  16. select t.floor_id,t.floor_id floorId,t.attr_id,t.attr_id attrId,t.operate,t.spec_cd,t.spec_cd specCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value
  17. from business_floor_attr t
  18. where 1 =1
  19. <if test="floorId !=null and floorId != ''">
  20. and t.floor_id= #{floorId}
  21. </if>
  22. <if test="attrId !=null and attrId != ''">
  23. and t.attr_id= #{attrId}
  24. </if>
  25. <if test="operate !=null and operate != ''">
  26. and t.operate= #{operate}
  27. </if>
  28. <if test="specCd !=null and specCd != ''">
  29. and t.spec_cd= #{specCd}
  30. </if>
  31. <if test="communityId !=null and communityId != ''">
  32. and t.community_id= #{communityId}
  33. </if>
  34. <if test="bId !=null and bId != ''">
  35. and t.b_id= #{bId}
  36. </if>
  37. <if test="value !=null and value != ''">
  38. and t.value= #{value}
  39. </if>
  40. </select>
  41. <!-- 保存考勤班组属性信息至 instance表中 add by wuxw 2018-07-03 -->
  42. <insert id="saveFloorAttrInfoInstance" parameterType="Map">
  43. insert into f_floor_attr(
  44. floor_id,attr_id,spec_cd,status_cd,community_id,b_id,value
  45. ) 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
  46. <if test="floorId !=null and floorId != ''">
  47. and t.floor_id= #{floorId}
  48. </if>
  49. <if test="attrId !=null and attrId != ''">
  50. and t.attr_id= #{attrId}
  51. </if>
  52. and t.operate= 'ADD'
  53. <if test="specCd !=null and specCd != ''">
  54. and t.spec_cd= #{specCd}
  55. </if>
  56. <if test="communityId !=null and communityId != ''">
  57. and t.community_id= #{communityId}
  58. </if>
  59. <if test="bId !=null and bId != ''">
  60. and t.b_id= #{bId}
  61. </if>
  62. <if test="value !=null and value != ''">
  63. and t.value= #{value}
  64. </if>
  65. </insert>
  66. <!-- 查询考勤班组属性信息 add by wuxw 2018-07-03 -->
  67. <select id="getFloorAttrInfo" parameterType="Map" resultType="Map">
  68. select t.floor_id,t.floor_id floorId,t.attr_id,t.attr_id attrId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value
  69. from f_floor_attr t
  70. where 1 =1
  71. <if test="floorId !=null and floorId != ''">
  72. and t.floor_id= #{floorId}
  73. </if>
  74. <if test="attrId !=null and attrId != ''">
  75. and t.attr_id= #{attrId}
  76. </if>
  77. <if test="specCd !=null and specCd != ''">
  78. and t.spec_cd= #{specCd}
  79. </if>
  80. <if test="statusCd !=null and statusCd != ''">
  81. and t.status_cd= #{statusCd}
  82. </if>
  83. <if test="communityId !=null and communityId != ''">
  84. and t.community_id= #{communityId}
  85. </if>
  86. <if test="bId !=null and bId != ''">
  87. and t.b_id= #{bId}
  88. </if>
  89. <if test="value !=null and value != ''">
  90. and t.value= #{value}
  91. </if>
  92. order by t.create_time desc
  93. <if test="page != -1 and page != null ">
  94. limit #{page}, #{row}
  95. </if>
  96. </select>
  97. <!-- 修改考勤班组属性信息 add by wuxw 2018-07-03 -->
  98. <update id="updateFloorAttrInfoInstance" parameterType="Map">
  99. update f_floor_attr t set t.status_cd = #{statusCd}
  100. <if test="newBId != null and newBId != ''">
  101. ,t.b_id = #{newBId}
  102. </if>
  103. <if test="floorId !=null and floorId != ''">
  104. , t.floor_id= #{floorId}
  105. </if>
  106. <if test="specCd !=null and specCd != ''">
  107. , t.spec_cd= #{specCd}
  108. </if>
  109. <if test="communityId !=null and communityId != ''">
  110. , t.community_id= #{communityId}
  111. </if>
  112. <if test="value !=null and value != ''">
  113. , t.value= #{value}
  114. </if>
  115. where 1=1 <if test="attrId !=null and attrId != ''">
  116. and t.attr_id= #{attrId}
  117. </if>
  118. <if test="bId !=null and bId != ''">
  119. and t.b_id= #{bId}
  120. </if>
  121. </update>
  122. <!-- 查询考勤班组属性数量 add by wuxw 2018-07-03 -->
  123. <select id="queryFloorAttrsCount" parameterType="Map" resultType="Map">
  124. select count(1) count
  125. from f_floor_attr t
  126. where 1 =1
  127. <if test="floorId !=null and floorId != ''">
  128. and t.floor_id= #{floorId}
  129. </if>
  130. <if test="attrId !=null and attrId != ''">
  131. and t.attr_id= #{attrId}
  132. </if>
  133. <if test="specCd !=null and specCd != ''">
  134. and t.spec_cd= #{specCd}
  135. </if>
  136. <if test="statusCd !=null and statusCd != ''">
  137. and t.status_cd= #{statusCd}
  138. </if>
  139. <if test="communityId !=null and communityId != ''">
  140. and t.community_id= #{communityId}
  141. </if>
  142. <if test="bId !=null and bId != ''">
  143. and t.b_id= #{bId}
  144. </if>
  145. <if test="value !=null and value != ''">
  146. and t.value= #{value}
  147. </if>
  148. </select>
  149. </mapper>