ParkingAreaServiceDaoImplMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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="parkingAreaServiceDaoImpl">
  6. <!-- 保存停车场信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessParkingAreaInfo" parameterType="Map">
  8. insert into business_parking_area(
  9. operate,type_cd,num,pa_id,remark,community_id,b_id
  10. ) values (
  11. #{operate},#{typeCd},#{num},#{paId},#{remark},#{communityId},#{bId}
  12. )
  13. </insert>
  14. <!-- 查询停车场信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessParkingAreaInfo" parameterType="Map" resultType="Map">
  16. select t.operate,t.type_cd,t.type_cd typeCd,t.num,t.pa_id,t.pa_id paId,t.remark,t.community_id,t.community_id
  17. communityId,t.b_id,t.b_id bId
  18. from business_parking_area t
  19. where 1 =1
  20. <if test="operate !=null and operate != ''">
  21. and t.operate= #{operate}
  22. </if>
  23. <if test="typeCd !=null and typeCd != ''">
  24. and t.type_cd= #{typeCd}
  25. </if>
  26. <if test="num !=null and num != ''">
  27. and t.num= #{num}
  28. </if>
  29. <if test="paId !=null and paId != ''">
  30. and t.pa_id= #{paId}
  31. </if>
  32. <if test="remark !=null and remark != ''">
  33. and t.remark= #{remark}
  34. </if>
  35. <if test="communityId !=null and communityId != ''">
  36. and t.community_id= #{communityId}
  37. </if>
  38. <if test="bId !=null and bId != ''">
  39. and t.b_id= #{bId}
  40. </if>
  41. </select>
  42. <!-- 保存停车场信息至 instance表中 add by wuxw 2018-07-03 -->
  43. <insert id="saveParkingAreaInfoInstance" parameterType="Map">
  44. insert into parking_area(
  45. type_cd,num,pa_id,remark,status_cd,community_id,b_id
  46. ) select t.type_cd,t.num,t.pa_id,t.remark,'0',t.community_id,t.b_id from business_parking_area t where 1=1
  47. and t.operate= 'ADD'
  48. <if test="typeCd !=null and typeCd != ''">
  49. and t.type_cd= #{typeCd}
  50. </if>
  51. <if test="num !=null and num != ''">
  52. and t.num= #{num}
  53. </if>
  54. <if test="paId !=null and paId != ''">
  55. and t.pa_id= #{paId}
  56. </if>
  57. <if test="remark !=null and remark != ''">
  58. and t.remark= #{remark}
  59. </if>
  60. <if test="communityId !=null and communityId != ''">
  61. and t.community_id= #{communityId}
  62. </if>
  63. <if test="bId !=null and bId != ''">
  64. and t.b_id= #{bId}
  65. </if>
  66. </insert>
  67. <!-- 查询停车场信息 add by wuxw 2018-07-03 -->
  68. <select id="getParkingAreaInfo" parameterType="Map" resultType="Map">
  69. select t.type_cd,t.type_cd typeCd,t.num,t.pa_id,t.pa_id paId,t.remark,t.status_cd,t.status_cd
  70. statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.create_time createTime
  71. from parking_area t
  72. where 1 =1
  73. <if test="typeCd !=null and typeCd != ''">
  74. and t.type_cd= #{typeCd}
  75. </if>
  76. <if test="num !=null and num != ''">
  77. and t.num= #{num}
  78. </if>
  79. <if test="paId !=null and paId != ''">
  80. and t.pa_id= #{paId}
  81. </if>
  82. <if test="paIds !=null ">
  83. and t.pa_id in
  84. <foreach collection="paIds" item="item" index="index" open="(" close=")" separator=",">
  85. #{item}
  86. </foreach>
  87. </if>
  88. <if test="remark !=null and remark != ''">
  89. and t.remark= #{remark}
  90. </if>
  91. <if test="statusCd !=null and statusCd != ''">
  92. and t.status_cd= #{statusCd}
  93. </if>
  94. <if test="communityId !=null and communityId != ''">
  95. and t.community_id= #{communityId}
  96. </if>
  97. <if test="bId !=null and bId != ''">
  98. and t.b_id= #{bId}
  99. </if>
  100. order by t.create_time desc
  101. <if test="page != -1 and page != null ">
  102. limit #{page}, #{row}
  103. </if>
  104. </select>
  105. <!-- 修改停车场信息 add by wuxw 2018-07-03 -->
  106. <update id="updateParkingAreaInfoInstance" parameterType="Map">
  107. update parking_area t set t.status_cd = #{statusCd}
  108. <if test="newBId != null and newBId != ''">
  109. ,t.b_id = #{newBId}
  110. </if>
  111. <if test="typeCd !=null and typeCd != ''">
  112. , t.type_cd= #{typeCd}
  113. </if>
  114. <if test="num !=null and num != ''">
  115. , t.num= #{num}
  116. </if>
  117. <if test="remark !=null and remark != ''">
  118. , t.remark= #{remark}
  119. </if>
  120. <if test="communityId !=null and communityId != ''">
  121. , t.community_id= #{communityId}
  122. </if>
  123. where 1=1
  124. <if test="paId !=null and paId != ''">
  125. and t.pa_id= #{paId}
  126. </if>
  127. <if test="bId !=null and bId != ''">
  128. and t.b_id= #{bId}
  129. </if>
  130. </update>
  131. <!-- 查询停车场数量 add by wuxw 2018-07-03 -->
  132. <select id="queryParkingAreasCount" parameterType="Map" resultType="Map">
  133. select count(1) count
  134. from parking_area t
  135. where 1 =1
  136. <if test="typeCd !=null and typeCd != ''">
  137. and t.type_cd= #{typeCd}
  138. </if>
  139. <if test="num !=null and num != ''">
  140. and t.num= #{num}
  141. </if>
  142. <if test="paId !=null and paId != ''">
  143. and t.pa_id= #{paId}
  144. </if>
  145. <if test="paIds !=null ">
  146. and t.pa_id in
  147. <foreach collection="paIds" item="item" index="index" open="(" close=")" separator=",">
  148. #{item}
  149. </foreach>
  150. </if>
  151. <if test="remark !=null and remark != ''">
  152. and t.remark= #{remark}
  153. </if>
  154. <if test="statusCd !=null and statusCd != ''">
  155. and t.status_cd= #{statusCd}
  156. </if>
  157. <if test="communityId !=null and communityId != ''">
  158. and t.community_id= #{communityId}
  159. </if>
  160. <if test="bId !=null and bId != ''">
  161. and t.b_id= #{bId}
  162. </if>
  163. </select>
  164. </mapper>