| | |
| | | (select count(id) from t_order_private_car where driverId = a.id and state in (7, 8, 9) and to_days(insertTime) = to_days(now())) + |
| | | (select count(id) from t_order_taxi where driverId = a.id and state in (7, 8, 9) and to_days(insertTime) = to_days(now())) + |
| | | (select count(id) from t_order_cross_city where driverId = a.id and state in (6, 8, 9) and to_days(insertTime) = to_days(now())) + |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 9) and to_days(insertTime) = to_days(now())) |
| | | ) as dayNum, |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 9) and to_days(insertTime) = to_days(now()))+ |
| | | (select count(id) from t_order_transfer where driverId = a.id and state in (7, 8, 9) and to_days(insertTime) = to_days(now())) |
| | | ) as dayNum, |
| | | ( |
| | | (select count(id) from t_order_private_car where driverId = a.id and state in (7, 8, 9) and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m')) + |
| | | (select count(id) from t_order_taxi where driverId = a.id and state in (7, 8, 9) and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m')) + |
| | | (select count(id) from t_order_cross_city where driverId = a.id and state in (6, 8, 9) and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m')) + |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 9) and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m')) |
| | | ) as mouthNum, |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 9) and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m'))+ |
| | | (select count(id) from t_order_transfer where driverId = a.id and state in (7, 8, 9) and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m')) |
| | | ) as mouthNum, |
| | | ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(fraction) from t_order_evaluate where driverId = a.id)) as score, |
| | | if((select count(id) from t_driver_work where driverId = a.id and state = 1) != 0, 1, 2) as `work` |
| | | from t_driver a |
| | |
| | | CONCAT(d.`name`, c.`name`) as brand, |
| | | ( |
| | | (select count(id) from t_order_private_car where driverId = a.id and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_taxi where driverId = a.id and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_cross_city where driverId = a.id and state in (6, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 9)) |
| | | ) as orderNum, |
| | | (select count(id) from t_order_transfer where driverId = a.id and state in (7, 8, 9)) |
| | | ) as orderNum, |
| | | ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(fraction) from t_order_evaluate where driverId = a.id)) as score |
| | | from t_driver a |
| | | left join t_car b on (a.carId = b.id) |