HouseOrderMapper.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.template.mapper.HouseOrderMapper">
  4. <select id="pageList" resultType="com.template.model.vo.HouseOrderPageListVo">
  5. SELECT
  6. ho.order_number as orderNumber,
  7. ho.live_time as liveTime,
  8. ho.leave_time as leaveTime,
  9. ho.reserve_name as reserveName,
  10. ho.live_name as liveName,
  11. ho.reserve_phone as phone,
  12. h.room_name as houseName,
  13. hn.room_number as houseNumber,
  14. ho.pay_price as orderPrice,
  15. ho.pay_type as payType,
  16. ho.order_status as orderStart,
  17. ho.pay_time as payTime,
  18. ho.refund_time as refundTime,
  19. ho.cancel_time as cancelTime,
  20. h.id as houseId,
  21. hn.id as houserNumberId
  22. FROM
  23. `house_order` ho
  24. LEFT JOIN house_number hn ON hn.id = ho.house_number_id
  25. AND hn.deleted = 0
  26. LEFT JOIN house h ON h.id = hn.house_id
  27. AND hn.deleted = 0
  28. <where>
  29. ho.deleted=0
  30. <if test="orderStatus != null and orderStatus != ''">
  31. AND ho.order_status = #{orderStatus}
  32. </if>
  33. <if test="houseType != null and houseType != ''">
  34. AND h.room_type = #{houseType}
  35. </if>
  36. <if test="keyWord != null and keyWord != ''">
  37. AND (ho.reserve_name LIKE '%' #{keyWord} '%' or ho.live_name LIKE '%' #{keyWord} '%' )
  38. </if>
  39. <if test="payPriceStartTime != null and payPriceStartTime != '' and payPriceEndTime != null and payPriceEndTime != '' ">
  40. AND #{payPriceEndTime} >= ho.pay_time
  41. AND ho.pay_time >= #{payPriceStartTime}
  42. </if>
  43. <if test="refundStartTime != null and refundStartTime != '' and refundEndTime != null and refundEndTime != '' ">
  44. AND ho.refund_time >= #{refundStartTime}
  45. AND #{refundEndTime} >= ho.refund_time
  46. </if>
  47. <if test="cancelStartTime != null and cancelStartTime != '' and cancelEndTime != null and cancelEndTime != '' ">
  48. AND ho.cancel_time >= #{cancelStartTime}
  49. AND #{cancelEndTime} >= ho.cancel_time
  50. </if>
  51. <if test="liveStartTime != null and liveStartTime != '' and liveEndTime != null and liveEndTime != '' ">
  52. AND #{liveEndTime} >= ho.live_time
  53. AND ho.live_time >= #{liveStartTime}
  54. </if>
  55. <if test="leaveStartTime != null and leaveStartTime != '' and leaveEndTime != null and leaveEndTime != '' ">
  56. AND #{leaveEndTime} >= ho.leave_time
  57. AND ho.leave_time >= #{leaveStartTime}
  58. </if>
  59. </where>
  60. ORDER BY
  61. ho.create_time DESC
  62. </select>
  63. </mapper>