luodangjia
2024-12-10 31ce6be2d56798d9509e6d90335999064351f7f3
UserNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml
@@ -243,7 +243,8 @@
        </if>
        and id in
        (
        select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        select driverId from t_driver_work
        where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        )
        and id in (select driverId from t_driver_orders where `type` = #{type})
        and carId in (select carId from t_car_service where `type` = #{type}
@@ -315,13 +316,15 @@
        (
        (select count(id) from t_order_private_car where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id) +
        (select count(id) from t_order_taxi where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id) +
        (select count(id) from t_order_cross_city where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id)
        ) = 0, 2, 3)) as state,
        (select count(id) from t_order_cross_city where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id) +
        (select count(id) from t_order_transfer where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id)
            ) = 0, 2, 3)) as state,
        (
        (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) +
        (select count(id) from t_order_taxi where state in (7, 8, 9) and driverId = a.id) +
        (select count(id) from t_order_cross_city where state in (6, 8, 9) and driverId = a.id)
        ) as orderNum,
        (select count(id) from t_order_cross_city where state in (6, 8, 9) and driverId = a.id) +
         (select count(id) from t_order_transfer where state in (7, 8, 9) and driverId = a.id)
                ) as orderNum,
        ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(id) from t_order_evaluate where driverId = a.id)) as fraction
        from t_driver a
        left join t_car b on (a.carId = b.id)