| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.template.mapper.HouseOrderMapper">
- <select id="pageList" resultType="com.template.model.vo.HouseOrderPageListVo">
- SELECT
- ho.order_number as orderNumber,
- ho.live_time as liveTime,
- ho.leave_time as leaveTime,
- ho.reserve_name as reserveName,
- ho.live_name as liveName,
- ho.reserve_phone as phone,
- h.room_name as houseName,
- hn.room_number as houseNumber,
- ho.pay_price as orderPrice,
- ho.pay_type as payType,
- ho.order_status as orderStart,
- ho.pay_time as payTime,
- ho.refund_time as refundTime,
- ho.cancel_time as cancelTime,
- h.id as houseId,
- hn.id as houserNumberId
- FROM
- `house_order` ho
- LEFT JOIN house_number hn ON hn.id = ho.house_number_id
- AND hn.deleted = 0
- LEFT JOIN house h ON h.id = hn.house_id
- AND hn.deleted = 0
- <where>
- ho.deleted=0
- <if test="orderStatus != null and orderStatus != ''">
- AND ho.order_status = #{orderStatus}
- </if>
- <if test="houseType != null and houseType != ''">
- AND h.room_type = #{houseType}
- </if>
- <if test="keyWord != null and keyWord != ''">
- AND (ho.reserve_name LIKE '%' #{keyWord} '%' or ho.live_name LIKE '%' #{keyWord} '%' )
- </if>
- <if test="payPriceStartTime != null and payPriceStartTime != '' and payPriceEndTime != null and payPriceEndTime != '' ">
- AND #{payPriceEndTime} >= ho.pay_time
- AND ho.pay_time >= #{payPriceStartTime}
- </if>
- <if test="refundStartTime != null and refundStartTime != '' and refundEndTime != null and refundEndTime != '' ">
- AND ho.refund_time >= #{refundStartTime}
- AND #{refundEndTime} >= ho.refund_time
- </if>
- <if test="cancelStartTime != null and cancelStartTime != '' and cancelEndTime != null and cancelEndTime != '' ">
- AND ho.cancel_time >= #{cancelStartTime}
- AND #{cancelEndTime} >= ho.cancel_time
- </if>
- <if test="liveStartTime != null and liveStartTime != '' and liveEndTime != null and liveEndTime != '' ">
- AND #{liveEndTime} >= ho.live_time
- AND ho.live_time >= #{liveStartTime}
- </if>
- <if test="leaveStartTime != null and leaveStartTime != '' and leaveEndTime != null and leaveEndTime != '' ">
- AND #{leaveEndTime} >= ho.leave_time
- AND ho.leave_time >= #{leaveStartTime}
- </if>
- </where>
- ORDER BY
- ho.create_time DESC
- </select>
- </mapper>
|