TaxiOrderMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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="com.ruoyi.system.mapper.TaxiOrderMapper">
  6. <resultMap type="TaxiOrder" id="TaxiOrderResult">
  7. <result property="id" column="id" />
  8. <result property="ddId" column="dd_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="driverId" column="driver_id" />
  11. <result property="boardingAddress" column="boarding_address" />
  12. <result property="intoLongitude" column="into_longitude" />
  13. <result property="intoLatitude" column="into_latitude" />
  14. <result property="downAddress" column="down_address" />
  15. <result property="downLongitude" column="down_longitude" />
  16. <result property="downLatitude" column="down_latitude" />
  17. <result property="distance" column="distance" />
  18. <result property="state" column="state" />
  19. <result property="taxiType" column="taxi_type" />
  20. <result property="releaseId" column="release_id" />
  21. <result property="orderTime" column="order_time" />
  22. <result property="boardingTime" column="boarding_time" />
  23. <result property="alightingTime" column="alighting_time" />
  24. <result property="appointmentTime" column="appointment_time" />
  25. <result property="fare" column="fare" />
  26. <result property="highwayCosts" column="highway_costs" />
  27. <result property="amount" column="amount" />
  28. <result property="estimatedDuration" column="estimated_duration" />
  29. <result property="notes" column="notes" />
  30. <result property="coupon" column="coupon" />
  31. </resultMap>
  32. <sql id="selectTaxiOrderVo">
  33. select id, dd_id, user_id, driver_id, boarding_address, into_longitude, into_latitude, down_address, down_longitude, down_latitude, distance, state, taxi_type, release_id, order_time, boarding_time, alighting_time, appointment_time, fare, highway_costs, amount, estimated_duration, notes, coupon from taxi_order
  34. </sql>
  35. <select id="selectTaxiOrderList" parameterType="TaxiOrder" resultMap="TaxiOrderResult">
  36. <include refid="selectTaxiOrderVo"/>
  37. <where>
  38. <if test="ddId != null "> and dd_id = #{ddId}</if>
  39. <if test="orderTime != null "> and order_time = #{orderTime}</if>
  40. </where>
  41. </select>
  42. <select id="selectTaxiOrderById" parameterType="Long" resultMap="TaxiOrderResult">
  43. <include refid="selectTaxiOrderVo"/>
  44. where id = #{id}
  45. </select>
  46. <insert id="insertTaxiOrder" parameterType="TaxiOrder" useGeneratedKeys="true" keyProperty="id">
  47. insert into taxi_order
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="ddId != null">dd_id,</if>
  50. <if test="userId != null">user_id,</if>
  51. <if test="driverId != null">driver_id,</if>
  52. <if test="boardingAddress != null">boarding_address,</if>
  53. <if test="intoLongitude != null">into_longitude,</if>
  54. <if test="intoLatitude != null">into_latitude,</if>
  55. <if test="downAddress != null">down_address,</if>
  56. <if test="downLongitude != null">down_longitude,</if>
  57. <if test="downLatitude != null">down_latitude,</if>
  58. <if test="distance != null">distance,</if>
  59. <if test="state != null">state,</if>
  60. <if test="taxiType != null">taxi_type,</if>
  61. <if test="releaseId != null">release_id,</if>
  62. <if test="orderTime != null">order_time,</if>
  63. <if test="boardingTime != null">boarding_time,</if>
  64. <if test="alightingTime != null">alighting_time,</if>
  65. <if test="appointmentTime != null">appointment_time,</if>
  66. <if test="fare != null">fare,</if>
  67. <if test="highwayCosts != null">highway_costs,</if>
  68. <if test="amount != null">amount,</if>
  69. <if test="estimatedDuration != null">estimated_duration,</if>
  70. <if test="notes != null">notes,</if>
  71. <if test="coupon != null">coupon,</if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides=",">
  74. <if test="ddId != null">#{ddId},</if>
  75. <if test="userId != null">#{userId},</if>
  76. <if test="driverId != null">#{driverId},</if>
  77. <if test="boardingAddress != null">#{boardingAddress},</if>
  78. <if test="intoLongitude != null">#{intoLongitude},</if>
  79. <if test="intoLatitude != null">#{intoLatitude},</if>
  80. <if test="downAddress != null">#{downAddress},</if>
  81. <if test="downLongitude != null">#{downLongitude},</if>
  82. <if test="downLatitude != null">#{downLatitude},</if>
  83. <if test="distance != null">#{distance},</if>
  84. <if test="state != null">#{state},</if>
  85. <if test="taxiType != null">#{taxiType},</if>
  86. <if test="releaseId != null">#{releaseId},</if>
  87. <if test="orderTime != null">#{orderTime},</if>
  88. <if test="boardingTime != null">#{boardingTime},</if>
  89. <if test="alightingTime != null">#{alightingTime},</if>
  90. <if test="appointmentTime != null">#{appointmentTime},</if>
  91. <if test="fare != null">#{fare},</if>
  92. <if test="highwayCosts != null">#{highwayCosts},</if>
  93. <if test="amount != null">#{amount},</if>
  94. <if test="estimatedDuration != null">#{estimatedDuration},</if>
  95. <if test="notes != null">#{notes},</if>
  96. <if test="coupon != null">#{coupon},</if>
  97. </trim>
  98. </insert>
  99. <update id="updateTaxiOrder" parameterType="TaxiOrder">
  100. update taxi_order
  101. <trim prefix="SET" suffixOverrides=",">
  102. <if test="ddId != null">dd_id = #{ddId},</if>
  103. <if test="userId != null">user_id = #{userId},</if>
  104. <if test="driverId != null">driver_id = #{driverId},</if>
  105. <if test="boardingAddress != null">boarding_address = #{boardingAddress},</if>
  106. <if test="intoLongitude != null">into_longitude = #{intoLongitude},</if>
  107. <if test="intoLatitude != null">into_latitude = #{intoLatitude},</if>
  108. <if test="downAddress != null">down_address = #{downAddress},</if>
  109. <if test="downLongitude != null">down_longitude = #{downLongitude},</if>
  110. <if test="downLatitude != null">down_latitude = #{downLatitude},</if>
  111. <if test="distance != null">distance = #{distance},</if>
  112. <if test="state != null">state = #{state},</if>
  113. <if test="taxiType != null">taxi_type = #{taxiType},</if>
  114. <if test="releaseId != null">release_id = #{releaseId},</if>
  115. <if test="orderTime != null">order_time = #{orderTime},</if>
  116. <if test="boardingTime != null">boarding_time = #{boardingTime},</if>
  117. <if test="alightingTime != null">alighting_time = #{alightingTime},</if>
  118. <if test="appointmentTime != null">appointment_time = #{appointmentTime},</if>
  119. <if test="fare != null">fare = #{fare},</if>
  120. <if test="highwayCosts != null">highway_costs = #{highwayCosts},</if>
  121. <if test="amount != null">amount = #{amount},</if>
  122. <if test="estimatedDuration != null">estimated_duration = #{estimatedDuration},</if>
  123. <if test="notes != null">notes = #{notes},</if>
  124. <if test="coupon != null">coupon = #{coupon},</if>
  125. </trim>
  126. where id = #{id}
  127. </update>
  128. <delete id="deleteTaxiOrderById" parameterType="Long">
  129. delete from taxi_order where id = #{id}
  130. </delete>
  131. <delete id="deleteTaxiOrderByIds" parameterType="String">
  132. delete from taxi_order where id in
  133. <foreach item="id" collection="array" open="(" separator="," close=")">
  134. #{id}
  135. </foreach>
  136. </delete>
  137. </mapper>