OwnerCarV1ServiceDaoImplMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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="ownerCarV1ServiceDaoImpl">
  6. <!-- 保存车辆信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOwnerCarInfo" parameterType="Map">
  8. insert into owner_car(car_brand, car_num, ps_id, remark, owner_id, car_type_cd, user_id, car_id, car_color,
  9. car_type, start_time, end_time, state, community_id, member_id, b_id,lease_type)
  10. values (#{carBrand}, #{carNum}, #{psId}, #{remark}, #{ownerId}, #{carTypeCd}, #{userId}, #{carId}, #{carColor},
  11. #{carType}, #{startTime}, #{endTime}, #{state}, #{communityId}, #{memberId}, '-1',#{leaseType})
  12. </insert>
  13. <!-- 查询车辆信息 add by wuxw 2018-07-03 -->
  14. <select id="getOwnerCarInfo" parameterType="Map" resultType="Map">
  15. select t.car_brand,t.car_brand carBrand,t.car_num,t.car_num carNum,t.ps_id,t.ps_id
  16. psId,t.remark,t.status_cd,t.status_cd statusCd,t.owner_id,t.owner_id ownerId,t.car_type_cd,t.car_type_cd
  17. carTypeCd,t.user_id,t.user_id userId,t.car_id,t.car_id carId,t.car_color,t.car_color
  18. carColor,t.car_type,t.car_type carType,t.start_time,t.start_time startTime,t.end_time,t.end_time
  19. endTime,t.state,t.community_id,t.community_id communityId,t.member_id,t.member_id memberId,t.lease_type leaseType
  20. from owner_car t
  21. where 1 =1
  22. <if test="carBrand !=null and carBrand != ''">
  23. and t.car_brand= #{carBrand}
  24. </if>
  25. <if test="carNum !=null and carNum != ''">
  26. and t.car_num= #{carNum}
  27. </if>
  28. <if test="psId !=null and psId != ''">
  29. and t.ps_id= #{psId}
  30. </if>
  31. <if test="remark !=null and remark != ''">
  32. and t.remark= #{remark}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="ownerId !=null and ownerId != ''">
  38. and t.owner_id= #{ownerId}
  39. </if>
  40. <if test="leaseType !=null and leaseType != ''">
  41. and t.lease_type= #{leaseType}
  42. </if>
  43. <if test="carTypeCd !=null and carTypeCd != ''">
  44. and t.car_type_cd= #{carTypeCd}
  45. </if>
  46. <if test="userId !=null and userId != ''">
  47. and t.user_id= #{userId}
  48. </if>
  49. <if test="carId !=null and carId != ''">
  50. and t.car_id= #{carId}
  51. </if>
  52. <if test="carColor !=null and carColor != ''">
  53. and t.car_color= #{carColor}
  54. </if>
  55. <if test="carType !=null and carType != ''">
  56. and t.car_type= #{carType}
  57. </if>
  58. <if test="startTime !=null and startTime != ''">
  59. and t.start_time= #{startTime}
  60. </if>
  61. <if test="endTime !=null and endTime != ''">
  62. and t.end_time= #{endTime}
  63. </if>
  64. <if test="state !=null and state != ''">
  65. and t.state= #{state}
  66. </if>
  67. <if test="communityId !=null and communityId != ''">
  68. and t.community_id= #{communityId}
  69. </if>
  70. <if test="memberId !=null and memberId != ''">
  71. and t.member_id= #{memberId}
  72. </if>
  73. order by t.create_time desc
  74. <if test="page != -1 and page != null ">
  75. limit #{page}, #{row}
  76. </if>
  77. </select>
  78. <!-- 修改车辆信息 add by wuxw 2018-07-03 -->
  79. <update id="updateOwnerCarInfo" parameterType="Map">
  80. update owner_car t set t.status_cd = #{statusCd}
  81. <if test="newBId != null and newBId != ''">
  82. ,t.b_id = #{newBId}
  83. </if>
  84. <if test="carBrand !=null and carBrand != ''">
  85. , t.car_brand= #{carBrand}
  86. </if>
  87. <if test="carNum !=null and carNum != ''">
  88. , t.car_num= #{carNum}
  89. </if>
  90. <if test="psId !=null and psId != ''">
  91. , t.ps_id= #{psId}
  92. </if>
  93. <if test="remark !=null and remark != ''">
  94. , t.remark= #{remark}
  95. </if>
  96. <if test="ownerId !=null and ownerId != ''">
  97. , t.owner_id= #{ownerId}
  98. </if>
  99. <if test="userId !=null and userId != ''">
  100. , t.user_id= #{userId}
  101. </if>
  102. <if test="carColor !=null and carColor != ''">
  103. , t.car_color= #{carColor}
  104. </if>
  105. <if test="carType !=null and carType != ''">
  106. , t.car_type= #{carType}
  107. </if>
  108. <if test="startTime !=null and startTime != ''">
  109. , t.start_time= #{startTime}
  110. </if>
  111. <if test="endTime !=null and endTime != ''">
  112. , t.end_time= #{endTime}
  113. </if>
  114. <if test="state !=null and state != ''">
  115. , t.state= #{state}
  116. </if>
  117. <if test="leaseType !=null and leaseType != ''">
  118. , t.lease_type= #{leaseType}
  119. </if>
  120. where 1=1
  121. <if test="bId !=null and bId != ''">
  122. and t.b_id= #{bId}
  123. </if>
  124. <if test="carId !=null and carId != ''">
  125. and t.car_id= #{carId}
  126. </if>
  127. <if test="memberId !=null and memberId != ''">
  128. and t.member_id= #{memberId}
  129. </if>
  130. <if test="communityId !=null and communityId != ''">
  131. and t.community_id= #{communityId}
  132. </if>
  133. <if test="carTypeCd !=null and carTypeCd != ''">
  134. and t.car_type_cd= #{carTypeCd}
  135. </if>
  136. </update>
  137. <!-- 查询车辆数量 add by wuxw 2018-07-03 -->
  138. <select id="queryOwnerCarsCount" parameterType="Map" resultType="Map">
  139. select count(1) count
  140. from owner_car t
  141. where 1 =1
  142. <if test="carBrand !=null and carBrand != ''">
  143. and t.car_brand= #{carBrand}
  144. </if>
  145. <if test="carNum !=null and carNum != ''">
  146. and t.car_num= #{carNum}
  147. </if>
  148. <if test="psId !=null and psId != ''">
  149. and t.ps_id= #{psId}
  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="ownerId !=null and ownerId != ''">
  158. and t.owner_id= #{ownerId}
  159. </if>
  160. <if test="leaseType !=null and leaseType != ''">
  161. and t.lease_type= #{leaseType}
  162. </if>
  163. <if test="carTypeCd !=null and carTypeCd != ''">
  164. and t.car_type_cd= #{carTypeCd}
  165. </if>
  166. <if test="userId !=null and userId != ''">
  167. and t.user_id= #{userId}
  168. </if>
  169. <if test="carId !=null and carId != ''">
  170. and t.car_id= #{carId}
  171. </if>
  172. <if test="carColor !=null and carColor != ''">
  173. and t.car_color= #{carColor}
  174. </if>
  175. <if test="carType !=null and carType != ''">
  176. and t.car_type= #{carType}
  177. </if>
  178. <if test="startTime !=null and startTime != ''">
  179. and t.start_time= #{startTime}
  180. </if>
  181. <if test="endTime !=null and endTime != ''">
  182. and t.end_time= #{endTime}
  183. </if>
  184. <if test="state !=null and state != ''">
  185. and t.state= #{state}
  186. </if>
  187. <if test="communityId !=null and communityId != ''">
  188. and t.community_id= #{communityId}
  189. </if>
  190. <if test="memberId !=null and memberId != ''">
  191. and t.member_id= #{memberId}
  192. </if>
  193. </select>
  194. </mapper>