ParkingCouponV1ServiceDaoImplMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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="parkingCouponV1ServiceDaoImpl">
  6. <!-- 保存停车卷信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveParkingCouponInfo" parameterType="Map">
  8. insert into parking_coupon(
  9. type_cd,name,pa_id,pa_name,coupon_id,community_id,value,value_price
  10. ) values (
  11. #{typeCd},#{name},#{paId},#{paName},#{couponId},#{communityId},#{value},#{valuePrice}
  12. )
  13. </insert>
  14. <!-- 查询停车卷信息 add by wuxw 2018-07-03 -->
  15. <select id="getParkingCouponInfo" parameterType="Map" resultType="Map">
  16. select t.type_cd,t.type_cd typeCd,t.name,t.pa_id,t.pa_id paId,t.pa_name paName,t.status_cd,t.status_cd
  17. statusCd,t.coupon_id,t.coupon_id couponId,t.community_id,t.community_id
  18. communityId,t.value,t.value_price,t.value_price valuePrice,td.name typeCdName
  19. from parking_coupon t
  20. left join t_dict td on t.type_cd = td.status_cd and td.table_name = 'parking_coupon' and td.table_columns = 'type_cd'
  21. where 1 =1
  22. <if test="typeCd !=null and typeCd != ''">
  23. and t.type_cd= #{typeCd}
  24. </if>
  25. <if test="name !=null and name != ''">
  26. and t.name= #{name}
  27. </if>
  28. <if test="paId !=null and paId != ''">
  29. and t.pa_id= #{paId}
  30. </if>
  31. <if test="statusCd !=null and statusCd != ''">
  32. and t.status_cd= #{statusCd}
  33. </if>
  34. <if test="couponId !=null and couponId != ''">
  35. and t.coupon_id= #{couponId}
  36. </if>
  37. <if test="communityId !=null and communityId != ''">
  38. and t.community_id= #{communityId}
  39. </if>
  40. <if test="value !=null and value != ''">
  41. and t.value= #{value}
  42. </if>
  43. <if test="valuePrice !=null and valuePrice != ''">
  44. and t.value_price= #{valuePrice}
  45. </if>
  46. order by t.create_time desc
  47. <if test="page != -1 and page != null ">
  48. limit #{page}, #{row}
  49. </if>
  50. </select>
  51. <!-- 修改停车卷信息 add by wuxw 2018-07-03 -->
  52. <update id="updateParkingCouponInfo" parameterType="Map">
  53. update parking_coupon t set t.status_cd = #{statusCd}
  54. <if test="newBId != null and newBId != ''">
  55. ,t.b_id = #{newBId}
  56. </if>
  57. <if test="typeCd !=null and typeCd != ''">
  58. , t.type_cd= #{typeCd}
  59. </if>
  60. <if test="name !=null and name != ''">
  61. , t.name= #{name}
  62. </if>
  63. <if test="paId !=null and paId != ''">
  64. , t.pa_id= #{paId}
  65. </if>
  66. <if test="paName !=null and paName != ''">
  67. , t.pa_name= #{paName}
  68. </if>
  69. <if test="communityId !=null and communityId != ''">
  70. , t.community_id= #{communityId}
  71. </if>
  72. <if test="value !=null and value != ''">
  73. , t.value= #{value}
  74. </if>
  75. <if test="valuePrice !=null and valuePrice != ''">
  76. , t.value_price= #{valuePrice}
  77. </if>
  78. where 1=1
  79. <if test="couponId !=null and couponId != ''">
  80. and t.coupon_id= #{couponId}
  81. </if>
  82. </update>
  83. <!-- 查询停车卷数量 add by wuxw 2018-07-03 -->
  84. <select id="queryParkingCouponsCount" parameterType="Map" resultType="Map">
  85. select count(1) count
  86. from parking_coupon t
  87. where 1 =1
  88. <if test="typeCd !=null and typeCd != ''">
  89. and t.type_cd= #{typeCd}
  90. </if>
  91. <if test="name !=null and name != ''">
  92. and t.name= #{name}
  93. </if>
  94. <if test="paId !=null and paId != ''">
  95. and t.pa_id= #{paId}
  96. </if>
  97. <if test="statusCd !=null and statusCd != ''">
  98. and t.status_cd= #{statusCd}
  99. </if>
  100. <if test="couponId !=null and couponId != ''">
  101. and t.coupon_id= #{couponId}
  102. </if>
  103. <if test="communityId !=null and communityId != ''">
  104. and t.community_id= #{communityId}
  105. </if>
  106. <if test="value !=null and value != ''">
  107. and t.value= #{value}
  108. </if>
  109. <if test="valuePrice !=null and valuePrice != ''">
  110. and t.value_price= #{valuePrice}
  111. </if>
  112. </select>
  113. </mapper>