后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WxCarPayRecordMapper.xml 5.1 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxCarPayRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCarPayRecord">
  5. <id column="id" property="id"/>
  6. <result column="tenant_id" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="vendor_type" property="vendorType"/>
  9. <result column="syn_id" property="synId"/>
  10. <result column="park_id" property="parkId"/>
  11. <result column="park_name" property="parkName"/>
  12. <result column="user_type" property="userType"/>
  13. <result column="plate_number" property="plateNumber"/>
  14. <result column="entrance_time" property="entranceTime"/>
  15. <result column="exit_time" property="exitTime"/>
  16. <result column="fee" property="fee"/>
  17. <result column="fee_time" property="feeTime"/>
  18. <result column="coupon" property="coupon"/>
  19. <result column="coupon_code" property="couponCode"/>
  20. <result column="fix_parking_id" property="fixParkingId"/>
  21. <result column="remaining_days" property="remainingDays"/>
  22. <result column="discount_amount" property="discountAmount"/>
  23. <result column="paid_service_fee" property="paidServiceFee"/>
  24. <result column="phone" property="phone"/>
  25. <result column="create_date" property="createDate"/>
  26. <result column="update_date" property="updateDate"/>
  27. <result column="stayed_time" property="stayedTime"/>
  28. </resultMap>
  29. <sql id="allColumns">
  30. `id`,`tenant_id`,`parent_tenant_id`,`vendor_type`,`create_date`,`update_date`,syn_id,park_id,park_name,user_type,
  31. plate_number,entrance_time,exit_time,fee,fee_time,coupon,coupon_code,fix_parking_id,remaining_days,discount_amount,phone
  32. ,paid_service_fee,create_date,update_date,floor(stayed_time/60) stayed_time
  33. </sql>
  34. <sql id="dynamicWhereConditions">
  35. where 1 = 1
  36. <if test=" null != id ">
  37. and `id` = #{id}
  38. </if>
  39. <if test=" null != synId ">
  40. and `syn_id` = #{synId}
  41. </if>
  42. <if test=" null != feeTimeStr ">
  43. and `fee_time` = #{feeTimeStr}
  44. </if>
  45. <if test=" null != fee ">
  46. and `fee` = #{fee}
  47. </if>
  48. <if test=" null != feeTime ">
  49. and TIMESTAMPDIFF(MINUTE, `fee_time`, #{feeTime}) &lt;= 15
  50. </if>
  51. <if test=" null != tenantId and '' != tenantId">
  52. and `tenant_id` = #{tenantId}
  53. </if>
  54. <if test=" null != parentTenantId and '' != parentTenantId">
  55. and `parent_tenant_id` = #{parentTenantId}
  56. </if>
  57. <if test=" null != vendorType ">
  58. and `vendor_type` = #{vendorType}
  59. </if>
  60. <choose>
  61. <when test="1==isPay">
  62. <if test=" null != startDate">
  63. and fee_time >= #{startDate}
  64. </if>
  65. <if test=" null != endDate">
  66. and fee_time &lt;= #{endDate}
  67. </if>
  68. </when>
  69. <otherwise>
  70. <if test=" null != startDate">
  71. and create_date >= #{startDate}
  72. </if>
  73. <if test=" null != endDate">
  74. and create_date &lt;= #{endDate}
  75. </if>
  76. </otherwise>
  77. </choose>
  78. <if test=" 1 == isPay">
  79. and fee is not null
  80. and fee != ''
  81. </if>
  82. <if test=" null != sortColumns">order by ${sortColumns}</if>
  83. <if test=" null == sortColumns">order by create_date</if>
  84. </sql>
  85. <select id="findCarPayListByPage" parameterType="com.iformall.domain.po.WxCarPayRecord" resultMap="BaseResultMap">
  86. select
  87. <include refid="allColumns"/>
  88. from wx_car_pay_record
  89. <include refid="dynamicWhereConditions"/>
  90. </select>
  91. <select id="findCarPayList" parameterType="com.iformall.domain.po.WxCarPayRecord" resultMap="BaseResultMap">
  92. select
  93. <include refid="allColumns"/>
  94. from wx_car_pay_record
  95. <include refid="dynamicWhereConditions"/>
  96. </select>
  97. <update id="updateBySynId" parameterType="com.iformall.domain.po.WxCarPayRecord">
  98. update wx_car_pay_record set update_date = now()
  99. <if test="null != exitTime">
  100. ,exit_time = #{exitTime}
  101. </if>
  102. <if test="null != stayedTime">
  103. ,stayed_time = #{stayedTime}
  104. </if>
  105. <if test="null != fee">
  106. ,fee = #{fee}
  107. </if>
  108. <if test="null != feeTime">
  109. ,fee_time = #{feeTime}
  110. </if>
  111. <if test="null != paidServiceFee">
  112. ,paid_service_fee = #{paidServiceFee}
  113. </if>
  114. where syn_id = #{synId}
  115. </update>
  116. <select id="findCarPayCount" parameterType="com.iformall.domain.po.WxCarPayRecord" resultType="Integer">
  117. select
  118. count(*)
  119. from wx_car_pay_record
  120. <include refid="dynamicWhereConditions"/>
  121. </select>
  122. </mapper>