6.5
luodangjia
2024-06-05 06c5eda038f967dc0c0261e16eff0ad1a18e41e7
DriverNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTransferMapper.xml
@@ -167,7 +167,7 @@
        <if test="state == 1">
            select
            id as id,
            (1) as type,
            (7) as type,
            ('接送机订单') as `name`,
            DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
            startAddress as startAddress,
@@ -185,7 +185,7 @@
            select
            id as id,
            (1) as type,
            (7) as type,
            ('接送机订单') as `name`,
            DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
            startAddress as startAddress,
@@ -202,7 +202,7 @@
        <if test="state == 2">
            select
            id as id,
            (1) as type,
            (7) as type,
            ('接送机订单') as `name`,
            DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
            startAddress as startAddress,
@@ -235,7 +235,48 @@
            orderType as orderType,
            isReassign as isReassign,
            companyId as companyId
        from t_order_private_car where id = #{orderId}
        from t_order_transfer where id = #{orderId}
    </select>
    <select id="queryOrderInfo" resultType="map">
        select
            a.id as orderId,
            a.userId as userId,
            a.driverId as driverId,
            a.state as orderState,
            DATE_FORMAT(a.travelTime, '%m月%d日 %H:%i') as travelTime_,
            DATE_FORMAT(a.travelTime, '%Y-%m-%d %H:%i:%s') as travelTime,
            DATE_FORMAT(a.arriveTime, '%Y-%m-%d %H:%i:%s') as arriveTime,
            a.startAddress as startAddress,
            a.endAddress as endAddress,
            a.startLon as startLon,
            a.startLat as startLat,
            a.endLon as endLon,
            a.endLat as endLat,
            a.orderMoney as orderMoney,
            a.payManner as payManner,
            a.trackId as trackId,
            b.nickName as nickName,
            a.passengersPhone as phone,
            a.orderType as reservation,
            a.telX as telX,
            a.bindId as bindId,
            (
                (select count(id) from t_order_private_car where userId = b.id and state in (8, 9)) +
                (select count(id) from t_order_taxi where userId = b.id and state in (8, 9)) +
                (select count(id) from t_order_cross_city where userId = b.id and state in (8, 9))
                ) as historyNum,
            (select phone from t_phone where companyId = a.companyId and `type` = 1) as emergencyCall,
            c.reason as cancelReason,
            c.remark as cancelRemark,
            c.money as cancelPayMoney,
            if(c.userType = 1, '用户取消', '平台取消') as cancelUser,
            (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign
        from t_order_transfer a
                 left join t_user b on (a.userId = b.id)
                 left join t_order_cancel c on (a.id = c.orderId and c.orderType = 1 and c.state = 2)
        where a.id = #{orderId}
    </select>
</mapper>