<?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.oying.modules.rider.mapper.RiderOrderRecordMapper">
|
<resultMap id="BaseResultMap" type="com.oying.modules.rider.domain.RiderOrderRecord">
|
<id column="record_id" property="recordId"/>
|
<result column="order_id" property="orderId"/>
|
<result column="order_num" property="orderNum"/>
|
<result column="merchant_id" property="merchantId"/>
|
<result column="merchant_name" property="merchantName"/>
|
<result column="merchant_address" property="merchantAddress"/>
|
<result column="receiver_address" property="receiverAddress"/>
|
<result column="order_status" property="orderStatus"/>
|
<result column="accept_time" property="acceptTime"/>
|
<result column="accept_num" property="acceptNum"/>
|
<result column="finish_time" property="finishTime"/>
|
<result column="delivery_duration" property="deliveryDuration"/>
|
<result column="is_overtime" property="isOvertime"/>
|
<result column="order_source" property="orderSource"/>
|
<result column="order_income" property="orderIncome"/>
|
<result column="create_by" property="createBy"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_by" property="updateBy"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="rider_id" property="riderId"/>
|
<result column="phone" property="phone"/>
|
<result column="rider_name" property="riderName"/>
|
<result column="user_longitude" property="userLongitude"/>
|
<result column="user_latitude" property="userLatitude"/>
|
<result column="merchant_longitude" property="merchantLongitude"/>
|
<result column="merchant_latitude" property="merchantLatitude"/>
|
<result column="user_id" property="userId"/>
|
<result column="delivery_fee_id" property="deliveryFeeId"/>
|
<result column="order_time" property="orderTime"/>
|
<result column="user_name" property="userName"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
record_id,
|
order_id,
|
order_num,
|
merchant_id,
|
merchant_name,
|
merchant_address,
|
receiver_address,
|
order_status,
|
accept_time,
|
accept_num,
|
finish_time,
|
delivery_duration,
|
is_overtime,
|
order_source,
|
order_income,
|
create_by,
|
create_time,
|
update_by,
|
update_time,
|
rider_id,
|
phone,
|
rider_name,
|
user_id,
|
user_longitude,
|
user_latitude,
|
merchant_longitude,
|
merchant_latitude,
|
delivery_fee_id,
|
order_time,
|
user_name
|
</sql>
|
<select id="findAll" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from qs_rider_order_record
|
<where>
|
<if test="criteria.riderId != null">
|
and rider_id = #{criteria.riderId}
|
</if>
|
<if test="criteria.userId != null">
|
and user_id = #{criteria.userId}
|
</if>
|
<if test="criteria.userName != null">
|
and user_name = #{criteria.userName}
|
</if>
|
<if test="criteria.orderId != null">
|
and order_id = #{criteria.orderId}
|
</if>
|
<if test="criteria.phone != null">
|
and phone = #{criteria.phone}
|
</if>
|
<if test="criteria.orderNum != null">
|
and order_num = #{criteria.orderNum}
|
</if>
|
<if test="criteria.merchantId != null">
|
and merchant_id = #{criteria.merchantId}
|
</if>
|
<if test="criteria.merchantName != null">
|
and merchant_name like concat('%', #{criteria.merchantName}, '%')
|
</if>
|
<if test="criteria.merchantAddress != null">
|
and merchant_address like concat('%', #{criteria.merchantAddress}, '%')
|
</if>
|
<if test="criteria.receiverAddress != null">
|
and receiver_address like concat('%', #{criteria.receiverAddress}, '%')
|
</if>
|
<if test="criteria.orderStatus != null">
|
and order_status = #{criteria.orderStatus}
|
</if>
|
<if test="criteria.isOvertime != null">
|
and is_overtime = #{criteria.isOvertime}
|
</if>
|
<if test="criteria.acceptTime != null and criteria.acceptTime.size() > 0">
|
AND accept_time BETWEEN #{criteria.acceptTime[0]} AND #{criteria.acceptTime[1]}
|
</if>
|
<if test="criteria.finishTime != null and criteria.finishTime.size() > 0">
|
AND finish_time BETWEEN #{criteria.finishTime[0]} AND #{criteria.finishTime[1]}
|
</if>
|
<if test="criteria.createTime != null and criteria.createTime.size() > 0">
|
AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
|
</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="selectRiderInfo" resultType="com.oying.modules.rider.domain.RiderOrderRecord">
|
select record_id recordId ,accept_time as acceptTime, order_time as orderTime
|
from qs_rider_order_record where order_num = #{orderNum}
|
</select>
|
</mapper>
|