<?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.stylefeng.guns.modular.system.dao.OrderCrossCityMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OrderCrossCity">
|
<id column="id" property="id"/>
|
<result column="userId" property="userId"/>
|
<result column="serverCarModelId" property="serverCarModelId"/>
|
<result column="driverId" property="driverId"/>
|
<result column="lineId" property="lineId"/>
|
<result column="lineShiftDriverId" property="lineShiftDriverId"/>
|
<result column="carId" property="carId"/>
|
<result column="orderNum" property="orderNum"/>
|
<result column="placementLon" property="placementLon"/>
|
<result column="placementLat" property="placementLat"/>
|
<result column="placementAddress" property="placementAddress"/>
|
<result column="startLon" property="startLon"/>
|
<result column="startLat" property="startLat"/>
|
<result column="startAddress" property="startAddress"/>
|
<result column="endLon" property="endLon"/>
|
<result column="endLat" property="endLat"/>
|
<result column="endAddress" property="endAddress"/>
|
<result column="boardingLon" property="boardingLon"/>
|
<result column="boardingLat" property="boardingLat"/>
|
<result column="boardingAddress" property="boardingAddress"/>
|
<result column="boardingTime" property="boardingTime"/>
|
<result column="getoffLon" property="getoffLon"/>
|
<result column="getoffLat" property="getoffLat"/>
|
<result column="getoffAddress" property="getoffAddress"/>
|
<result column="getoffTime" property="getoffTime"/>
|
<result column="mileage" property="mileage"/>
|
<result column="payManner" property="payManner"/>
|
<result column="payType" property="payType"/>
|
<result column="orderMoney" property="orderMoney"/>
|
<result column="redPacketMoney" property="redPacketMoney"/>
|
<result column="couponMoney" property="couponMoney"/>
|
<result column="redPacketId" property="redPacketId"/>
|
<result column="couponId" property="couponId"/>
|
<result column="discount" property="discount"/>
|
<result column="discountMoney" property="discountMoney"/>
|
<result column="peopleNumber" property="peopleNumber"/>
|
<result column="seatNumber" property="seatNumber" />
|
<result column="activityId" property="activityId"/>
|
<result column="companyId" property="companyId"/>
|
<result column="payMoney" property="payMoney"/>
|
<result column="passengers" property="passengers"/>
|
<result column="passengersPhone" property="passengersPhone"/>
|
<result column="sort" property="sort"/>
|
<result column="state" property="state"/>
|
<result column="insertTime" property="insertTime"/>
|
<result column="travelTime" property="travelTime"/>
|
<result column="snatchOrderTime" property="snatchOrderTime"/>
|
<result column="setOutTime" property="setOutTime"/>
|
<result column="arriveTime" property="arriveTime"/>
|
<result column="startServiceTime" property="startServiceTime"/>
|
<result column="endServiceTime" property="endServiceTime"/>
|
<result column="travelMode" property="travelMode"/>
|
<result column="orderSource" property="orderSource"/>
|
<result column="isReassign" property="isReassign"/>
|
<result column="reassignNotice" property="reassignNotice"/>
|
<result column="invoiceId" property="invoiceId"/>
|
<result column="trackId" property="trackId"/>
|
<result column="isDelete" property="isDelete"/>
|
<result column="oldState" property="oldState"/>
|
<result column="telX" property="telX"/>
|
<result column="bindId" property="bindId"/>
|
</resultMap>
|
|
|
<select id="queryOrderList" resultType="map">
|
select
|
a.id as id,
|
DATE_FORMAT(a.insertTime, '%Y年%m月%d日%H:%i') as orderTime,
|
CONCAT(b.nickName, '-', b.phone) as `user`,
|
a.startAddress as startAddress,
|
a.endAddress as endAddress,
|
a.state as state,
|
c.`name` as lineName
|
from t_order_cross_city a
|
left join t_user b on (a.userId = b.id)
|
left join t_line c on (a.lineId = c.id)
|
left join t_car d on (a.carId = d.id)
|
left join t_driver e on (a.driverId = e.id)
|
where a.isDelete = 1 and a.companyId = #{companyId}
|
<if test="null != search and '' != search">
|
and (a.passengersPhone = #{search} or c.name like CONCAT('%', #{search}, '%') or e.phone like CONCAT('%', #{search}, '%') or d.carLicensePlate like CONCAT('%', #{search}, '%'))
|
</if>
|
<if test="null != orderSource">
|
and a.orderSource in
|
<foreach collection="orderSource" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="null != state">
|
and a.state in
|
<foreach collection="state" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="null != lineId">
|
and a.lineId in
|
<foreach collection="lineId" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
order by a.insertTime desc
|
<if test="null != pageNum and null != size">
|
limit #{pageNum}, #{size}
|
</if>
|
</select>
|
|
|
<select id="queryOrderInfo" resultType="map">
|
select
|
a.id as id,
|
DATE_FORMAT(a.insertTime, '%Y/%m/%d/%H:%i') as orderTime,
|
a.orderNum as orderNumber,
|
a.orderSource as orderSource,
|
DATE_FORMAT(a.travelTime, '%Y/%m/%d/%H:%i') as travelTime,
|
CONCAT(b.nickName, '-', b.phone) as `user`,
|
CONCAT(a.passengers, '-',a.passengersPhone) as passengers,
|
a.startAddress as startAddress,
|
a.endAddress as endAddress,
|
c.`name` as line,
|
a.peopleNumber as peopleNumber,
|
a.seatNumber as seatNumber,
|
a.remark as remark,
|
a.orderMoney as orderMoney,
|
a.travelMode as travelType,
|
CONCAT(d.`name`, '-',d.phone) as driver,
|
e.carLicensePlate as car,
|
a.state as state
|
from t_order_cross_city a
|
left join t_user b on (a.userId = b.id)
|
left join t_line c on (a.lineId = c.id)
|
left join t_driver d on (a.driverId = d.id)
|
left join t_car e on (a.carId = e.id)
|
where a.id = #{id}
|
</select>
|
|
|
<select id="queryByDriverId" resultType="OrderCrossCity">
|
select
|
id as id,
|
userId as userId,
|
serverCarModelId as serverCarModelId,
|
driverId as driverId,
|
lineId as lineId,
|
lineShiftDriverId as lineShiftDriverId,
|
carId as carId,
|
orderNum as orderNum,
|
placementLon as placementLon,
|
placementLat as placementLat,
|
placementAddress as placementAddress,
|
startLon as startLon,
|
startLat as startLat,
|
startAddress as startAddress,
|
endLon as endLon,
|
endLat as endLat,
|
endAddress as endAddress,
|
boardingLon as boardingLon,
|
boardingLat as boardingLat,
|
boardingAddress as boardingAddress,
|
boardingTime as boardingTime,
|
getoffLon as getoffLon,
|
getoffLat as getoffLat,
|
getoffAddress as getoffAddress,
|
getoffTime as getoffTime,
|
mileage as mileage,
|
payManner as payManner,
|
payType as payType,
|
orderMoney as orderMoney,
|
redPacketMoney as redPacketMoney,
|
couponMoney as couponMoney,
|
redPacketId as redPacketId,
|
couponId as couponId,
|
discount as discount,
|
discountMoney as discountMoney,
|
activityId as activityId,
|
companyId as companyId,
|
payMoney as payMoney,
|
passengers as passengers,
|
passengersPhone as passengersPhone,
|
peopleNumber as peopleNumber,
|
seatNumber as seatNumber,
|
sort as sort,
|
state as state,
|
insertTime as insertTime,
|
travelTime as travelTime,
|
snatchOrderTime as snatchOrderTime,
|
setOutTime as setOutTime,
|
arriveTime as arriveTime,
|
startServiceTime as startServiceTime,
|
endServiceTime as endServiceTime,
|
travelMode as travelMode,
|
orderSource as orderSource,
|
isReassign as isReassign,
|
reassignNotice as reassignNotice,
|
invoiceId as invoiceId,
|
trackId as trackId,
|
isDelete as isDelete,
|
oldState as oldState,
|
telX as telX,
|
bindId as bindId
|
from t_order_cross_city where isDelete = 1
|
<if test="null != driverId">
|
and driverId = #{driverId}
|
</if>
|
<if test="null != state">
|
and state in
|
<foreach collection="state" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
</select>
|
|
|
|
<select id="query" resultType="OrderCrossCity">
|
select
|
id as id,
|
userId as userId,
|
serverCarModelId as serverCarModelId,
|
driverId as driverId,
|
lineId as lineId,
|
lineShiftDriverId as lineShiftDriverId,
|
carId as carId,
|
orderNum as orderNum,
|
placementLon as placementLon,
|
placementLat as placementLat,
|
placementAddress as placementAddress,
|
startLon as startLon,
|
startLat as startLat,
|
startAddress as startAddress,
|
endLon as endLon,
|
endLat as endLat,
|
endAddress as endAddress,
|
boardingLon as boardingLon,
|
boardingLat as boardingLat,
|
boardingAddress as boardingAddress,
|
boardingTime as boardingTime,
|
getoffLon as getoffLon,
|
getoffLat as getoffLat,
|
getoffAddress as getoffAddress,
|
getoffTime as getoffTime,
|
mileage as mileage,
|
payManner as payManner,
|
payType as payType,
|
orderMoney as orderMoney,
|
redPacketMoney as redPacketMoney,
|
couponMoney as couponMoney,
|
redPacketId as redPacketId,
|
couponId as couponId,
|
discount as discount,
|
discountMoney as discountMoney,
|
activityId as activityId,
|
companyId as companyId,
|
payMoney as payMoney,
|
passengers as passengers,
|
passengersPhone as passengersPhone,
|
peopleNumber as peopleNumber,
|
seatNumber as seatNumber,
|
sort as sort,
|
state as state,
|
insertTime as insertTime,
|
travelTime as travelTime,
|
snatchOrderTime as snatchOrderTime,
|
setOutTime as setOutTime,
|
arriveTime as arriveTime,
|
startServiceTime as startServiceTime,
|
endServiceTime as endServiceTime,
|
travelMode as travelMode,
|
orderSource as orderSource,
|
isReassign as isReassign,
|
reassignNotice as reassignNotice,
|
invoiceId as invoiceId,
|
trackId as trackId,
|
isDelete as isDelete,
|
oldState as oldState,
|
telX as telX,
|
bindId as bindId
|
from t_order_cross_city where isDelete = 1
|
<if test="null != start and null != end">
|
and travelTime between #{start} and #{end}
|
</if>
|
</select>
|
|
|
<select id="queryByDriver" resultType="OrderCrossCity">
|
select
|
id as id,
|
userId as userId,
|
serverCarModelId as serverCarModelId,
|
driverId as driverId,
|
lineId as lineId,
|
lineShiftDriverId as lineShiftDriverId,
|
carId as carId,
|
orderNum as orderNum,
|
placementLon as placementLon,
|
placementLat as placementLat,
|
placementAddress as placementAddress,
|
startLon as startLon,
|
startLat as startLat,
|
startAddress as startAddress,
|
endLon as endLon,
|
endLat as endLat,
|
endAddress as endAddress,
|
boardingLon as boardingLon,
|
boardingLat as boardingLat,
|
boardingAddress as boardingAddress,
|
boardingTime as boardingTime,
|
getoffLon as getoffLon,
|
getoffLat as getoffLat,
|
getoffAddress as getoffAddress,
|
getoffTime as getoffTime,
|
mileage as mileage,
|
payManner as payManner,
|
payType as payType,
|
orderMoney as orderMoney,
|
redPacketMoney as redPacketMoney,
|
couponMoney as couponMoney,
|
redPacketId as redPacketId,
|
couponId as couponId,
|
discount as discount,
|
discountMoney as discountMoney,
|
activityId as activityId,
|
companyId as companyId,
|
payMoney as payMoney,
|
passengers as passengers,
|
passengersPhone as passengersPhone,
|
peopleNumber as peopleNumber,
|
seatNumber as seatNumber,
|
sort as sort,
|
state as state,
|
insertTime as insertTime,
|
travelTime as travelTime,
|
snatchOrderTime as snatchOrderTime,
|
setOutTime as setOutTime,
|
arriveTime as arriveTime,
|
startServiceTime as startServiceTime,
|
endServiceTime as endServiceTime,
|
travelMode as travelMode,
|
orderSource as orderSource,
|
isReassign as isReassign,
|
reassignNotice as reassignNotice,
|
invoiceId as invoiceId,
|
trackId as trackId,
|
isDelete as isDelete,
|
oldState as oldState,
|
telX as telX,
|
bindId as bindId
|
from t_order_cross_city where isDelete = 1
|
<if test="null != start and null != end">
|
and travelTime between #{start} and #{end}
|
</if>
|
<if test="null != driverId">
|
and driverId = #{driverId}
|
</if>
|
<if test="null != state">
|
and state in
|
<foreach collection="state" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
</select>
|
|
|
<select id="queryByLineShiftDriverId" resultType="OrderCrossCity">
|
select
|
id as id,
|
userId as userId,
|
serverCarModelId as serverCarModelId,
|
driverId as driverId,
|
lineId as lineId,
|
lineShiftDriverId as lineShiftDriverId,
|
carId as carId,
|
orderNum as orderNum,
|
placementLon as placementLon,
|
placementLat as placementLat,
|
placementAddress as placementAddress,
|
startLon as startLon,
|
startLat as startLat,
|
startAddress as startAddress,
|
endLon as endLon,
|
endLat as endLat,
|
endAddress as endAddress,
|
boardingLon as boardingLon,
|
boardingLat as boardingLat,
|
boardingAddress as boardingAddress,
|
boardingTime as boardingTime,
|
getoffLon as getoffLon,
|
getoffLat as getoffLat,
|
getoffAddress as getoffAddress,
|
getoffTime as getoffTime,
|
mileage as mileage,
|
payManner as payManner,
|
payType as payType,
|
orderMoney as orderMoney,
|
redPacketMoney as redPacketMoney,
|
couponMoney as couponMoney,
|
redPacketId as redPacketId,
|
couponId as couponId,
|
discount as discount,
|
discountMoney as discountMoney,
|
activityId as activityId,
|
companyId as companyId,
|
payMoney as payMoney,
|
passengers as passengers,
|
passengersPhone as passengersPhone,
|
peopleNumber as peopleNumber,
|
seatNumber as seatNumber,
|
sort as sort,
|
state as state,
|
insertTime as insertTime,
|
travelTime as travelTime,
|
snatchOrderTime as snatchOrderTime,
|
setOutTime as setOutTime,
|
arriveTime as arriveTime,
|
startServiceTime as startServiceTime,
|
endServiceTime as endServiceTime,
|
travelMode as travelMode,
|
orderSource as orderSource,
|
isReassign as isReassign,
|
reassignNotice as reassignNotice,
|
invoiceId as invoiceId,
|
trackId as trackId,
|
isDelete as isDelete,
|
oldState as oldState,
|
telX as telX,
|
bindId as bindId
|
from t_order_cross_city where isDelete = 1
|
<if test="null != lineShiftDriverId">
|
and lineShiftDriverId = #{lineShiftDriverId}
|
</if>
|
<if test="null != state">
|
and state in
|
<foreach collection="state" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
</select>
|
|
|
<select id="queryOrders" resultType="OrderCrossCity">
|
select
|
id as id,
|
userId as userId,
|
serverCarModelId as serverCarModelId,
|
driverId as driverId,
|
lineId as lineId,
|
lineShiftDriverId as lineShiftDriverId,
|
carId as carId,
|
orderNum as orderNum,
|
placementLon as placementLon,
|
placementLat as placementLat,
|
placementAddress as placementAddress,
|
startLon as startLon,
|
startLat as startLat,
|
startAddress as startAddress,
|
endLon as endLon,
|
endLat as endLat,
|
endAddress as endAddress,
|
boardingLon as boardingLon,
|
boardingLat as boardingLat,
|
boardingAddress as boardingAddress,
|
boardingTime as boardingTime,
|
getoffLon as getoffLon,
|
getoffLat as getoffLat,
|
getoffAddress as getoffAddress,
|
getoffTime as getoffTime,
|
mileage as mileage,
|
payManner as payManner,
|
payType as payType,
|
orderMoney as orderMoney,
|
redPacketMoney as redPacketMoney,
|
couponMoney as couponMoney,
|
redPacketId as redPacketId,
|
couponId as couponId,
|
discount as discount,
|
discountMoney as discountMoney,
|
activityId as activityId,
|
companyId as companyId,
|
payMoney as payMoney,
|
passengers as passengers,
|
passengersPhone as passengersPhone,
|
peopleNumber as peopleNumber,
|
seatNumber as seatNumber,
|
sort as sort,
|
state as state,
|
insertTime as insertTime,
|
travelTime as travelTime,
|
snatchOrderTime as snatchOrderTime,
|
setOutTime as setOutTime,
|
arriveTime as arriveTime,
|
startServiceTime as startServiceTime,
|
endServiceTime as endServiceTime,
|
travelMode as travelMode,
|
orderSource as orderSource,
|
isReassign as isReassign,
|
reassignNotice as reassignNotice,
|
invoiceId as invoiceId,
|
trackId as trackId,
|
isDelete as isDelete,
|
oldState as oldState,
|
telX as telX,
|
bindId as bindId
|
from t_order_cross_city where isDelete = 1
|
<if test="null != driverId">
|
and driverId = #{driverId}
|
</if>
|
<if test="null != lineShiftDriverId">
|
and lineShiftDriverId = #{lineShiftDriverId}
|
</if>
|
<if test="null != state">
|
and state in
|
<foreach collection="state" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
</select>
|
|
|
<select id="queryListOrder" resultType="OrderCrossCity">
|
select
|
a.id as id,
|
a.userId as userId,
|
a.serverCarModelId as serverCarModelId,
|
a.driverId as driverId,
|
a.lineId as lineId,
|
a.lineShiftDriverId as lineShiftDriverId,
|
a.carId as carId,
|
a.orderNum as orderNum,
|
a.placementLon as placementLon,
|
a.placementLat as placementLat,
|
a.placementAddress as placementAddress,
|
a.startLon as startLon,
|
a.startLat as startLat,
|
a.startAddress as startAddress,
|
a.endLon as endLon,
|
a.endLat as endLat,
|
a.endAddress as endAddress,
|
a.boardingLon as boardingLon,
|
a.boardingLat as boardingLat,
|
a.boardingAddress as boardingAddress,
|
a.boardingTime as boardingTime,
|
a.getoffLon as getoffLon,
|
a.getoffLat as getoffLat,
|
a.getoffAddress as getoffAddress,
|
a.getoffTime as getoffTime,
|
a.mileage as mileage,
|
a.payManner as payManner,
|
a.payType as payType,
|
a.orderMoney as orderMoney,
|
a.redPacketMoney as redPacketMoney,
|
a.couponMoney as couponMoney,
|
a.redPacketId as redPacketId,
|
a.couponId as couponId,
|
a.discount as discount,
|
a.discountMoney as discountMoney,
|
a.activityId as activityId,
|
a.companyId as companyId,
|
a.payMoney as payMoney,
|
a.passengers as passengers,
|
a.passengersPhone as passengersPhone,
|
a.peopleNumber as peopleNumber,
|
a.seatNumber as seatNumber,
|
a.sort as sort,
|
a.state as state,
|
a.insertTime as insertTime,
|
a.travelTime as travelTime,
|
a.snatchOrderTime as snatchOrderTime,
|
a.setOutTime as setOutTime,
|
a.arriveTime as arriveTime,
|
a.startServiceTime as startServiceTime,
|
a.endServiceTime as endServiceTime,
|
a.travelMode as travelMode,
|
a.orderSource as orderSource,
|
a.isReassign as isReassign,
|
a.reassignNotice as reassignNotice,
|
a.invoiceId as invoiceId,
|
a.trackId as trackId,
|
a.isDelete as isDelete,
|
a.oldState as oldState,
|
a.telX as telX,
|
a.bindId as bindId,
|
a.remark as remark
|
from t_order_cross_city a
|
left join t_line_shift_driver b on (a.lineShiftDriverId = b.id)
|
where a.isDelete = 1
|
<if test="null != driverId">
|
and a.driverId = #{driverId}
|
</if>
|
<if test="null != lineShiftId">
|
and b.lineShiftId = #{lineShiftId}
|
</if>
|
<if test="null != state">
|
and a.state in
|
<foreach collection="state" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="null != day and '' != day">
|
and DATE_FORMAT(a.travelTime, '%Y-%m-%d') = #{day}
|
</if>
|
</select>
|
</mapper>
|