ParkingCouponCarV1ServiceDaoImplMapper.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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="parkingCouponCarV1ServiceDaoImpl">
  6. <!-- 保存车辆停车卷信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveParkingCouponCarInfo" parameterType="Map">
  8. insert into parking_coupon_car(
  9. give_way,car_num,coupon_shop_id,remark,coupon_id,pcc_id,type_cd,pa_id,start_time,shop_id,state,end_time,community_id,value
  10. ) values (
  11. #{giveWay},#{carNum},#{couponShopId},#{remark},#{couponId},#{pccId},#{typeCd},#{paId},#{startTime},#{shopId},#{state},#{endTime},#{communityId},#{value}
  12. )
  13. </insert>
  14. <!-- 查询车辆停车卷信息 add by wuxw 2018-07-03 -->
  15. <select id="getParkingCouponCarInfo" parameterType="Map" resultType="Map">
  16. select t.give_way,t.give_way giveWay,t.car_num,t.car_num carNum,t.coupon_shop_id,t.coupon_shop_id
  17. couponShopId,t.remark,t.status_cd,t.status_cd statusCd,t.coupon_id,t.coupon_id couponId,t.pcc_id,t.pcc_id
  18. pccId,t.type_cd,t.type_cd typeCd,t.pa_id,t.pa_id paId,t.start_time,t.start_time startTime,t.shop_id,t.shop_id
  19. shopId,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.value,td.name stateName,td1.name giveWayName,
  20. td2.name stateName,t.create_time createTime,pcs.pa_name paName ,pcs.shop_name shopName,pc.`name` couponName
  21. from parking_coupon_car t
  22. left join t_dict td on t.state = td.status_cd and td.table_name = 'parking_coupon_car' and td.table_columns = 'state'
  23. left join t_dict td1 on t.give_way = td1.status_cd and td1.table_name = 'parking_coupon_car' and td1.table_columns = 'give_way'
  24. left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'parking_coupon_car' and td2.table_columns = 'give_way'
  25. left join parking_coupon_shop pcs on t.coupon_shop_id = pcs.coupon_shop_id and pcs.status_cd = '0'
  26. left join parking_coupon pc on t.coupon_id = pc.coupon_id and pc.status_cd = '0'
  27. where 1 =1
  28. <if test="giveWay !=null and giveWay != ''">
  29. and t.give_way= #{giveWay}
  30. </if>
  31. <if test="carNum !=null and carNum != ''">
  32. and t.car_num= #{carNum}
  33. </if>
  34. <if test="carNumLike !=null and carNumLike != ''">
  35. and t.car_num like concat('%',#{carNumLike},'%')
  36. </if>
  37. <if test="couponShopId !=null and couponShopId != ''">
  38. and t.coupon_shop_id= #{couponShopId}
  39. </if>
  40. <if test="remark !=null and remark != ''">
  41. and t.remark= #{remark}
  42. </if>
  43. <if test="statusCd !=null and statusCd != ''">
  44. and t.status_cd= #{statusCd}
  45. </if>
  46. <if test="couponId !=null and couponId != ''">
  47. and t.coupon_id= #{couponId}
  48. </if>
  49. <if test="couponNameLike !=null and couponNameLike != ''">
  50. and pc.`name` like concat('%',#{couponNameLike},'%')
  51. </if>
  52. <if test="pccId !=null and pccId != ''">
  53. and t.pcc_id= #{pccId}
  54. </if>
  55. <if test="typeCd !=null and typeCd != ''">
  56. and t.type_cd= #{typeCd}
  57. </if>
  58. <if test="paId !=null and paId != ''">
  59. and t.pa_id= #{paId}
  60. </if>
  61. <if test="startTime !=null and startTime != ''">
  62. and t.start_time= #{startTime}
  63. </if>
  64. <if test="shopId !=null and shopId != ''">
  65. and t.shop_id= #{shopId}
  66. </if>
  67. <if test="shopNameLike !=null and shopNameLike != ''">
  68. and pcs.shop_name like concat('%',#{shopNameLike},'%')
  69. </if>
  70. <if test="state !=null and state != ''">
  71. and t.state= #{state}
  72. </if>
  73. <if test="endTime !=null and endTime != ''">
  74. and t.end_time= #{endTime}
  75. </if>
  76. <if test="communityId !=null and communityId != ''">
  77. and t.community_id= #{communityId}
  78. </if>
  79. <if test="value !=null and value != ''">
  80. and t.value= #{value}
  81. </if>
  82. order by t.create_time desc
  83. <if test="page != -1 and page != null ">
  84. limit #{page}, #{row}
  85. </if>
  86. </select>
  87. <!-- 修改车辆停车卷信息 add by wuxw 2018-07-03 -->
  88. <update id="updateParkingCouponCarInfo" parameterType="Map">
  89. update parking_coupon_car t set t.status_cd = #{statusCd}
  90. <if test="newBId != null and newBId != ''">
  91. ,t.b_id = #{newBId}
  92. </if>
  93. <if test="giveWay !=null and giveWay != ''">
  94. , t.give_way= #{giveWay}
  95. </if>
  96. <if test="carNum !=null and carNum != ''">
  97. , t.car_num= #{carNum}
  98. </if>
  99. <if test="couponShopId !=null and couponShopId != ''">
  100. , t.coupon_shop_id= #{couponShopId}
  101. </if>
  102. <if test="remark !=null and remark != ''">
  103. , t.remark= #{remark}
  104. </if>
  105. <if test="couponId !=null and couponId != ''">
  106. , t.coupon_id= #{couponId}
  107. </if>
  108. <if test="typeCd !=null and typeCd != ''">
  109. , t.type_cd= #{typeCd}
  110. </if>
  111. <if test="paId !=null and paId != ''">
  112. , t.pa_id= #{paId}
  113. </if>
  114. <if test="startTime !=null and startTime != ''">
  115. , t.start_time= #{startTime}
  116. </if>
  117. <if test="shopId !=null and shopId != ''">
  118. , t.shop_id= #{shopId}
  119. </if>
  120. <if test="state !=null and state != ''">
  121. , t.state= #{state}
  122. </if>
  123. <if test="endTime !=null and endTime != ''">
  124. , t.end_time= #{endTime}
  125. </if>
  126. <if test="communityId !=null and communityId != ''">
  127. , t.community_id= #{communityId}
  128. </if>
  129. <if test="value !=null and value != ''">
  130. , t.value= #{value}
  131. </if>
  132. where 1=1
  133. <if test="pccId !=null and pccId != ''">
  134. and t.pcc_id= #{pccId}
  135. </if>
  136. </update>
  137. <!-- 查询车辆停车卷数量 add by wuxw 2018-07-03 -->
  138. <select id="queryParkingCouponCarsCount" parameterType="Map" resultType="Map">
  139. select count(1) count
  140. from parking_coupon_car t
  141. left join t_dict td on t.state = td.status_cd and td.table_name = 'parking_coupon_car' and td.table_columns = 'state'
  142. left join t_dict td1 on t.give_way = td1.status_cd and td1.table_name = 'parking_coupon_car' and td1.table_columns = 'give_way'
  143. left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'parking_coupon_car' and td2.table_columns = 'give_way'
  144. left join parking_coupon_shop pcs on t.coupon_shop_id = pcs.coupon_shop_id and pcs.status_cd = '0'
  145. left join parking_coupon pc on t.coupon_id = pc.coupon_id and pc.status_cd = '0'
  146. where 1 =1
  147. <if test="giveWay !=null and giveWay != ''">
  148. and t.give_way= #{giveWay}
  149. </if>
  150. <if test="carNum !=null and carNum != ''">
  151. and t.car_num= #{carNum}
  152. </if>
  153. <if test="carNumLike !=null and carNumLike != ''">
  154. and t.car_num like concat('%',#{carNumLike},'%')
  155. </if>
  156. <if test="couponShopId !=null and couponShopId != ''">
  157. and t.coupon_shop_id= #{couponShopId}
  158. </if>
  159. <if test="remark !=null and remark != ''">
  160. and t.remark= #{remark}
  161. </if>
  162. <if test="statusCd !=null and statusCd != ''">
  163. and t.status_cd= #{statusCd}
  164. </if>
  165. <if test="couponId !=null and couponId != ''">
  166. and t.coupon_id= #{couponId}
  167. </if>
  168. <if test="couponNameLike !=null and couponNameLike != ''">
  169. and pc.`name` like concat('%',#{couponNameLike},'%')
  170. </if>
  171. <if test="pccId !=null and pccId != ''">
  172. and t.pcc_id= #{pccId}
  173. </if>
  174. <if test="typeCd !=null and typeCd != ''">
  175. and t.type_cd= #{typeCd}
  176. </if>
  177. <if test="paId !=null and paId != ''">
  178. and t.pa_id= #{paId}
  179. </if>
  180. <if test="startTime !=null and startTime != ''">
  181. and t.start_time= #{startTime}
  182. </if>
  183. <if test="shopId !=null and shopId != ''">
  184. and t.shop_id= #{shopId}
  185. </if>
  186. <if test="shopNameLike !=null and shopNameLike != ''">
  187. and pcs.shop_name like concat('%',#{shopNameLike},'%')
  188. </if>
  189. <if test="state !=null and state != ''">
  190. and t.state= #{state}
  191. </if>
  192. <if test="endTime !=null and endTime != ''">
  193. and t.end_time= #{endTime}
  194. </if>
  195. <if test="communityId !=null and communityId != ''">
  196. and t.community_id= #{communityId}
  197. </if>
  198. <if test="value !=null and value != ''">
  199. and t.value= #{value}
  200. </if>
  201. </select>
  202. </mapper>