ParkingSpaceServiceDaoImplMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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="parkingSpaceServiceDaoImpl">
  6. <!-- 保存停车位信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessParkingSpaceInfo" parameterType="Map">
  8. insert into business_parking_space(
  9. area,operate,type_cd,num,ps_id,remark,state,community_id,b_id,user_id
  10. ) values (
  11. #{area},#{operate},#{typeCd},#{num},#{psId},#{remark},#{state},#{communityId},#{bId},#{userId}
  12. )
  13. </insert>
  14. <!-- 查询停车位信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessParkingSpaceInfo" parameterType="Map" resultType="Map">
  16. select t.area,t.operate,t.type_cd,t.type_cd typeCd,t.num,t.ps_id,t.ps_id
  17. psId,t.remark,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.user_id,t.user_id userId
  18. from business_parking_space t
  19. where 1 =1
  20. <if test="area !=null and area != ''">
  21. and t.area= #{area}
  22. </if>
  23. <if test="operate !=null and operate != ''">
  24. and t.operate= #{operate}
  25. </if>
  26. <if test="typeCd !=null and typeCd != ''">
  27. and t.type_cd= #{typeCd}
  28. </if>
  29. <if test="num !=null and num != ''">
  30. and t.num= #{num}
  31. </if>
  32. <if test="psId !=null and psId != ''">
  33. and t.ps_id= #{psId}
  34. </if>
  35. <if test="remark !=null and remark != ''">
  36. and t.remark= #{remark}
  37. </if>
  38. <if test="state !=null and state != ''">
  39. and t.state= #{state}
  40. </if>
  41. <if test="communityId !=null and communityId != ''">
  42. and t.community_id= #{communityId}
  43. </if>
  44. <if test="bId !=null and bId != ''">
  45. and t.b_id= #{bId}
  46. </if>
  47. <if test="userId !=null and userId != ''">
  48. and t.user_id= #{userId}
  49. </if>
  50. </select>
  51. <!-- 保存停车位信息至 instance表中 add by wuxw 2018-07-03 -->
  52. <insert id="saveParkingSpaceInfoInstance" parameterType="Map">
  53. insert into p_parking_space(
  54. area,type_cd,num,ps_id,remark,status_cd,state,community_id,b_id,user_id
  55. ) select t.area,t.type_cd,t.num,t.ps_id,t.remark,'0',t.state,t.community_id,t.b_id,t.user_id from
  56. business_parking_space t where 1=1
  57. <if test="area !=null and area != ''">
  58. and t.area= #{area}
  59. </if>
  60. and t.operate= 'ADD'
  61. <if test="typeCd !=null and typeCd != ''">
  62. and t.type_cd= #{typeCd}
  63. </if>
  64. <if test="num !=null and num != ''">
  65. and t.num= #{num}
  66. </if>
  67. <if test="psId !=null and psId != ''">
  68. and t.ps_id= #{psId}
  69. </if>
  70. <if test="remark !=null and remark != ''">
  71. and t.remark= #{remark}
  72. </if>
  73. <if test="state !=null and state != ''">
  74. and t.state= #{state}
  75. </if>
  76. <if test="communityId !=null and communityId != ''">
  77. and t.community_id= #{communityId}
  78. </if>
  79. <if test="bId !=null and bId != ''">
  80. and t.b_id= #{bId}
  81. </if>
  82. <if test="userId !=null and userId != ''">
  83. and t.user_id= #{userId}
  84. </if>
  85. </insert>
  86. <!-- 查询停车位信息 add by wuxw 2018-07-03 -->
  87. <select id="getParkingSpaceInfo" parameterType="Map" resultType="Map">
  88. SELECT
  89. t.area,
  90. t.`type_cd` typeCd,
  91. t.`type_cd`,
  92. t.num,
  93. t.ps_id psId,
  94. t.ps_id,
  95. t.remark,
  96. t.status_cd statusCd,
  97. t.status_cd,
  98. t.`state`,
  99. t.community_id,
  100. t.community_id communityId,
  101. t.b_id,
  102. t.b_id bId,
  103. t.user_id,
  104. t.user_id userId
  105. FROM
  106. p_parking_space t
  107. <where>
  108. <if test="area !=null and area != ''">
  109. and t.area= #{area}
  110. </if>
  111. <if test="typeCd !=null and typeCd != ''">
  112. and t.type_cd= #{typeCd}
  113. </if>
  114. <if test="num !=null and num != ''">
  115. and t.num= #{num}
  116. </if>
  117. <if test="psId !=null and psId != ''">
  118. and t.ps_id= #{psId}
  119. </if>
  120. <if test="remark !=null and remark != ''">
  121. and t.remark= #{remark}
  122. </if>
  123. <if test="statusCd !=null and statusCd != ''">
  124. and t.status_cd= #{statusCd}
  125. </if>
  126. <if test="state !=null and state != ''">
  127. and t.state= #{state}
  128. </if>
  129. <if test="states != null and states != null">
  130. and t.state in
  131. <foreach collection="states" item="item" open="(" close=")" separator=",">
  132. #{item}
  133. </foreach>
  134. </if>
  135. <if test="psIds != null and psIds != null">
  136. and t.ps_id in
  137. <foreach collection="psIds" item="item" open="(" close=")" separator=",">
  138. #{item}
  139. </foreach>
  140. </if>
  141. <if test="communityId !=null and communityId != ''">
  142. and t.community_id= #{communityId}
  143. </if>
  144. <if test="bId !=null and bId != ''">
  145. and t.b_id= #{bId}
  146. </if>
  147. <if test="userId !=null and userId != ''">
  148. and t.user_id= #{userId}
  149. </if>
  150. <if test="page != -1 and page != null ">
  151. limit #{page}, #{row}
  152. </if>
  153. </where>
  154. </select>
  155. <!-- 修改停车位信息 add by wuxw 2018-07-03 -->
  156. <update id="updateParkingSpaceInfoInstance" parameterType="Map">
  157. update p_parking_space t set t.status_cd = #{statusCd}
  158. <if test="newBId != null and newBId != ''">
  159. ,t.b_id = #{newBId}
  160. </if>
  161. <if test="area !=null and area != ''">
  162. , t.area= #{area}
  163. </if>
  164. <if test="typeCd !=null and typeCd != ''">
  165. , t.type_cd= #{typeCd}
  166. </if>
  167. <if test="num !=null and num != ''">
  168. , t.num= #{num}
  169. </if>
  170. <if test="remark !=null and remark != ''">
  171. , t.remark= #{remark}
  172. </if>
  173. <if test="state !=null and state != ''">
  174. , t.state= #{state}
  175. </if>
  176. <if test="communityId !=null and communityId != ''">
  177. , t.community_id= #{communityId}
  178. </if>
  179. <if test="userId !=null and userId != ''">
  180. , t.user_id= #{userId}
  181. </if>
  182. where 1=1
  183. <if test="psId !=null and psId != ''">
  184. and t.ps_id= #{psId}
  185. </if>
  186. <if test="bId !=null and bId != ''">
  187. and t.b_id= #{bId}
  188. </if>
  189. </update>
  190. <!-- 查询停车位数量 add by wuxw 2018-07-03 -->
  191. <select id="queryParkingSpacesCount" parameterType="Map" resultType="Map">
  192. select count(1) count
  193. from p_parking_space t
  194. where 1 =1
  195. <if test="area !=null and area != ''">
  196. and t.area= #{area}
  197. </if>
  198. <if test="typeCd !=null and typeCd != ''">
  199. and t.type_cd= #{typeCd}
  200. </if>
  201. <if test="num !=null and num != ''">
  202. and t.num= #{num}
  203. </if>
  204. <if test="psId !=null and psId != ''">
  205. and t.ps_id= #{psId}
  206. </if>
  207. <if test="remark !=null and remark != ''">
  208. and t.remark= #{remark}
  209. </if>
  210. <if test="statusCd !=null and statusCd != ''">
  211. and t.status_cd= #{statusCd}
  212. </if>
  213. <if test="state !=null and state != ''">
  214. and t.state= #{state}
  215. </if>
  216. <if test="states != null and states != null">
  217. and t.state in
  218. <foreach collection="states" item="item" open="(" close=")" separator=",">
  219. #{item}
  220. </foreach>
  221. </if>
  222. <if test="communityId !=null and communityId != ''">
  223. and t.community_id= #{communityId}
  224. </if>
  225. <if test="bId !=null and bId != ''">
  226. and t.b_id= #{bId}
  227. </if>
  228. <if test="userId !=null and userId != ''">
  229. and t.user_id= #{userId}
  230. </if>
  231. </select>
  232. </mapper>