liujie
3 天以前 cbc307682c0ca48d59e7b539d6a2ae58d49cabe1
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml
@@ -500,15 +500,15 @@
        b.carLicensePlate as licensePlate,
        CONCAT(d.`name`, c.`name`, ' . ', b.carColor) as brand,
        (
        (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_private_car where driverId = a.id and state !=10 and to_days(insertTime) = to_days(now())) +
        (select count(id) from t_order_taxi where driverId = a.id and state !=10  and to_days(insertTime) = to_days(now())) +
        (select count(id) from t_order_cross_city where driverId = a.id and state !=10  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_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_private_car where driverId = a.id and state !=10  and DATE_FORMAT(insertTime, '%Y%m') = DATE_FORMAT(now(), '%Y%m')) +
        (select count(id) from t_order_taxi where driverId = a.id and state !=10  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 !=10  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 sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(fraction) from t_order_evaluate where driverId = a.id)) as score,
@@ -556,11 +556,14 @@
        (select count(id) from t_order_logistics where driverId = a.id and state in (6, 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,
        if((select id from t_merchant where auditStatus = 2 and userType = 2 and userId = a.id and state = 1) is null, 0, 1) as merchant
        if((select id from t_merchant where auditStatus = 2 and userType = 2 and userId = a.id and state = 1) is null, 0, 1) as merchant,
        a.companyId as companyId,
        e.name as companyName
        from t_driver a
        left join t_car b on (a.carId = b.id)
        left join t_car_model c on (b.carModelId = c.id)
        left join t_car_brand d on (c.brandId = d.id)
        left join t_company e on (a.companyId = e.id)
        where a.id = #{uid}
    </select>