OwnerCarServiceDaoImplMapper.xml 9.1 KB

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