ParkingCouponShopV1ServiceDaoImplMapper.xml 6.3 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="parkingCouponShopV1ServiceDaoImpl">
  6. <!-- 保存商家停车卷信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveParkingCouponShopInfo" parameterType="Map">
  8. insert into parking_coupon_shop(
  9. quantity,pa_name,pa_id,shop_name,coupon_shop_id,community_name,start_time,shop_id,end_time,coupon_id,community_id
  10. ) values (
  11. #{quantity},#{paName},#{paId},#{shopName},#{couponShopId},#{communityName},#{startTime},#{shopId},#{endTime},#{couponId},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询商家停车卷信息 add by wuxw 2018-07-03 -->
  15. <select id="getParkingCouponShopInfo" parameterType="Map" resultType="Map">
  16. select t.quantity,t.pa_name,t.pa_name paName,t.pa_id,t.pa_id paId,t.shop_name,t.shop_name
  17. shopName,t.coupon_shop_id,t.coupon_shop_id couponShopId,t.community_name,t.community_name
  18. communityName,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.shop_id,t.shop_id
  19. shopId,t.end_time,t.end_time endTime,t.coupon_id,t.coupon_id couponId,t.community_id,t.community_id communityId,pc.`name` couponName
  20. from parking_coupon_shop t
  21. left join parking_coupon pc on t.coupon_id = pc.coupon_id and pc.status_cd = '0'
  22. where 1 =1
  23. <if test="quantity !=null and quantity != ''">
  24. and t.quantity= #{quantity}
  25. </if>
  26. <if test="paName !=null and paName != ''">
  27. and t.pa_name= #{paName}
  28. </if>
  29. <if test="paId !=null and paId != ''">
  30. and t.pa_id= #{paId}
  31. </if>
  32. <if test="shopName !=null and shopName != ''">
  33. and t.shop_name= #{shopName}
  34. </if>
  35. <if test="couponShopId !=null and couponShopId != ''">
  36. and t.coupon_shop_id= #{couponShopId}
  37. </if>
  38. <if test="communityName !=null and communityName != ''">
  39. and t.community_name= #{communityName}
  40. </if>
  41. <if test="startTime !=null and startTime != ''">
  42. and t.start_time= #{startTime}
  43. </if>
  44. <if test="statusCd !=null and statusCd != ''">
  45. and t.status_cd= #{statusCd}
  46. </if>
  47. <if test="shopId !=null and shopId != ''">
  48. and t.shop_id= #{shopId}
  49. </if>
  50. <if test="endTime !=null and endTime != ''">
  51. and t.end_time= #{endTime}
  52. </if>
  53. <if test="couponId !=null and couponId != ''">
  54. and t.coupon_id= #{couponId}
  55. </if>
  56. <if test="communityId !=null and communityId != ''">
  57. and t.community_id= #{communityId}
  58. </if>
  59. order by t.create_time desc
  60. <if test="page != -1 and page != null ">
  61. limit #{page}, #{row}
  62. </if>
  63. </select>
  64. <!-- 修改商家停车卷信息 add by wuxw 2018-07-03 -->
  65. <update id="updateParkingCouponShopInfo" parameterType="Map">
  66. update parking_coupon_shop t set t.status_cd = #{statusCd}
  67. <if test="newBId != null and newBId != ''">
  68. ,t.b_id = #{newBId}
  69. </if>
  70. <if test="quantity !=null and quantity != ''">
  71. , t.quantity= #{quantity}
  72. </if>
  73. <if test="paName !=null and paName != ''">
  74. , t.pa_name= #{paName}
  75. </if>
  76. <if test="paId !=null and paId != ''">
  77. , t.pa_id= #{paId}
  78. </if>
  79. <if test="shopName !=null and shopName != ''">
  80. , t.shop_name= #{shopName}
  81. </if>
  82. <if test="communityName !=null and communityName != ''">
  83. , t.community_name= #{communityName}
  84. </if>
  85. <if test="startTime !=null and startTime != ''">
  86. , t.start_time= #{startTime}
  87. </if>
  88. <if test="shopId !=null and shopId != ''">
  89. , t.shop_id= #{shopId}
  90. </if>
  91. <if test="endTime !=null and endTime != ''">
  92. , t.end_time= #{endTime}
  93. </if>
  94. <if test="couponId !=null and couponId != ''">
  95. , t.coupon_id= #{couponId}
  96. </if>
  97. <if test="communityId !=null and communityId != ''">
  98. , t.community_id= #{communityId}
  99. </if>
  100. where 1=1
  101. <if test="couponShopId !=null and couponShopId != ''">
  102. and t.coupon_shop_id= #{couponShopId}
  103. </if>
  104. </update>
  105. <!-- 查询商家停车卷数量 add by wuxw 2018-07-03 -->
  106. <select id="queryParkingCouponShopsCount" parameterType="Map" resultType="Map">
  107. select count(1) count
  108. from parking_coupon_shop t
  109. where 1 =1
  110. <if test="quantity !=null and quantity != ''">
  111. and t.quantity= #{quantity}
  112. </if>
  113. <if test="paName !=null and paName != ''">
  114. and t.pa_name= #{paName}
  115. </if>
  116. <if test="paId !=null and paId != ''">
  117. and t.pa_id= #{paId}
  118. </if>
  119. <if test="shopName !=null and shopName != ''">
  120. and t.shop_name= #{shopName}
  121. </if>
  122. <if test="couponShopId !=null and couponShopId != ''">
  123. and t.coupon_shop_id= #{couponShopId}
  124. </if>
  125. <if test="communityName !=null and communityName != ''">
  126. and t.community_name= #{communityName}
  127. </if>
  128. <if test="startTime !=null and startTime != ''">
  129. and t.start_time= #{startTime}
  130. </if>
  131. <if test="statusCd !=null and statusCd != ''">
  132. and t.status_cd= #{statusCd}
  133. </if>
  134. <if test="shopId !=null and shopId != ''">
  135. and t.shop_id= #{shopId}
  136. </if>
  137. <if test="endTime !=null and endTime != ''">
  138. and t.end_time= #{endTime}
  139. </if>
  140. <if test="couponId !=null and couponId != ''">
  141. and t.coupon_id= #{couponId}
  142. </if>
  143. <if test="communityId !=null and communityId != ''">
  144. and t.community_id= #{communityId}
  145. </if>
  146. </select>
  147. <select id="queryParkingCouponShopStatistics" parameterType="Map" resultType="Map">
  148. select t.shop_id shopId,sum(t.quantity) quantity
  149. from parking_coupon_shop t
  150. where 1 =1
  151. and t.shop_id in
  152. <foreach collection="shopIds" item="item" index="index" open="(" close=")" separator=",">
  153. #{item}
  154. </foreach>
  155. group by t.shop_id
  156. </select>
  157. </mapper>