FloorV1ServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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="floorV1ServiceDaoImpl">
  6. <!-- 保存楼栋信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveFloorInfo" parameterType="Map">
  8. insert into f_floor(
  9. floor_id,name,remark,b_id,community_id,user_id,floor_num,floor_area,seq
  10. ) values (
  11. #{floorId},#{name},#{remark},#{bId},#{communityId},#{userId},#{floorNum},#{floorArea},#{seq}
  12. )
  13. </insert>
  14. <!-- 查询楼栋信息 add by wuxw 2018-07-03 -->
  15. <select id="getFloorInfo" parameterType="Map" resultType="Map">
  16. select t.floor_id,t.floor_id floorId,t.name floorName,t.remark,t.b_id,t.b_id bId,t.community_id,t.community_id
  17. communityId,t.user_id,t.user_id userId,t3.name userName,
  18. t.floor_num,t.floor_num floorNum,t.floor_area,t.floor_area floorArea,t.seq
  19. from f_floor t
  20. LEFT JOIN f_floor_attr t2 on t.floor_id = t2.floor_id and t2.spec_cd='100201912001' and t2.value='8008'
  21. LEFT JOIN u_user t3 on t.user_id = t3.user_id and t3.status_cd = 0
  22. where t.status_cd=0
  23. <if test="floorId !=null and floorId != ''">
  24. and t.floor_id= #{floorId}
  25. </if>
  26. <if test="name !=null and name != ''">
  27. and t.name= #{name}
  28. </if>
  29. <if test="remark !=null and remark != ''">
  30. and t.remark= #{remark}
  31. </if>
  32. <if test="bId !=null and bId != ''">
  33. and t.b_id= #{bId}
  34. </if>
  35. <if test="communityId !=null and communityId != ''">
  36. and t.community_id= #{communityId}
  37. </if>
  38. <if test="userId !=null and userId != ''">
  39. and t.user_id= #{userId}
  40. </if>
  41. <if test="floorNum !=null and floorNum != ''">
  42. and t.floor_num= #{floorNum}
  43. </if>
  44. <if test="floorArea !=null and floorArea != ''">
  45. and t.floor_area= #{floorArea}
  46. </if>
  47. order by t.seq
  48. <if test="page != -1 and page != null ">
  49. limit #{page}, #{row}
  50. </if>
  51. </select>
  52. <!-- 修改楼栋信息 add by wuxw 2018-07-03 -->
  53. <update id="updateFloorInfo" parameterType="Map">
  54. update f_floor t set t.status_cd = #{statusCd}
  55. <if test="newBId != null and newBId != ''">
  56. ,t.b_id = #{newBId}
  57. </if>
  58. <if test="name !=null and name != ''">
  59. , t.name= #{name}
  60. </if>
  61. <if test="remark !=null and remark != ''">
  62. , t.remark= #{remark}
  63. </if>
  64. <if test="communityId !=null and communityId != ''">
  65. , t.community_id= #{communityId}
  66. </if>
  67. <if test="userId !=null and userId != ''">
  68. , t.user_id= #{userId}
  69. </if>
  70. <if test="floorNum !=null and floorNum != ''">
  71. , t.floor_num= #{floorNum}
  72. </if>
  73. <if test="floorArea !=null and floorArea != ''">
  74. , t.floor_area= #{floorArea}
  75. </if>
  76. <if test="seq !=null and seq != ''">
  77. , t.seq= #{seq}
  78. </if>
  79. where 1=1
  80. <if test="floorId !=null and floorId != ''">
  81. and t.floor_id= #{floorId}
  82. </if>
  83. <if test="bId !=null and bId != ''">
  84. and t.b_id= #{bId}
  85. </if>
  86. </update>
  87. <!-- 查询楼栋数量 add by wuxw 2018-07-03 -->
  88. <select id="queryFloorsCount" parameterType="Map" resultType="Map">
  89. select count(1) count
  90. from f_floor t
  91. LEFT JOIN f_floor_attr t2 on t.floor_id = t2.floor_id
  92. LEFT JOIN u_user t3 on t.user_id = t3.user_id and t3.status_cd = 0
  93. where t2.spec_cd='100201912001' and t2.value='8008' and t.status_cd=0
  94. <if test="floorId !=null and floorId != ''">
  95. and t.floor_id= #{floorId}
  96. </if>
  97. <if test="name !=null and name != ''">
  98. and t.name= #{name}
  99. </if>
  100. <if test="remark !=null and remark != ''">
  101. and t.remark= #{remark}
  102. </if>
  103. <if test="bId !=null and bId != ''">
  104. and t.b_id= #{bId}
  105. </if>
  106. <if test="communityId !=null and communityId != ''">
  107. and t.community_id= #{communityId}
  108. </if>
  109. <if test="userId !=null and userId != ''">
  110. and t.user_id= #{userId}
  111. </if>
  112. <if test="floorNum !=null and floorNum != ''">
  113. and t.floor_num= #{floorNum}
  114. </if>
  115. <if test="floorArea !=null and floorArea != ''">
  116. and t.floor_area= #{floorArea}
  117. </if>
  118. </select>
  119. </mapper>