ParkingAreaServiceDaoImplMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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="remark !=null and remark != ''">
  83. and t.remark= #{remark}
  84. </if>
  85. <if test="statusCd !=null and statusCd != ''">
  86. and t.status_cd= #{statusCd}
  87. </if>
  88. <if test="communityId !=null and communityId != ''">
  89. and t.community_id= #{communityId}
  90. </if>
  91. <if test="bId !=null and bId != ''">
  92. and t.b_id= #{bId}
  93. </if>
  94. order by t.create_time desc
  95. <if test="page != -1 and page != null ">
  96. limit #{page}, #{row}
  97. </if>
  98. </select>
  99. <!-- 修改停车场信息 add by wuxw 2018-07-03 -->
  100. <update id="updateParkingAreaInfoInstance" parameterType="Map">
  101. update parking_area t set t.status_cd = #{statusCd}
  102. <if test="newBId != null and newBId != ''">
  103. ,t.b_id = #{newBId}
  104. </if>
  105. <if test="typeCd !=null and typeCd != ''">
  106. , t.type_cd= #{typeCd}
  107. </if>
  108. <if test="num !=null and num != ''">
  109. , t.num= #{num}
  110. </if>
  111. <if test="remark !=null and remark != ''">
  112. , t.remark= #{remark}
  113. </if>
  114. <if test="communityId !=null and communityId != ''">
  115. , t.community_id= #{communityId}
  116. </if>
  117. where 1=1
  118. <if test="paId !=null and paId != ''">
  119. and t.pa_id= #{paId}
  120. </if>
  121. <if test="bId !=null and bId != ''">
  122. and t.b_id= #{bId}
  123. </if>
  124. </update>
  125. <!-- 查询停车场数量 add by wuxw 2018-07-03 -->
  126. <select id="queryParkingAreasCount" parameterType="Map" resultType="Map">
  127. select count(1) count
  128. from parking_area t
  129. where 1 =1
  130. <if test="typeCd !=null and typeCd != ''">
  131. and t.type_cd= #{typeCd}
  132. </if>
  133. <if test="num !=null and num != ''">
  134. and t.num= #{num}
  135. </if>
  136. <if test="paId !=null and paId != ''">
  137. and t.pa_id= #{paId}
  138. </if>
  139. <if test="remark !=null and remark != ''">
  140. and t.remark= #{remark}
  141. </if>
  142. <if test="statusCd !=null and statusCd != ''">
  143. and t.status_cd= #{statusCd}
  144. </if>
  145. <if test="communityId !=null and communityId != ''">
  146. and t.community_id= #{communityId}
  147. </if>
  148. <if test="bId !=null and bId != ''">
  149. and t.b_id= #{bId}
  150. </if>
  151. </select>
  152. </mapper>