Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/dao/mapping/OrderPrivateCarMapper.xml
@@ -98,48 +98,32 @@
            select
            id as id,
            (1) as type,
            if(#{language} = 1, '专车订单', if(#{language} = 2 , 'Private car order', 'Commande de voiture exclusive')) as `name`,
            if(#{language} = 1, '打车', if(#{language} = 2 , 'Ride', 'Course')) as `name`,
            DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
            startAddress as startAddress,
            endAddress as endAddress,
            state as state,
            orderType as reservation,
            driverId as driverId
            driverId as driverId,
            isFrozen
            from t_order_private_car where 1 = 1
            <if test="null != driverId">
                and driverId = #{driverId}
            </if>
            and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) &lt; 1800
            UNION ALL
            select
            id as id,
            (1) as type,
            if(#{language} = 1, '专车订单', if(#{language} = 2 , 'Private car order', 'Commande de voiture exclusive')) as `name`,
            DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
            startAddress as startAddress,
            endAddress as endAddress,
            state as state,
            orderType as reservation,
            driverId as driverId
            from t_order_private_car where 1 = 1
            <if test="null != driverId">
                and driverId = #{driverId}
            </if>
            and state in (3, 4, 5, 6, 11)
            and (state in (3, 4, 5, 6, 11) or (state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) &lt; 1800))
        </if>
        <if test="state == 2">
            select
            id as id,
            (1) as type,
            if(#{language} = 1, '专车订单', if(#{language} = 2 , 'Private car order', 'Commande de voiture exclusive')) as `name`,
            if(#{language} = 1, '打车', if(#{language} = 2 , 'Ride', 'Course')) as `name`,
            DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
            startAddress as startAddress,
            endAddress as endAddress,
            state as state,
            orderType as reservation,
            driverId as driverId
            driverId as driverId,
            isFrozen
            from t_order_private_car where 1 = 1
            <if test="null != driverId">
                and driverId = #{driverId}
@@ -155,7 +139,7 @@
        select
        id as id,
        (1) as type,
        if(#{language} = 1, '专车订单', if(#{language} = 2 , 'Private car order', 'Commande de voiture exclusive')) as `name`,
        if(#{language} = 1, '打车', if(#{language} = 2 , 'Ride', 'Course')) as `name`,
        DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -165,13 +149,16 @@
        payManner as payManner,
        UNIX_TIMESTAMP(travelTime) as travelTime,
        remark as remark,
        driverPay
        from t_order_private_car where driverId = #{driverId}
        driverPay,
        cancelMidway,
        isFrozen
        from t_order_private_car
        where driverId = #{driverId}
        <if test="state == 1">
            and state != 1
        </if>
        <if test="state == 2">
            and state = 7
            and (state in (7, 12) or driverPay = 1)
        </if>
        <if test="state == 3">
            and state = 10
@@ -188,7 +175,7 @@
        select
        id as orderId,
        state as orderState,
        if(#{language} = 1, '专车订单', if(#{language} = 2 , 'Private car order', 'Commande de voiture exclusive')) as orderName,
        if(#{language} = 1, '打车', if(#{language} = 2 , 'Ride', 'Course')) as orderName,
        DATE_FORMAT(travelTime, '%m-%d %H:%i') as travelTime,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -201,7 +188,8 @@
        orderSource as orderSource,
        orderType as orderType,
        isReassign as isReassign,
        companyId as companyId
        companyId as companyId,
        tripId
        from t_order_private_car where id = #{orderId}
    </select>
@@ -227,6 +215,7 @@
        a.payMoney as payMoney,
        a.trackId as trackId,
        b.nickName as nickName,
        b.phone as userPhone,
        a.passengersPhone as phone,
        a.orderType as reservation,
        a.telX as telX,
@@ -234,16 +223,23 @@
        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))
        (select count(id) from t_order_logistics 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,
        if(c.userType = 1, '用户', '平台') as cancelUser,
        (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign,
        a.driverPay
        a.driverPay,
        a.isFrozen,
        a.tripId,
        a.companyId,
        DATE_FORMAT(a.snatchOrderTime, '%Y-%m-%d %H:%i:%s') as snatchOrderTime,
        a.cancelMidway,
        DATE_FORMAT(a.estimateArriveTime, '%Y-%m-%d %H:%i:%s') as estimateArriveTime,
        a.estimateArriveMileage,
        a.orderType
        from t_order_private_car 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)
@@ -251,155 +247,13 @@
    </select>
    <select  id="taskMidAxbUnBindSend" resultType="OrderPrivateCar">
        select
        id as id,
        `type` as `type`,
        userId as userId,
        serverCarModelId as serverCarModelId,
        driverId as driverId,
        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,
        startMileage as startMileage,
        startMoney as startMoney,
        mileageKilometers as mileageKilometers,
        mileageMoney as mileageMoney,
        duration as duration,
        durationMoney as durationMoney,
        wait as wait,
        waitMoney as waitMoney,
        longDistance as longDistance,
        longDistanceMoney as longDistanceMoney,
        parkMoney as parkMoney,
        roadTollMoney as roadTollMoney,
        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,
        substitute as substitute,
        passengers as passengers,
        passengersPhone as passengersPhone,
        state as state,
        insertTime as insertTime,
        travelTime as travelTime,
        snatchOrderTime as snatchOrderTime,
        setOutTime as setOutTime,
        arriveTime as arriveTime,
        startServiceTime as startServiceTime,
        endServiceTime as endServiceTime,
        orderType as orderType,
        orderSource as orderSource,
        invoiceId as invoiceId,
        isReassign as isReassign,
        reassignNotice as reassignNotice,
        trackId as trackId,
        isDelete as isDelete,
        oldState as oldState,
        telX as telX,
        bindId as bindId
        from t_order_private_car where (state in (8, 9) and telX != '' and telX is not null and (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(endServiceTime)) > 1800) or (state = 10 and telX != '' and telX is not null)
    <select  id="taskMidAxbUnBindSend" resultType="com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar">
        select * from t_order_private_car where (state in (8, 9) and telX != '' and telX is not null and (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(endServiceTime)) > 1800) or (state = 10 and telX != '' and telX is not null)
    </select>
    <select id="queryByState" resultType="OrderPrivateCar">
        select
        id as id,
        `type` as `type`,
        userId as userId,
        serverCarModelId as serverCarModelId,
        driverId as driverId,
        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,
        startMileage as startMileage,
        startMoney as startMoney,
        mileageKilometers as mileageKilometers,
        mileageMoney as mileageMoney,
        duration as duration,
        durationMoney as durationMoney,
        wait as wait,
        waitMoney as waitMoney,
        longDistance as longDistance,
        longDistanceMoney as longDistanceMoney,
        parkMoney as parkMoney,
        roadTollMoney as roadTollMoney,
        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,
        substitute as substitute,
        passengers as passengers,
        passengersPhone as passengersPhone,
        state as state,
        insertTime as insertTime,
        travelTime as travelTime,
        snatchOrderTime as snatchOrderTime,
        setOutTime as setOutTime,
        arriveTime as arriveTime,
        startServiceTime as startServiceTime,
        endServiceTime as endServiceTime,
        orderType as orderType,
        orderSource as orderSource,
        invoiceId as invoiceId,
        isReassign as isReassign,
        reassignNotice as reassignNotice,
        trackId as trackId,
        isDelete as isDelete,
        oldState as oldState,
        telX as telX,
        bindId as bindId
        from t_order_private_car where isDelete = 1 and userId = #{uid}
    <select id="queryByState" resultType="com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar">
        select * from t_order_private_car where isDelete = 1 and userId = #{uid}
        <if test="null != orderType">
            and orderType = #{orderType}
        </if>
@@ -415,63 +269,8 @@
    </select>
    <select id="query" resultType="OrderPrivateCar">
        select
        id as id,
        userId as userId,
        driverId as driverId,
        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,
        parkMoney as parkMoney,
        roadTollMoney as roadTollMoney,
        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,
        substitute as substitute,
        passengers as passengers,
        passengersPhone as passengersPhone,
        state as state,
        insertTime as insertTime,
        travelTime as travelTime,
        snatchOrderTime as snatchOrderTime,
        setOutTime as setOutTime,
        arriveTime as arriveTime,
        startServiceTime as startServiceTime,
        endServiceTime as endServiceTime,
        orderType as orderType,
        orderSource as orderSource,
        invoiceId as invoiceId,
        isReassign as isReassign,
        trackId as trackId,
        orderType as reservation
        from t_order_private_car where 1 = 1
    <select id="query" resultType="com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar">
        select * from t_order_private_car where 1 = 1
        <if test="null != state">
            and state in
            <foreach collection="state" item="item" index="index" open="(" separator="," close=")">