xuhy
2023-02-24 c6e83b9d48ffe43967e395eb6fc43e0d4f02fbfc
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml
@@ -80,4 +80,34 @@
        left join t_app_user b on (a.userId = b.id)
        where a.`status` = 1 and a.hallOrder = 1 order by a.createTime desc
    </select>
    <select id="queryOrderInfo" resultType="com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper">
        select
        a.id,
        b.avatar,
        a.userName,
        a.userPhone,
        (select count(1) from t_order where userPhone = a.userPhone and state in (107, 108)) as orderTimes,
        (select count(1) from t_order where userPhone = a.userPhone and state in (301)) as cancelTimes,
        a.source,
        UNIX_TIMESTAMP(a.createTime) * 1000 as createTime,
        a.startAddress,
        a.startLat,
        a.startLng,
        a.endAddress,
        a.endLat,
        a.endLng,
        a.estimatedPrice,
        a.estimatedMileage,
        a.startPrice,
        a.waitTime,
        a.actualMileage,
        a.state,
        (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(a.startTime)) / 60 as travelTime
        from t_order a
        left join t_app_user b on (a.userId = b.id)
        where a.id = #{orderId}
    </select>
</mapper>